Compare commits
5 Commits
a96fa0ed9b
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d8a5c1e88 | |||
|
|
9014e8bcc8 | ||
|
|
fa43a6579a | ||
| 33b5ec7be5 | |||
| 5a82d9abd8 |
@@ -71,6 +71,7 @@ public class SampleAnalysisController implements BusinessControllerMarker {
|
||||
return success("成功");
|
||||
}
|
||||
|
||||
//提交分析
|
||||
@PostMapping("/submitSampleAnalysisByTaskId")
|
||||
public CommonResult<?> submitSampleAnalysisByTaskId(Long businessAssayTaskId) {
|
||||
sampleAnalysisService.submitSampleAnalysisByTaskId(businessAssayTaskId);
|
||||
|
||||
@@ -44,4 +44,7 @@ public class BusinessAssayTaskDataExtendRespVO extends BusinessAssayTaskDataResp
|
||||
private Integer asmtIsRecheck;
|
||||
|
||||
private String asmtReportedStatus;
|
||||
|
||||
@Schema(description = "配料信息")
|
||||
private String ingredientInfo;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BusinessAssayTaskParameterDataExtendRespVO extends BusinessAssayTaskParameterDataRespVO {
|
||||
|
||||
@Schema(description = "检测方法ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29823")
|
||||
@ExcelProperty("检测方法ID")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@Schema(description = "参数名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("参数名称")
|
||||
private String parameterName;
|
||||
|
||||
@Schema(description = "参数简称", example = "张三")
|
||||
@ExcelProperty("参数简称")
|
||||
private String shortName;
|
||||
|
||||
@Schema(description = "参数序号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("参数序号")
|
||||
private Integer no;
|
||||
|
||||
@Schema(description = "键值")
|
||||
@ExcelProperty("键值")
|
||||
private String key;
|
||||
}
|
||||
@@ -32,6 +32,14 @@ public class BusinessXRFDataPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] sampleTime;
|
||||
|
||||
@Schema(description = "样品开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] sampleStartTime;
|
||||
|
||||
@Schema(description = "样品结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] sampleEndTime;
|
||||
|
||||
@Schema(description = "分析人")
|
||||
private String assayOperator;
|
||||
|
||||
|
||||
@@ -35,6 +35,14 @@ public class BusinessXRFDataReqVO {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] sampleTime;
|
||||
|
||||
@Schema(description = "样品开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] sampleStartTime;
|
||||
|
||||
@Schema(description = "样品结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] sampleEndTime;
|
||||
|
||||
@Schema(description = "分析人")
|
||||
private String assayOperator;
|
||||
|
||||
|
||||
@@ -40,6 +40,14 @@ public class BusinessXRFDataRespVO {
|
||||
@ExcelProperty("样品时间")
|
||||
private LocalDateTime sampleTime;
|
||||
|
||||
@Schema(description = "样品开始时间")
|
||||
@ExcelProperty("样品开始时间")
|
||||
private LocalDateTime sampleStartTime;
|
||||
|
||||
@Schema(description = "样品结束时间")
|
||||
@ExcelProperty("样品结束时间")
|
||||
private LocalDateTime sampleEndTime;
|
||||
|
||||
@Schema(description = "分析人")
|
||||
@ExcelProperty("分析人")
|
||||
private String assayOperator;
|
||||
|
||||
@@ -34,6 +34,12 @@ public class BusinessXRFDataSaveReqVO {
|
||||
@Schema(description = "样品时间")
|
||||
private LocalDateTime sampleTime;
|
||||
|
||||
@Schema(description = "样品开始时间")
|
||||
private LocalDateTime sampleStartTime;
|
||||
|
||||
@Schema(description = "样品结束时间")
|
||||
private LocalDateTime sampleEndTime;
|
||||
|
||||
@Schema(description = "分析人")
|
||||
private String assayOperator;
|
||||
|
||||
|
||||
@@ -2,10 +2,7 @@ package com.zt.plat.module.qms.business.bus.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
@@ -64,6 +61,16 @@ public class BusinessXRFDataDO extends BusinessBaseDO {
|
||||
@TableField("SMP_TM")
|
||||
private LocalDateTime sampleTime;
|
||||
/**
|
||||
* 样品开始时间
|
||||
*/
|
||||
@TableField("SMP_STRT_TM")
|
||||
private LocalDateTime sampleStartTime;
|
||||
/**
|
||||
* 样品结束时间
|
||||
*/
|
||||
@TableField("SMP_END_TM")
|
||||
private LocalDateTime sampleEndTime;
|
||||
/**
|
||||
* 分析人
|
||||
*/
|
||||
@TableField("ASY_OPTR")
|
||||
|
||||
@@ -290,6 +290,7 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
||||
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
||||
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
||||
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
||||
.selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId)
|
||||
.in(BusinessSubSampleDO::getSampleAssayCode, sampleAssayCodes)
|
||||
.eq(ConfigAssayMethodDO::getDictionaryBusinessKey, configAssayMethodDictionaryBusinessKey)
|
||||
.eq(BusinessAssayTaskDataDO::getIsReported, QmsCommonConstant.NO));
|
||||
@@ -374,9 +375,11 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
||||
*/
|
||||
default List<BusinessAssayTaskDataExtendRespVO> selectExtendByBusinessAssayTaskId(Long businessAssayTaskId) {
|
||||
return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayTaskDataDO>()
|
||||
.leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||
.leftJoin(BusinessBaseSampleDO.class, BusinessBaseSampleDO::getId, BusinessAssayTaskDataDO::getBusinessBaseSampleId)
|
||||
.selectAll(BusinessAssayTaskDataDO.class)
|
||||
.selectAs(BusinessBaseSampleDO::getConfigBaseSampleId, BusinessAssayTaskDataExtendRespVO::getConfigBaseSampleId)
|
||||
.selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId)
|
||||
.eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId));
|
||||
}
|
||||
|
||||
@@ -390,6 +393,18 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
||||
.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据子样及分析方法Key查询分析任务
|
||||
* @param businessSubSampleId 子样id
|
||||
* @param methodKey 分析方法key
|
||||
* @return
|
||||
*/
|
||||
default List<BusinessAssayTaskDataDO> selectByBusinessSubSampleIdAndMethodKey(Long businessSubSampleId, String methodKey) {
|
||||
String inSql = "SELECT tcam.ID FROM T_CFG_ASY_MTHD tcam WHERE tcam.DELETED = 0 AND tcam.DIC_BSN_KY = '" + methodKey + "'";
|
||||
return selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>()
|
||||
.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId)
|
||||
.inSql(BusinessAssayTaskDataDO::getConfigAssayMethodId, inSql));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据子样及分析部门查询分析任务
|
||||
|
||||
@@ -61,4 +61,18 @@ public interface BusinessAssayTaskParameterDataMapper extends BaseMapperX<Busine
|
||||
.orderByAsc(ConfigAssayMethodParameterDO::getSortNo));
|
||||
}
|
||||
|
||||
default List<BusinessAssayTaskParameterDataExtendRespVO> selectExtendByBusinessAssayTaskDataIds(List<Long> businessAssayTaskDataIdList) {
|
||||
return selectJoinList(BusinessAssayTaskParameterDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayTaskParameterDataDO>()
|
||||
.leftJoin(ConfigAssayMethodParameterDO.class, ConfigAssayMethodParameterDO::getId, BusinessAssayTaskParameterDataDO::getConfigAssayMethodParameterId)
|
||||
.selectAll(BusinessAssayTaskParameterDataDO.class)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getConfigAssayMethodId, BusinessAssayTaskParameterDataExtendRespVO::getConfigAssayMethodId)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getParameterName, BusinessAssayTaskParameterDataExtendRespVO::getParameterName)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getShortName, BusinessAssayTaskParameterDataExtendRespVO::getShortName)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getKey, BusinessAssayTaskParameterDataExtendRespVO::getKey)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getNo, BusinessAssayTaskParameterDataExtendRespVO::getNo)
|
||||
.in(BusinessAssayTaskParameterDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,17 +1,30 @@
|
||||
package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
||||
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;
|
||||
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.controller.vo.ConfigSubSampleMethodExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.security.core.LoginUser;
|
||||
@@ -34,6 +47,15 @@ public class BusinessAssayTaskDataServiceImpl implements BusinessAssayTaskDataSe
|
||||
|
||||
@Resource
|
||||
private BusinessAssayTaskDataMapper businessAssayTaskDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayProjectDataMapper businessAssayProjectDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayParameterDataMapper businessAssayParameterDataMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigSubSampleMethodMapper configSubSampleMethodMapper;
|
||||
|
||||
@Override
|
||||
public BusinessAssayTaskDataRespVO createBusinessAssayTaskData(BusinessAssayTaskDataSaveReqVO createReqVO) {
|
||||
@@ -100,12 +122,86 @@ public class BusinessAssayTaskDataServiceImpl implements BusinessAssayTaskDataSe
|
||||
|
||||
@Override
|
||||
public List<BusinessAssayTaskDataExtendRespVO> getBusinessAssayTaskDataList(BusinessAssayTaskDataReqVO reqVO) {
|
||||
return businessAssayTaskDataMapper.selectList(reqVO);
|
||||
List<BusinessAssayTaskDataExtendRespVO> list = businessAssayTaskDataMapper.selectList(reqVO);
|
||||
List<Long> configSubSampleIdList = list.stream().map(m -> m.getConfigSubSampleId()).collect(Collectors.toList());
|
||||
List<ConfigSubSampleMethodExtendRespVO> configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, reqVO.getConfigAssayMethodId());
|
||||
List<Long> businessAssayTaskDataIdList = list.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
//查询检测项目
|
||||
List<BusinessAssayProjectDataExtendRespVO> businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList);
|
||||
List<Long> businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
//查询检测项目参数
|
||||
List<BusinessAssayParameterDataExtendRespVO> businessAssayParameterDataList = businessAssayParameterDataMapper.selectExtendByBusinessAssayProjectDataIds(businessAssayProjectDataIdList);
|
||||
|
||||
for (BusinessAssayTaskDataExtendRespVO businessAssayTaskData : list) {
|
||||
ConfigSubSampleMethodExtendRespVO configSubSampleMethod = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(businessAssayTaskData.getConfigSubSampleId()) && f.getConfigAssayMethodId().equals(businessAssayTaskData.getConfigAssayMethodId())).findFirst().orElse(null);
|
||||
String configInfomation = configSubSampleMethod.getConfigInfomation();
|
||||
if (StringUtils.isNotBlank(configInfomation)) {
|
||||
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
||||
List<ConfigSubSampleMethodConfItem> getParamList = configSubSampleMethodConfInfo.getGetParam();
|
||||
StringBuilder ingredientInfoBuilder = new StringBuilder();
|
||||
for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem : getParamList) {
|
||||
ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();
|
||||
List<String> projectList = Arrays.asList(target.getProject().split(","));//来源可以有多个
|
||||
for (String project : projectList) {
|
||||
String parameter = target.getParameter();
|
||||
BusinessAssayProjectDataExtendRespVO currentBusinessAssayProjectData = businessAssayProjectDataList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskData.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 (currentBusinessAssayParameterData != null && StringUtils.isNotBlank(currentBusinessAssayParameterData.getValue())) {
|
||||
ingredientInfoBuilder.append(currentBusinessAssayParameterData.getParameterName()).append(":").append(currentBusinessAssayParameterData.getValue()).append("、");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ingredientInfoBuilder.length() > 0) {
|
||||
ingredientInfoBuilder.delete(ingredientInfoBuilder.length() - 1, ingredientInfoBuilder.length());
|
||||
}
|
||||
businessAssayTaskData.setIngredientInfo(ingredientInfoBuilder.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BusinessAssayTaskDataExtendRespVO> getBusinessAssayTaskDataPage(BusinessAssayTaskDataPageReqVO pageReqVO) {
|
||||
return businessAssayTaskDataMapper.selectPage(pageReqVO);
|
||||
PageResult<BusinessAssayTaskDataExtendRespVO> page = businessAssayTaskDataMapper.selectPage(pageReqVO);
|
||||
List<BusinessAssayTaskDataExtendRespVO> list = page.getList();
|
||||
List<Long> configSubSampleIdList = list.stream().map(m -> m.getConfigSubSampleId()).collect(Collectors.toList());
|
||||
List<ConfigSubSampleMethodExtendRespVO> configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, pageReqVO.getConfigAssayMethodId());
|
||||
List<Long> businessAssayTaskDataIdList = list.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
//查询检测项目
|
||||
List<BusinessAssayProjectDataExtendRespVO> businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList);
|
||||
List<Long> businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
//查询检测项目参数
|
||||
List<BusinessAssayParameterDataExtendRespVO> businessAssayParameterDataList = businessAssayParameterDataMapper.selectExtendByBusinessAssayProjectDataIds(businessAssayProjectDataIdList);
|
||||
|
||||
for (BusinessAssayTaskDataExtendRespVO businessAssayTaskData : list) {
|
||||
ConfigSubSampleMethodExtendRespVO configSubSampleMethod = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(businessAssayTaskData.getConfigSubSampleId()) && f.getConfigAssayMethodId().equals(businessAssayTaskData.getConfigAssayMethodId())).findFirst().orElse(null);
|
||||
String configInfomation = configSubSampleMethod.getConfigInfomation();
|
||||
if (StringUtils.isNotBlank(configInfomation)) {
|
||||
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
||||
List<ConfigSubSampleMethodConfItem> getParamList = configSubSampleMethodConfInfo.getGetParam();
|
||||
StringBuilder ingredientInfoBuilder = new StringBuilder();
|
||||
for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem : getParamList) {
|
||||
ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();
|
||||
List<String> projectList = Arrays.asList(target.getProject().split(","));//来源可以有多个
|
||||
for (String project : projectList) {
|
||||
String parameter = target.getParameter();
|
||||
BusinessAssayProjectDataExtendRespVO currentBusinessAssayProjectData = businessAssayProjectDataList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskData.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 (currentBusinessAssayParameterData != null && StringUtils.isNotBlank(currentBusinessAssayParameterData.getValue())) {
|
||||
ingredientInfoBuilder.append(currentBusinessAssayParameterData.getParameterName()).append(":").append(currentBusinessAssayParameterData.getValue()).append("、");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ingredientInfoBuilder.length() > 0) {
|
||||
ingredientInfoBuilder.delete(ingredientInfoBuilder.length() - 1, ingredientInfoBuilder.length());
|
||||
}
|
||||
businessAssayTaskData.setIngredientInfo(ingredientInfoBuilder.toString());
|
||||
}
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,7 +21,6 @@ import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.zt.plat.framework.common.exception.ServiceException;
|
||||
import com.zt.plat.framework.common.util.date.DateUtils;
|
||||
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.LoginUser;
|
||||
@@ -85,7 +84,6 @@ 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.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.BaseSampleMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectCoefficientMapper;
|
||||
@@ -98,9 +96,7 @@ import com.zt.plat.module.qms.common.dic.controller.vo.DictionaryBusinessExtendR
|
||||
import com.zt.plat.module.qms.common.dic.dal.mapper.DictionaryBusinessMapper;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
@@ -662,85 +658,87 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
Long configMethodId = source.getMethodId();
|
||||
String sourceProject = source.getProject();
|
||||
//String sourceParameter = source.getParameter();
|
||||
|
||||
|
||||
|
||||
ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();//目标
|
||||
String targetProject = target.getProject();
|
||||
String targetParameter = target.getParameter();
|
||||
|
||||
BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataMapper.selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(businessAssayTaskDataDO.getId(), targetProject, targetParameter);
|
||||
if (businessAssayParameterDataDO == null) {
|
||||
throw new ServiceException(1_032_100_000, "子样检测方法映射配置错误");
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(businessAssayParameterDataDO.getValue())) {
|
||||
//1 查询委托明细
|
||||
BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectByBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId());
|
||||
//2 查询样品大类
|
||||
BaseSampleDO baseSampleDO = baseSampleMapper.selectById(businessSampleEntrustDetailDO.getBaseSampleId());
|
||||
//3 判断样品大类类型
|
||||
if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检分析样
|
||||
//查询当前批次的第一个商检分析样
|
||||
BusinessSampleEntrustDetailDO currBatchFirstBusinessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectCurrBatchFirstByBusinessBaseSampleIdAndBaseSampleDictionaryBusinessKey(businessAssayTaskDataDO.getBusinessBaseSampleId(), QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE);
|
||||
List<BusinessSubParentSampleDO> currBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleId(currBatchFirstBusinessSampleEntrustDetailDO.getBusinessBaseSampleId());
|
||||
List<Long> currBusinessSubParentSampleIdList = currBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(currBusinessSubParentSampleIdList, configMethodId);
|
||||
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
}
|
||||
} else if (QmsCommonConstant.ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检综合样
|
||||
//查询当前样品的其他分析方法的结果
|
||||
List<Long> businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId);
|
||||
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
}
|
||||
} else if (QmsCommonConstant.ENTRUST_COMMISSION_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是委检样
|
||||
//查询来样品位
|
||||
Boolean isForecastS = false;
|
||||
String forecastValue = null;
|
||||
String forecastResult = businessSampleEntrustDetailDO.getForecastResult();
|
||||
if (StringUtils.isNotBlank(forecastResult)) {
|
||||
JSONArray array = JSON.parseArray(forecastResult);
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject item = array.getJSONObject(i);
|
||||
if ("S".equals(item.getString("simpleName"))) {
|
||||
isForecastS = true;
|
||||
break;
|
||||
}
|
||||
|
||||
List<String> projectList = Arrays.asList(target.getProject().split(","));//目标可以有多个
|
||||
for (String targetProject : projectList) {
|
||||
String targetParameter = target.getParameter();
|
||||
|
||||
BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataMapper.selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(businessAssayTaskDataDO.getId(), targetProject, targetParameter);
|
||||
// if (businessAssayParameterDataDO == null) {
|
||||
// throw new ServiceException(1_032_100_000, "子样检测方法映射配置错误");
|
||||
// }
|
||||
|
||||
if (businessAssayParameterDataDO != null && StringUtils.isBlank(businessAssayParameterDataDO.getValue())) {
|
||||
//1 查询委托明细
|
||||
BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectByBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId());
|
||||
//2 查询样品大类
|
||||
BaseSampleDO baseSampleDO = baseSampleMapper.selectById(businessSampleEntrustDetailDO.getBaseSampleId());
|
||||
//3 判断样品大类类型
|
||||
if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检分析样
|
||||
//查询当前批次的第一个商检分析样
|
||||
BusinessSampleEntrustDetailDO currBatchFirstBusinessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectCurrBatchFirstByBusinessBaseSampleIdAndBaseSampleDictionaryBusinessKey(businessAssayTaskDataDO.getBusinessBaseSampleId(), QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE);
|
||||
List<BusinessSubParentSampleDO> currBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleId(currBatchFirstBusinessSampleEntrustDetailDO.getBusinessBaseSampleId());
|
||||
List<Long> currBusinessSubParentSampleIdList = currBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(currBusinessSubParentSampleIdList, configMethodId);
|
||||
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
}
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject item = array.getJSONObject(i);
|
||||
if (sourceProject.equals(item.getString("simpleName"))) {
|
||||
forecastValue = item.getString("value");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isForecastS) {//来样品位存在S值, 则取预报的值
|
||||
businessAssayParameterDataDO.setValue(forecastValue);
|
||||
} else {
|
||||
//查询当前样品的其他方法的结果
|
||||
} else if (QmsCommonConstant.ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检综合样
|
||||
//查询当前样品的其他分析方法的结果
|
||||
List<Long> businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId);
|
||||
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
}
|
||||
} else if (QmsCommonConstant.ENTRUST_COMMISSION_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是委检样
|
||||
//查询来样品位
|
||||
Boolean isForecastS = false;
|
||||
String forecastValue = null;
|
||||
String forecastResult = businessSampleEntrustDetailDO.getForecastResult();
|
||||
if (StringUtils.isNotBlank(forecastResult)) {
|
||||
JSONArray array = JSON.parseArray(forecastResult);
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject item = array.getJSONObject(i);
|
||||
if ("S".equals(item.getString("simpleName"))) {
|
||||
isForecastS = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject item = array.getJSONObject(i);
|
||||
if (sourceProject.equals(item.getString("simpleName"))) {
|
||||
forecastValue = item.getString("value");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isForecastS) {//来样品位存在S值, 则取预报的值
|
||||
businessAssayParameterDataDO.setValue(forecastValue);
|
||||
} else {
|
||||
//查询当前样品的其他方法的结果
|
||||
List<Long> businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId);
|
||||
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//处理已查询的数据
|
||||
BusinessAssayProjectAndParameterRespVO businessAssayProjectAndParameterRespVO = businessAssayParameterDataList.stream().filter(f -> f.getBizId().equals(businessAssayParameterDataDO.getBusinessAssayProjectDataId()) && f.getDicId().equals(businessAssayParameterDataDO.getConfigAssayMethodProjectParameterId()) ).findFirst().orElse(null);
|
||||
if (businessAssayProjectAndParameterRespVO != null) {
|
||||
businessAssayProjectAndParameterRespVO.setValue(businessAssayParameterDataDO.getValue());
|
||||
}
|
||||
//处理已查询的数据
|
||||
BusinessAssayProjectAndParameterRespVO businessAssayProjectAndParameterRespVO = businessAssayParameterDataList.stream().filter(f -> f.getBizId().equals(businessAssayParameterDataDO.getBusinessAssayProjectDataId()) && f.getDicId().equals(businessAssayParameterDataDO.getConfigAssayMethodProjectParameterId()) ).findFirst().orElse(null);
|
||||
if (businessAssayProjectAndParameterRespVO != null) {
|
||||
businessAssayProjectAndParameterRespVO.setValue(businessAssayParameterDataDO.getValue());
|
||||
}
|
||||
|
||||
//更新
|
||||
businessAssayParameterDataMapper.updateById(businessAssayParameterDataDO);
|
||||
//更新
|
||||
businessAssayParameterDataMapper.updateById(businessAssayParameterDataDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1275,8 +1273,59 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
businessAssayTaskDO.setFinishStatus(QmsCommonConstant.IN_PROGRESS);
|
||||
businessAssayTaskDO.setFlowStatus(QmsCommonConstant.IN_PROGRESS);
|
||||
|
||||
//设置参数值
|
||||
List<BusinessAssayParameterDataDO> updateBusinessAssayParameterDataList = new ArrayList<>();
|
||||
|
||||
List<BusinessAssayTaskDataExtendRespVO> businessAssayTaskDataExtendList = businessAssayTaskDataMapper.selectExtendByBusinessAssayTaskId(businessAssayTaskId);
|
||||
|
||||
//查询检测项目
|
||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataExtendList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
List<BusinessAssayProjectDataExtendRespVO> businessAssayProjectDataExtendList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList);
|
||||
|
||||
//子样配置id列表
|
||||
List<Long> configSubSampleIdList = businessAssayTaskDataExtendList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||
|
||||
//子样方法配置列表
|
||||
List<ConfigSubSampleMethodExtendRespVO> configSubSampleMethodDOList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId());
|
||||
|
||||
//循环任务,赋值
|
||||
for (BusinessAssayTaskDataExtendRespVO businessAssayTaskData : businessAssayTaskDataExtendList) {
|
||||
ConfigSubSampleMethodExtendRespVO configSubSampleMethod = configSubSampleMethodDOList.stream().filter(f -> f.getConfigBaseSampleId().equals(businessAssayTaskData.getConfigSubSampleId()) && f.getConfigAssayMethodId().equals(businessAssayTaskData.getConfigAssayMethodId())).findFirst().orElse(null);
|
||||
String configInfomation = configSubSampleMethod.getConfigInfomation();
|
||||
if (StringUtils.isNotBlank(configInfomation)) {
|
||||
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
||||
List<ConfigSubSampleMethodConfItem> setParamList = configSubSampleMethodConfInfo.getSetParam();
|
||||
if (CollUtil.isEmpty(setParamList)) {
|
||||
continue;//跳出循环
|
||||
}
|
||||
|
||||
String methodKey = setParamList.stream().map(m -> m.getTarget().getMethodKey()).distinct().findFirst().orElse(null);
|
||||
List<BusinessAssayTaskDataDO> targetBusinessAssayTaskDataList = businessAssayTaskDataMapper.selectByBusinessSubSampleIdAndMethodKey(businessAssayTaskData.getBusinessSubSampleId(), methodKey);
|
||||
List<Long> targetBusinessAssayTaskDataIdList = targetBusinessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
List<BusinessAssayProjectDataExtendRespVO> targetBusinessAssayProjectDataExtendList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(targetBusinessAssayTaskDataIdList);
|
||||
|
||||
for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem : setParamList) {
|
||||
ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource();
|
||||
String project = source.getProject();
|
||||
BusinessAssayProjectDataExtendRespVO currentBusinessAssayProjectData = businessAssayProjectDataExtendList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskData.getId()) && f.getSimpleName().equals(project)).findFirst().orElse(null);
|
||||
ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();
|
||||
for (BusinessAssayTaskDataDO targetBusinessAssayTaskData : targetBusinessAssayTaskDataList) {
|
||||
List<String> targetProjectList = Arrays.asList(target.getProject().split(","));
|
||||
String targetParameter = target.getParameter();
|
||||
for (String targetProject : targetProjectList) {
|
||||
BusinessAssayProjectDataExtendRespVO targetBusinessAssayProjectData = targetBusinessAssayProjectDataExtendList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(targetBusinessAssayTaskData.getId()) && f.getSimpleName().equals(targetProject)).findFirst().orElse(null);
|
||||
BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataMapper.selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(targetBusinessAssayProjectData.getId(), targetProject, targetParameter);
|
||||
if (businessAssayParameterDataDO != null) {
|
||||
businessAssayParameterDataDO.setValue(currentBusinessAssayProjectData.getValue());
|
||||
updateBusinessAssayParameterDataList.add(businessAssayParameterDataDO);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//补正系数列表
|
||||
List<ConfigAssayMethodProjectCoefficientDO> configAssayMethodProjectCoefficientList = new ArrayList<>();
|
||||
if (businessAssayTaskDO.getIsIngredients().equals(QmsCommonConstant.YES) && QmsCommonConstant.MANUAL.equals(businessAssayTaskDO.getIngredientsWay())) {//如果是需要配料,并且是人工配料的
|
||||
@@ -1284,8 +1333,6 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
configAssayMethodProjectCoefficientList = configAssayMethodProjectCoefficientMapper.selectByConfigBaseSampleIds(configBaseSampleIdList);
|
||||
}
|
||||
|
||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataExtendList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
List<BusinessAssayProjectDataExtendRespVO> businessAssayProjectDataExtendList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList);
|
||||
for (BusinessAssayProjectDataExtendRespVO businessAssayProjectDataExtend : businessAssayProjectDataExtendList) {
|
||||
if (businessAssayTaskDO.getIsIngredients().equals(QmsCommonConstant.YES) && QmsCommonConstant.MANUAL.equals(businessAssayTaskDO.getIngredientsWay())) {
|
||||
ConfigAssayMethodProjectCoefficientDO configAssayMethodProjectCoefficientDO = configAssayMethodProjectCoefficientList.stream().filter(f ->
|
||||
@@ -1313,6 +1360,10 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
businessAssayProjectDataMapper.updateBatch(businessAssayProjectDataList);
|
||||
}
|
||||
|
||||
if (updateBusinessAssayParameterDataList.size() > 0) {
|
||||
businessAssayParameterDataMapper.updateBatch(updateBusinessAssayParameterDataList);
|
||||
}
|
||||
|
||||
businessAssayTaskMapper.updateById(businessAssayTaskDO);
|
||||
}
|
||||
|
||||
@@ -1461,12 +1512,15 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
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, "当前分析任务,存在下发配料必填为空情况。请检查后再下发!");
|
||||
|
||||
List<String> projectList = Arrays.asList(source.getProject().split(","));//来源可以有多个
|
||||
for (String project : projectList) {
|
||||
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, "当前分析任务,存在下发配料必填为空情况。请检查后再下发!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@ public class ConfigSubSampleMethodConfInfo {
|
||||
/** 添加分析任务 **/
|
||||
private ConfigSubSampleMethodConfAdd addAssayTask;
|
||||
|
||||
/** 分析方法参数设置值配置 **/
|
||||
private List<ConfigSubSampleMethodConfItem> setParam;
|
||||
|
||||
/** 分析方法参数取值配置 **/
|
||||
private List<ConfigSubSampleMethodConfItem> getParam;
|
||||
|
||||
|
||||
@@ -8,7 +8,10 @@ public class ConfigSubSampleMethodConfPoint {
|
||||
/** 分析方法id **/
|
||||
private Long methodId;
|
||||
|
||||
/** 检测项目 **/
|
||||
/** 分析方法Key **/
|
||||
private String methodKey;
|
||||
|
||||
/** 检测项目,多个以“,”号分割 **/
|
||||
private String project;
|
||||
|
||||
/** 参数 **/
|
||||
|
||||
@@ -214,9 +214,17 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
||||
|
||||
//委托单号
|
||||
String entrustCode = "";
|
||||
|
||||
if(!ObjectUtils.isEmpty(entrustList)){
|
||||
for(BusinessSampleEntrustRegistrationDO entrust : entrustList){
|
||||
entrustCode += entrust.getEntrustNumber() + ",";
|
||||
String externalInfomation = entrust.getExternalInfomation();
|
||||
if(!ObjectUtils.isEmpty(externalInfomation)){
|
||||
JSONObject externalInfomationJson = JSONObject.parseObject(externalInfomation);
|
||||
String sampleCategory = externalInfomationJson.getString("sampleCategory");
|
||||
if(!ObjectUtils.isEmpty(sampleCategory))
|
||||
formDataJson.put("sampleCategory", sampleCategory);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,26 @@ public class XRFDeviceSampleReqVO implements Serializable {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "样品时间")
|
||||
private LocalDateTime sampleTime;
|
||||
|
||||
/**
|
||||
* 样品开始时间
|
||||
*/
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应)
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化(请求)
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "样品开始时间")
|
||||
private LocalDateTime sampleStartTime;
|
||||
|
||||
/**
|
||||
* 样品结束时间
|
||||
*/
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应)
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化(请求)
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "样品结束时间")
|
||||
private LocalDateTime sampleEndTime;
|
||||
|
||||
/**
|
||||
* 分析人
|
||||
|
||||
@@ -154,13 +154,18 @@ public class AutoIngredientsServiceImpl implements AutoIngredientsService {
|
||||
for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem : downIngredients) {
|
||||
if (configSubSampleMethodConfItem.getRequired()) {
|
||||
ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource();
|
||||
String project = source.getProject();
|
||||
String parameter = source.getParameter();
|
||||
BusinessAssayProjectDataExtendRespVO currentBusinessAssayProjectData = currentBusinessAssayProjectDataList.stream().filter(f -> 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);
|
||||
ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();
|
||||
String field = target.getField();
|
||||
BeanUtil.setFieldValue(autoIngredientsTaskDetailRespVO, field, currentBusinessAssayParameterData.getValue());
|
||||
List<String> projectList = Arrays.asList(source.getProject().split(","));//来源可以有多个
|
||||
for (String project : projectList) {
|
||||
String parameter = source.getParameter();
|
||||
BusinessAssayProjectDataExtendRespVO currentBusinessAssayProjectData = currentBusinessAssayProjectDataList.stream().filter(f -> 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.isNotBlank(currentBusinessAssayParameterData.getValue())) {
|
||||
ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();
|
||||
String field = target.getField();
|
||||
BeanUtil.setFieldValue(autoIngredientsTaskDetailRespVO, field, currentBusinessAssayParameterData.getValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -239,19 +244,19 @@ public class AutoIngredientsServiceImpl implements AutoIngredientsService {
|
||||
// System.out.println("fieldValue:" + fieldValue);
|
||||
|
||||
ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();
|
||||
String project = target.getProject();
|
||||
|
||||
BusinessAssayProjectDataExtendRespVO currentBusinessAssayProjectData = businessAssayProjectDataList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(autoIngredientsTaskDetailAssayResultReqVO.getId()) && f.getSimpleName().equals(project)).findFirst().orElse(null);
|
||||
String parameter = target.getParameter();
|
||||
if (StringUtils.isBlank(parameter)) {
|
||||
currentBusinessAssayProjectData.setValue(fieldValue.toString());
|
||||
updateBusinessAssayProjectDataDOList.add(BeanUtils.toBean(currentBusinessAssayProjectData, BusinessAssayProjectDataDO.class));
|
||||
} else {
|
||||
BusinessAssayParameterDataExtendRespVO currentBusinessAssayParameterData = businessAssayParameterDataList.stream().filter(f -> f.getBusinessAssayProjectDataId().equals(currentBusinessAssayProjectData.getId()) && f.getParameterKey().equals(parameter)).findFirst().orElse(null);
|
||||
currentBusinessAssayParameterData.setValue(fieldValue.toString());
|
||||
updateBusinessAssayParameterDataDOList.add(BeanUtils.toBean(currentBusinessAssayParameterData, BusinessAssayParameterDataDO.class));
|
||||
List<String> projectList = Arrays.asList(target.getProject().split(","));//目标可以有多个
|
||||
for (String project : projectList) {
|
||||
BusinessAssayProjectDataExtendRespVO currentBusinessAssayProjectData = businessAssayProjectDataList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(autoIngredientsTaskDetailAssayResultReqVO.getId()) && f.getSimpleName().equals(project)).findFirst().orElse(null);
|
||||
String parameter = target.getParameter();
|
||||
if (StringUtils.isBlank(parameter)) {
|
||||
currentBusinessAssayProjectData.setValue(fieldValue.toString());
|
||||
updateBusinessAssayProjectDataDOList.add(BeanUtils.toBean(currentBusinessAssayProjectData, BusinessAssayProjectDataDO.class));
|
||||
} else {
|
||||
BusinessAssayParameterDataExtendRespVO currentBusinessAssayParameterData = businessAssayParameterDataList.stream().filter(f -> f.getBusinessAssayProjectDataId().equals(currentBusinessAssayProjectData.getId()) && f.getParameterKey().equals(parameter)).findFirst().orElse(null);
|
||||
currentBusinessAssayParameterData.setValue(fieldValue.toString());
|
||||
updateBusinessAssayParameterDataDOList.add(BeanUtils.toBean(currentBusinessAssayParameterData, BusinessAssayParameterDataDO.class));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -17,29 +18,40 @@ import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO;
|
||||
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.BusinessQCManagementDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO;
|
||||
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;
|
||||
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;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessXRFDataMapper;
|
||||
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.controller.vo.ConfigSubSampleMethodExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFConversionRateDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFLineDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFProjectDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFConversionRateMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFLineMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFProjectMapper;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.*;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -59,15 +71,24 @@ public class XRFDataServiceImpl implements XRFDataService {
|
||||
@Resource
|
||||
private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigSubSampleMethodMapper configSubSampleMethodMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessXRFDataMapper businessXRFDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayTaskDataMapper businessAssayTaskDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayTaskParameterDataMapper businessAssayTaskParameterDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayProjectDataMapper businessAssayProjectDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayParameterDataMapper businessAssayParameterDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessQCManagementDataMapper businessQCManagementDataMapper;
|
||||
|
||||
@@ -120,6 +141,11 @@ public class XRFDataServiceImpl implements XRFDataService {
|
||||
|
||||
//根据样品编号及分析方法类型,获取检测任务数据
|
||||
List<BusinessAssayTaskDataExtendRespVO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(sampleCodeList, "xshxyggpf");
|
||||
|
||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
//获取检测参数
|
||||
List<BusinessAssayTaskParameterDataExtendRespVO> businessAssayTaskParameterDataExtendList = businessAssayTaskParameterDataMapper.selectExtendByBusinessAssayTaskDataIds(businessAssayTaskDataIdList);
|
||||
|
||||
|
||||
//管理样和标准样
|
||||
List<BusinessQCManagementDataDO> businessQCManagementDataList = businessQCManagementDataMapper.selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(sampleCodeList, "xshxyggpf");
|
||||
@@ -128,7 +154,11 @@ public class XRFDataServiceImpl implements XRFDataService {
|
||||
// List<BusinessQCCoefficientDataDO> businessQCCoefficientDataList = businessQCCoefficientDataMapper.selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(sampleCodeList, "xshxyggpf");
|
||||
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = new ArrayList<>();
|
||||
List<BusinessAssayTaskParameterDataDO> businessAssayTaskParameterDataList = new ArrayList<>();
|
||||
List<BusinessAssayProjectDataDO> busElementValueList = new ArrayList<>();
|
||||
|
||||
List<BusinessAssayParameterDataDO> updateBusinessAssayParameterDataList = new ArrayList<>();
|
||||
|
||||
List<BusinessQCManagementProjectDataDO> busQcManageElementValueList = new ArrayList<>();
|
||||
// List<BusinessQCCoefficientParameterDataDO> busQccParameterValueList = new ArrayList<>();
|
||||
List<BusinessXRFDataDO> busYgDataList = new ArrayList<>();
|
||||
@@ -149,6 +179,8 @@ public class XRFDataServiceImpl implements XRFDataService {
|
||||
busYgData.setXRFSampleId(ygDeviceSample.getSampleId());
|
||||
busYgData.setSampleCode(ygDeviceSample.getSampleCode());
|
||||
busYgData.setSampleTime(ygDeviceSample.getSampleTime());
|
||||
busYgData.setSampleStartTime(ygDeviceSample.getSampleStartTime());
|
||||
busYgData.setSampleEndTime(ygDeviceSample.getSampleEndTime());
|
||||
busYgData.setAssayOperator(ygDeviceSample.getAssayOper());
|
||||
busYgData.setIsCheckCreate(ygDeviceSample.getIsCheck() ? 1 : 0);
|
||||
|
||||
@@ -164,7 +196,26 @@ public class XRFDataServiceImpl implements XRFDataService {
|
||||
List<BusinessAssayProjectDataExtendRespVO> tempBusElementValueList = new ArrayList<>();
|
||||
List<BusinessAssayTaskDataExtendRespVO> currBusinessAssayTaskDataList = businessAssayTaskDataList.stream().filter(f -> ygDeviceSample.getSampleCode().equals(f.getSampleAssayCode())).collect(Collectors.toList());
|
||||
if (currBusinessAssayTaskDataList != null && currBusinessAssayTaskDataList.size() > 0) {
|
||||
for (BusinessAssayTaskDataExtendRespVO businessAssayTaskData : currBusinessAssayTaskDataList) {
|
||||
for (BusinessAssayTaskDataExtendRespVO businessAssayTaskData : currBusinessAssayTaskDataList) {
|
||||
//处理任务参数
|
||||
List<BusinessAssayTaskParameterDataExtendRespVO> currBusinessAssayTaskParameterDataExtendList = businessAssayTaskParameterDataExtendList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskData.getId())).collect(Collectors.toList());
|
||||
for (BusinessAssayTaskParameterDataExtendRespVO currBusinessAssayTaskParameterDataExtend : currBusinessAssayTaskParameterDataExtendList) {
|
||||
switch (currBusinessAssayTaskParameterDataExtend.getKey()) {
|
||||
case "lineName":
|
||||
currBusinessAssayTaskParameterDataExtend.setValue(busYgData.getLineName());
|
||||
businessAssayTaskParameterDataList.add(BeanUtils.toBean(currBusinessAssayTaskParameterDataExtend, BusinessAssayTaskParameterDataDO.class));
|
||||
break;
|
||||
case "sampleStartTime":
|
||||
currBusinessAssayTaskParameterDataExtend.setValue(DateUtil.formatLocalDateTime(busYgData.getSampleStartTime()));
|
||||
businessAssayTaskParameterDataList.add(BeanUtils.toBean(currBusinessAssayTaskParameterDataExtend, BusinessAssayTaskParameterDataDO.class));
|
||||
break;
|
||||
case "sampleEndTime":
|
||||
currBusinessAssayTaskParameterDataExtend.setValue(DateUtil.formatLocalDateTime(busYgData.getSampleEndTime()));
|
||||
businessAssayTaskParameterDataList.add(BeanUtils.toBean(currBusinessAssayTaskParameterDataExtend, BusinessAssayTaskParameterDataDO.class));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
List<BusinessAssayProjectDataExtendRespVO> busElementValues = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskData.getId());
|
||||
tempBusElementValueList.addAll(busElementValues);
|
||||
}
|
||||
@@ -295,6 +346,43 @@ public class XRFDataServiceImpl implements XRFDataService {
|
||||
|
||||
if (currBusinessAssayTaskDataList != null && currBusinessAssayTaskDataList.size() > 0) {
|
||||
for (BusinessAssayTaskDataExtendRespVO businessAssayTaskData : currBusinessAssayTaskDataList) {
|
||||
ConfigSubSampleMethodExtendRespVO configSubSampleMethod = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessAssayTaskData.getConfigSubSampleId(), businessAssayTaskData.getConfigAssayMethodId());
|
||||
|
||||
String configInfomation = configSubSampleMethod.getConfigInfomation();
|
||||
if (StringUtils.isNotBlank(configInfomation)) {
|
||||
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
||||
List<ConfigSubSampleMethodConfItem> setParamList = configSubSampleMethodConfInfo.getSetParam();
|
||||
if (CollUtil.isEmpty(setParamList)) {
|
||||
continue;//跳出循环
|
||||
}
|
||||
|
||||
String methodKey = setParamList.stream().map(m -> m.getTarget().getMethodKey()).distinct().findFirst().orElse(null);
|
||||
List<BusinessAssayTaskDataDO> targetBusinessAssayTaskDataList = businessAssayTaskDataMapper.selectByBusinessSubSampleIdAndMethodKey(businessAssayTaskData.getBusinessSubSampleId(), methodKey);
|
||||
List<Long> targetBusinessAssayTaskDataIdList = targetBusinessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
List<BusinessAssayProjectDataExtendRespVO> targetBusinessAssayProjectDataExtendList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(targetBusinessAssayTaskDataIdList);
|
||||
|
||||
for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem : setParamList) {
|
||||
ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource();
|
||||
String project = source.getProject();
|
||||
BusinessAssayProjectDataExtendRespVO currentBusinessAssayProjectData = tempBusElementValueList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskData.getId()) && f.getSimpleName().equals(project)).findFirst().orElse(null);
|
||||
ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();
|
||||
for (BusinessAssayTaskDataDO targetBusinessAssayTaskData : targetBusinessAssayTaskDataList) {
|
||||
List<String> targetProjectList = Arrays.asList(target.getProject().split(","));
|
||||
String targetParameter = target.getParameter();
|
||||
for (String targetProject : targetProjectList) {
|
||||
BusinessAssayProjectDataExtendRespVO targetBusinessAssayProjectData = targetBusinessAssayProjectDataExtendList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(targetBusinessAssayTaskData.getId()) && f.getSimpleName().equals(targetProject)).findFirst().orElse(null);
|
||||
BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataMapper.selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(targetBusinessAssayProjectData.getId(), targetProject, targetParameter);
|
||||
if (businessAssayParameterDataDO != null) {
|
||||
businessAssayParameterDataDO.setValue(currentBusinessAssayProjectData.getValue());
|
||||
updateBusinessAssayParameterDataList.add(businessAssayParameterDataDO);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
busYgData.setIsMatched(QmsCommonConstant.YES);
|
||||
busYgData.setBusinessBaseSampleId(businessAssayTaskData.getBusinessBaseSampleId());
|
||||
busYgData.setBusinessSubParentSampleId(businessAssayTaskData.getBusinessSubParentSampleId());
|
||||
@@ -326,11 +414,22 @@ public class XRFDataServiceImpl implements XRFDataService {
|
||||
|
||||
//保存荧光数据
|
||||
businessXRFDataMapper.insertBatch(busYgDataList);
|
||||
|
||||
|
||||
//更新任务参数
|
||||
if (businessAssayTaskParameterDataList.size() > 0) {
|
||||
businessAssayTaskParameterDataMapper.updateBatch(businessAssayTaskParameterDataList);
|
||||
}
|
||||
|
||||
//更新分析结果
|
||||
if (busElementValueList.size() > 0) {
|
||||
businessAssayProjectDataMapper.updateBatch(busElementValueList);
|
||||
}
|
||||
|
||||
//更新检测项目参数
|
||||
if (updateBusinessAssayParameterDataList.size() > 0) {
|
||||
businessAssayParameterDataMapper.updateBatch(updateBusinessAssayParameterDataList);
|
||||
}
|
||||
|
||||
//荧光管理样和标准样
|
||||
if (busQcManageElementValueList.size() > 0) {
|
||||
businessQCManagementProjectDataMapper.updateBatch(busQcManageElementValueList);
|
||||
|
||||
Reference in New Issue
Block a user