diff --git a/zh-module-applet/zh-applet-admin/src/main/java/org/jeecg/modules/appmana/controller/BigScreenController.java b/zh-module-applet/zh-applet-admin/src/main/java/org/jeecg/modules/appmana/controller/BigScreenController.java index 6bdb4d5..5c75511 100644 --- a/zh-module-applet/zh-applet-admin/src/main/java/org/jeecg/modules/appmana/controller/BigScreenController.java +++ b/zh-module-applet/zh-applet-admin/src/main/java/org/jeecg/modules/appmana/controller/BigScreenController.java @@ -819,19 +819,21 @@ public class BigScreenController { List deployList = new ArrayList<>(); Map> zhibiaoMap = new HashMap<>(); List orientIds = new ArrayList<>(); - + //设备数量 + int counts = survStationInfo.getDeviceList()!=null?survStationInfo.getDeviceList().size():0; if(survStationInfo.getDeviceList()!=null&&survStationInfo.getDeviceList().size()>0){ - //补充设备数量 - survStationInfo.setDeviceCount(survStationInfo.getDeviceList().size()); + List listIds = survStationInfo.getDeviceList().stream().map(SurvDeviceDeploy::getId).collect(Collectors.toList()); + List equList = zhibiaoService.getAllChemical(listIds); + if(!equList.isEmpty()){ + zhibiaoMap.putAll(equList.stream().collect(Collectors.groupingBy(ScEquZhibiao::getEquId))); + } + List remainList = new ArrayList<>(); for (SurvDeviceDeploy survDeviceDeploy : survStationInfo.getDeviceList()) { deviceList.add(survDeviceDeploy.getDeviceCode()); deployList.add(survDeviceDeploy.getId()); - List equList = zhibiaoService.getAllChemical(deployList); - if(!equList.isEmpty()){ - zhibiaoMap.putAll(equList.stream().collect(Collectors.groupingBy(ScEquZhibiao::getEquId))); - } + if(PollutionConstants.SOIL_SURV.equals(survDeviceDeploy.getDeployType())){//土壤设备 SurvTransdataSoilVo transdataSoil = transdataSoilService.getNewestData(survDeviceDeploy.getDeployCode()); if(transdataSoil!=null) { @@ -878,12 +880,9 @@ public class BigScreenController { survStationInfo.getDeviceList().retainAll(remainList); //补充在线状态 survStationInfo.setDeviceList(iotutils.addOnlineStatus(survStationInfo.getDeviceList())); - - } - //重新计算设备数 - int counts = survStationInfo.getDeviceList().size(); + if(!orientIds.isEmpty()){ //已配置的设备用指标数,未配置用1; for (String id : orientIds) {