Browse Source

设备下发编码问题修改

master
lijw 7 months ago
parent
commit
4a621ec738
3 changed files with 20 additions and 24 deletions
  1. +2
    -2
      inspect-main/inspect-main-client/src/main/java/com/inspect/client/service/ClientService.java
  2. +16
    -20
      inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java
  3. +2
    -2
      inspect-main/inspect-main-task/src/main/java/com/inspect/taskinfo/service/impl/PatrolTaskInfoServiceImpl.java

+ 2
- 2
inspect-main/inspect-main-client/src/main/java/com/inspect/client/service/ClientService.java View File

@ -217,13 +217,13 @@ public class ClientService {
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("Command", "4");//边缘节点点位同步命令为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("Command", "1");//直连设备点位同步命令为1
jsonObject.put("ReceiveCode",receiveCode);
logger.info("--------------[CLIENT] 直连设备点位同步jsonObject: {}", jsonObject.toJSONString());
}


+ 16
- 20
inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java View File

@ -777,24 +777,22 @@ public class PatrolTaskController extends BaseController {
List<String> infoListFull = map.get("listFull");
logger.info("[TASK] taskId1: {}, infoList1: {}, infoListFull1: {}", patrolTask.getTaskId(), infoList, infoListFull);
if (!infoList.isEmpty()) {
if (receiveCode.startsWith("areaPatrolServer")) {
List areaPatrolDevList = new ArrayList();
if (StringUtils.isNotBlank(receiveCode)) {
List otherDevList = new ArrayList();
for (int i = 0; i < infoListFull.size(); i++) {
String dev = infoListFull.get(i);
if (dev.startsWith("areaPatrolServer")) {
areaPatrolDevList.add(infoList.get(i));
if (dev.startsWith(receiveCode)) {
otherDevList.add(infoList.get(i));
}
}
patrolSendTask.setDeviceList(String.join(StringUtils.COMMA, areaPatrolDevList));
patrolSendTask.setDeviceList(String.join(StringUtils.COMMA, otherDevList));
} else {
List otherDevList = new ArrayList();
List selfDevList = new ArrayList();
for (int i = 0; i < infoListFull.size(); i++) {
String dev = infoListFull.get(i);
if (!dev.startsWith("areaPatrolServer")) {
otherDevList.add(infoList.get(i));
}
selfDevList.add(infoListFull.get(i));
}
patrolSendTask.setDeviceList(String.join(StringUtils.COMMA, otherDevList));
patrolSendTask.setDeviceList(String.join(StringUtils.COMMA, selfDevList));
}
} else {
patrolSendTask.setDeviceList("[empty device list 2]");
@ -980,24 +978,22 @@ public class PatrolTaskController extends BaseController {
List<String> infoListFull = map.get("listFull");
logger.info("[TASK] taskId2: {}, infoList2: {}, infoListFull2: {}", patrolTask.getTaskId(), infoList, infoListFull);
if (!infoList.isEmpty()) {
if (receiveCode.startsWith("areaPatrolServer")) {
List areaPatrolDevList = new ArrayList();
if (StringUtils.isNotBlank(receiveCode)) {
List otherDevList = new ArrayList();
for (int i = 0; i < infoListFull.size(); i++) {
String dev = infoListFull.get(i);
if (dev.startsWith("areaPatrolServer")) {
areaPatrolDevList.add(infoList.get(i));
if (dev.startsWith(receiveCode)) {
otherDevList.add(infoList.get(i));
}
}
patrolSendTask.setDeviceList(String.join(StringUtils.COMMA, areaPatrolDevList));
patrolSendTask.setDeviceList(String.join(StringUtils.COMMA, otherDevList));
} else {
List otherDevList = new ArrayList();
List selfDevList = new ArrayList();
for (int i = 0; i < infoListFull.size(); i++) {
String dev = infoListFull.get(i);
if (!dev.startsWith("areaPatrolServer")) {
otherDevList.add(infoList.get(i));
}
selfDevList.add(infoListFull.get(i));
}
patrolSendTask.setDeviceList(String.join(StringUtils.COMMA, otherDevList));
patrolSendTask.setDeviceList(String.join(StringUtils.COMMA, selfDevList));
}
} else {
patrolSendTask.setDeviceList("[empty device list 4]");


+ 2
- 2
inspect-main/inspect-main-task/src/main/java/com/inspect/taskinfo/service/impl/PatrolTaskInfoServiceImpl.java View File

@ -47,10 +47,10 @@ public class PatrolTaskInfoServiceImpl implements IPatrolTaskInfoService {
public Map<String, List> selectPatrolTaskInfoListByMajorId(String taskId) {
Map<String, List> map = new HashMap<>();
List<String> list1 = this.patrolTaskInfoMapper.selectPatrolTaskInfoListByMajorId(taskId);
List<String> list1 = this.patrolTaskInfoMapper.selectPatrolTaskInfoListByMajorId(taskId);//query point base on device|point format
List<String> listFull = this.patrolTaskInfoMapper.selectPatrolTaskInfoListByMajorIdFull(taskId);
if(list1.size() > 0 && list1.get(0).equals(listFull.get(0))) {
List<String> list2 = this.patrolTaskInfoMapper.selectPatrolTaskInfoListByMajorIdEither(taskId);
List<String> list2 = this.patrolTaskInfoMapper.selectPatrolTaskInfoListByMajorIdEither(taskId);//query point base on device_point format
map.put("list" , list2);
map.put("listFull", listFull);
} else {


Loading…
Cancel
Save