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 2e2ccd55..5e5cef62 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 @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.njcn.gather.detection.pojo.enums.SourceOperateCodeEnum; import com.njcn.gather.detection.pojo.enums.SourceResponseCodeEnum; import com.njcn.gather.detection.pojo.param.PreDetectionParam; @@ -79,6 +80,7 @@ public class SocketDevResponseService { * 成功结束的装置 */ List successXieyi = new ArrayList<>(); + List successXieyi3 = new ArrayList<>(); /** * 装置名称 */ @@ -190,18 +192,46 @@ public class SocketDevResponseService { case SUCCESS: webSocketHandler.sendMsgToUser(param.getUserPageId(), msg); System.out.println(successXieyi.size()+"====="+moniterIdListXieyi.size()); - String mId = JSON.parseObject(msg).get("data").toString(); - successXieyi.add(mId); - if (successXieyi.size() == moniterIdListXieyi.size()) { - //开始相序校验 + JSONObject jsonObject = JSON.parseObject(msg); + String mId = jsonObject.get("data").toString(); + String type = jsonObject.get("operateCode").toString(); + if(type.equals(SourceOperateCodeEnum.DEV_INIT_GATHER_02.getValue())){ + successXieyi.add(mId); + if (successXieyi.size() == moniterIdListXieyi.size()) { + //协议3校验 + successXieyi = new ArrayList<>(); + List devList = iPqDevService.getDevInfo(param.getDevIds()); + Map> map = new HashMap(1); + map.put("deviceList", devList); + String jsonString = JSON.toJSONString(map); + socketMsg.setRequestId(SourceOperateCodeEnum.YJC_XYJY.getValue()); + socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_INIT_GATHER_03.getValue()); + socketMsg.setData(jsonString); + String json = JSON.toJSONString(socketMsg); + + System.out.println("开始3协议校验++++++++++"); + SocketManager.sendMsg(s, json); + + } + }else if(type.equals(SourceOperateCodeEnum.DEV_INIT_GATHER_03.getValue())){ + successXieyi3.add(mId); + if (successXieyi.size() == moniterIdListXieyi.size()) { + System.out.println("开始相序校验++++++++++"); + + + } } + + + + break; case UNPROCESSED_BUSINESS: break; case RE_OPERATE: //发起关闭操作 - //发起关闭操作 + socketMsg.setRequestId("quit"); socketMsg.setOperateCode("QUIT_FUNEND$01"); SocketManager.sendMsg(s, JSON.toJSONString(socketMsg)); @@ -571,6 +601,7 @@ public class SocketDevResponseService { this.moniterIdListXieyi = new ArrayList<>(); this.successXieyi = new ArrayList<>(); + this.successXieyi3 = new ArrayList<>(); this.devNameMapXieyi = new HashMap<>(); List pqDevList = iPqDevService.getDevInfo(param.getDevIds());