|
|
|
@@ -13,12 +13,14 @@ import java.util.Objects;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.collections4.map.HashedMap;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
|
|
|
|
import com.alibaba.nacos.shaded.io.grpc.Attributes.Key;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
|
import com.ql.util.express.DefaultContext;
|
|
|
|
import com.ql.util.express.DefaultContext;
|
|
|
|
@@ -32,7 +34,10 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDa
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO;
|
|
|
|
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.BusinessAssayTaskDataDO;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
|
|
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO;
|
|
|
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO;
|
|
|
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO;
|
|
|
|
@@ -44,6 +49,11 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMappe
|
|
|
|
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.BusinessBaseSampleMapper;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper;
|
|
|
|
|
|
|
|
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.BusinessQCManagementParameterDataMapper;
|
|
|
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper;
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper;
|
|
|
|
@@ -104,6 +114,21 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private BusinessAssayProjectDataMapper businessAssayProjectDataMapper;
|
|
|
|
private BusinessAssayProjectDataMapper businessAssayProjectDataMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private BusinessQCCoefficientDataMapper businessQCCoefficientDataMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private BusinessQCManagementDataMapper businessQCManagementDataMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private ConfigAssayMethodProjectAssessmentMapper configAssayMethodProjectAssessmentMapper;
|
|
|
|
private ConfigAssayMethodProjectAssessmentMapper configAssayMethodProjectAssessmentMapper;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -254,6 +279,115 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public JSONObject crossAuditByTaskId(Long businessAssayTaskId) {
|
|
|
|
|
|
|
|
JSONObject resultJsonObject = new JSONObject();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
|
|
|
|
|
|
|
if (businessAssayTaskDO == null) {
|
|
|
|
|
|
|
|
throw new ServiceException(1_032_100_000, "未找到任务分配单");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<BusinessAssayTaskDetailDO> businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDetailDO>().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()));
|
|
|
|
|
|
|
|
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
|
|
|
|
|
|
|
|
BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0);
|
|
|
|
|
|
|
|
//处理数据
|
|
|
|
|
|
|
|
List<Map<String, Object>> datas = new ArrayList<>();
|
|
|
|
|
|
|
|
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) {
|
|
|
|
|
|
|
|
BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getSampleId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashedMap<>();
|
|
|
|
|
|
|
|
map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId());
|
|
|
|
|
|
|
|
map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId());
|
|
|
|
|
|
|
|
map.put("businessSubSampleId", businessAssayTaskDataDO.getBusinessSubSampleId());
|
|
|
|
|
|
|
|
map.put("businessSubParentSampleId", businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
|
|
|
|
|
|
|
map.put("configAssayMethodId", businessAssayTaskDataDO.getConfigAssayMethodId());
|
|
|
|
|
|
|
|
map.put("businessAssayTaskDetailId", businessAssayTaskDetailDO.getId());
|
|
|
|
|
|
|
|
map.put("sampleCode", businessAssayTaskDetailDO.getSampleCode());
|
|
|
|
|
|
|
|
map.put("sampleName", businessAssayTaskDetailDO.getSampleName());
|
|
|
|
|
|
|
|
map.put("analysisType", "analysis");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO();
|
|
|
|
|
|
|
|
projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
|
|
|
|
|
|
|
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2);
|
|
|
|
|
|
|
|
for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) {
|
|
|
|
|
|
|
|
map.put("e" + ep.getDicId(), ep);
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(ep.getFormula())) {
|
|
|
|
|
|
|
|
BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
|
|
|
|
|
|
|
|
parameterDataSearch.setBusinessAssayProjectDataId(ep.getId());
|
|
|
|
|
|
|
|
List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
|
|
|
|
|
|
|
for (BusinessAssayProjectAndParameterRespVO p : plist) {
|
|
|
|
|
|
|
|
map.put("p" + p.getDicId(), p);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
datas.add(map);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<BusinessQCManagementDataDO> businessQCManagementDataDOList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (BusinessQCManagementDataDO businessQCManagementData : businessQCManagementDataDOList) {
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashedMap<>();
|
|
|
|
|
|
|
|
map.put("businessAssayTaskDataId", businessQCManagementData.getId());
|
|
|
|
|
|
|
|
map.put("businessAssayTaskId", businessQCManagementData.getBusinessAssayTaskId());
|
|
|
|
|
|
|
|
map.put("businessSubSampleId", "");
|
|
|
|
|
|
|
|
map.put("businessSubParentSampleId", "");
|
|
|
|
|
|
|
|
map.put("configAssayMethodId", businessQCManagementData.getConfigAssayMethodId());
|
|
|
|
|
|
|
|
map.put("businessAssayTaskDetailId", "");
|
|
|
|
|
|
|
|
map.put("sampleCode", businessQCManagementData.getSampleCode());
|
|
|
|
|
|
|
|
map.put("sampleName", businessQCManagementData.getSampleName());
|
|
|
|
|
|
|
|
map.put("analysisType", businessQCManagementData.getDictionaryBusinessKey());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BusinessQCManagementProjectDataReqVO projectDataSearch2 = new BusinessQCManagementProjectDataReqVO();
|
|
|
|
|
|
|
|
projectDataSearch2.setBusinessQCManagementDataId(businessQCManagementData.getId());
|
|
|
|
|
|
|
|
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList2 = businessQCManagementProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2);
|
|
|
|
|
|
|
|
for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) {
|
|
|
|
|
|
|
|
map.put("e" + ep.getDicId(), ep);
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(ep.getFormula())) {
|
|
|
|
|
|
|
|
BusinessQCManagementParameterDataReqVO parameterDataSearch = new BusinessQCManagementParameterDataReqVO();
|
|
|
|
|
|
|
|
parameterDataSearch.setBusinessQCManagementProjectDataId(ep.getId());
|
|
|
|
|
|
|
|
List<BusinessAssayProjectAndParameterRespVO> plist = businessQCManagementParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
|
|
|
|
|
|
|
for (BusinessAssayProjectAndParameterRespVO p : plist) {
|
|
|
|
|
|
|
|
map.put("p" + p.getDicId(), p);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
datas.add(map);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<BusinessQCCoefficientDataDO> businessQCCoefficientDataDOList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
|
|
|
|
|
|
|
|
for (BusinessQCCoefficientDataDO businessQCCoefficientData: businessQCCoefficientDataDOList) {
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashedMap<>();
|
|
|
|
|
|
|
|
map.put("businessAssayTaskDataId", businessQCCoefficientData.getId());
|
|
|
|
|
|
|
|
map.put("businessAssayTaskId", businessQCCoefficientData.getBusinessAssayTaskId());
|
|
|
|
|
|
|
|
map.put("businessSubSampleId", "");
|
|
|
|
|
|
|
|
map.put("businessSubParentSampleId", "");
|
|
|
|
|
|
|
|
map.put("configAssayMethodId", businessQCCoefficientData.getConfigAssayMethodId());
|
|
|
|
|
|
|
|
map.put("businessAssayTaskDetailId", "");
|
|
|
|
|
|
|
|
map.put("sampleCode", businessQCCoefficientData.getSampleCode());
|
|
|
|
|
|
|
|
map.put("sampleName", businessQCCoefficientData.getSampleName());
|
|
|
|
|
|
|
|
map.put("analysisType", businessQCCoefficientData.getDictionaryBusinessKey());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BusinessQCCoefficientParameterDataReqVO parameterDataSearch2 = new BusinessQCCoefficientParameterDataReqVO();
|
|
|
|
|
|
|
|
parameterDataSearch2.setBusinessQCCoefficientDataId(businessQCCoefficientData.getId());
|
|
|
|
|
|
|
|
List<BusinessAssayProjectAndParameterRespVO> plist2 = businessQCCoefficientParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch2);
|
|
|
|
|
|
|
|
for (BusinessAssayProjectAndParameterRespVO p : plist2) {
|
|
|
|
|
|
|
|
map.put("p" + p.getDicId(), p);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
datas.add(map);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, List<Map<String, Object>>> map = datas.stream().collect(Collectors.groupingBy(g -> (String) g.get("analysisType")));
|
|
|
|
|
|
|
|
for (Map.Entry<String, List<Map<String, Object>>> entry : map.entrySet()) {
|
|
|
|
|
|
|
|
resultJsonObject.put(entry.getKey(), entry.getValue());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return resultJsonObject;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void crossAuditByByTaskId(Long businessAssayTaskId, String auditStatus) {
|
|
|
|
public void crossAuditByByTaskId(Long businessAssayTaskId, String auditStatus) {
|
|
|
|
|
|
|
|
|
|
|
|
@@ -873,6 +1007,8 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|
|
|
return getParallelResultAssessment(businessSubSampleId, configAssayMethodId);
|
|
|
|
return getParallelResultAssessment(businessSubSampleId, configAssayMethodId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|