1
昨天 15f7122856ef4e7cfe19d0e8bf8d693072240be7
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/WcsServiceImpl.java
@@ -475,17 +475,49 @@
        }
        /**料箱搬运中, 修改站点状态*/
//        if (params.getEventType().equals(CallBackEvent.CALL_BACK_EVENT_OBIT.event)) {
//            if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type)
//                    || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type)
//                    || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)
//                    || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type)
//                    || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type)
//                    || task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) {
//
//            }
//            /**取箱完成, 修改任务状态*/
//        } else
        if (params.getEventType().equals(CallBackEvent.CALL_BACK_EVENT_BIN.event)) {
            if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type)
                    || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type)
                    || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)
                    || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type)
                    || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type)
                    || task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) {
                /**修改出库站点状态*/
                BasStation station = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                        .eq(BasStation::getStationName, task.getOrgSite()));
                if (Objects.isNull(station)) {
                    throw new CoolException("数据错误,站点不存在!!");
                }
                if (station.getType().equals(StationTypeEnum.STATION_TYPE_NORMAL.type)) {
                    station.setUseStatus(LocStsType.LOC_STS_TYPE_O.type);
                    station.setBarcode(null);
                    if (!basStationService.updateById(station)) {
                        throw new CoolException("站点状态修改失败!!");
                    }
                }
            } else if (task.getTaskType().equals(TaskType.TASK_TYPE_OUT.type)
                    || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_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_EMPITY_OUT.type)) {
                /**修改出库站点状态*/
                BasStation station = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                        .eq(BasStation::getStationName, task.getOrgLoc()));
                if (Objects.isNull(station)) {
                    throw new CoolException("数据错误,站点不存在!!");
                }
                if (station.getType().equals(StationTypeEnum.STATION_TYPE_NORMAL.type)) {
                    station.setUseStatus(LocStsType.LOC_STS_TYPE_O.type);
                    station.setBarcode(null);
                    if (!basStationService.updateById(station)) {
                        throw new CoolException("站点状态修改失败!!");
                    }
                }
            }
            /**取箱完成, 修改任务状态*/
        } else
        if (params.getEventType().equals(CallBackEvent.CALL_BACK_EVENT_END.event)) {
            if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type)
                    || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type)
@@ -549,6 +581,7 @@
                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("任务状态修改失败!!");
                }
@@ -952,10 +985,6 @@
        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)) {
@@ -966,7 +995,7 @@
        }
        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();
@@ -975,6 +1004,10 @@
            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());