|
|
|
|
@@ -49,6 +49,7 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampl
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentProjectDO;
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO;
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO;
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO;
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentProjectDO;
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO;
|
|
|
|
|
@@ -63,6 +64,7 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAss
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentProjectMapper;
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper;
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAnalysisGroupMapper;
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper;
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentProjectMapper;
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
|
|
|
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleParentRecheckMapper;
|
|
|
|
|
@@ -100,9 +102,15 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|
|
|
|
@Resource
|
|
|
|
|
private BusinessAssayTaskDataMapper businessAssayTaskDataMapper;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private BusinessSubParentSampleAssessmentProjectMapper businessSubParentSampleAssessmentProjectMapper;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private BusinessSubSampleAssessmentMapper businessSubSampleAssessmentMapper;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private BusinessSubSampleAssessmentProjectMapper businessSubSampleAssessmentProjectMapper;
|
|
|
|
|
|
|
|
|
|
@@ -313,6 +321,8 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public void createRecheckSample(RecheckSubSampleParentCreateReqVO reqVO) {
|
|
|
|
|
|
|
|
|
|
List<BusinessSubParentSampleAssessmentDO> newSubParentSampleAssessmentDOList = new ArrayList<>();
|
|
|
|
|
List<BusinessSubSampleAssessmentDO> newSubSampleAssessmentDOList = new ArrayList<>();
|
|
|
|
|
List<BusinessAssayTaskDataDO> newBusinessAssayTaskDataDOList = new ArrayList<>();
|
|
|
|
|
List<BusinessAssayProjectDataDO> newBusinessAssayProjectDataDOList = new ArrayList<>();
|
|
|
|
|
List<BusinessAssayParameterDataDO> newBusinessAssayParameterDataDOList = new ArrayList<>();
|
|
|
|
|
@@ -330,7 +340,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|
|
|
|
List<BusinessSubParentSampleAssessmentProjectDO> businessSubParentSampleAssessmentProjectDOList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleAssessmentIdAndDictionaryProjectIds(businessSubParentSampleAssessmentDO.getId(), recheckDictionaryProjectIdList);
|
|
|
|
|
for (BusinessSubParentSampleAssessmentProjectDO businessSubParentSampleAssessmentProjectDO : businessSubParentSampleAssessmentProjectDOList) {
|
|
|
|
|
businessSubParentSampleAssessmentProjectDO.setIsReported(QmsCommonConstant.NO);
|
|
|
|
|
businessSubParentSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.IN_PROGRESS);
|
|
|
|
|
businessSubParentSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.VOID);
|
|
|
|
|
businessSubParentSampleAssessmentProjectDO.setAssessmentValue(null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -371,6 +381,33 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|
|
|
|
//根据任务数判断是平行还是
|
|
|
|
|
String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
|
|
|
|
|
|
|
|
|
|
BusinessSubParentSampleAssessmentDO newBusinessSubParentSampleAssessmentDO = newSubParentSampleAssessmentDOList.stream().filter(f -> businessSubSampleDO.getBusinessSubParentSampleId().equals(f.getBusinessSubParentSampleId()) && configAssayMethodId.equals(f.getConfigAssayMethodId()) && "复测".equals(f.getTaskType())).findFirst().orElse(null);
|
|
|
|
|
if (newBusinessSubParentSampleAssessmentDO == null) {
|
|
|
|
|
newBusinessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO();
|
|
|
|
|
newBusinessSubParentSampleAssessmentDO.setId(IdWorker.getId());
|
|
|
|
|
newBusinessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
|
|
|
newBusinessSubParentSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodId);
|
|
|
|
|
newBusinessSubParentSampleAssessmentDO.setAssayType(assayType);
|
|
|
|
|
newBusinessSubParentSampleAssessmentDO.setTaskType("复测");
|
|
|
|
|
newSubParentSampleAssessmentDOList.add(newBusinessSubParentSampleAssessmentDO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BusinessSubSampleAssessmentDO newBusinessSubSampleAssessmentDO = newSubSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleAssessmentId().equals(businessSubParentSampleAssessmentDO.getId())).findFirst().orElse(null);
|
|
|
|
|
if (newBusinessSubSampleAssessmentDO == null) {
|
|
|
|
|
newBusinessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO();
|
|
|
|
|
newBusinessSubSampleAssessmentDO.setId(IdWorker.getId());
|
|
|
|
|
newBusinessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
|
|
|
|
newBusinessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
|
|
|
newBusinessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
|
|
|
|
newBusinessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(newBusinessSubParentSampleAssessmentDO.getId());
|
|
|
|
|
newBusinessSubSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodId);
|
|
|
|
|
newBusinessSubSampleAssessmentDO.setAssayType(assayType);
|
|
|
|
|
newBusinessSubSampleAssessmentDO.setTaskType("复测");
|
|
|
|
|
|
|
|
|
|
newSubSampleAssessmentDOList.add(newBusinessSubSampleAssessmentDO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据任务数循环
|
|
|
|
|
for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) {
|
|
|
|
|
//子样检测任务
|
|
|
|
|
@@ -379,6 +416,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|
|
|
|
businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
|
|
|
|
businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
|
|
|
businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
|
|
|
|
businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(newBusinessSubSampleAssessmentDO.getId());
|
|
|
|
|
businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId);
|
|
|
|
|
businessAssayTaskDataDO.setAssayType(assayType);
|
|
|
|
|
businessAssayTaskDataDO.setTaskType("复测");
|
|
|
|
|
@@ -404,8 +442,11 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|
|
|
|
businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId());
|
|
|
|
|
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
|
|
|
|
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
|
|
|
|
businessAssayProjectDataDO.setIsEnabled(1);
|
|
|
|
|
businessAssayProjectDataDO.setIsNotAssessment(0);
|
|
|
|
|
businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT);
|
|
|
|
|
|
|
|
|
|
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
|
|
|
|
businessAssayProjectDataDO.setIsEnabled(QmsCommonConstant.YES);
|
|
|
|
|
businessAssayProjectDataDO.setIsNotAssessment(QmsCommonConstant.NO);
|
|
|
|
|
|
|
|
|
|
newBusinessAssayProjectDataDOList.add(businessAssayProjectDataDO);
|
|
|
|
|
|
|
|
|
|
@@ -435,6 +476,15 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|
|
|
|
if (CollUtil.isNotEmpty(businessSubParentSampleAssessmentProjectDOList)) {
|
|
|
|
|
businessSubParentSampleAssessmentProjectMapper.updateBatch(businessSubParentSampleAssessmentProjectDOList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(newSubParentSampleAssessmentDOList)) {
|
|
|
|
|
businessSubParentSampleAssessmentMapper.insertBatch(newSubParentSampleAssessmentDOList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(newSubSampleAssessmentDOList)) {
|
|
|
|
|
businessSubSampleAssessmentMapper.insertBatch(newSubSampleAssessmentDOList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(newBusinessAssayTaskDataDOList)) {
|
|
|
|
|
businessAssayTaskDataMapper.insertBatch(newBusinessAssayTaskDataDOList);
|
|
|
|
|
}
|
|
|
|
|
@@ -470,9 +520,6 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|
|
|
|
@Resource
|
|
|
|
|
private BusinessSubSampleAnalysisGroupMapper businessSubSampleAnalysisGroupMapper;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private BusinessSampleEntrustRegistrationMapper businessSampleEntrustRegistrationMapper;
|
|
|
|
|
|
|
|
|
|
@@ -703,12 +750,12 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|
|
|
|
//查询正常上报的
|
|
|
|
|
List<Long> businessSubParentSampleAssessmentIdList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> "normal".equals(f.getAssessmentStatus())).map(m -> m.getId()).collect(Collectors.toList());
|
|
|
|
|
//查询未上报的分样主id
|
|
|
|
|
List<Long> noAllReportBusinessSubParentSampleIdList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> "in_progress".equals(f.getAssessmentStatus())).map(m -> m.getBusinessSubParentSampleId()).distinct().collect(Collectors.toList());
|
|
|
|
|
// List<Long> noAllReportBusinessSubParentSampleIdList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> "in_progress".equals(f.getAssessmentStatus())).map(m -> m.getBusinessSubParentSampleId()).distinct().collect(Collectors.toList());
|
|
|
|
|
//全部上报的
|
|
|
|
|
List<Long> allReportBusinessSubParentSampleIdList = new ArrayList<>();
|
|
|
|
|
if (noAllReportBusinessSubParentSampleIdList.size() > 0) {
|
|
|
|
|
reqVO.getBusinessSubParentSampleIds().stream().filter(item -> noAllReportBusinessSubParentSampleIdList.contains(item)).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
// List<Long> allReportBusinessSubParentSampleIdList = new ArrayList<>();
|
|
|
|
|
// if (noAllReportBusinessSubParentSampleIdList != null) {
|
|
|
|
|
// allReportBusinessSubParentSampleIdList = reqVO.getBusinessSubParentSampleIds().stream().filter(item -> !noAllReportBusinessSubParentSampleIdList.contains(item)).collect(Collectors.toList());
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
businessSubParentSampleAssessmentProjectMapper.update(new LambdaUpdateWrapper<BusinessSubParentSampleAssessmentProjectDO>()
|
|
|
|
|
.set(BusinessSubParentSampleAssessmentProjectDO::getIsReported, QmsCommonConstant.YES)
|
|
|
|
|
@@ -716,14 +763,20 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|
|
|
|
.set(BusinessSubParentSampleAssessmentProjectDO::getReportTime, LocalDateTime.now())
|
|
|
|
|
.in(BusinessSubParentSampleAssessmentProjectDO::getId, businessSubParentSampleAssessmentIdList));
|
|
|
|
|
|
|
|
|
|
if (allReportBusinessSubParentSampleIdList.size() > 0) {
|
|
|
|
|
businessSubParentSampleAssessmentMapper.update(new LambdaUpdateWrapper<BusinessSubParentSampleAssessmentDO>()
|
|
|
|
|
.set(BusinessSubParentSampleAssessmentDO::getIsReported, QmsCommonConstant.YES)
|
|
|
|
|
.set(BusinessSubParentSampleAssessmentDO::getReporter, nickName)
|
|
|
|
|
.set(BusinessSubParentSampleAssessmentDO::getReportTime, LocalDateTime.now())
|
|
|
|
|
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, allReportBusinessSubParentSampleIdList)
|
|
|
|
|
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()));
|
|
|
|
|
}
|
|
|
|
|
// if (allReportBusinessSubParentSampleIdList.size() > 0) {
|
|
|
|
|
// businessSubParentSampleAssessmentMapper.update(new LambdaUpdateWrapper<BusinessSubParentSampleAssessmentDO>()
|
|
|
|
|
// .set(BusinessSubParentSampleAssessmentDO::getIsReported, QmsCommonConstant.YES)
|
|
|
|
|
// .set(BusinessSubParentSampleAssessmentDO::getReporter, nickName)
|
|
|
|
|
// .set(BusinessSubParentSampleAssessmentDO::getReportTime, LocalDateTime.now())
|
|
|
|
|
// .in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, allReportBusinessSubParentSampleIdList)
|
|
|
|
|
// .eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()));
|
|
|
|
|
// }
|
|
|
|
|
businessSubParentSampleAssessmentMapper.update(new LambdaUpdateWrapper<BusinessSubParentSampleAssessmentDO>()
|
|
|
|
|
.set(BusinessSubParentSampleAssessmentDO::getIsReported, QmsCommonConstant.YES)
|
|
|
|
|
.set(BusinessSubParentSampleAssessmentDO::getReporter, nickName)
|
|
|
|
|
.set(BusinessSubParentSampleAssessmentDO::getReportTime, LocalDateTime.now())
|
|
|
|
|
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleIds())
|
|
|
|
|
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()));
|
|
|
|
|
|
|
|
|
|
if (updatebBusinessSampleEntrustRegistrationDOList.size() > 0) {
|
|
|
|
|
businessSampleEntrustRegistrationMapper.updateBatch(updatebBusinessSampleEntrustRegistrationDOList);
|
|
|
|
|
|