|
|
|
@ -203,7 +203,6 @@ public class ClientService { |
|
|
|
String stationNo = statisticsMapper.selectStationNo(); |
|
|
|
if (StringUtils.isNotBlank(stationNo)) { |
|
|
|
jsonObject.put("Code", stationNo); |
|
|
|
jsonObject.put("Command", 1); |
|
|
|
} |
|
|
|
|
|
|
|
String iipCode = statisticsMapper.queryIICSystemCode(); |
|
|
|
@ -212,22 +211,26 @@ public class ClientService { |
|
|
|
} |
|
|
|
jsonObject.put("SendCode", iipCode); |
|
|
|
|
|
|
|
// 武汉电站同步点位数据 |
|
|
|
try { |
|
|
|
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()); |
|
|
|
String receiveCode = jsonObject.getString("ReceiveCode"); |
|
|
|
if(StringUtils.isNotEmpty(receiveCode)) { |
|
|
|
if (receiveCode.startsWith("areaPatrolServer")) { |
|
|
|
logger.info("[CLIENT] 许继边缘节点ReceiveCode: {}, lowMsgUrl: {}", receiveCode, lowMsgUrl); |
|
|
|
jsonObject.computeIfAbsent("Time", k -> DateUtils.format(DateUtils.yyyyMMddHHmmss2, new Date())); |
|
|
|
jsonObject.put("Command", "4"); |
|
|
|
jsonObject.put("ReceiveCode",receiveCode); |
|
|
|
logger.info("--------------[CLIENT] 许继边缘节点点位同步jsonObject: {}", jsonObject.toJSONString()); |
|
|
|
} else { |
|
|
|
logger.info("[CLIENT] 直连设备ReceiveCode: {}, lowMsgUrl: {}", receiveCode, lowMsgUrl); |
|
|
|
jsonObject.computeIfAbsent("Time", k -> DateUtils.format(DateUtils.yyyyMMddHHmmss2, new Date())); |
|
|
|
jsonObject.put("Command", "1"); |
|
|
|
jsonObject.put("ReceiveCode",receiveCode); |
|
|
|
logger.info("--------------[CLIENT] 直连设备点位同步jsonObject: {}", jsonObject.toJSONString()); |
|
|
|
} |
|
|
|
return CallDeviceApi.callDevice(lowMsgUrl, jsonObject.toJSONString()); |
|
|
|
} else { |
|
|
|
throw new ServiceException("receiveCode is empty"); |
|
|
|
} |
|
|
|
return CallDeviceApi.callDevice(lowMsgUrl, jsonObject.toJSONString()); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new ServiceException("Call " + lowMsgUrl + " Exception!"); |
|
|
|
} |
|
|
|
|