diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java index f02e0d7..be01540 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java @@ -118,7 +118,7 @@ * @param id 主键 * @return 设备信息 */ - DeviceInfo selectDetailByCategory(String category, String sn); + DeviceInfo selectDetailByCategoryWithOutTest(String category, String sn); /** * 分页查询设备信息 diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java index f02e0d7..be01540 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java @@ -118,7 +118,7 @@ * @param id 主键 * @return 设备信息 */ - DeviceInfo selectDetailByCategory(String category, String sn); + DeviceInfo selectDetailByCategoryWithOutTest(String category, String sn); /** * 分页查询设备信息 diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java index 510cf86..501e3d0 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java @@ -72,7 +72,7 @@ List deviceInfoList = new ArrayList<>(); for(DeviceInfoImportRequest infoImportRequest : request.getDeviceInfoImportRequestList()){ - if(null != selectDetailByCategory("project", infoImportRequest.getSn())){ + if(null != selectDetailByCategoryWithOutTest("project", infoImportRequest.getSn())){ throw new ServiceException(String.format("站点已存在:%s", infoImportRequest.getSn())); } DeviceInfo deviceInfo = new DeviceInfo(); @@ -198,11 +198,15 @@ return null; } - @Override - public DeviceInfo selectDetailByCategory(String category, String sn) { + public DeviceInfo selectDetailByCategoryWithOutTest(String category, String sn) { DeviceInfoQueryRequest request = new DeviceInfoQueryRequest(); request.setCategory(category); request.setSn(sn); + + List projectCodeNotInList = new ArrayList<>(); + projectCodeNotInList.add("test"); + request.setProjectCodeNotInList(projectCodeNotInList); + List deviceInfoList = selectList(request); if(CollectionUtils.isNotEmpty(deviceInfoList)){ return deviceInfoList.get(0); diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java index f02e0d7..be01540 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java @@ -118,7 +118,7 @@ * @param id 主键 * @return 设备信息 */ - DeviceInfo selectDetailByCategory(String category, String sn); + DeviceInfo selectDetailByCategoryWithOutTest(String category, String sn); /** * 分页查询设备信息 diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java index 510cf86..501e3d0 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java @@ -72,7 +72,7 @@ List deviceInfoList = new ArrayList<>(); for(DeviceInfoImportRequest infoImportRequest : request.getDeviceInfoImportRequestList()){ - if(null != selectDetailByCategory("project", infoImportRequest.getSn())){ + if(null != selectDetailByCategoryWithOutTest("project", infoImportRequest.getSn())){ throw new ServiceException(String.format("站点已存在:%s", infoImportRequest.getSn())); } DeviceInfo deviceInfo = new DeviceInfo(); @@ -198,11 +198,15 @@ return null; } - @Override - public DeviceInfo selectDetailByCategory(String category, String sn) { + public DeviceInfo selectDetailByCategoryWithOutTest(String category, String sn) { DeviceInfoQueryRequest request = new DeviceInfoQueryRequest(); request.setCategory(category); request.setSn(sn); + + List projectCodeNotInList = new ArrayList<>(); + projectCodeNotInList.add("test"); + request.setProjectCodeNotInList(projectCodeNotInList); + List deviceInfoList = selectList(request); if(CollectionUtils.isNotEmpty(deviceInfoList)){ return deviceInfoList.get(0); diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/ProjectInfoServiceImpl.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/ProjectInfoServiceImpl.java index b193c90..beda500 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/ProjectInfoServiceImpl.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/ProjectInfoServiceImpl.java @@ -85,7 +85,7 @@ @Transactional(rollbackFor = Exception.class) public boolean delete(String ids) { for(String id : ids.split(",")){ - ProjectInfo projectInfo = selectDetail(id); + ProjectInfo projectInfo = selectDetail(Long.parseLong(id)); deviceInfoService.deleteByProjectCode(projectInfo.getProjectCode()); projectUserService.deleteByProject(projectInfo.getProjectCode()); } diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java index f02e0d7..be01540 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java @@ -118,7 +118,7 @@ * @param id 主键 * @return 设备信息 */ - DeviceInfo selectDetailByCategory(String category, String sn); + DeviceInfo selectDetailByCategoryWithOutTest(String category, String sn); /** * 分页查询设备信息 diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java index 510cf86..501e3d0 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java @@ -72,7 +72,7 @@ List deviceInfoList = new ArrayList<>(); for(DeviceInfoImportRequest infoImportRequest : request.getDeviceInfoImportRequestList()){ - if(null != selectDetailByCategory("project", infoImportRequest.getSn())){ + if(null != selectDetailByCategoryWithOutTest("project", infoImportRequest.getSn())){ throw new ServiceException(String.format("站点已存在:%s", infoImportRequest.getSn())); } DeviceInfo deviceInfo = new DeviceInfo(); @@ -198,11 +198,15 @@ return null; } - @Override - public DeviceInfo selectDetailByCategory(String category, String sn) { + public DeviceInfo selectDetailByCategoryWithOutTest(String category, String sn) { DeviceInfoQueryRequest request = new DeviceInfoQueryRequest(); request.setCategory(category); request.setSn(sn); + + List projectCodeNotInList = new ArrayList<>(); + projectCodeNotInList.add("test"); + request.setProjectCodeNotInList(projectCodeNotInList); + List deviceInfoList = selectList(request); if(CollectionUtils.isNotEmpty(deviceInfoList)){ return deviceInfoList.get(0); diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/ProjectInfoServiceImpl.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/ProjectInfoServiceImpl.java index b193c90..beda500 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/ProjectInfoServiceImpl.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/ProjectInfoServiceImpl.java @@ -85,7 +85,7 @@ @Transactional(rollbackFor = Exception.class) public boolean delete(String ids) { for(String id : ids.split(",")){ - ProjectInfo projectInfo = selectDetail(id); + ProjectInfo projectInfo = selectDetail(Long.parseLong(id)); deviceInfoService.deleteByProjectCode(projectInfo.getProjectCode()); projectUserService.deleteByProject(projectInfo.getProjectCode()); } diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java index 43b5d1d..a507df0 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java @@ -199,7 +199,7 @@ @Override public boolean insertMonitorDevice(TermiteInfoSaveRequest request){ - DeviceInfo existDeviceInfo = deviceInfoService.selectDetailByCategory(request.getCategory(), request.getSn()); + DeviceInfo existDeviceInfo = deviceInfoService.selectDetailByCategoryWithOutTest(request.getCategory(), request.getSn()); if(null != existDeviceInfo){ throw new ServiceException(String.format("站点%s已存在", request.getSn())); } diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java index f02e0d7..be01540 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java @@ -118,7 +118,7 @@ * @param id 主键 * @return 设备信息 */ - DeviceInfo selectDetailByCategory(String category, String sn); + DeviceInfo selectDetailByCategoryWithOutTest(String category, String sn); /** * 分页查询设备信息 diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java index 510cf86..501e3d0 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java @@ -72,7 +72,7 @@ List deviceInfoList = new ArrayList<>(); for(DeviceInfoImportRequest infoImportRequest : request.getDeviceInfoImportRequestList()){ - if(null != selectDetailByCategory("project", infoImportRequest.getSn())){ + if(null != selectDetailByCategoryWithOutTest("project", infoImportRequest.getSn())){ throw new ServiceException(String.format("站点已存在:%s", infoImportRequest.getSn())); } DeviceInfo deviceInfo = new DeviceInfo(); @@ -198,11 +198,15 @@ return null; } - @Override - public DeviceInfo selectDetailByCategory(String category, String sn) { + public DeviceInfo selectDetailByCategoryWithOutTest(String category, String sn) { DeviceInfoQueryRequest request = new DeviceInfoQueryRequest(); request.setCategory(category); request.setSn(sn); + + List projectCodeNotInList = new ArrayList<>(); + projectCodeNotInList.add("test"); + request.setProjectCodeNotInList(projectCodeNotInList); + List deviceInfoList = selectList(request); if(CollectionUtils.isNotEmpty(deviceInfoList)){ return deviceInfoList.get(0); diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/ProjectInfoServiceImpl.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/ProjectInfoServiceImpl.java index b193c90..beda500 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/ProjectInfoServiceImpl.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/ProjectInfoServiceImpl.java @@ -85,7 +85,7 @@ @Transactional(rollbackFor = Exception.class) public boolean delete(String ids) { for(String id : ids.split(",")){ - ProjectInfo projectInfo = selectDetail(id); + ProjectInfo projectInfo = selectDetail(Long.parseLong(id)); deviceInfoService.deleteByProjectCode(projectInfo.getProjectCode()); projectUserService.deleteByProject(projectInfo.getProjectCode()); } diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java index 43b5d1d..a507df0 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java @@ -199,7 +199,7 @@ @Override public boolean insertMonitorDevice(TermiteInfoSaveRequest request){ - DeviceInfo existDeviceInfo = deviceInfoService.selectDetailByCategory(request.getCategory(), request.getSn()); + DeviceInfo existDeviceInfo = deviceInfoService.selectDetailByCategoryWithOutTest(request.getCategory(), request.getSn()); if(null != existDeviceInfo){ throw new ServiceException(String.format("站点%s已存在", request.getSn())); } diff --git a/newfiber-termites-business/newfiber-termites-biz/src/main/resources/mapper/termite/TermiteMapper.xml b/newfiber-termites-business/newfiber-termites-biz/src/main/resources/mapper/termite/TermiteMapper.xml index 25156d1..cca9ad9 100644 --- a/newfiber-termites-business/newfiber-termites-biz/src/main/resources/mapper/termite/TermiteMapper.xml +++ b/newfiber-termites-business/newfiber-termites-biz/src/main/resources/mapper/termite/TermiteMapper.xml @@ -23,7 +23,7 @@ tb.heating, tb.heating_datetime, tb.uptime, - tb.software, + ta.software, ta.status, case when TIMESTAMPDIFF(minute, tb.uptime, now()) > 1440 then 0 else 1 end as onlineStatus, case when TIMESTAMPDIFF(minute, ta.last_sync_time, now()) > 1440 then 0 else 1 end as syncStatus,