|
|
|
@ -204,9 +204,6 @@ public class ClientService { |
|
|
|
if (StringUtils.isNotBlank(stationNo)) { |
|
|
|
jsonObject.put("Code", stationNo); |
|
|
|
jsonObject.put("Command", 1); |
|
|
|
if(stationNo.equals("2")) {//武汉站固定编码为2,和许继边缘节点通信,模型同步Command为4 |
|
|
|
jsonObject.put("Command", 4); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
String iipCode = statisticsMapper.queryIICSystemCode(); |
|
|
|
@ -215,40 +212,48 @@ public class ClientService { |
|
|
|
} |
|
|
|
jsonObject.put("SendCode", iipCode); |
|
|
|
|
|
|
|
// 临时处理同步无人机点位数据 |
|
|
|
// 武汉电站同步点位数据 |
|
|
|
try { |
|
|
|
if (StringUtils.isNotEmpty(jsonObject.getString("ReceiveCode")) && jsonObject.getString("ReceiveCode").equals("Client05")) { |
|
|
|
if (StringUtils.isNotEmpty(jsonObject.getString("ReceiveCode")) && jsonObject.getString("ReceiveCode").equals("areaPatrolServer")) { |
|
|
|
logger.info("[CLIENT] 许继ReceiveCode: {}, lowMsgUrl: {}", jsonObject.getString("ReceiveCode"), lowMsgUrl); |
|
|
|
jsonObject.computeIfAbsent("Time", k -> DateUtils.format(DateUtils.yyyyMMddHHmmss2, new Date())); |
|
|
|
jsonObject.put("Command", "4"); |
|
|
|
jsonObject.put("ReceiveCode", "areaPatrolServer"); |
|
|
|
logger.info("--------------[CLIENT] 许继点位同步jsonObject: {}", jsonObject.toJSONString()); |
|
|
|
} else if (StringUtils.isNotEmpty(jsonObject.getString("ReceiveCode")) && jsonObject.getString("ReceiveCode").equals("Client05")) { |
|
|
|
logger.info("[CLIENT] 无人机ReceiveCode: {}, lowMsgUrl: {}", jsonObject.getString("ReceiveCode"), lowMsgUrl); |
|
|
|
jsonObject.computeIfAbsent("Time", k -> DateUtils.format(DateUtils.yyyyMMddHHmmss2, new Date())); |
|
|
|
jsonObject.put("Command", "1"); |
|
|
|
jsonObject.put("ReceiveCode", "Client05"); |
|
|
|
logger.info("--------------[CLIENT] 无人机点位同步jsonObject: {}", jsonObject.toJSONString()); |
|
|
|
return CallDeviceApi.callDevice(lowMsgUrl, jsonObject.toJSONString()); |
|
|
|
} |
|
|
|
return CallDeviceApi.callDevice(lowMsgUrl, jsonObject.toJSONString()); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new ServiceException("Call " + lowMsgUrl + " Exception!"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String robotSystemCode = statisticsMapper.queryRobotSystemCode(); |
|
|
|
if (StringUtils.isBlank(robotSystemCode)) { |
|
|
|
logger.error("机器人巡视系统唯一标识未查询到"); |
|
|
|
robotSystemCode = ""; |
|
|
|
} |
|
|
|
|
|
|
|
jsonObject.put("ReceiveCode", robotSystemCode); |
|
|
|
String nestSystemCode = statisticsMapper.queryNestSystemCode(); |
|
|
|
if (StringUtils.isBlank(nestSystemCode)) { |
|
|
|
throw new ServiceException("机器人巡视系统唯一标识未查询到"); |
|
|
|
} else { |
|
|
|
try { |
|
|
|
logger.info("[CLIENT] nestSystemCode: {}, lowMsgUrl: {}", nestSystemCode, lowMsgUrl); |
|
|
|
jsonObject.put("ReceiveCode", nestSystemCode); |
|
|
|
jsonObject.computeIfAbsent("Time", k -> DateUtils.format(DateUtils.yyyyMMddHHmmss2, new Date())); |
|
|
|
|
|
|
|
return CallDeviceApi.callDevice(lowMsgUrl, jsonObject.toJSONString()); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new ServiceException("Call " + lowMsgUrl + " Exception!"); |
|
|
|
} |
|
|
|
} |
|
|
|
// String robotSystemCode = statisticsMapper.queryRobotSystemCode(); |
|
|
|
// if (StringUtils.isBlank(robotSystemCode)) { |
|
|
|
// logger.error("机器人巡视系统唯一标识未查询到"); |
|
|
|
// robotSystemCode = ""; |
|
|
|
// } |
|
|
|
// |
|
|
|
// jsonObject.put("ReceiveCode", robotSystemCode); |
|
|
|
// String nestSystemCode = statisticsMapper.queryNestSystemCode(); |
|
|
|
// if (StringUtils.isBlank(nestSystemCode)) { |
|
|
|
// throw new ServiceException("机器人巡视系统唯一标识未查询到"); |
|
|
|
// } else { |
|
|
|
// try { |
|
|
|
// logger.info("[CLIENT] nestSystemCode: {}, lowMsgUrl: {}", nestSystemCode, lowMsgUrl); |
|
|
|
// jsonObject.put("ReceiveCode", nestSystemCode); |
|
|
|
// jsonObject.computeIfAbsent("Time", k -> DateUtils.format(DateUtils.yyyyMMddHHmmss2, new Date())); |
|
|
|
// |
|
|
|
// return CallDeviceApi.callDevice(lowMsgUrl, jsonObject.toJSONString()); |
|
|
|
// } catch (Exception e) { |
|
|
|
// throw new ServiceException("Call " + lowMsgUrl + " Exception!"); |
|
|
|
// } |
|
|
|
// } |
|
|
|
} else { |
|
|
|
try { |
|
|
|
return CallDeviceApi.callDevice(lowMsgUrl, msg); |
|
|
|
|