skyouc
1 天以前 99411967019bbf0d7b0b971eae0db2c2c58025f0
修改任务状态
1个文件已修改
28 ■■■■■ 已修改文件
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/WcsServiceImpl.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/WcsServiceImpl.java
@@ -455,7 +455,35 @@
        if (Objects.isNull(params)) {
            return R.error("参数不能为空!!");
        }
        Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getTaskCode, params.getSeqNum()));
        if (Objects.isNull(task)) {
            throw new CoolException("任务不存在!!");
        }
        
        if (params.getEventType().equals("END")) {
            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)) {
                if (!taskService.update(new LambdaUpdateWrapper<Task>().eq(Task::getTaskCode, task.getTaskCode())
                        .set(Task::getTaskStatus, TaskStsType.COMPLETE_IN.id))) {
                    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)) {
                if (!taskService.update(new LambdaUpdateWrapper<Task>().eq(Task::getTaskCode, task.getTaskCode())
                        .set(Task::getTaskStatus, TaskStsType.COMPLETE_OUT.id))) {
                    throw new CoolException("任务状态修改失败!!");
                }
            }
        }
        log.info(JSONObject.toJSONString(params));
        return R.ok(JSONObject.toJSONString(params));
    }