From 9b99e41676b4428470c11413a7bf818a65f9c7a9 Mon Sep 17 00:00:00 2001
From: wxr
Date: Thu, 27 Nov 2025 14:16:44 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E4=B8=8B=E5=8F=91=E9=85=8D=E6=96=99?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A3=80=E6=9F=A5=E6=98=AF=E5=90=A6=E9=83=BD?=
=?UTF-8?q?=E5=AD=98=E5=9C=A8=E9=85=8D=E6=96=99=E5=BF=85=E5=A1=AB=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../service/SampleAnalysisServiceImpl.java | 72 +++++++++++++++----
1 file changed, 59 insertions(+), 13 deletions(-)
diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java
index 1a12032..986b70f 100644
--- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java
+++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java
@@ -21,8 +21,10 @@ import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
import com.zt.plat.module.qms.business.bus.controller.vo.BatchSampleAnalysisColumnRespVO;
+import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataExtendRespVO;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataReqVO;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO;
+import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataExtendRespVO;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataReqVO;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskAnalysisSampleAndQcProjectRespVO;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskAnalysisSampleProjectRespVO;
@@ -41,6 +43,7 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientP
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO;
+import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper;
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper;
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper;
@@ -51,36 +54,31 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParam
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper;
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper;
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper;
+import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
import com.zt.plat.module.qms.business.config.controller.vo.BusinessAssayTaskAnalysisDataRespVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectCoefficientRespVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangeRespVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO;
+import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfInfo;
+import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfItem;
+import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfPoint;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectCoefficientDO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectRangeDO;
+import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO;
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper;
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectCoefficientMapper;
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectRangeMapper;
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodMapper;
+import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper;
import com.zt.plat.module.qms.common.data.dal.dataobject.DataCollectionDO;
import com.zt.plat.module.qms.common.data.service.DataCollectionService;
import com.zt.plat.module.qms.enums.QmsCommonConstant;
+import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import jakarta.annotation.Resource;
-/**
- * SampleAnalysisServiceImpl
- *
- * 更新历史:
- *
版本 更新时间 更新者 更新内容
- * V1.0 2025年9月22日 wxr Add
- * Copyright (C) 云南志者竟成科技有限公司
- *
- * @author 王兴荣
- * @version V1.0
- * @since 2025年9月22日
- */
@Service
public class SampleAnalysisServiceImpl implements SampleAnalysisService {
@@ -93,6 +91,12 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
@Resource
private ConfigAssayMethodProjectCoefficientMapper configAssayMethodProjectCoefficientMapper;
+ @Resource
+ private ConfigSubSampleMethodMapper configSubSampleMethodMapper;
+
+ @Resource
+ private BusinessSubSampleMapper businessSubSampleMapper;
+
@Resource
private BusinessAssayTaskMapper businessAssayTaskMapper;
@@ -931,7 +935,49 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
@Transactional(rollbackFor = Exception.class)
public void issuedIngredients(Long businessAssayTaskId) {
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
- businessAssayTaskDO.setIngredientsStatus("in_progress");
+ List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessAssayTaskId(businessAssayTaskId);
+ List businessAssayTaskDataIdList = businessAssayTaskDataDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
+ //获取子样id列表
+ List businessSubSampleIdList = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
+ //获取子样
+ List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList);
+ //子样配置id列表
+ List configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
+ //子样配置方法
+ List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId());
+
+ List businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList);
+ List businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
+ //查询检测项目参数
+ List businessAssayParameterDataList = businessAssayParameterDataMapper.selectExtendByBusinessAssayProjectDataIds(businessAssayProjectDataIdList);
+
+ for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) {
+ //获取子样
+ BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null);
+
+ //子样配置信息
+ ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null);
+ String configInfomation = configSubSampleMethodDO.getConfigInfomation();
+ if (StringUtils.isNotBlank(configInfomation)) {
+ ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
+ //获取下发配置
+ List downIngredients = configSubSampleMethodConfInfo.getDownIngredients();
+ for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem : downIngredients) {
+ if (configSubSampleMethodConfItem.getRequired()) {
+ ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource();
+ String project = source.getProject();
+ String parameter = source.getParameter();
+ BusinessAssayProjectDataExtendRespVO currentBusinessAssayProjectData = businessAssayProjectDataList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId()) && f.getSimpleName().equals(project)).findFirst().orElse(null);
+ BusinessAssayParameterDataExtendRespVO currentBusinessAssayParameterData = businessAssayParameterDataList.stream().filter(f -> f.getBusinessAssayProjectDataId().equals(currentBusinessAssayProjectData.getId()) && f.getParameterKey().equals(parameter)).findFirst().orElse(null);
+ if (StringUtils.isBlank(currentBusinessAssayParameterData.getValue())) {
+ throw new ServiceException(1_032_050_000, "当前分析任务,存在下发配料必填为空情况。请检查后再下发!");
+ }
+ }
+ }
+
+ }
+ }
+ businessAssayTaskDO.setIngredientsStatus(QmsCommonConstant.IN_PROGRESS);
businessAssayTaskMapper.updateById(businessAssayTaskDO);
}
From ab505189f344234bca876e4085572ea695c92c18 Mon Sep 17 00:00:00 2001
From: wxr
Date: Thu, 27 Nov 2025 15:45:45 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E5=95=86=E6=A3=80=E6=A0=B7S=E5=80=BC?=
=?UTF-8?q?=E5=88=86=E6=A0=B7=E5=88=A4=E5=AE=9Abug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../sample/entrust/SampleEntrustGenSampleDataCmp.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java
index 792a155..904998f 100644
--- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java
+++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java
@@ -580,7 +580,17 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
//根据任务数判断是平行还是
String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
+
+ //分样判定数据
+ BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO();
+ businessSubParentSampleAssessmentDO.setId(IdWorker.getId());
+ businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
+ businessSubParentSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodZhy.getId());
+ businessSubParentSampleAssessmentDO.setAssayType(assayType);
+ businessSubParentSampleAssessmentDO.setTaskType("常规");
+ businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO);
+ //子样判定数据
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO();
businessSubSampleAssessmentDO.setId(IdWorker.getId());
businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
From 353a6dcb3e7dc29b0bc624ff43bff8d9c5ab91fc Mon Sep 17 00:00:00 2001
From: wxr
Date: Thu, 27 Nov 2025 16:27:09 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E6=A0=B7=E5=93=81=E5=88=86=E6=9E=90?=
=?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/vo/BusinessAssayProjectDataReqVO.java | 4 ++++
.../dal/mapper/BusinessAssayProjectDataMapper.java | 2 ++
.../bus/service/SampleAnalysisServiceImpl.java | 12 ++++++++----
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java
index a052df1..462fcc0 100644
--- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java
+++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java
@@ -65,4 +65,8 @@ public class BusinessAssayProjectDataReqVO {
@Schema(description = "备注")
private String remark;
+ //========================扩展字段==================================
+
+ @Schema(description = "检测任务ID列表", example = "16505")
+ private List businessAssayTaskDataIdList;
}
\ No newline at end of file
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 ce6ef99..d82da9e 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
@@ -49,6 +49,7 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskId));
List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
- BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0);
+ List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
+ //BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0);
BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO();
- projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
+// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
+ projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
List projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) {
String fieldIndex = "e" + ep.getDicId();
@@ -423,10 +425,12 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()));
List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
- BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0);
+ List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
+ // BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0);
BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO();
- projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
+// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
+ projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
List projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) {
String fieldIndex = "e" + ep.getDicId();
From 600e8bcd92e7bb7608755ac77427e50337088049 Mon Sep 17 00:00:00 2001
From: wxr
Date: Thu, 27 Nov 2025 17:30:18 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E5=88=86=E6=9E=90=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=AD=97=E5=85=B8id=E8=BF=87=E6=BB=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../BusinessAssayProjectDataMapper.java | 1 -
.../service/SampleAnalysisServiceImpl.java | 47 +++++++++++++++++--
2 files changed, 44 insertions(+), 4 deletions(-)
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);