From e60bad3640cdade446b8d7ba3ab13ee22fb79b05 Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Wed, 10 Jan 2024 08:49:01 +0800
Subject: [PATCH] fix:立行立改经纬度必填

---
 screen-api/src/main/java/com/moral/api/pojo/vo/monitorPoint/MonitorPointsVO.java |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/screen-api/src/main/java/com/moral/api/pojo/vo/monitorPoint/MonitorPointsVO.java b/screen-api/src/main/java/com/moral/api/pojo/vo/monitorPoint/MonitorPointsVO.java
index 9f0d036..d54852a 100644
--- a/screen-api/src/main/java/com/moral/api/pojo/vo/monitorPoint/MonitorPointsVO.java
+++ b/screen-api/src/main/java/com/moral/api/pojo/vo/monitorPoint/MonitorPointsVO.java
@@ -7,6 +7,7 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @ClassName MonitorPointsVO
@@ -20,7 +21,7 @@
 
     private List<MonitorPointVO> monitorPoints;
 
-    public static MonitorPointsVO convert(List<MonitorPoint> monitorPoints){
+    public static MonitorPointsVO convert(List<MonitorPoint> monitorPoints,boolean type){
         MonitorPointsVO monitorPointsVO = new MonitorPointsVO();
         List<MonitorPointVO> monitorPointVOS = new ArrayList<>();
         for (MonitorPoint monitorPoint : monitorPoints) {
@@ -31,13 +32,22 @@
                 DeviceVO deviceVO = deviceConvert(device);
                 deviceVOS.add(deviceVO);
             }
-            monitorPointVO.setName(monitorPoint.getName());
+            List<Device> resultState = devices.stream().filter(it->!it.getState().equals("0")).collect(Collectors.toList());
+            monitorPointVO.setId(monitorPoint.getId());
+            StringBuffer stringBuffer = new StringBuffer(monitorPoint.getName());
+            if(type){
+                stringBuffer.append("(");
+                stringBuffer.append("������:").append(resultState.size()+"���;");
+                stringBuffer.append("���:").append(devices.size()+"���");
+                stringBuffer.append(")");
+            }
+            monitorPointVO.setName(stringBuffer.toString());
             monitorPointVO.setLatitude(monitorPoint.getLatitude());
             monitorPointVO.setLongitude(monitorPoint.getLongitude());
             monitorPointVO.setDevices(deviceVOS);
             monitorPointVOS.add(monitorPointVO);
         }
-        monitorPointsVO.setMonitorPoints(monitorPointVOS);
+            monitorPointsVO.setMonitorPoints(monitorPointVOS);
         return monitorPointsVO;
     }
 
@@ -45,6 +55,7 @@
         DeviceVO vo = new DeviceVO();
         vo.setName(device.getName());
         vo.setMac(device.getMac());
+        vo.setState(device.getState());
         vo.setLatitude(device.getLatitude());
         vo.setLongitude(device.getLongitude());
         return vo;

--
Gitblit v1.8.0