| | |
| | | taskInstanceNode.setStatus(flowInstance.getStatus()); |
| | | TaskInstance taskInstance = taskInstanceService.getById(flowInstance.getTaskId()); |
| | | if (Cools.isEmpty(taskInstance)) { continue;} |
| | | Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getTaskCode, taskInstance.getTaskNo())); |
| | | Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getTaskCode, taskInstance.getTaskNo()).last("limit 1"),false); |
| | | if (Cools.isEmpty(task)) { continue;} |
| | | if (!task.getTaskStatus().equals(flowStepInstance.getWmsNowTaskStatus())) { |
| | | log.error("任务号:"+task.getTaskCode()+"的任务状态与执行档案任务状态:"+flowStepInstance.getWmsNowTaskStatus()+"不一致!!!"); |
| | |
| | | .eq(FlowStepInstance::getStatus, (short)0) |
| | | .eq(FlowStepInstance::getTaskNo, flowStepInstance.getTaskNo()) |
| | | .eq(FlowStepInstance::getStepOrder, flowStepInstance.getStepOrder() + 1) |
| | | .eq(FlowStepInstance::getWmsNowTaskStatus, flowStepInstance.getWmsNextTaskStatus())); |
| | | .eq(FlowStepInstance::getWmsNowTaskStatus, flowStepInstance.getWmsNextTaskStatus()).last("limit 1")); |
| | | if (Cools.isEmpty(nextFlowStepInstance)) { |
| | | throw new CoolException("任务号"+task.getTaskCode()+"任务步骤丢失!!!"); |
| | | } |
| | |
| | | if (souSign){ |
| | | WarehouseAreas warehouseAreas = warehouseAreasService.getById(Long.parseLong(taskInstance.getSourceCode())); |
| | | if (Cools.isEmpty(warehouseAreas)){ |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getSourceCode())); |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getSourceCode()).last("limit 1")); |
| | | if (Cools.isEmpty(basStation)){ |
| | | basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .apply("station_alias != '[]'") // 不是空数组 |
| | |
| | | missionTaskIssueParam.setSourceCode(taskInstance.getSourceCode()); |
| | | } |
| | | } else { |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getSourceCode())); |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getSourceCode()).last("limit 1")); |
| | | if (Cools.isEmpty(basStation)){ |
| | | basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .apply("station_alias != '[]'") // 不是空数组 |
| | |
| | | if (endSign){ |
| | | WarehouseAreas warehouseAreas = warehouseAreasService.getById(Long.parseLong(taskInstance.getTargetCode())); |
| | | if (Cools.isEmpty(warehouseAreas)){ |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getTargetCode())); |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getTargetCode()).last("limit 1")); |
| | | if (Cools.isEmpty(basStation)){ |
| | | basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .apply("station_alias != '[]'") // 不是空数组 |
| | |
| | | missionTaskIssueParam.setTargetCode(taskInstance.getTargetCode()); |
| | | } |
| | | } else { |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getTargetCode())); |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, taskInstance.getTargetCode()).last("limit 1")); |
| | | if (Cools.isEmpty(basStation)){ |
| | | basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .apply("station_alias != '[]'") // 不是空数组 |
| | |
| | | .eq(FlowStepInstance::getStatus, (short)0) |
| | | .eq(FlowStepInstance::getTaskNo, flowStepInstance.getTaskNo()) |
| | | .eq(FlowStepInstance::getStepOrder, flowStepInstance.getStepOrder() + 1) |
| | | .eq(FlowStepInstance::getWmsNowTaskStatus, flowStepInstance.getWmsNextTaskStatus())); |
| | | .eq(FlowStepInstance::getWmsNowTaskStatus, flowStepInstance.getWmsNextTaskStatus()).last("limit 1")); |
| | | if (Cools.isEmpty(nextFlowStepInstance)) { |
| | | throw new CoolException("任务号"+task.getTaskCode()+"任务步骤丢失!!!"); |
| | | } |
| | |
| | | |
| | | BasStation station = null; |
| | | if (!task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) { |
| | | station = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getTargSite())); |
| | | station = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getTargSite()).last("limit 1")); |
| | | if (Objects.isNull(station)) { |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | |
| | | Loc locStart = null; |
| | | if (task.getTaskType().equals(TaskType.TASK_TYPE_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type) || |
| | | task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_OUT.type)) { |
| | | locStart = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getOrgLoc())); |
| | | locStart = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getOrgLoc()).last("limit 1")); |
| | | if (Objects.isNull(locStart)) { |
| | | throw new CoolException("源库位不存在!!"); |
| | | } |
| | |
| | | task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type) || |
| | | task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type) |
| | | ) { |
| | | BasStation stationS = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getOrgSite())); |
| | | BasStation stationS = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getOrgSite()).last("limit 1")); |
| | | if (Objects.isNull(stationS)) { |
| | | throw new CoolException("源库位不存在!!"); |
| | | } |
| | |
| | | if (stationS.getType().equals(StationTypeEnum.STATION_TYPE_MUTI.type)) { |
| | | taskParams.setSign(LocStsWcsOrOtherType.LOC_STS_TYPE_WCS.type); |
| | | } else { |
| | | Loc locEnd = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTargLoc())); |
| | | Loc locEnd = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTargLoc()).last("limit 1")); |
| | | if (Objects.isNull(locEnd)) { |
| | | throw new CoolException("源库位不存在!!"); |
| | | } |
| | |
| | | /**站点间移库参数*/ |
| | | itemParam.setOriSta(task.getOrgSite()).setDestSta(task.getTargSite()); |
| | | |
| | | BasStation curSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getOrgSite())); |
| | | BasStation curSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getOrgSite()).last("limit 1")); |
| | | if (Objects.isNull(curSta)) { |
| | | throw new CoolException("站点不存在!!"); |
| | | } |