lyq 2 ヶ月 前
コミット
a2ebe2a0f6

+ 1 - 1
monitor_ui/src/views/centerMonitor/camera/index.vue

@@ -2050,7 +2050,7 @@ export default {
       }
     },
     getDraws(point) {
-      this.infoDraw.pointId = point.id
+      this.infoDraw.pointId = point.presetPointCode
       this.infoDraw.pointName = point.presetPointName
       if (this.infoDraw.channelId && this.infoDraw.taskId && this.infoDraw.pointId && this.infoDraw.pointName && this.infoDraw.type) {
         let param = {channelId: this.infoDraw.channelId, taskId: this.infoDraw.taskId, pointId: this.infoDraw.pointId, pointName: this.infoDraw.pointName, type: this.infoDraw.type}

+ 24 - 28
src/main/java/com/sooka/sponest/monitor/channelrail/service/impl/ChannelRailServiceImpl.java

@@ -2,7 +2,6 @@ package com.sooka.sponest.monitor.channelrail.service.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.alibaba.nacos.shaded.com.google.gson.JsonObject;
 import com.sooka.sponest.monitor.channelrail.domain.ChannelRail;
 import com.sooka.sponest.monitor.channelrail.mapper.ChannelRailMapper;
 import com.sooka.sponest.monitor.channelrail.service.IChannelRailService;
@@ -43,33 +42,30 @@ public class ChannelRailServiceImpl implements IChannelRailService {
             List<JSONObject> channels = JSONObject.parseArray(jsonObject.getString("channelInfos"), JSONObject.class);
             channels = channels.stream().map(channel -> {
                 if (channel.getString("channelCode").equals(channelRail.getChannelId())) {
-                    List<Map<String, Object>> points = new ArrayList<>();
-                    List<JSONObject> polygons = JSONObject.parseArray(JSONObject.parseObject(channelRail.getJsonData()).getString("polygons"), JSONObject.class);
-                    polygons.forEach(item -> {
-                        Map<String, Object> point = new HashMap<>();
-                        point.put("taskId", jsonObject.getLong("id"));
-                        point.put("presetPointId", channelRail.getPointId());
-                        point.put("pointName", channelRail.getPointName());
-                        List<Map<String, Object>> channelCutInfos = new ArrayList<>();
-                        Map<String, Object> map = new HashMap<>();
-                        map.put("taskId", jsonObject.getLong("id"));
-                        map.put("pointId", channelRail.getPointId());
-                        map.put("pointName", channelRail.getPointName());
-                        map.put("type", channelRail.getType());
-                        item.remove("lineColor");
-                        item.remove("fillColor");
-                        item.remove("lineWidth");
-                        map.put("areaPoints", item.toJSONString());
-                        map.put("channelCode", channel.getString("channelCode"));
-                        map.put("channelName", channel.getString("channelName"));
-                        channelCutInfos.add(map);
-                        point.put("channelCutInfos", channelCutInfos);
-                        point.put("channelCode", channel.getString("channelCode"));
-                        point.put("channelName", channel.getString("channelName"));
-                        point.put("pointType", 1);
-                        points.add(point);
-                    });
-                    channel.put("channelPresetPointVOS", points);
+                    List<JSONObject> channelPresetPointVOS = JSONObject.parseArray(channel.getString("channelPresetPointVOS"), JSONObject.class);
+                    channelPresetPointVOS = channelPresetPointVOS.stream().map(channelPresetPointVO -> {
+                        if (channelPresetPointVO.getLong("presetPointId").equals(channelRail.getPointId())) {
+                            List<Map<String, Object>> channelCutInfos = new ArrayList<>();
+                            List<JSONObject> polygons = JSONObject.parseArray(JSONObject.parseObject(channelRail.getJsonData()).getString("polygons"), JSONObject.class);
+                            polygons.forEach(item -> {
+                                Map<String, Object> map = new HashMap<>();
+                                map.put("taskId", jsonObject.getLong("id"));
+                                map.put("pointId", channelRail.getPointId());
+                                map.put("pointName", channelRail.getPointName());
+                                map.put("type", channelRail.getType());
+                                item.remove("lineColor");
+                                item.remove("fillColor");
+                                item.remove("lineWidth");
+                                map.put("areaPoints", item.toJSONString());
+                                map.put("channelCode", channel.getString("channelCode"));
+                                map.put("channelName", channel.getString("channelName"));
+                                channelCutInfos.add(map);
+                            });
+                            channelPresetPointVO.put("channelCutInfos", channelCutInfos);
+                        }
+                        return channelPresetPointVO;
+                    }).collect(Collectors.toList());
+                    channel.put("channelPresetPointVOS", channelPresetPointVOS);
                 }
                 return channel;
             }).collect(Collectors.toList());