| | |
| | | try { |
| | | // valid ----------------------------------------------- |
| | | Agv agv = agvService.getById(agvId); |
| | | if (!agvService.judgeEnable(agv.getId(), true)) { |
| | | if (!agvService.judgeEnable(agv.getId(), false)) { |
| | | return; |
| | | } |
| | | if (!Cools.isEmpty(taskService.selectInSts(agvId, TaskStsType.ASSIGN, TaskStsType.PROGRESS))) { |
| | |
| | | // JSONObject storeDirection = configService.getVal("storeDirection", JSONObject.class); |
| | | int angleOffsetVal = configService.getVal("mapAngleOffsetVal", Integer.class); |
| | | String agvNo = agvService.getAgvNo(agvId); |
| | | if (!agvService.judgeEnable(agvId)) { |
| | | throw new CoolException("AGV[" + agvNo + "]当前不可用..."); |
| | | } |
| | | // if (!agvService.judgeEnable(agvId)) { |
| | | // throw new CoolException("AGV[" + agvNo + "]当前不可用..."); |
| | | // } |
| | | |
| | | AgvModel agvModel = agvModelService.getByAgvId(agvId); |
| | | Double workDirection = agvModel.getWorkDirection(); |
| | |
| | | now // 工作时间 |
| | | )); |
| | | |
| | | // List<Action> newActionList = new ArrayList<>(actionList); |
| | | |
| | | // List<Action> optimizeList = actionService.optimizeSort(actionList); |
| | | |
| | | List<Action> optimizeList = actionSorter.optimizeSort(actionList); |
| | | List<Action> newActionList = new ArrayList<>(optimizeList); |
| | | |
| | | |
| | | List<Action> newActionList = actionSorter.optimizeSort(actionList); |
| | | String groupId = String.valueOf(snowflakeIdWorker.nextId()).substring(3); |
| | | |
| | | // save action |
| | | int i = newActionList.size(); |
| | | for (Action action : newActionList) { |
| | | action.setUuid(String.valueOf(snowflakeIdWorker.nextId()).substring(3)); |
| | | // action.setUuid(String.valueOf(snowflakeIdWorker.nextId()).substring(3)); |
| | | action.setGroupId(groupId); |
| | | action.setPriority(i); |
| | | if (!actionService.save(action)) { |
| | | throw new BusinessException(action.getName() + "动作保存失败"); |
| | | } |
| | | i -= 1; |
| | | } |
| | | if (!actionService.saveBatch(newActionList)) { |
| | | throw new BusinessException("group[" + groupId + "] 动作保存失败"); |
| | | } |
| | | |
| | | // update segment |
| | | for (Segment item : segmentList) { |