分析项目根据字典id过滤

This commit is contained in:
2025-11-27 17:30:18 +08:00
parent 353a6dcb3e
commit 600e8bcd92
2 changed files with 44 additions and 4 deletions

View File

@@ -63,7 +63,6 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX<BusinessAssa
.eqIfPresent(BusinessAssayProjectDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.betweenIfPresent(BusinessAssayProjectDataDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(BusinessAssayProjectDataDO::getRemark, reqVO.getRemark())
.distinct()
.orderByAsc(ConfigAssayMethodProjectDO::getSortNo));
}

View File

@@ -172,7 +172,9 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) {
Map<Long, List<BusinessAssayProjectAndParameterRespVO>> projectAndParameterMap = projectAndParameterList.stream().collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId));
for (Map.Entry<Long, List<BusinessAssayProjectAndParameterRespVO>> entry : projectAndParameterMap.entrySet()) {
BusinessAssayProjectAndParameterRespVO ep = entry.getValue().get(0);
String fieldIndex = "e" + ep.getDicId();
String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")");
boolean isEdit = StringUtils.isBlank(ep.getFormula());
@@ -189,7 +191,26 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
}
}
}
// for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) {
// String fieldIndex = "e" + ep.getDicId();
// String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")");
// boolean isEdit = StringUtils.isBlank(ep.getFormula());
// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
//
// if (StringUtils.isNotEmpty(ep.getFormula())) {
// BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
// parameterDataSearch.setBusinessAssayProjectDataId(ep.getId());
// List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
// for (BusinessAssayProjectAndParameterRespVO p : plist) {
// fieldIndex = "p" + p.getDicId();
// title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")");
// isEdit = StringUtils.isBlank(p.getFormula());
// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
// }
// }
// }
businessAssayTaskAnalysisSampleProjectRespVO.setColumns(cloumns);
@@ -432,7 +453,9 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) {
Map<Long, List<BusinessAssayProjectAndParameterRespVO>> projectAndParameterMap = projectAndParameterList.stream().collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId));
for (Map.Entry<Long, List<BusinessAssayProjectAndParameterRespVO>> entry : projectAndParameterMap.entrySet()) {
BusinessAssayProjectAndParameterRespVO ep = entry.getValue().get(0);
String fieldIndex = "e" + ep.getDicId();
String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")");
boolean isEdit = StringUtils.isBlank(ep.getFormula());
@@ -450,6 +473,24 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
}
}
}
// for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) {
// String fieldIndex = "e" + ep.getDicId();
// String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")");
// boolean isEdit = StringUtils.isBlank(ep.getFormula());
// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
//
// if (StringUtils.isNotEmpty(ep.getFormula())) {
// BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
// parameterDataSearch.setBusinessAssayProjectDataId(ep.getId());
// List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
// for (BusinessAssayProjectAndParameterRespVO p : plist) {
// fieldIndex = "p" + p.getDicId();
// title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")");
// isEdit = StringUtils.isBlank(p.getFormula());
// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
// }
// }
// }
businessAssayTaskAnalysisDataRespVO.setColumns(cloumns);