| | |
| | | { |
| | | TTest test = tests.selectTestById(summary.getTestId()); |
| | | if (!"COMPLETED".equals(test.getTestStatus())) continue; |
| | | result.addAll(candidates(test, data.records(test.getTestId()))); |
| | | var available = candidates(test, data.records(test.getTestId())); |
| | | Set<String> mapped = new HashSet<>(); |
| | | for (var item : available) if (item.selection().logicalNo() != null) |
| | | mapped.add(item.selection().testBatteryId() + "|" + item.selection().cycleNo()); |
| | | // 与控制台一致:有保存的逻辑工步时,新选入口展示合并结果;旧快照仍保留原选择。 |
| | | result.addAll(available.stream().filter(item -> item.selection().logicalNo() != null |
| | | || !mapped.contains(item.selection().testBatteryId() + "|" + item.selection().cycleNo())).toList()); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | /** 预览所选当前有效记录;相同电池的不同循环或工步是独立比对项。 */ |
| | | public List<Item> preview(List<Selection> selections) |
| | | { |
| | | if (selections == null || selections.isEmpty() || selections.contains(null) |
| | | if (selections == null || selections.isEmpty() || selections.stream().anyMatch(Objects::isNull) |
| | | || new HashSet<>(selections).size() != selections.size()) |
| | | throw new ServiceException("请选择不重复的比对项"); |
| | | Map<Long, TTest> loadedTests = new HashMap<>(); |