Browse Source

新建指令先创建再下发,防止未插入数据库NDC已有反馈导致数据不存在

master
pangshenghao 1 year ago
parent
commit
4ad099f874
  1. 9
      acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java

9
acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java

@ -339,7 +339,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver;
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
try {
String start_device_code = dto.getStart_device_code();
String next_device_code = dto.getNext_device_code();
@ -360,6 +360,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
if (ObjectUtil.isEmpty(route)) {
throw new BadRequestException("未查询到相关路由!");
}
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
wo.insert(json);
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
@ -370,10 +373,10 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
log.error("");
}
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
wo.insert(json);
wo.update(json);
instructions.add(dto);
}

Loading…
Cancel
Save