From 239927b057f65a040594f7a4cb08c8881b303797 Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Fri, 18 Aug 2023 14:52:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/cjl-230812' into cjl-230812
---
screen-api/src/main/java/com/moral/api/pojo/vo/monitorPoint/MonitorPointsVO.java | 15 ++++++++++++---
1 files changed, 12 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 fd1d4bc..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,14 +32,22 @@
DeviceVO deviceVO = deviceConvert(device);
deviceVOS.add(deviceVO);
}
+ List<Device> resultState = devices.stream().filter(it->!it.getState().equals("0")).collect(Collectors.toList());
monitorPointVO.setId(monitorPoint.getId());
- monitorPointVO.setName(monitorPoint.getName());
+ 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;
}
--
Gitblit v1.8.0