1.添加日志
2.重复查询inst并过滤已取消或已完成的指令
This commit is contained in:
@@ -134,9 +134,17 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
}
|
}
|
||||||
if (ikey != 0) {
|
if (ikey != 0) {
|
||||||
inst = instructionService.findByCodeFromCache(String.valueOf(ikey));
|
inst = instructionService.findByCodeFromCache(String.valueOf(ikey));
|
||||||
// if (ObjectUtil.isEmpty(inst)) {
|
if (ObjectUtil.isEmpty(inst)) {
|
||||||
// inst = instructionService.findByCode(String.valueOf(ikey));
|
inst = instructionService.findByCode(String.valueOf(ikey));
|
||||||
// }
|
if(inst!=null) {
|
||||||
|
log.info(inst.toString());
|
||||||
|
//如果任務已完成或已取消則置為空
|
||||||
|
if (!"0".equals(inst.getInstruction_status()) &&
|
||||||
|
!"1".equals(inst.getInstruction_status())) {
|
||||||
|
inst = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!ObjectUtil.isEmpty(link_inst)) {
|
if (!ObjectUtil.isEmpty(link_inst)) {
|
||||||
link_flag = true;
|
link_flag = true;
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CancelTaskResponse cancelFromWms(List<CancelTaskRequest> reqs) throws Exception {
|
public CancelTaskResponse cancelFromWms(List<CancelTaskRequest> reqs) throws Exception {
|
||||||
|
log.info("cancelFromWms--------------:输入参数:" + reqs);
|
||||||
ParamService paramService = SpringContextHolder.getBean(ParamService.class);
|
ParamService paramService = SpringContextHolder.getBean(ParamService.class);
|
||||||
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
|
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
|
||||||
CancelTaskResponse response = new CancelTaskResponse();
|
CancelTaskResponse response = new CancelTaskResponse();
|
||||||
@@ -84,7 +85,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
}
|
}
|
||||||
TaskDto taskDto = taskService.findByCodeFromCache(task_code);
|
TaskDto taskDto = taskService.findByCodeFromCache(task_code);
|
||||||
String cancelTaskCheck = paramService.findByCode(AcsConfig.CANCELTASKCHECK).getValue();
|
String cancelTaskCheck = paramService.findByCode(AcsConfig.CANCELTASKCHECK).getValue();
|
||||||
|
if(taskDto==null){
|
||||||
|
log.info("任务已完成或取消");
|
||||||
|
}else {
|
||||||
// if (StrUtil.equals(cancelTaskCheck, "1")) {
|
// if (StrUtil.equals(cancelTaskCheck, "1")) {
|
||||||
// taskService.cancelNoSendWms(taskDto.getTask_id());
|
// taskService.cancelNoSendWms(taskDto.getTask_id());
|
||||||
// } else if (StrUtil.equals(cancelTaskCheck, "0")) {
|
// } else if (StrUtil.equals(cancelTaskCheck, "0")) {
|
||||||
@@ -92,10 +95,11 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
instructionService.cancel(inst.getInstruction_id());
|
instructionService.cancel(inst.getInstruction_id());
|
||||||
}
|
}
|
||||||
taskService.cancelNoSendWms(taskDto.getTask_id());
|
taskService.cancelNoSendWms(taskDto.getTask_id());
|
||||||
// } else {
|
// } else {
|
||||||
// throw new RuntimeException("指令正在执行中,操作失败!");
|
// throw new RuntimeException("指令正在执行中,操作失败!");
|
||||||
// }
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user