diff --git a/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java b/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java index 53663589..f96bf12c 100644 --- a/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java +++ b/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java @@ -1,5 +1,6 @@ package com.njcn.gather.detection.handler; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; @@ -735,7 +736,11 @@ public class SocketDevResponseService { successComm.clear(); failComm.clear(); Map> map = new HashMap<>(1); - map.put("deviceList", FormalTestManager.devList); + List preDetections = BeanUtil.copyToList(FormalTestManager.devList, PreDetection.class); + preDetections.forEach(x -> { + x.setDevType(x.getIcdType()); + }); + map.put("deviceList", preDetections); String jsonString = JSON.toJSONString(map); socketMsg.setRequestId(SourceOperateCodeEnum.YJC_XYJY.getValue()); socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_INIT_GATHER_02.getValue()); @@ -819,7 +824,11 @@ public class SocketDevResponseService { successComm.clear(); failComm.clear(); Map> map = new HashMap<>(1); - map.put("deviceList", FormalTestManager.devList); + List preDetections = BeanUtil.copyToList(FormalTestManager.devList, PreDetection.class); + preDetections.forEach(x -> { + x.setDevType(x.getIcdType()); + }); + map.put("deviceList", preDetections); String jsonString = JSON.toJSONString(map); socketMsg.setRequestId(SourceOperateCodeEnum.YJC_XYJY.getValue()); socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_INIT_GATHER_03.getValue()); diff --git a/detection/src/main/java/com/njcn/gather/detection/handler/SocketSourceResponseService.java b/detection/src/main/java/com/njcn/gather/detection/handler/SocketSourceResponseService.java index c436b120..6707c9a1 100644 --- a/detection/src/main/java/com/njcn/gather/detection/handler/SocketSourceResponseService.java +++ b/detection/src/main/java/com/njcn/gather/detection/handler/SocketSourceResponseService.java @@ -1,5 +1,6 @@ package com.njcn.gather.detection.handler; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSON; import com.njcn.gather.detection.pojo.enums.SourceOperateCodeEnum; @@ -234,9 +235,13 @@ public class SocketSourceResponseService { WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg)); String s = param.getUserPageId() + DEV; //开始设备通讯检测(发送设备初始化) - List devList = iPqDevService.getDevInfo(param.getDevIds()); + //List devList = iPqDevService.getDevInfo(param.getDevIds()); Map> map = new HashMap<>(1); - map.put("deviceList", devList); + List preDetections = BeanUtil.copyToList(FormalTestManager.devList, PreDetection.class); + preDetections.forEach(x -> { + x.setDevType(x.getIcdType()); + }); + map.put("deviceList", preDetections); String jsonString = JSON.toJSONString(map); socketMsg.setRequestId(SourceOperateCodeEnum.YJC_SBTXJY.getValue()); socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_INIT_GATHER_01.getValue());