| | |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) { |
| | | /**修改出库站点状态*/ |
| | | BasStation station = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getStationName, task.getTargSite())); |
| | | .eq(BasStation::getStationName, task.getOrgSite())); |
| | | if (Objects.isNull(station)) { |
| | | throw new CoolException("数据错误,站点不存在!!"); |
| | | } |
| | |
| | | if (!taskService.update(new LambdaUpdateWrapper<Task>() |
| | | .lt(Task::getTaskStatus, TaskStsType.WCS_EXECUTE_IN.id) |
| | | .eq(Task::getTaskCode, task.getTaskCode()) |
| | | .set(Task::getOrgSite, task.getTargSite()) |
| | | .set(Task::getTaskStatus, TaskStsType.WCS_EXECUTE_IN.id))) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, params.getBarcode())); |
| | | if (waitPakins.isEmpty()) { |
| | | throw new CoolException("单据不存在 !!"); |
| | | } |
| | | |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, params.getSourceStaNo()).orderByDesc(BasStation::getId), false); |
| | | if (Objects.isNull(basStation)) { |
| | |
| | | } |
| | | Task one = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, params.getBarcode())); |
| | | if (!Cools.isEmpty(one)) { |
| | | if (!one.getTaskStatus().equals(TaskStsType.COMPLETE_IN.id)) { |
| | | if (!one.getTaskStatus().equals(TaskStsType.WCS_EXECUTE_IN.id)) { |
| | | return R.error("任务已存在但是状态不一致!!!").add("任务已存在但是状态不一致!!!"); |
| | | } |
| | | InTaskWcsReportParam inTaskWcsReportParam = new InTaskWcsReportParam(); |
| | |
| | | inTaskWcsReportParam.setTaskPri(one.getSort()); |
| | | return R.ok("任务已存在直接下发!").add(inTaskWcsReportParam); |
| | | } |
| | | List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, params.getBarcode())); |
| | | if (waitPakins.isEmpty()) { |
| | | throw new CoolException("组托单据不存在 !!"); |
| | | } |
| | | GenerateTaskParams taskParams = new GenerateTaskParams(); |
| | | taskParams.setWaitPakins(waitPakins) |
| | | .setSiteId(basStation.getId()); |