分析相关修改
This commit is contained in:
@@ -4,8 +4,14 @@ import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO;
|
||||
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO;
|
||||
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -31,4 +37,28 @@ public interface BusinessAssayTaskParameterDataMapper extends BaseMapperX<Busine
|
||||
.orderByDesc(BusinessAssayTaskParameterDataDO::getId));
|
||||
}
|
||||
|
||||
default List<BusinessAssayProjectAndParameterRespVO> selectByBusinessAssayTaskDataIds(List<Long> businessAssayTaskDataIdList) {
|
||||
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessAssayTaskParameterDataDO>()
|
||||
.leftJoin(ConfigAssayMethodParameterDO.class, ConfigAssayMethodParameterDO::getId, BusinessAssayTaskParameterDataDO::getConfigAssayMethodParameterId)
|
||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodParameterDO::getDictionaryBusinessId)
|
||||
.selectAs(BusinessAssayTaskParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||
.selectAs(BusinessAssayTaskParameterDataDO::getConfigAssayMethodParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getShortName, BusinessAssayProjectAndParameterRespVO::getShowName)
|
||||
.selectAs(BusinessAssayTaskParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType)
|
||||
.selectAs(BusinessAssayTaskParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition)
|
||||
.selectAs(BusinessAssayTaskParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue)
|
||||
//.selectAs(ConfigAssayMethodParameterDO::getDictionaryProjectUnit, BusinessAssayProjectAndParameterRespVO::getUnit)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull)
|
||||
//.selectAs(ConfigAssayMethodParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
|
||||
.selectAs("'attribute'", BusinessAssayProjectAndParameterRespVO::getType)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
|
||||
.selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName)
|
||||
.in(BusinessAssayTaskParameterDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList)
|
||||
.orderByAsc(ConfigAssayMethodParameterDO::getSortNo));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameter
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleAssayResultDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustDetailDO;
|
||||
@@ -36,6 +37,7 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterData
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskParameterDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleAssayResultMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustDetailMapper;
|
||||
@@ -54,16 +56,17 @@ import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMetho
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleFlowDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleReportDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.BaseSampleMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodParameterMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectParameterMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigBaseSampleMapper;
|
||||
@@ -141,9 +144,15 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
@Resource
|
||||
private ConfigSubSampleMethodMapper configSubSampleMethodMapper;//子样分析方法关联配置
|
||||
|
||||
@Resource
|
||||
private ConfigAssayMethodParameterMapper configAssayMethodParameterMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayTaskDataMapper businessAssayTaskDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayTaskParameterDataMapper businessAssayTaskParameterDataMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper;
|
||||
|
||||
@@ -210,6 +219,8 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
List<Long> configAssayMethodIdList = configSubSampleMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
||||
//分析方法配置
|
||||
List<ConfigAssayMethodDO> configAssayMethodList = configAssayMethodMapper.selectByIds(configAssayMethodIdList);
|
||||
//分析方法参数配置
|
||||
List<ConfigAssayMethodParameterDO> configAssayMethodParameterList = configAssayMethodParameterMapper.selectByConfigAssayMethodIds(configAssayMethodList);
|
||||
//分析方法检测项目配置
|
||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodIds(configAssayMethodIdList);
|
||||
//分析方法检测项目参数配置
|
||||
@@ -242,6 +253,8 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
List<BusinessSubSampleAssessmentDO> businessSubSampleAssessmentDOList = new ArrayList<>();
|
||||
//子样检测任务
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = new ArrayList<>();
|
||||
//子样检测任务参数
|
||||
List<BusinessAssayTaskParameterDataDO> businessAssayTaskParameterDataDOList = new ArrayList<>();
|
||||
//检测任务的分析项目
|
||||
List<BusinessAssayProjectDataDO> businessAssayProjectDataDOList = new ArrayList<>();
|
||||
//分析项目对应的分析参数
|
||||
@@ -453,7 +466,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
businessSubSampleAssessmentDOList, businessAssayTaskDataDOList,
|
||||
businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample,
|
||||
configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId,
|
||||
projectIdList);
|
||||
projectIdList, configAssayMethodParameterList, businessAssayTaskParameterDataDOList);
|
||||
} else if (QmsCommonConstant.ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList) {//如果是商检综合样,并且包含需检查的项目
|
||||
addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList,
|
||||
configAssayMethodProjectParameterList, dictionaryProjectList,
|
||||
@@ -461,7 +474,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
businessSubSampleAssessmentDOList, businessAssayTaskDataDOList,
|
||||
businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample,
|
||||
configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId,
|
||||
projectIdList);
|
||||
projectIdList, configAssayMethodParameterList, businessAssayTaskParameterDataDOList);
|
||||
|
||||
} else if (QmsCommonConstant.ENTRUST_COMMISSION_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList && !isForecastS ) {//如果是委检样,包含检测项目,未预报S值
|
||||
addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList,
|
||||
@@ -470,7 +483,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
businessSubSampleAssessmentDOList, businessAssayTaskDataDOList,
|
||||
businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample,
|
||||
configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId,
|
||||
projectIdList);
|
||||
projectIdList, configAssayMethodParameterList, businessAssayTaskParameterDataDOList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -536,7 +549,21 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId());
|
||||
businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName());
|
||||
|
||||
//子样检测任务参数
|
||||
List<ConfigAssayMethodParameterDO> configAssayMethodParameterDOList = configAssayMethodParameterList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).collect(Collectors.toList());
|
||||
BusinessAssayTaskParameterDataDO businessAssayTaskParameterDataDO = null;
|
||||
for (ConfigAssayMethodParameterDO configAssayMethodParameterDO : configAssayMethodParameterDOList) {
|
||||
businessAssayTaskParameterDataDO = new BusinessAssayTaskParameterDataDO();
|
||||
businessAssayTaskParameterDataDO.setId(IdWorker.getId());
|
||||
businessAssayTaskParameterDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
||||
businessAssayTaskParameterDataDO.setConfigAssayMethodParameterId(configAssayMethodParameterDO.getId());
|
||||
businessAssayTaskParameterDataDO.setDataType(configAssayMethodParameterDO.getDataType());
|
||||
businessAssayTaskParameterDataDO.setDecimalPosition(configAssayMethodParameterDO.getDecimalPosition());
|
||||
|
||||
businessAssayTaskParameterDataDOList.add(businessAssayTaskParameterDataDO);
|
||||
}
|
||||
|
||||
//子样检测任务检测项目
|
||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).collect(Collectors.toList());
|
||||
|
||||
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||
@@ -630,7 +657,10 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
}
|
||||
if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) {
|
||||
businessAssayTaskDataMapper.insertBatch(businessAssayTaskDataDOList);
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(businessAssayTaskParameterDataDOList)) {
|
||||
businessAssayTaskParameterDataMapper.insertBatch(businessAssayTaskParameterDataDOList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(businessAssayProjectDataDOList)) {
|
||||
businessAssayProjectDataMapper.insertBatch(businessAssayProjectDataDOList);
|
||||
}
|
||||
@@ -653,7 +683,9 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
List<BusinessAssayProjectDataDO> businessAssayProjectDataDOList,
|
||||
List<BusinessAssayParameterDataDO> businessAssayParameterDataDOList, ConfigSubSampleDO configSubSample,
|
||||
ConfigSampleFlowDO configSampleFlowSub, SampleFlowNode sampleFlowNodeSub,
|
||||
BusinessSubSampleDO businessSubSampleDO, Long methodId, List<Long> projectIdList) {
|
||||
BusinessSubSampleDO businessSubSampleDO, Long methodId, List<Long> projectIdList,
|
||||
List<ConfigAssayMethodParameterDO> configAssayMethodParameterList,
|
||||
List<BusinessAssayTaskParameterDataDO> businessAssayTaskParameterDataDOList) {
|
||||
BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO;
|
||||
ConfigAssayMethodDO addAssayTaskConfigAssayMethod = configAssayMethodMapper.selectById(methodId);
|
||||
Long addAssayTaskAssayDepartmentId = addAssayTaskConfigAssayMethod.getAssayDepartmentId();
|
||||
@@ -720,6 +752,22 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
businessAssayTaskDataDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId());
|
||||
businessAssayTaskDataDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName());
|
||||
|
||||
|
||||
//子样检测任务参数
|
||||
List<ConfigAssayMethodParameterDO> configAssayMethodParameterDOList = configAssayMethodParameterList.stream().filter(f -> f.getConfigAssayMethodId().equals(methodId)).collect(Collectors.toList());
|
||||
BusinessAssayTaskParameterDataDO businessAssayTaskParameterDataDO = null;
|
||||
for (ConfigAssayMethodParameterDO configAssayMethodParameterDO : configAssayMethodParameterDOList) {
|
||||
businessAssayTaskParameterDataDO = new BusinessAssayTaskParameterDataDO();
|
||||
businessAssayTaskParameterDataDO.setId(IdWorker.getId());
|
||||
businessAssayTaskParameterDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
||||
businessAssayTaskParameterDataDO.setConfigAssayMethodParameterId(configAssayMethodParameterDO.getId());
|
||||
businessAssayTaskParameterDataDO.setDataType(configAssayMethodParameterDO.getDataType());
|
||||
businessAssayTaskParameterDataDO.setDecimalPosition(configAssayMethodParameterDO.getDecimalPosition());
|
||||
|
||||
businessAssayTaskParameterDataDOList.add(businessAssayTaskParameterDataDO);
|
||||
}
|
||||
|
||||
//子样检测任务检测项目
|
||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(methodId)).collect(Collectors.toList());
|
||||
|
||||
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||
|
||||
@@ -43,6 +43,7 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDa
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO;
|
||||
@@ -56,6 +57,7 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMa
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskParameterDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper;
|
||||
@@ -119,6 +121,9 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
@Resource
|
||||
private BusinessAssayTaskDataMapper businessAssayTaskDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayTaskParameterDataMapper businessAssayTaskParameterDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayProjectDataMapper businessAssayProjectDataMapper;
|
||||
|
||||
@@ -564,6 +569,15 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
|
||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
|
||||
//任务参数查询
|
||||
List<BusinessAssayProjectAndParameterRespVO> taskParameterList = businessAssayTaskParameterDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList);
|
||||
for (BusinessAssayProjectAndParameterRespVO taskParameter : taskParameterList) {
|
||||
String fieldIndex = "a" + taskParameter.getDicId();
|
||||
String title = taskParameter.getShowName() + (StringUtils.isBlank(taskParameter.getUnit()) ? "" : "(" + taskParameter.getUnit() + ")");
|
||||
boolean isEdit = StringUtils.isBlank(taskParameter.getFormula());
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", taskParameter.getDataType(), taskParameter.getDecimalPosition(), null, taskParameter.getFormula(), taskParameter.getParamNo(), isEdit, taskParameter.getUnit(), "project", taskParameter.getFillingWay(), taskParameter.getGroupDictionaryBusinessId(), taskParameter.getGroupDictionaryBusinessKey(), taskParameter.getGroupDictionaryBusinessName()));
|
||||
}
|
||||
|
||||
BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO();
|
||||
projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
|
||||
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
|
||||
@@ -738,7 +752,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
|
||||
//处理数据
|
||||
List<Map<String, Object>> datas = new ArrayList<>();
|
||||
if ("kby".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()) || "by".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey())) {
|
||||
if ("withoutProject".equals(configQCSampleMethodExtendRespVO.getParentDictionaryBusinesskey())) {//不带检测项目
|
||||
List<BusinessQCCoefficientDataDO> businessQCCoefficientDataDOList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskIdAndDictionaryBusinessKey(businessAssayTaskDO.getId(), configQCSampleMethodExtendRespVO.getDictionaryBusinessKey());
|
||||
if (CollUtil.isEmpty(businessQCCoefficientDataDOList)) {
|
||||
break;
|
||||
@@ -777,7 +791,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
} else {//带检测项目
|
||||
List<BusinessQCManagementDataDO> businessQCManagementDataDOList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
|
||||
|
||||
if (CollUtil.isEmpty(businessQCManagementDataDOList)) {
|
||||
@@ -868,11 +882,14 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
|
||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
|
||||
List<BusinessAssayTaskParameterDataDO> businessAssayTaskParameterDataList = businessAssayTaskParameterDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskParameterDataDO>().in(BusinessAssayTaskParameterDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList));
|
||||
|
||||
List<BusinessAssayProjectDataDO> businessAssayProjectDataList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayProjectDataDO>().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList));
|
||||
List<Long> businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
|
||||
List<BusinessAssayParameterDataDO> businessAssayParameterDataList = businessAssayParameterDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayParameterDataDO>().in(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataIdList));
|
||||
|
||||
|
||||
List<Map<String,Object>> datas = businessAssayTaskAnalysisDataRespVO.getDatas();
|
||||
for (Map<String, Object> map : datas) {
|
||||
|
||||
@@ -935,11 +952,39 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
} else {
|
||||
businessAssayParameterDataDO.setValue(null);
|
||||
}
|
||||
} else if ("attribute".equals(pap.getType())) {
|
||||
BusinessAssayTaskParameterDataDO businessAssayTaskParameterDataDO = businessAssayTaskParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
|
||||
if (StringUtils.isNotBlank(pap.getValue())) {
|
||||
String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间
|
||||
switch (dataType) {
|
||||
case "int":
|
||||
case "date":
|
||||
case "datetime":
|
||||
case "string":
|
||||
businessAssayTaskParameterDataDO.setValue(pap.getValue());
|
||||
businessAssayTaskParameterDataDO.setRemark(pap.getShowName() + ": " + pap.getValue());
|
||||
break;
|
||||
case "decimal":
|
||||
BigDecimal value = new BigDecimal(pap.getValue());
|
||||
value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN);
|
||||
businessAssayTaskParameterDataDO.setValue(value.toPlainString());
|
||||
businessAssayTaskParameterDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString());
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unexpected value: " + dataType);
|
||||
}
|
||||
} else {
|
||||
businessAssayTaskParameterDataDO.setValue(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(businessAssayTaskParameterDataList)) {
|
||||
businessAssayTaskParameterDataMapper.updateBatch(businessAssayTaskParameterDataList);
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(businessAssayProjectDataList)) {
|
||||
businessAssayProjectDataMapper.updateBatch(businessAssayProjectDataList);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO;
|
||||
@@ -48,10 +49,10 @@ public interface BaseSampleMapper extends BaseMapperX<BaseSampleDO> {
|
||||
.betweenIfPresent(BaseSampleDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(BaseSampleDO::getRemark, reqVO.getRemark());
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getConfigEntrustSourceId())) {
|
||||
queryWrapperX.inSql(BaseSampleDO::getDictionaryBusinessId, "SELECT tcesst.DIC_BSN_ID FROM T_CFG_ENTT_SRC_SMP_TP tcesst WHERE tcesst.CFG_ENTT_SRC_ID = " + reqVO.getConfigEntrustSourceId());
|
||||
queryWrapperX.inSql(BaseSampleDO::getDictionaryBusinessId, "SELECT tcesst.DIC_BSN_ID FROM T_CFG_ENTT_SRC_SMP_TP tcesst WHERE tcesst.DELETED = 0 AND tcesst.TENANT_ID = " + TenantContextHolder.getRequiredTenantId() + " AND tcesst.CFG_ENTT_SRC_ID = " + reqVO.getConfigEntrustSourceId());
|
||||
}
|
||||
if (QmsCommonConstant.ENTRUST_INSPECTION.equals(reqVO.getEntrustType())) {
|
||||
queryWrapperX.inSql(BaseSampleDO::getDictionaryBusinessId, "SELECT tcesst.DIC_BSN_ID FROM T_CFG_ENTT_SRC_SMP_TP tcesst LEFT JOIN T_CFG_ENTT_SRC tces ON tcesst.CFG_ENTT_SRC_ID = tces.ID WHERE tces.ENTT_TP = '" + reqVO.getEntrustType() + "'");
|
||||
queryWrapperX.inSql(BaseSampleDO::getDictionaryBusinessId, "SELECT tcesst.DIC_BSN_ID FROM T_CFG_ENTT_SRC_SMP_TP tcesst LEFT JOIN T_CFG_ENTT_SRC tces ON tcesst.CFG_ENTT_SRC_ID = tces.ID WHERE tcesst.DELETED = 0 AND tcesst.TENANT_ID = " + TenantContextHolder.getRequiredTenantId() + " AND tces.DELETED = 0 AND tces.TENANT_ID = " + TenantContextHolder.getRequiredTenantId() + " AND tces.ENTT_TP = '" + reqVO.getEntrustType() + "'");
|
||||
}
|
||||
|
||||
queryWrapperX.orderByDesc(BaseSampleDO::getId);
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.*;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -40,4 +41,9 @@ public interface ConfigAssayMethodParameterMapper extends BaseMapperX<ConfigAssa
|
||||
.orderByDesc(ConfigAssayMethodParameterDO::getId));
|
||||
}
|
||||
|
||||
default List<ConfigAssayMethodParameterDO> selectByConfigAssayMethodIds(List<ConfigAssayMethodDO> configAssayMethodList) {
|
||||
return selectList(new LambdaQueryWrapperX<ConfigAssayMethodParameterDO>()
|
||||
.in(ConfigAssayMethodParameterDO::getConfigAssayMethodId, configAssayMethodList));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectPageReqVO;
|
||||
@@ -72,7 +73,9 @@ public interface ConfigAssayMethodProjectMapper extends BaseMapperX<ConfigAssayM
|
||||
* @return
|
||||
*/
|
||||
default List<ConfigAssayMethodProjectExtendRespVO> selectByConfigSubSampleIdsAndAssayDepartmentId(List<Long> configSubSampleIds, Long assayDepartmentId) {
|
||||
StringBuilder inSql = new StringBuilder("SELECT tcssm.CFG_ASY_MTHD_ID FROM T_CFG_SB_SMP_MTHD tcssm WHERE tcssm.DELETED = 0 AND tcssm.CFG_SB_SMP_ID IN (");
|
||||
StringBuilder inSql = new StringBuilder("SELECT tcssm.CFG_ASY_MTHD_ID FROM T_CFG_SB_SMP_MTHD tcssm WHERE tcssm.DELETED = 0 AND tcesst.TENANT_ID = ");
|
||||
inSql.append(TenantContextHolder.getRequiredTenantId());
|
||||
inSql.append(" AND tcssm.CFG_SB_SMP_ID IN (");
|
||||
for (Long configSubSampleId : configSubSampleIds) {
|
||||
inSql.append(configSubSampleId).append(",");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user