Compare commits

...

2 Commits

Author SHA1 Message Date
wxr
7a03bc6293 Merge branch 'test' of https://git.will-way.cn/zgty/zt-qms into test 2025-11-27 18:23:45 +08:00
wxr
171de4c8d4 分析样顺序调整 2025-11-27 18:23:34 +08:00

View File

@@ -4,7 +4,9 @@ import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -172,7 +174,11 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId()); // projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList); projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch); List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
Map<Long, List<BusinessAssayProjectAndParameterRespVO>> projectAndParameterMap = projectAndParameterList.stream().collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId));
Map<Long, List<BusinessAssayProjectAndParameterRespVO>> projectAndParameterMap = projectAndParameterList.stream().sorted(Comparator.comparing(BusinessAssayProjectAndParameterRespVO::getParamNo)).collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId,
LinkedHashMap::new, // 保持组首次出现的顺序(可选)
Collectors.toList() // ArrayList 保持组内顺序
));
for (Map.Entry<Long, List<BusinessAssayProjectAndParameterRespVO>> entry : projectAndParameterMap.entrySet()) { for (Map.Entry<Long, List<BusinessAssayProjectAndParameterRespVO>> entry : projectAndParameterMap.entrySet()) {
BusinessAssayProjectAndParameterRespVO ep = entry.getValue().get(0); BusinessAssayProjectAndParameterRespVO ep = entry.getValue().get(0);
String fieldIndex = "e" + ep.getDicId(); String fieldIndex = "e" + ep.getDicId();
@@ -453,7 +459,10 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId()); // projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList); projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch); List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
Map<Long, List<BusinessAssayProjectAndParameterRespVO>> projectAndParameterMap = projectAndParameterList.stream().collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId)); Map<Long, List<BusinessAssayProjectAndParameterRespVO>> projectAndParameterMap = projectAndParameterList.stream().sorted(Comparator.comparing(BusinessAssayProjectAndParameterRespVO::getParamNo)).collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId,
LinkedHashMap::new, // 保持组首次出现的顺序(可选)
Collectors.toList() // ArrayList 保持组内顺序
));
for (Map.Entry<Long, List<BusinessAssayProjectAndParameterRespVO>> entry : projectAndParameterMap.entrySet()) { for (Map.Entry<Long, List<BusinessAssayProjectAndParameterRespVO>> entry : projectAndParameterMap.entrySet()) {
BusinessAssayProjectAndParameterRespVO ep = entry.getValue().get(0); BusinessAssayProjectAndParameterRespVO ep = entry.getValue().get(0);
String fieldIndex = "e" + ep.getDicId(); String fieldIndex = "e" + ep.getDicId();