| | |
| | | AgvDetail agvDetail = agvDetailService.selectMajorByAgvId(firstAction.getAgvId()); |
| | | Double lastDirection = MapService.mapToNearest(agvDetail.getAgvAngle()); |
| | | |
| | | List<Action> fullActionList = actionService.list( |
| | | new LambdaQueryWrapper<Action>() |
| | | List<Action> fullActionList = actionService.list(new LambdaQueryWrapper<Action>() |
| | | .eq(Action::getGroupId, actionGroupId) |
| | | .select(Action::getId, Action::getActionType, Action::getPriority) |
| | | .orderByDesc(Action::getPriority) |
| | |
| | | if (null != turnActionId) { |
| | | Action turn = actionService.getById(turnActionId); |
| | | Double direction = Double.parseDouble(turn.getParams()); |
| | | |
| | | if (!lastDirection.equals(direction)) { |
| | | if (!code.getCornerBool()) { |
| | | throw new CoolException(agvDetail.getAgvId$() + "号小车方向错误,请推至转弯点手动调整"); |
| | | } |
| | | } |
| | | |
| | | // new turn action |
| | | prependTurn = new Action( |
| | | null, // 编号 |
| | |
| | | } |
| | | int i = newActionList.size(); |
| | | for (Action action : newActionList) { |
| | | action.setId(null); |
| | | action.setPriority(i); |
| | | if (!actionService.save(action)) { |
| | | throw new BusinessException(action.getName() + " Action Update Fail!"); |
| | | throw new BusinessException(action.getName() + " Action Save Fail!"); |
| | | } |
| | | i -= 1; |
| | | } |