From b31c07e7df303aa593ff2e57f59c29967fb1aed0 Mon Sep 17 00:00:00 2001 From: zy <82248909@qq.com> Date: Mon, 1 Dec 2025 14:40:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E8=AE=BE=E5=A4=87=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BigScreenController.java | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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 5c75511..42973c2 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 @@ -261,11 +261,20 @@ public class BigScreenController { if(stationList!=null&&stationList.size()>0){ Integer count = 0; for (SurvStationInfo survStationInfo : stationList) { + //设备数量 + int counts = survStationInfo.getDeviceList()!=null?survStationInfo.getDeviceList().size():0; JSONObject jsonObject = new JSONObject(); survStationInfo.setName(count.toString()); List deployList = new ArrayList<>(); - survStationInfo.setDeviceCount(survStationInfo.getDeviceList().size()); + List orientIds = new ArrayList<>(); + Map> zhibiaoMap = new HashMap<>(); if(survStationInfo.getDeviceList()!=null&&survStationInfo.getDeviceList().size()>0){ + 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()) { deployList.add(survDeviceDeploy.getId()); @@ -311,6 +320,7 @@ public class BigScreenController { //只保留摄像头的数据 remainList.add(survDeviceDeploy); }else if(PollutionConstants.WATER_ORIENT.equals(survDeviceDeploy.getDeployType())) {//面源 + orientIds.add(survDeviceDeploy.getId()); SurvTransdataOrientwaterVo transdataVo= transdataOrientwaterService.getNewestData(survDeviceDeploy.getDeployCode()); if(transdataVo!=null) { jsonObject.putAll(JSONObject.parseObject(JSON.toJSONString(transdataVo))); @@ -323,6 +333,7 @@ public class BigScreenController { } }else if(PollutionConstants.WATER_LIVE.equals(survDeviceDeploy.getDeployType())) {//畜禽 + orientIds.add(survDeviceDeploy.getId()); SurvTransdataLivestockwaterVo transdataAir= transdataLivestockwaterService.getNewestData(survDeviceDeploy.getDeployCode()); if(transdataAir!=null) { jsonObject.putAll(JSONObject.parseObject(JSON.toJSONString(transdataAir))); @@ -358,6 +369,18 @@ public class BigScreenController { } survStationInfo.setSurvColorItems(survList); count++; + + //补充设备数量 + if(!orientIds.isEmpty()){ + //已配置的设备用指标数,未配置用1; + for (String id : orientIds) { + List zhibiaos = zhibiaoMap.get(id); + if(zhibiaos!=null){ + counts = counts + zhibiaos.size() -1; + } + } + } + survStationInfo.setDeviceCount(counts); } }