chen.lin
1 天以前 bb69d7a4bdfbb90cde19b3d828f490ab10f2bb43
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -150,7 +150,7 @@
            }
            Task task = new Task();
            task.setTaskCode(ruleCode)
                    .setTaskStatus(TaskStsType.GENERATE_IN.id)
                    .setTaskStatus(TaskStsType.MISSION_INITIAL.id)
                    .setTaskType(TaskType.TASK_TYPE_IN.type)
                    .setWarehType(WarehType.WAREHOUSE_TYPE_AGV.val)
                    .setTargLoc(targetLoc)
@@ -366,7 +366,7 @@
            }
            Task task = new Task();
            task.setTaskCode(ruleCode)
                    .setTaskStatus(TaskStsType.GENERATE_IN.id)
                    .setTaskStatus(TaskStsType.MISSION_INITIAL.id)
                    .setTaskType(TaskType.TASK_TYPE_IN.type)
                    .setResource(TaskResouceType.TASK_RESOUCE_PAKIN_TYPE.val)
                    .setTargLoc(targetLoc)
@@ -509,7 +509,7 @@
            for (BasContainer container : containers) {
                String codeType = container.getCodeType();  // 获取正则表达式
                if (barcode.matches(codeType)) {  // 判断条码是否符合这个正则
                    List<Integer> areaList2 = container.getAreas();
                    List<Integer> areaList2 = container.getAreasIds();
                    if (!areaList2.contains(Integer.parseInt(area))) {
                        matches2 = false;
                        continue;
@@ -758,7 +758,7 @@
                } else if (task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) {
                    //移库
                    moveInStock(task, loginUserId);
                } else if (task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type)) {
                } else if (task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_IN.type)) {
                    //移库
                    complateInstockE(task, loginUserId);
                }
@@ -776,7 +776,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Task taskToTop(Long id, Long loginUserId) throws Exception {
        List<Integer> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id);
        List<Integer> longs = Arrays.asList(TaskStsType.MISSION_INITIAL.id, TaskStsType.MISSION_INITIAL.id);
        Task tasks = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getId, id).in(Task::getTaskStatus, longs));
        if (Objects.isNull(tasks)) {
            throw new CoolException("任务已处执行状态不可一键置顶!!");
@@ -800,7 +800,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Task operateComplete(Long id, Long loginUserId) {
        List<Integer> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id);
        List<Integer> longs = Arrays.asList(TaskStsType.MISSION_INITIAL.id, TaskStsType.MISSION_INITIAL.id);
        Task task = taskService.getOne(new LambdaQueryWrapper<Task>()
                .eq(Task::getId, id)
                .in(Task::getTaskStatus, longs));
@@ -830,7 +830,7 @@
     */
    private Task modiftyTaskSort(Task task, Long loginUserId) {
        String curLoc;
        if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type)) {
        if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_IN.type)) {
            curLoc = task.getTargLoc();
        } else {
            curLoc = task.getOrgLoc();
@@ -981,7 +981,7 @@
        for (Task task : tasks) {
            //出库任务
            try {
                if (task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_OUT.type)) {
                if (task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_OUT.type)) {
                    //110.空板出库
                    complateOutStockEmpty(task, loginUserId);
                } else {
@@ -1071,10 +1071,10 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R removeTask(Long[] ids, Long loginUserId) {
        List<Integer> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id);
        List<Integer> longs = Arrays.asList(TaskStsType.MISSION_INITIAL.id, TaskStsType.MISSION_INITIAL.id);
        List<Integer> list = Arrays.asList(TaskType.TASK_TYPE_IN.type, TaskType.TASK_TYPE_OUT.type, TaskType.TASK_TYPE_PICK_AGAIN_OUT.type,
                TaskType.TASK_TYPE_CHECK_OUT.type, TaskType.TASK_TYPE_EMPITY_IN.type, TaskType.TASK_TYPE_LOC_MOVE.type,
                TaskType.TASK_TYPE_EMPITY_OUT.type, TaskType.TASK_TYPE_MERGE_OUT.type);
                TaskType.TASK_TYPE_CHECK_OUT.type, TaskType.TASK_TYPE_EMPTY_IN.type, TaskType.TASK_TYPE_LOC_MOVE.type,
                TaskType.TASK_TYPE_EMPTY_OUT.type, TaskType.TASK_TYPE_MERGE_OUT.type);
        List<Task> tasks = this.list(new LambdaQueryWrapper<Task>()
                .in(Task::getTaskType, list)
                .in(Task::getId, ids)
@@ -1084,7 +1084,7 @@
        }
        for (Task task : tasks) {
            //取消移库任务
            if (task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type) && task.getTaskStatus().equals(TaskStsType.GENERATE_IN.id)) {
            if (task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type) && task.getTaskStatus().equals(TaskStsType.MISSION_INITIAL.id)) {
                if (!locService.update(new LambdaUpdateWrapper<Loc>()
                        .eq(Loc::getCode, task.getOrgLoc())
                        .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type))) {
@@ -1148,7 +1148,7 @@
            if (!Objects.isNull(task.getWarehType()) && task.getWarehType().equals(WarehType.WAREHOUSE_TYPE_AGV.val)) {
                BasStation basStation = null;
                if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type)) {
                if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_IN.type)) {
                    basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                            .eq(BasStation::getStationName, task.getOrgSite())
                            .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_R.type));
