| | |
| | | Task task = taskService.getById(segment.getTaskId()); |
| | | TaskPosDto.PosType posType = Objects.requireNonNull(TaskPosDto.queryPosType(segment.getPosType())); |
| | | boolean isStation = posType.equals(TaskPosDto.PosType.ORI_STA) || posType.equals(TaskPosDto.PosType.DEST_STA); |
| | | |
| | | boolean isLoc = posType.equals(TaskPosDto.PosType.ORI_LOC) || posType.equals(TaskPosDto.PosType.DEST_LOC); |
| | | // 节点条码 |
| | | Code code = codeService.getCacheById(segment.getEndNode()); |
| | | |
| | |
| | | boolean reverse = false; |
| | | if (nextDirection.equals((workDirection + 180) % 360)) { |
| | | List<String> list = Arrays.asList("00000050", "00000051", "00000052", "00000053", "00000054", "00000080", "00000081", "00000082", "00000083", "00000084"); |
| | | if (isStation && list.contains(lastCode.getData())) { |
| | | if ((isStation && list.contains("00000050")) || (isLoc && list.contains("00000080"))) { |
| | | reverse = false; |
| | | lastDirection = nextDirection; |
| | | } else { |
| | |
| | | nextDirection = lastDirection; |
| | | reverse = true; |
| | | } else { |
| | | if (isStation && (lastCode.getData().equals("00000050") || lastCode.getData().equals("00000080"))) { |
| | | if ((isStation && lastCode.getData().equals("00000050")) || (isLoc && lastCode.getData().equals("00000080"))) { |
| | | // turn |
| | | reverse = false; |
| | | actionList.add(new Action( |
| | |
| | | } else { |
| | | List<String> list = Arrays.asList("00000051", "00000052", "00000053", "00000054"); |
| | | Double turnDirection = nextDirection; |
| | | if (list.contains(nextCode.getData()) && lastCode.getData().equals("00000050")) { |
| | | if ((isStation && list.contains("00000050")) || (isLoc && list.contains("00000080"))) { |
| | | turnDirection = 180.0; |
| | | } |
| | | // turn |
| | |
| | | lastDirection = nextDirection; |
| | | } |
| | | } else { |
| | | if (isStation && (lastCode.getData().equals("00000050") || lastCode.getData().equals("00000080"))) { |
| | | if ((isStation && lastCode.getData().equals("00000050")) || (isLoc && lastCode.getData().equals("00000080"))) { |
| | | // turn |
| | | reverse = false; |
| | | actionList.add(new Action( |
| | |
| | | if (Cools.isEmpty(actionList) || !actionList.get(0).getActionType().equals(ActionTypeType.TurnCorner.val())) { |
| | | Double turnDirection = workDirection; |
| | | List<String> list = Arrays.asList("00000050","00000051", "00000052", "00000053", "00000054", "00000080", "00000081", "00000082", "00000083", "00000084"); |
| | | if (isStation && list.contains(lastCode.getData())) { |
| | | if ((isStation && list.contains("00000050")) || (isLoc && list.contains("00000080"))) { |
| | | turnDirection = workDirection + 180.0; |
| | | } |
| | | if (lastCode.getCornerBool()) { |