装置通讯检测
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
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.SourceOperateCodeEnum;
|
||||||
import com.njcn.gather.detection.pojo.enums.SourceResponseCodeEnum;
|
import com.njcn.gather.detection.pojo.enums.SourceResponseCodeEnum;
|
||||||
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
import com.njcn.gather.detection.pojo.param.PreDetectionParam;
|
||||||
@@ -79,6 +80,7 @@ public class SocketDevResponseService {
|
|||||||
* 成功结束的装置
|
* 成功结束的装置
|
||||||
*/
|
*/
|
||||||
List<String> successXieyi = new ArrayList<>();
|
List<String> successXieyi = new ArrayList<>();
|
||||||
|
List<String> successXieyi3 = new ArrayList<>();
|
||||||
/**
|
/**
|
||||||
* 装置名称
|
* 装置名称
|
||||||
*/
|
*/
|
||||||
@@ -190,18 +192,46 @@ public class SocketDevResponseService {
|
|||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
webSocketHandler.sendMsgToUser(param.getUserPageId(), msg);
|
webSocketHandler.sendMsgToUser(param.getUserPageId(), msg);
|
||||||
System.out.println(successXieyi.size()+"====="+moniterIdListXieyi.size());
|
System.out.println(successXieyi.size()+"====="+moniterIdListXieyi.size());
|
||||||
String mId = JSON.parseObject(msg).get("data").toString();
|
JSONObject jsonObject = JSON.parseObject(msg);
|
||||||
successXieyi.add(mId);
|
String mId = jsonObject.get("data").toString();
|
||||||
if (successXieyi.size() == moniterIdListXieyi.size()) {
|
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<PreDetection> devList = iPqDevService.getDevInfo(param.getDevIds());
|
||||||
|
Map<String, List<PreDetection>> 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;
|
break;
|
||||||
case UNPROCESSED_BUSINESS:
|
case UNPROCESSED_BUSINESS:
|
||||||
break;
|
break;
|
||||||
case RE_OPERATE:
|
case RE_OPERATE:
|
||||||
//发起关闭操作
|
//发起关闭操作
|
||||||
//发起关闭操作
|
|
||||||
socketMsg.setRequestId("quit");
|
socketMsg.setRequestId("quit");
|
||||||
socketMsg.setOperateCode("QUIT_FUNEND$01");
|
socketMsg.setOperateCode("QUIT_FUNEND$01");
|
||||||
SocketManager.sendMsg(s, JSON.toJSONString(socketMsg));
|
SocketManager.sendMsg(s, JSON.toJSONString(socketMsg));
|
||||||
@@ -571,6 +601,7 @@ public class SocketDevResponseService {
|
|||||||
|
|
||||||
this.moniterIdListXieyi = new ArrayList<>();
|
this.moniterIdListXieyi = new ArrayList<>();
|
||||||
this.successXieyi = new ArrayList<>();
|
this.successXieyi = new ArrayList<>();
|
||||||
|
this.successXieyi3 = new ArrayList<>();
|
||||||
this.devNameMapXieyi = new HashMap<>();
|
this.devNameMapXieyi = new HashMap<>();
|
||||||
|
|
||||||
List<PreDetection> pqDevList = iPqDevService.getDevInfo(param.getDevIds());
|
List<PreDetection> pqDevList = iPqDevService.getDevInfo(param.getDevIds());
|
||||||
|
|||||||
Reference in New Issue
Block a user