@@ -1156,7 +1156,7 @@
                        || 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)) {
                        || task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_OUT.type)) {
                    basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                            .eq(BasStation::getStationName, task.getTargLoc())
                            .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_R.type));
@@ -1312,7 +1312,7 @@
        task.setTaskCode(ruleCode)
                .setTaskType(type)
                .setBarcode(task.getBarcode())
                .setTaskStatus(TaskStsType.GENERATE_IN.id);
                .setTaskStatus(TaskStsType.MISSION_INITIAL.id);
        TaskInParam param = new TaskInParam();
        param.setSourceStaNo(task.getTargSite())
@@ -1693,7 +1693,7 @@
        if (Objects.isNull(ids) || ids.isEmpty()) {
            return R.error("任务编码不能为空!!");
        }
        List<Integer> integers = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id);
        List<Integer> integers = Arrays.asList(TaskStsType.MISSION_INITIAL.id, TaskStsType.MISSION_INITIAL.id);
        List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>()
                .in(Task::getId, ids)
                .in(Task::getTaskStatus, integers)
@@ -1739,7 +1739,7 @@
                }
            }
            /**判断是否光电站点,非光店站点需管控站点状态*/
            /**判断是否智能站点,非光店站点需管控站点状态*/
            if (!Objects.isNull(station) && station.getType().equals(StationTypeEnum.STATION_TYPE_NORMAL.type)) {
                if (task.getTaskType() <= TaskType.TASK_TYPE_CHECK_IN.type && !task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) {
                    station.setUseStatus(LocStsType.LOC_STS_TYPE_R.type);
@@ -1759,7 +1759,7 @@
                itemParam.setOriLoc(task.getOrgLoc()).setDestLoc(task.getTargLoc());
            } else if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type)
                    || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type)
                    || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type)) {
                    || task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_IN.type)) {
                /**全板入库参数*/
                itemParam.setDestLoc(task.getTargLoc())
                        .setOriSta(task.getOrgSite());
@@ -1769,7 +1769,7 @@
                        .setOriSta(task.getTargSite());
            } 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_EMPITY_OUT.type)
                    || task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_OUT.type)
                    || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type)
                    || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type)) {
                /**出库参数*/
@@ -1821,7 +1821,7 @@
                        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_EMPTY_IN.type)
                                || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type)
                                || task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) {
@@ -1847,7 +1847,7 @@
                        } else if (task.getTaskType().equals(TaskType.TASK_TYPE_OUT.type)
                                || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type)
                                || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type)
                                || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_OUT.type)
                                || task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_OUT.type)
                                || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_OUT.type)) {
                            BasStation curSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, task.getTargSite()));
                            if (Objects.isNull(curSta)) {
@@ -2088,7 +2088,7 @@
        if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) ||
                task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type) ||
                task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type) ||
                task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type) ||
                task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_IN.type) ||
                task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) {
            stock.setLocCode(task.getTargLoc());
        } else {