| | |
| | | throw new BusinessException("Internal Server Error!"); |
| | | } |
| | | Boolean locStaStatusCheck = configService.getVal("LOC_STA_STATUS_CHECK", Boolean.class, true); |
| | | Integer locStaTaskNum = configService.getVal("LOC_STA_TASK_NUM", Integer.class, 2); |
| | | |
| | | |
| | | // 保存任务 |
| | |
| | | if (locStaStatusCheck && !destSta.getStaSts().equals(StaStsType.IDLE.val())) { |
| | | throw new BusinessException("destSta:" + task.getDestSta$() + " is not in IDLE status"); |
| | | } |
| | | } else { |
| | | List<Task> list = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getDestSta, destSta.getId()).in(Task::getTaskSts, TaskStsType.INIT.val(), TaskStsType.WAITING.val(), TaskStsType.ASSIGN.val(), TaskStsType.PROGRESS.val())); |
| | | if (!Cools.isEmpty(list) && list.size() >= locStaTaskNum) { |
| | | throw new BusinessException("destSta:" + task.getDestSta$() + " task more"); |
| | | } |
| | | } |
| | | destSta.setStaSts(StaStsType.READY_RELEASE.val()); |
| | | destSta.setUpdateTime(now); |
| | |
| | | if (destSta.getStaTypeIsCheck() != 1) { |
| | | if (locStaStatusCheck && !destSta.getStaSts().equals(StaStsType.IDLE.val())) { |
| | | throw new BusinessException("destSta:" + task.getDestSta$() + " is not in IDLE status"); |
| | | } |
| | | } else { |
| | | List<Task> list = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getDestSta, destSta.getId()).in(Task::getTaskSts, TaskStsType.INIT.val(), TaskStsType.WAITING.val(), TaskStsType.ASSIGN.val(), TaskStsType.PROGRESS.val())); |
| | | if (!Cools.isEmpty(list) && list.size() >= locStaTaskNum) { |
| | | throw new BusinessException("destSta:" + task.getDestSta$() + " task more"); |
| | | } |
| | | } |
| | | destSta.setStaSts(StaStsType.READY_RELEASE.val()); |
| | |
| | | log.error("Task [{}] 更新失败 !!!", task.getSeqNum()); |
| | | } else { |
| | | report(task, null, TaskReportStsType.END); |
| | | if (task.getSeqNum() != null && task.getSeqNum().contains("SSX-CK")) { |
| | | report(task, "1001", TaskReportStsType.COMPLETED); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | List<TaskReport> list = taskReportService.list(new LambdaQueryWrapper<TaskReport>().eq(TaskReport::getSeqNum, task.getSeqNum()).eq(TaskReport::getBusNo, task.getBusId$()).eq(TaskReport::getTaskSts, taskReportStsType.status)); |
| | | if (!Cools.isEmpty(list)) { |
| | | log.info("TaskReport [{}] 已重复,不再插入 ==========>> ", JSON.toJSONString(task)); |
| | | log.info("TaskReport [{},{}] 已重复,不再插入 ==========>> ", taskReportStsType, JSON.toJSONString(task)); |
| | | return; |
| | | } |
| | | TaskReport taskReport = new TaskReport(); |
| | |
| | | taskReport.setEventType(taskReportStsType.name); |
| | | taskReport.setSeqNum(task.getSeqNum()); |
| | | taskReport.setZpallet(task.getZpallet()); |
| | | |
| | | if (!taskReportService.save(taskReport)) { |
| | | log.info("TaskReport [{}] 插入失败 ==========>> ", JSON.toJSONString(taskReport)); |
| | | } else { |