| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | // if (taskType.equals(TaskTypeType.TO_STANDBY)) { |
| | | // redis.setObject(RedisConstant.AGV_TO_STANDBY_FLAG, agv.getUuid(), false); |
| | | // } |
| | | |
| | | return true; |
| | | } catch (Exception e) { |