diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java index d82da9e..f1407d5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java @@ -63,7 +63,6 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch); - for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) { + Map> projectAndParameterMap = projectAndParameterList.stream().collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId)); + for (Map.Entry> 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 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 projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch); - for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) { + Map> projectAndParameterMap = projectAndParameterList.stream().collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId)); + for (Map.Entry> 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()); @@ -449,7 +472,25 @@ 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 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);