| | |
| | | newDto.setCodeId(endCode.getId()); |
| | | destPosList.add(newDto); |
| | | |
| | | // sort - reference to buildMarjoTask |
| | | final String sameGroupXy = configService.getVal("sameGroupXy", String.class); |
| | | |
| | | // DEST-only sort |
| | | destPosList.sort((a, b) -> { |
| | | int c1 = Double.compare(a.getXy()[0], b.getXy()[0]); // X |
| | | if (c1 != 0) return c1; |
| | | int c2 = Double.compare(a.getXy()[1], b.getXy()[1]); // Y |
| | | if (c2 != 0) return c2; |
| | | // 同坐标时用 taskId 打散(避免排序不稳定) |
| | | |
| | | // 主轴 |
| | | double aFirst = a.getFirstWeight(sameGroupXy); |
| | | double bFirst = b.getFirstWeight(sameGroupXy); |
| | | int c = Double.compare(aFirst, bFirst); |
| | | if (c != 0) return c; |
| | | |
| | | // 副轴 |
| | | double aSecond = a.getSecondWeight(sameGroupXy); |
| | | double bSecond = b.getSecondWeight(sameGroupXy); |
| | | c = Double.compare(aSecond, bSecond); |
| | | if (c != 0) return c; |
| | | |
| | | return Long.compare(a.getTaskId(), b.getTaskId()); |
| | | }); |
| | | |
| | |
| | | * val: new TaskPosDto(taskId, new Double[]{code.getX(), code.getY()}, posType) |
| | | */ |
| | | Map<String, List<TaskPosDto>> groups = new HashMap<>(); |
| | | final String sameGroupXy = configService.getVal( "sameGroupXy", String.class); |
| | | final String sameGroupXy = configService.getVal("sameGroupXy", String.class); |
| | | |
| | | int backpackLev = 0; |
| | | for (Task task : taskList) { |