#
luxiaotao1123
2024-11-18 8d425ae26f1070043f4e81e7ebce1e6f39d5d013
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
@@ -254,6 +254,10 @@
            if (!Cools.isEmpty(taskService.selectInSts(agvId, TaskStsType.ASSIGN, TaskStsType.PROGRESS))) {
                throw new CoolException("AGV[" + agv.getUuid() + "]分配任务失败,已存在执行任务...");
            }
            if (!Cools.isEmpty(segmentService.getByAgvAndState(agv.getId(), SegmentStateType.WAITING.toString()))
                    || !Cools.isEmpty(segmentService.getByAgvAndState(agv.getId(), SegmentStateType.RUNNING.toString()))) {
                throw new CoolException("AGV[" + agv.getUuid() + "] failed to assign,because already has the segment in running...");
            }
            // execute ----------------------------------------------------
            Date now = new Date();
@@ -501,6 +505,10 @@
            if (!Cools.isEmpty(taskService.selectInSts(agv.getId(), TaskStsType.ASSIGN, TaskStsType.PROGRESS))) {
                throw new CoolException("AGV[" + agv.getUuid() + "] failed to assign,because already has the task in running...");
            }
            if (!Cools.isEmpty(segmentService.getByAgvAndState(agv.getId(), SegmentStateType.WAITING.toString()))
                    || !Cools.isEmpty(segmentService.getByAgvAndState(agv.getId(), SegmentStateType.RUNNING.toString()))) {
                throw new CoolException("AGV[" + agv.getUuid() + "] failed to assign,because already has the segment in running...");
            }
            Date now = new Date();
            Code endCode = null;
@@ -623,10 +631,6 @@
                default:
                    break;
            }
//            if (taskType.equals(TaskTypeType.TO_STANDBY)) {
//                redis.setObject(RedisConstant.AGV_TO_STANDBY_FLAG, agv.getUuid(), false);
//            }
            return true;
        } catch (Exception e) {