质控空白样
This commit is contained in:
@@ -56,14 +56,6 @@ public class SampleTaskAssignController implements BusinessControllerMarker {
|
|||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
@GetMapping("/getAssayMethodList")
|
|
||||||
public CommonResult<?> getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId) {
|
|
||||||
List<Object> list = sampleTaskAssignService.getAssayMethodList(businessSubSampleId, configAssayMethodId);
|
|
||||||
return success(list);
|
|
||||||
}
|
|
||||||
**/
|
|
||||||
|
|
||||||
@GetMapping("/getAssayMethodProjectList")
|
@GetMapping("/getAssayMethodProjectList")
|
||||||
public CommonResult<?> getAssayMethodProjectList(String businessSubSampleIds, Long configAssayMethodId) {
|
public CommonResult<?> getAssayMethodProjectList(String businessSubSampleIds, Long configAssayMethodId) {
|
||||||
List<Long> businessSubSampleIdList = Arrays.asList(businessSubSampleIds.split(",")).stream().map(Long::parseLong).toList();
|
List<Long> businessSubSampleIdList = Arrays.asList(businessSubSampleIds.split(",")).stream().map(Long::parseLong).toList();
|
||||||
|
|||||||
@@ -11,11 +11,17 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataD
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO;
|
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.BusinessQCCoefficientParameterDataDO;
|
||||||
|
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.mapper.BusinessAssayTaskDataMapper;
|
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.BusinessAssayTaskDetailMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper;
|
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.BusinessQCCoefficientParameterDataMapper;
|
||||||
|
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.liteflow.slot.SampleTaskAssignContext;
|
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignContext;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
|
||||||
@@ -36,6 +42,15 @@ public class SampleTaskAssignDataSaveOrUpdateCmp extends NodeComponent {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper;
|
private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessQCManagementDataMapper businessQCManagementDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process() throws Exception {
|
public void process() throws Exception {
|
||||||
@@ -53,6 +68,12 @@ public class SampleTaskAssignDataSaveOrUpdateCmp extends NodeComponent {
|
|||||||
|
|
||||||
List<BusinessQCCoefficientParameterDataDO> businessQCCoefficientParameterDataList = sampleTaskAssignContext.getBusinessQCCoefficientParameterDataList();
|
List<BusinessQCCoefficientParameterDataDO> businessQCCoefficientParameterDataList = sampleTaskAssignContext.getBusinessQCCoefficientParameterDataList();
|
||||||
|
|
||||||
|
List<BusinessQCManagementDataDO> businessQCManagementDataDOList = sampleTaskAssignContext.getBusinessQCManagementDataDOList();
|
||||||
|
|
||||||
|
List<BusinessQCManagementProjectDataDO> businessQCManagementProjectDataDOList = sampleTaskAssignContext.getBusinessQCManagementProjectDataDOList();
|
||||||
|
|
||||||
|
List<BusinessQCManagementParameterDataDO> businessQCManagementParameterDataDOList = sampleTaskAssignContext.getBusinessQCManagementParameterDataDOList();
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(savebusinessAssayTaskList)) {
|
if (CollUtil.isNotEmpty(savebusinessAssayTaskList)) {
|
||||||
this.businessAssayTaskMapper.insertBatch(savebusinessAssayTaskList);
|
this.businessAssayTaskMapper.insertBatch(savebusinessAssayTaskList);
|
||||||
}
|
}
|
||||||
@@ -76,6 +97,18 @@ public class SampleTaskAssignDataSaveOrUpdateCmp extends NodeComponent {
|
|||||||
if (CollUtil.isNotEmpty(businessQCCoefficientParameterDataList)) {
|
if (CollUtil.isNotEmpty(businessQCCoefficientParameterDataList)) {
|
||||||
this.businessQCCoefficientParameterDataMapper.insertBatch(businessQCCoefficientParameterDataList);
|
this.businessQCCoefficientParameterDataMapper.insertBatch(businessQCCoefficientParameterDataList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(businessQCManagementDataDOList)) {
|
||||||
|
this.businessQCManagementDataMapper.insertBatch(businessQCManagementDataDOList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(businessQCManagementProjectDataDOList)) {
|
||||||
|
this.businessQCManagementProjectDataMapper.insertBatch(businessQCManagementProjectDataDOList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(businessQCManagementParameterDataDOList)) {
|
||||||
|
this.businessQCManagementParameterDataMapper.insertBatch(businessQCManagementParameterDataDOList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,12 +11,20 @@ import com.yomahub.liteflow.core.NodeComponent;
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO;
|
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.BusinessQCCoefficientParameterDataDO;
|
||||||
|
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.mapper.BusinessQCCoefficientDataMapper;
|
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.BusinessQCCoefficientParameterDataMapper;
|
||||||
|
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.liteflow.slot.SampleTaskAssignContext;
|
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignContext;
|
||||||
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodParameterExtendRespVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodParameterExtendRespVO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper;
|
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper;
|
||||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper;
|
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.ConfigAssayMethodProjectParameterMapper;
|
||||||
@@ -55,6 +63,15 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent {
|
|||||||
@Resource
|
@Resource
|
||||||
private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper;
|
private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessQCManagementDataMapper businessQCManagementDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process() throws Exception {
|
public void process() throws Exception {
|
||||||
SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class);
|
SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class);
|
||||||
@@ -62,6 +79,11 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent {
|
|||||||
List<BusinessQCCoefficientDataDO> businessQCCoefficientDataDOList = new ArrayList<>();
|
List<BusinessQCCoefficientDataDO> businessQCCoefficientDataDOList = new ArrayList<>();
|
||||||
List<BusinessQCCoefficientParameterDataDO> businessQCCoefficientParameterDataDOList = new ArrayList<>();
|
List<BusinessQCCoefficientParameterDataDO> businessQCCoefficientParameterDataDOList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
List<BusinessQCManagementDataDO> businessQCManagementDataDOList = new ArrayList<>();
|
||||||
|
List<BusinessQCManagementProjectDataDO> businessQCManagementProjectDataDOList = new ArrayList<>();
|
||||||
|
List<BusinessQCManagementParameterDataDO> businessQCManagementParameterDataDOList = new ArrayList<>();
|
||||||
|
|
||||||
//分配任务
|
//分配任务
|
||||||
List<BusinessAssayTaskDO> businessAssayTaskList = new ArrayList<>();
|
List<BusinessAssayTaskDO> businessAssayTaskList = new ArrayList<>();
|
||||||
//获取需要保存的分配任务
|
//获取需要保存的分配任务
|
||||||
@@ -86,63 +108,140 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent {
|
|||||||
|
|
||||||
//循环分配任务
|
//循环分配任务
|
||||||
for (BusinessAssayTaskDO businessAssayTaskDO : businessAssayTaskList) {
|
for (BusinessAssayTaskDO businessAssayTaskDO : businessAssayTaskList) {
|
||||||
ConfigQCSampleMethodExtendRespVO configQCSampleMethodExtendRespVO = configQCSampleMethodList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDO.getConfigAssayMethodId()) && "kby".equals(f.getDictionaryBusinessKey())).findFirst().orElse(null);
|
ConfigQCSampleMethodExtendRespVO configQCSampleMethodExtendRespVO = configQCSampleMethodList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDO.getConfigAssayMethodId()) && ("kby".equals(f.getDictionaryBusinessKey()) || "zkkby".equals(f.getDictionaryBusinessKey()))).findFirst().orElse(null);
|
||||||
//不存在空白样,直接跳出
|
//不存在空白样,直接跳出
|
||||||
if (configQCSampleMethodExtendRespVO == null) {
|
if (configQCSampleMethodExtendRespVO == null) {
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(businessAssayTaskDO.getConfigAssayMethodId());
|
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(businessAssayTaskDO.getConfigAssayMethodId());
|
||||||
|
|
||||||
//查询下质控数据,如果存在则跳出循环
|
if ("kby".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey())) { //普通空白样
|
||||||
List<BusinessQCCoefficientDataDO> businessQCCoefficientDataList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
|
|
||||||
//如果存在则跳出循环
|
//查询下质控数据,如果存在则跳出循环
|
||||||
if (CollUtil.isNotEmpty(businessQCCoefficientDataList)) {
|
List<BusinessQCCoefficientDataDO> businessQCCoefficientDataList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
|
||||||
break;
|
//如果存在则跳出循环
|
||||||
|
if (CollUtil.isNotEmpty(businessQCCoefficientDataList)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据默认配置的个数生成空白样
|
||||||
|
for (int i = 0; i < configQCSampleMethodExtendRespVO.getDefaultCount(); i++) {
|
||||||
|
|
||||||
|
BusinessQCCoefficientDataDO businessQCCoefficientDataDO = new BusinessQCCoefficientDataDO();
|
||||||
|
businessQCCoefficientDataDO.setId(IdWorker.getId());
|
||||||
|
businessQCCoefficientDataDO.setBusinessAssayTaskId(businessAssayTaskDO.getId());
|
||||||
|
businessQCCoefficientDataDO.setConfigAssayMethodId(configQCSampleMethodExtendRespVO.getConfigAssayMethodId());
|
||||||
|
businessQCCoefficientDataDO.setSampleName(configQCSampleMethodExtendRespVO.getDictionaryBusinessName());
|
||||||
|
if (StringUtils.isNotBlank(configQCSampleMethodExtendRespVO.getCodeRule())) {
|
||||||
|
String codeSample = sequenceUtil.genCode(configQCSampleMethodExtendRespVO.getCodeRule());
|
||||||
|
businessQCCoefficientDataDO.setSampleCode(codeSample);
|
||||||
|
}
|
||||||
|
businessQCCoefficientDataDO.setDictionaryBusinessId(configQCSampleMethodExtendRespVO.getDictionaryBusinessId());
|
||||||
|
businessQCCoefficientDataDO.setDictionaryBusinessKey(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey());
|
||||||
|
businessQCCoefficientDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId());
|
||||||
|
businessQCCoefficientDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName());
|
||||||
|
businessQCCoefficientDataDO.setAssayOperator(businessAssayTaskDO.getAssayOperator());
|
||||||
|
businessQCCoefficientDataDO.setAssayOperatorId(businessAssayTaskDO.getAssayOperatorId());
|
||||||
|
businessQCCoefficientDataDO.setAssayProject("");
|
||||||
|
businessQCCoefficientDataDO.setAssignTaskTime(businessAssayTaskDO.getTaskAssignTime());
|
||||||
|
businessQCCoefficientDataDO.setIsAssignTasked(QmsCommonConstant.YES);
|
||||||
|
businessQCCoefficientDataDO.setIsReported(QmsCommonConstant.NO);
|
||||||
|
|
||||||
|
businessQCCoefficientDataDOList.add(businessQCCoefficientDataDO);
|
||||||
|
|
||||||
|
List<ConfigQCSampleMethodParameterExtendRespVO> configQCSampleMethodParameterExtendRespVOs = configQcSampleMethodParameterList.stream().filter(f -> f.getConfigQCSampleMethodId().equals(configQCSampleMethodExtendRespVO.getId())).collect(Collectors.toList());
|
||||||
|
for (ConfigQCSampleMethodParameterExtendRespVO configQCSampleMethodParameterExtendRespVO : configQCSampleMethodParameterExtendRespVOs) {
|
||||||
|
BusinessQCCoefficientParameterDataDO businessQCCoefficientParameterDataDO = new BusinessQCCoefficientParameterDataDO();
|
||||||
|
businessQCCoefficientParameterDataDO.setBusinessQCCoefficientDataId(businessQCCoefficientDataDO.getId());
|
||||||
|
businessQCCoefficientParameterDataDO.setConfigQCSampleMethodParameterId(configQCSampleMethodParameterExtendRespVO.getId());
|
||||||
|
businessQCCoefficientParameterDataDO.setDictionaryParameterId(configQCSampleMethodParameterExtendRespVO.getDictionaryParameterId());
|
||||||
|
businessQCCoefficientParameterDataDO.setDataType(configQCSampleMethodParameterExtendRespVO.getDataType());
|
||||||
|
businessQCCoefficientParameterDataDO.setDecimalPosition(configQCSampleMethodParameterExtendRespVO.getDecimalPosition());
|
||||||
|
businessQCCoefficientParameterDataDO.setValue(configQCSampleMethodParameterExtendRespVO.getDefaultValue());
|
||||||
|
|
||||||
|
businessQCCoefficientParameterDataDOList.add(businessQCCoefficientParameterDataDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if ("zkkby".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey())) {//质控空白样
|
||||||
|
//查询质控数据,如果存在则跳出循环
|
||||||
|
List<BusinessQCManagementDataDO> businessQCManagementDataList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
|
||||||
|
if (CollUtil.isNotEmpty(businessQCManagementDataList)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//分析项目
|
||||||
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectExtendRespList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId());
|
||||||
|
List<Long> configAssayMethodProjectIds = configAssayMethodProjectExtendRespList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
//分析项目参数
|
||||||
|
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectIds(configAssayMethodProjectIds);
|
||||||
|
//分析项目
|
||||||
|
String assayProject = configAssayMethodProjectExtendRespList.stream().map(m -> m.getShowName()).collect(Collectors.joining(","));
|
||||||
|
|
||||||
|
for (int i = 0; i < configQCSampleMethodExtendRespVO.getDefaultCount(); i++) {
|
||||||
|
|
||||||
|
BusinessQCManagementDataDO businessQCManagementDataDO = new BusinessQCManagementDataDO();
|
||||||
|
businessQCManagementDataDO.setId(IdWorker.getId());
|
||||||
|
businessQCManagementDataDO.setBusinessAssayTaskId(businessAssayTaskDO.getId());
|
||||||
|
businessQCManagementDataDO.setConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId());
|
||||||
|
businessQCManagementDataDO.setSampleName(configQCSampleMethodExtendRespVO.getDictionaryBusinessName());
|
||||||
|
if (StringUtils.isNotBlank(configQCSampleMethodExtendRespVO.getCodeRule())) {
|
||||||
|
String codeSample = sequenceUtil.genCode(configQCSampleMethodExtendRespVO.getCodeRule());
|
||||||
|
businessQCManagementDataDO.setSampleCode(codeSample);
|
||||||
|
}
|
||||||
|
businessQCManagementDataDO.setBusinessStandardSampleId(null);//特殊空白样无定值样
|
||||||
|
businessQCManagementDataDO.setDictionaryBusinessId(configQCSampleMethodExtendRespVO.getDictionaryBusinessId());
|
||||||
|
businessQCManagementDataDO.setDictionaryBusinessKey(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey());
|
||||||
|
businessQCManagementDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId());
|
||||||
|
businessQCManagementDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName());
|
||||||
|
businessQCManagementDataDO.setAssayOperator(businessAssayTaskDO.getAssayOperator());
|
||||||
|
businessQCManagementDataDO.setAssayOperatorId(businessAssayTaskDO.getAssayOperatorId());
|
||||||
|
businessQCManagementDataDO.setAssayProject(assayProject);
|
||||||
|
businessQCManagementDataDO.setAssignTaskTime(businessAssayTaskDO.getTaskAssignTime());
|
||||||
|
businessQCManagementDataDO.setIsAssignTasked(QmsCommonConstant.YES);
|
||||||
|
businessQCManagementDataDO.setIsReported(QmsCommonConstant.NO);
|
||||||
|
|
||||||
|
businessQCManagementDataDOList.add(businessQCManagementDataDO);
|
||||||
|
|
||||||
|
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectExtendRespVO : configAssayMethodProjectExtendRespList) {
|
||||||
|
BusinessQCManagementProjectDataDO businessQCManagementProjectDataDO = new BusinessQCManagementProjectDataDO();
|
||||||
|
businessQCManagementProjectDataDO.setId(IdWorker.getId());
|
||||||
|
businessQCManagementProjectDataDO.setBusinessQCManagementDataId(businessQCManagementDataDO.getId());
|
||||||
|
businessQCManagementProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectExtendRespVO.getId());
|
||||||
|
businessQCManagementProjectDataDO.setDictionaryProjectId(configAssayMethodProjectExtendRespVO.getDictionaryProjectId());
|
||||||
|
businessQCManagementProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_QUALITY_CONTROL);
|
||||||
|
businessQCManagementProjectDataDO.setSymbol("=");
|
||||||
|
businessQCManagementProjectDataDO.setDataType(configAssayMethodProjectExtendRespVO.getDataType());
|
||||||
|
businessQCManagementProjectDataDO.setDecimalPosition(configAssayMethodProjectExtendRespVO.getDecimalPosition());
|
||||||
|
businessQCManagementProjectDataDO.setIsEnabled(configAssayMethodProjectExtendRespVO.getIsDefaultEnabled());
|
||||||
|
|
||||||
|
businessQCManagementProjectDataDOList.add(businessQCManagementProjectDataDO);
|
||||||
|
|
||||||
|
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterDoList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectExtendRespVO.getId())).collect(Collectors.toList());
|
||||||
|
for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDoList) {
|
||||||
|
BusinessQCManagementParameterDataDO businessQCManagementParameterDataDO = new BusinessQCManagementParameterDataDO();
|
||||||
|
businessQCManagementParameterDataDO.setBusinessQCManagementProjectDataId(businessQCManagementProjectDataDO.getId());
|
||||||
|
businessQCManagementParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId());
|
||||||
|
businessQCManagementParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId());
|
||||||
|
businessQCManagementParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType());
|
||||||
|
businessQCManagementParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition());
|
||||||
|
|
||||||
|
businessQCManagementParameterDataDOList.add(businessQCManagementParameterDataDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//根据默认配置的个数生成空白样
|
|
||||||
for (int i = 0; i < configQCSampleMethodExtendRespVO.getDefaultCount(); i++) {
|
|
||||||
|
|
||||||
BusinessQCCoefficientDataDO businessQCCoefficientDataDO = new BusinessQCCoefficientDataDO();
|
|
||||||
businessQCCoefficientDataDO.setId(IdWorker.getId());
|
|
||||||
businessQCCoefficientDataDO.setBusinessAssayTaskId(businessAssayTaskDO.getId());
|
|
||||||
businessQCCoefficientDataDO.setConfigAssayMethodId(configQCSampleMethodExtendRespVO.getConfigAssayMethodId());
|
|
||||||
businessQCCoefficientDataDO.setSampleName(configQCSampleMethodExtendRespVO.getDictionaryBusinessName());
|
|
||||||
if (StringUtils.isNotBlank(configQCSampleMethodExtendRespVO.getCodeRule())) {
|
|
||||||
String codeSample = sequenceUtil.genCode(configQCSampleMethodExtendRespVO.getCodeRule());
|
|
||||||
businessQCCoefficientDataDO.setSampleCode(codeSample);
|
|
||||||
}
|
|
||||||
businessQCCoefficientDataDO.setDictionaryBusinessId(configQCSampleMethodExtendRespVO.getDictionaryBusinessId());
|
|
||||||
businessQCCoefficientDataDO.setDictionaryBusinessKey(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey());
|
|
||||||
businessQCCoefficientDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId());
|
|
||||||
businessQCCoefficientDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName());
|
|
||||||
businessQCCoefficientDataDO.setAssayOperator(businessAssayTaskDO.getAssayOperator());
|
|
||||||
businessQCCoefficientDataDO.setAssayOperatorId(businessAssayTaskDO.getAssayOperatorId());
|
|
||||||
businessQCCoefficientDataDO.setAssayProject("");
|
|
||||||
businessQCCoefficientDataDO.setAssignTaskTime(businessAssayTaskDO.getTaskAssignTime());
|
|
||||||
businessQCCoefficientDataDO.setIsAssignTasked(QmsCommonConstant.YES);
|
|
||||||
businessQCCoefficientDataDO.setIsReported(QmsCommonConstant.NO);
|
|
||||||
|
|
||||||
businessQCCoefficientDataDOList.add(businessQCCoefficientDataDO);
|
|
||||||
|
|
||||||
List<ConfigQCSampleMethodParameterExtendRespVO> configQCSampleMethodParameterExtendRespVOs = configQcSampleMethodParameterList.stream().filter(f -> f.getConfigQCSampleMethodId().equals(configQCSampleMethodExtendRespVO.getId())).collect(Collectors.toList());
|
|
||||||
for (ConfigQCSampleMethodParameterExtendRespVO configQCSampleMethodParameterExtendRespVO : configQCSampleMethodParameterExtendRespVOs) {
|
|
||||||
BusinessQCCoefficientParameterDataDO businessQCCoefficientParameterDataDO = new BusinessQCCoefficientParameterDataDO();
|
|
||||||
businessQCCoefficientParameterDataDO.setBusinessQCCoefficientDataId(businessQCCoefficientDataDO.getId());
|
|
||||||
businessQCCoefficientParameterDataDO.setConfigQCSampleMethodParameterId(configQCSampleMethodParameterExtendRespVO.getId());
|
|
||||||
businessQCCoefficientParameterDataDO.setDictionaryParameterId(configQCSampleMethodParameterExtendRespVO.getDictionaryParameterId());
|
|
||||||
businessQCCoefficientParameterDataDO.setDataType(configQCSampleMethodParameterExtendRespVO.getDataType());
|
|
||||||
businessQCCoefficientParameterDataDO.setDecimalPosition(configQCSampleMethodParameterExtendRespVO.getDecimalPosition());
|
|
||||||
businessQCCoefficientParameterDataDO.setValue(configQCSampleMethodParameterExtendRespVO.getDefaultValue());
|
|
||||||
|
|
||||||
businessQCCoefficientParameterDataDOList.add(businessQCCoefficientParameterDataDO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
sampleTaskAssignContext.setBusinessQCCoefficientDataList(businessQCCoefficientDataDOList);
|
sampleTaskAssignContext.setBusinessQCCoefficientDataList(businessQCCoefficientDataDOList);
|
||||||
sampleTaskAssignContext.setBusinessQCCoefficientParameterDataList(businessQCCoefficientParameterDataDOList);
|
sampleTaskAssignContext.setBusinessQCCoefficientParameterDataList(businessQCCoefficientParameterDataDOList);
|
||||||
|
|
||||||
|
sampleTaskAssignContext.setBusinessQCManagementDataDOList(businessQCManagementDataDOList);
|
||||||
|
sampleTaskAssignContext.setBusinessQCManagementProjectDataDOList(businessQCManagementProjectDataDOList);
|
||||||
|
sampleTaskAssignContext.setBusinessQCManagementParameterDataDOList(businessQCManagementParameterDataDOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataD
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO;
|
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.BusinessQCCoefficientParameterDataDO;
|
||||||
|
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.dataobject.BusinessSubSampleDO;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.AssignAssayUser;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.AssignAssayUser;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||||
@@ -89,5 +92,14 @@ public class SampleTaskAssignContext {
|
|||||||
|
|
||||||
/** 质控样-(空白、标准)检测参数数据 **/
|
/** 质控样-(空白、标准)检测参数数据 **/
|
||||||
private List<BusinessQCCoefficientParameterDataDO> businessQCCoefficientParameterDataList;
|
private List<BusinessQCCoefficientParameterDataDO> businessQCCoefficientParameterDataList;
|
||||||
|
|
||||||
|
/** 质控样-(质控空白) **/
|
||||||
|
private List<BusinessQCManagementDataDO> businessQCManagementDataDOList;
|
||||||
|
|
||||||
|
/** 质控样-(质控空白)检测项目 **/
|
||||||
|
private List<BusinessQCManagementProjectDataDO> businessQCManagementProjectDataDOList;
|
||||||
|
|
||||||
|
/** 质控样-(质控空白)检测项目参数 **/
|
||||||
|
private List<BusinessQCManagementParameterDataDO> businessQCManagementParameterDataDOList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -947,7 +947,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
businessAssayParameterDataMapper.updateBatch(businessAssayParameterDataList);
|
businessAssayParameterDataMapper.updateBatch(businessAssayParameterDataList);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ("zky".equals(businessAssayTaskAnalysisDataRespVO.getAnalysisType())) {
|
} else if ("zky".equals(businessAssayTaskAnalysisDataRespVO.getAnalysisType()) || "zkkby".equals(businessAssayTaskAnalysisDataRespVO.getAnalysisType())) {
|
||||||
List<BusinessQCManagementDataDO> BusinessQCManagementDataList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
|
List<BusinessQCManagementDataDO> BusinessQCManagementDataList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
|
||||||
|
|
||||||
List<Long> businessQCManagementDataIdList = BusinessQCManagementDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
List<Long> businessQCManagementDataIdList = BusinessQCManagementDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
|||||||
@@ -31,14 +31,6 @@ public interface SampleTaskAssignService {
|
|||||||
*/
|
*/
|
||||||
List<UnAssignTaskedSubSampleRespVO> getAssaySampleList(BusinessAssayTaskDataReqVO reqVO);
|
List<UnAssignTaskedSubSampleRespVO> getAssaySampleList(BusinessAssayTaskDataReqVO reqVO);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据子样id查询分析方法
|
|
||||||
* @param businessSubSampleId
|
|
||||||
* @param configAssayMethodId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
// List<Object> getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据子样id列表,查询分析方法项目
|
* 根据子样id列表,查询分析方法项目
|
||||||
* @param businessSubSampleIdList 子样id列表
|
* @param businessSubSampleIdList 子样id列表
|
||||||
|
|||||||
@@ -187,65 +187,6 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
List<UnAssignTaskedSubSampleRespVO> list = businessAssayTaskDataMapper.selectUnAssignTaskedSubSample(reqVO);
|
List<UnAssignTaskedSubSampleRespVO> list = businessAssayTaskDataMapper.selectUnAssignTaskedSubSample(reqVO);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
@Override
|
|
||||||
public List<Object> getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId) {
|
|
||||||
List<Object> resutList = new ArrayList<>();
|
|
||||||
//当前登录用户
|
|
||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
|
||||||
Long visitDeptId = loginUser.getVisitDeptId();
|
|
||||||
|
|
||||||
//子样
|
|
||||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId);
|
|
||||||
//原检测项目
|
|
||||||
List<ConfigAssayMethodProjectExtendRespVO> oldConfigAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId);
|
|
||||||
//原检测项目字典id列表
|
|
||||||
List<Long> oldDictionaryProjectIdList = oldConfigAssayMethodProjectList.stream().map(m -> m.getDictionaryProjectId()).collect(Collectors.toList());
|
|
||||||
|
|
||||||
|
|
||||||
//子样对应的检测任务
|
|
||||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubSampleId(businessSubSampleId);
|
|
||||||
|
|
||||||
//查询子样配置的方法
|
|
||||||
List<ConfigSubSampleMethodExtendRespVO> configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdAndAssayDepartmentId(businessSubSampleDO.getConfigSubSampleId(), visitDeptId);
|
|
||||||
|
|
||||||
JSONObject jsonObject = null;
|
|
||||||
for (ConfigSubSampleMethodExtendRespVO configSubSampleMethod : configSubSampleMethodList) {
|
|
||||||
jsonObject = new JSONObject();
|
|
||||||
jsonObject.put("configAssayMethodId", configSubSampleMethod.getConfigAssayMethodId());
|
|
||||||
jsonObject.put("configAssayMethodName", configSubSampleMethod.getConfigAssayMethodName());
|
|
||||||
jsonObject.put("configAssayMethodNameAndCategory", configSubSampleMethod.getConfigAssayMethodNameAndCategory());
|
|
||||||
jsonObject.put("configAssayMethodCode", configSubSampleMethod.getConfigAssayMethodCode());
|
|
||||||
|
|
||||||
StringBuilder assayProjectBuilder = new StringBuilder();
|
|
||||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configSubSampleMethod.getConfigAssayMethodId());
|
|
||||||
|
|
||||||
//判定是否存在原检测项目
|
|
||||||
boolean isExistProject = configAssayMethodProjectList.stream().anyMatch(m -> oldDictionaryProjectIdList.contains(m.getDictionaryProjectId()));
|
|
||||||
if (!isExistProject) {//如果不存在,则跳出循环
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProject : configAssayMethodProjectList) {
|
|
||||||
assayProjectBuilder.append(configAssayMethodProject.getShowName()).append(",");
|
|
||||||
}
|
|
||||||
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
|
||||||
|
|
||||||
jsonObject.put("assayProject", assayProjectBuilder.toString());
|
|
||||||
|
|
||||||
boolean checked = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getConfigAssayMethodId().equals(configSubSampleMethod.getConfigAssayMethodId()));
|
|
||||||
boolean disabled = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getConfigAssayMethodId().equals(configSubSampleMethod.getConfigAssayMethodId()) && m.getIsAssignTasked().equals(QmsCommonConstant.YES));
|
|
||||||
jsonObject.put("checked", checked);
|
|
||||||
jsonObject.put("disabled", disabled);
|
|
||||||
|
|
||||||
resutList.add(jsonObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
return resutList;
|
|
||||||
}
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AssayMethodProjectRespVO> getAssayMethodProjectList(List<Long> businessSubSampleIdList, Long configAssayMethodId) {
|
public List<AssayMethodProjectRespVO> getAssayMethodProjectList(List<Long> businessSubSampleIdList, Long configAssayMethodId) {
|
||||||
@@ -709,147 +650,6 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void changeMethod(ChangeAssayMethodReqVO req) {
|
|
||||||
|
|
||||||
List<BusinessAssayReportDataDO> updateBusinessAssayReportDataDOList = new ArrayList<>();
|
|
||||||
List<BusinessAssayTaskDataDO> saveBusinessAssayTaskDataDOList = new ArrayList<>();
|
|
||||||
List<BusinessAssayProjectDataDO> saveBusinessAssayProjectDataDOList = new ArrayList<>();
|
|
||||||
List<BusinessAssayParameterDataDO> saveBusinessAssayParameterDataDOList = new ArrayList<>();
|
|
||||||
|
|
||||||
List<Long> removeProjectIdList = new ArrayList<>();
|
|
||||||
List<Long> removeParameterIdList = new ArrayList<>();
|
|
||||||
//子样
|
|
||||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(req.getBusinessSubSampleId());
|
|
||||||
|
|
||||||
//查询检测任务
|
|
||||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubSampleDO.getBusinessSubParentSampleId(), req.getConfigAssayMethodId());
|
|
||||||
|
|
||||||
boolean disabled = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getIsAssignTasked().equals(QmsCommonConstant.YES));
|
|
||||||
if (disabled) {
|
|
||||||
throw new ServiceException(10010, "当前样品存在已分配任务,不允许修改分析方法");
|
|
||||||
}
|
|
||||||
//查询报表数据
|
|
||||||
List<BusinessAssayReportDataDO> businessAssayReportDataDOList = businessAssayReportDataMapper.selectBytBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
|
||||||
for (BusinessAssayReportDataDO businessAssayReportDataDO : businessAssayReportDataDOList) {
|
|
||||||
String dataSource = businessAssayReportDataDO.getDataSource();
|
|
||||||
if (dataSource.contains(req.getConfigAssayMethodId().toString())) {//判定是否存在
|
|
||||||
List<Long> dataSourceList = new ArrayList<>();
|
|
||||||
String[] dataSourceSplit = dataSource.split(",");
|
|
||||||
for (int i = 0; i < dataSourceSplit.length; i++) {
|
|
||||||
dataSourceList.add(Long.parseLong(dataSourceSplit[i]));
|
|
||||||
}
|
|
||||||
//移除当前的
|
|
||||||
dataSourceList.remove(req.getConfigAssayMethodId());
|
|
||||||
//添加新的
|
|
||||||
dataSourceList.addAll(req.getChangeConfigAssayMethodIdList());
|
|
||||||
|
|
||||||
//重新赋值
|
|
||||||
businessAssayReportDataDO.setDataSource(CollUtil.join(dataSourceList, ","));
|
|
||||||
|
|
||||||
//添加到更新列表
|
|
||||||
updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) {
|
|
||||||
//查询旧的
|
|
||||||
List<BusinessAssayProjectDataExtendRespVO> businessAssayProjectDataExtendRespVOs = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
|
||||||
List<Long> businessAssayProjectDataIdList = businessAssayProjectDataExtendRespVOs.stream().map(m -> m.getId()).collect(Collectors.toList());
|
|
||||||
removeProjectIdList.addAll(businessAssayProjectDataIdList);
|
|
||||||
List<BusinessAssayParameterDataDO> businessAssayParameterDataDOList = businessAssayParameterDataMapper.selectByBusinessAssayProjectDataIds(businessAssayProjectDataIdList);
|
|
||||||
List<Long> businessAssayParameterDataDOIdList = businessAssayParameterDataDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
|
||||||
removeParameterIdList.addAll(businessAssayParameterDataDOIdList);
|
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
for (Long configAssayMethodId : req.getChangeConfigAssayMethodIdList()) {
|
|
||||||
Long businessAssayTaskDataId = null;
|
|
||||||
if (i == 0) {
|
|
||||||
businessAssayTaskDataId = businessAssayTaskDataDO.getId();
|
|
||||||
businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId);
|
|
||||||
} else {
|
|
||||||
businessAssayTaskDataId = IdWorker.getId();
|
|
||||||
BusinessAssayTaskDataDO newBusinessAssayTaskDataDO = new BusinessAssayTaskDataDO();
|
|
||||||
newBusinessAssayTaskDataDO.setId(businessAssayTaskDataId);
|
|
||||||
newBusinessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
|
||||||
newBusinessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
||||||
newBusinessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
|
||||||
newBusinessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId);
|
|
||||||
newBusinessAssayTaskDataDO.setAssayType(businessAssayTaskDataDO.getAssayType());
|
|
||||||
newBusinessAssayTaskDataDO.setTaskType(businessAssayTaskDataDO.getTaskType());
|
|
||||||
newBusinessAssayTaskDataDO.setConfigSampleFlowId(businessAssayTaskDataDO.getConfigSampleFlowId());
|
|
||||||
newBusinessAssayTaskDataDO.setSampleFlowNodeKey(businessAssayTaskDataDO.getSampleFlowNodeKey());
|
|
||||||
newBusinessAssayTaskDataDO.setSampleFlowNodeTime(businessAssayTaskDataDO.getSampleFlowNodeTime());
|
|
||||||
newBusinessAssayTaskDataDO.setAssayDepartmentId(businessAssayTaskDataDO.getAssayDepartmentId());
|
|
||||||
newBusinessAssayTaskDataDO.setAssayDepartmentName(businessAssayTaskDataDO.getAssayDepartmentName());
|
|
||||||
|
|
||||||
saveBusinessAssayTaskDataDOList.add(newBusinessAssayTaskDataDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
//查询新的检测项目
|
|
||||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId());
|
|
||||||
|
|
||||||
StringBuilder assayProjectBuilder = new StringBuilder();
|
|
||||||
|
|
||||||
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
|
||||||
assayProjectBuilder.append(configAssayMethodProjectDO.getShowName()).append(",");
|
|
||||||
|
|
||||||
//检测项目
|
|
||||||
BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO();
|
|
||||||
businessAssayProjectDataDO.setId(IdWorker.getId());
|
|
||||||
businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
|
||||||
businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId());
|
|
||||||
businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId());
|
|
||||||
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
|
||||||
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
|
||||||
businessAssayProjectDataDO.setIsEnabled(1);
|
|
||||||
businessAssayProjectDataDO.setIsNotAssessment(0);
|
|
||||||
|
|
||||||
saveBusinessAssayProjectDataDOList.add(businessAssayProjectDataDO);
|
|
||||||
|
|
||||||
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectId(configAssayMethodProjectDO.getId());
|
|
||||||
for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) {
|
|
||||||
BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO();
|
|
||||||
businessAssayParameterDataDO.setId(IdWorker.getId());
|
|
||||||
businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId());
|
|
||||||
businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId());
|
|
||||||
businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId());
|
|
||||||
businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType());
|
|
||||||
businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition());
|
|
||||||
|
|
||||||
|
|
||||||
saveBusinessAssayParameterDataDOList.add(businessAssayParameterDataDO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataDOList);
|
|
||||||
businessAssayProjectDataMapper.deleteByIds(removeProjectIdList);
|
|
||||||
businessAssayParameterDataMapper.deleteByIds(removeParameterIdList);
|
|
||||||
//更新报表数据来源
|
|
||||||
if (updateBusinessAssayReportDataDOList.size() > 0) {
|
|
||||||
businessAssayReportDataMapper.updateBatch(updateBusinessAssayReportDataDOList);
|
|
||||||
}
|
|
||||||
if (saveBusinessAssayTaskDataDOList.size() > 0) {
|
|
||||||
businessAssayTaskDataMapper.insertBatch(saveBusinessAssayTaskDataDOList);
|
|
||||||
}
|
|
||||||
if (saveBusinessAssayProjectDataDOList.size() > 0) {
|
|
||||||
businessAssayProjectDataMapper.insertBatch(saveBusinessAssayProjectDataDOList);
|
|
||||||
}
|
|
||||||
if (saveBusinessAssayParameterDataDOList.size() > 0) {
|
|
||||||
businessAssayParameterDataMapper.insertBatch(saveBusinessAssayParameterDataDOList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public LiteflowResponse methodAssign(SampleTaskAssignMethodParam param) {
|
public LiteflowResponse methodAssign(SampleTaskAssignMethodParam param) {
|
||||||
|
|||||||
Reference in New Issue
Block a user