diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentProjectDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentProjectDO.java index 91d8df9..266478f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentProjectDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentProjectDO.java @@ -38,6 +38,11 @@ public class BusinessSubParentSampleAssessmentProjectDO extends BusinessBaseDO { @TableField("BSN_SB_PRN_SMP_ID") private Long businessSubParentSampleId; /** + * 班组判定数据业务ID + */ + @TableField("BSN_SB_PRN_SMP_ASMT_ID") + private Long businessSubParentSampleAssessmentId; + /** * 检测项目ID,字典表【T_DIC_PRJ】 */ @TableField("DIC_PRJ_ID") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.java index bd5b3e2..1116eda 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.java @@ -34,5 +34,18 @@ public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX() + .eq(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleId) + .eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default List selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List businessSubParentSampleIds, + Long configAssayMethodId) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds) + .eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java index 5333459..13376e6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java @@ -37,7 +37,7 @@ public interface BusinessSubSampleAssessmentMapper extends BaseMapperX() .eq(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, businessSubSampleId) .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java index 2ab1511..3675d80 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java @@ -209,6 +209,20 @@ public interface BusinessSubSampleMapper extends BaseMapperX() + .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, BusinessSubSampleDO::getDictionaryBusinessId) + .leftJoin(ConfigSubSampleDO.class, ConfigSubSampleDO::getId, BusinessSubSampleDO::getConfigSubSampleId) + .selectAll(BusinessSubSampleDO.class) + .selectAs(DictionaryBusinessDO::getName, BusinessSubSampleExtendRespVO::getDictionaryBusinessName) + .selectAs(ConfigSubSampleDO::getIsPrint, BusinessSubSampleExtendRespVO::getIsPrint) + .selectAs(ConfigSubSampleDO::getPrintTemplate, BusinessSubSampleExtendRespVO::getPrintTemplate) + .eqIfPresent(BusinessSubSampleDO::getSampleCode, reqVO.getSampleCode()) + .eqIfPresent(BusinessSubSampleDO::getSampleStatus, QmsCommonConstant.NORMAL) + .eqIfPresent(BusinessSubSampleDO::getIsEnabled, QmsCommonConstant.YES) + .orderByDesc(BusinessSubSampleDO::getId)); + } + default BusinessSubSampleExtendRespVO getBySampleCodeAndFlowKey(BusinessSubSampleReqVO reqVO) { return selectJoinOne(BusinessSubSampleExtendRespVO.class, new MPJLambdaWrapperX() .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, BusinessSubSampleDO::getDictionaryBusinessId) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java index 05a9fc3..4daa516 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java @@ -202,13 +202,16 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { @Override public BusinessSubSampleExtendRespVO getBySampleCodeAndFlowKey(@Valid BusinessSubSampleReqVO reqVO) { LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); - BusinessSubSampleExtendRespVO subSample = businessSubSampleMapper.getBySampleCodeAndFlowKey(reqVO); + BusinessSubSampleExtendRespVO subSample = null; if (QmsCommonConstant.FLOW_NODE_TEAM_RECEIVE.equals(reqVO.getSampleFlowNodeKey())) { + subSample = businessSubSampleMapper.getBySampleCode(reqVO); List businessSubSampleAnalysisGroupList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleId(subSample.getId()); BusinessSubSampleAnalysisGroupDO receiveSample = businessSubSampleAnalysisGroupList.stream().filter(f -> "已收样".equals(f.getSampleStatus()) && !f.getAssayDepartmentId().equals(loginUser.getVisitDeptId())).findFirst().orElse(null); if (receiveSample != null) { throw new ServiceException(1_032_100_000, "当前样品在" + receiveSample.getAssayDepartmentName() + ",不允许收样!"); } + } else { + subSample = businessSubSampleMapper.getBySampleCodeAndFlowKey(reqVO); } return subSample; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java index 4790f06..fc903c0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java @@ -41,6 +41,7 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetai 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.BusinessSubParentSampleAssessmentProjectDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; @@ -58,6 +59,7 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParam 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.BusinessSubParentSampleAssessmentProjectMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper; @@ -725,6 +727,9 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic @Resource private BusinessSubParentSampleMapper businessSubParentSampleMapper; + @Resource + private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper; + @Resource private BusinessSubParentSampleAssessmentProjectMapper businessSubParentSampleAssessmentProjectMapper; @@ -740,9 +745,8 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic if (unReportedList.size() > 0) { throw new ServiceException(1_032_100_000, "存在未上报的数据"); } + //自动上报 List automaticBusinessSubParentSampleIdList = new ArrayList<>(); -// List saveBusinessAssayReportDataDOList = new ArrayList<>(); -// List updateBusinessAssayReportDataDOList = new ArrayList<>(); List businessSubParentSampleAssessmentDOList = new ArrayList<>(); @@ -758,18 +762,23 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic //查询主样 BusinessBaseSampleDO businessBaseSampleDO = businessBaseSampleMapper.selectById(businessAssayTaskDataDO.getBusinessBaseSampleId()); -// List businessSubParentSampleIdList = reportedList.stream().map(m -> m.getBusinessSubParentSampleId()).distinct().collect(Collectors.toList()); - //查询分样 BusinessSubParentSampleDO businessSubParentSampleDO = businessSubParentSampleMapper.selectById(businessAssayTaskDataDO.getBusinessSubParentSampleId()); //查询分样对应的方法 ConfigSubSampleParentMethodDO configSubSampleParentMethodDO = configSubSampleParentMethodMapper.selectByConfigSubSampleParentIdAndConfigAssayMethodId(businessSubParentSampleDO.getConfigSubSampleParentId(), configAssayMethodId); + //子样判定 + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); + + //分样判定 + BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleDO.getId(), configAssayMethodId); + //循环判定值 BusinessSubParentSampleAssessmentProjectDO businessSubParentSampleAssessmentProjectDO = null; for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { businessSubParentSampleAssessmentProjectDO = new BusinessSubParentSampleAssessmentProjectDO(); + businessSubParentSampleAssessmentProjectDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId()); businessSubParentSampleAssessmentProjectDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); businessSubParentSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.NORMAL); businessSubParentSampleAssessmentProjectDO.setAssessmentValue(businessSubSampleAssessment.getAssessmentValue()); @@ -787,101 +796,18 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic } - /** - //查询报表 - List businessAssayReportDataDOList = businessAssayReportDataMapper.selectBytBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId()); - - ConfigSampleReportReqVO configSampleReportSearch = new ConfigSampleReportReqVO(); - configSampleReportSearch.setConfigBaseSampleId(businessBaseSampleDO.getConfigBaseSampleId()); - List configSampleReportList = configSampleReportMapper.selectList(configSampleReportSearch); - - List configReportTypeIdList = configSampleReportList.stream().map(m -> m.getConfigReportTypeId()).collect(Collectors.toList()); - - //查询动态和计算的报表字段 - List configReportFieldList = configReportFieldMapper.selectByConfigReportTypeIds(configReportTypeIdList, Arrays.asList(QmsCommonConstant.FIELD_DYNAMIC, QmsCommonConstant.FIELD_CALCULATED)); - //动态报表字段 - List configReportFieldDynamicList = configReportFieldList.stream().filter(f -> QmsCommonConstant.FIELD_DYNAMIC.equals(f.getFieldType())).collect(Collectors.toList()); - //根据检测方法查询字段配置 - List configProjectList = configProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); - - - for (ConfigSampleReportExtendRespVO configSampleReport : configSampleReportList) { - BusinessAssayReportDataDO businessAssayReportDataDO = businessAssayReportDataDOList.stream().filter(f -> f.getConfigReportTypeId().equals(configSampleReport.getConfigReportTypeId()) && f.getConfigSampleReportId().equals(configSampleReport.getId())).findFirst().orElse(null); - if (businessAssayReportDataDO == null) { - businessAssayReportDataDO = new BusinessAssayReportDataDO(); - businessAssayReportDataDO.setBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId()); - businessAssayReportDataDO.setConfigReportTypeId(configSampleReport.getConfigReportTypeId()); - businessAssayReportDataDO.setConfigSampleReportId(configSampleReport.getId()); - businessAssayReportDataDO.setSampleCode(businessBaseSampleDO.getSampleCode()); - - saveBusinessAssayReportDataDOList.add(businessAssayReportDataDO); - } else { - updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO); - } - JSONObject assayDataJson = new JSONObject(); - String assayData = businessAssayReportDataDO.getAssayData(); - if (StringUtils.isNotBlank(assayData)) { - assayDataJson = JSON.parseObject(assayData); - } - //循环判定值 - for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { - Long configAssayMethodProjectId = businessSubSampleAssessment.getConfigAssayMethodProjectId(); - List configProjectFeildList = configProjectList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectId)).collect(Collectors.toList()); - for (ConfigProjectExtendRespVO configProjectFeild : configProjectFeildList) { - //查询动态报表字段 - ConfigReportFieldDO configReportField = configReportFieldDynamicList.stream().filter(f -> f.getConfigReportTypeId().equals(configSampleReport.getConfigReportTypeId()) && f.getField().equals(configProjectFeild.getSaveColumn())).findFirst().orElse(null); - - if (configReportField == null) { - continue; - } - - ReportFieldValueData reportFieldValueData = new ReportFieldValueData(); - reportFieldValueData.setFieldName(configReportField.getFieldName()); - reportFieldValueData.setFieldValue(businessSubSampleAssessment.getAssessmentValue()); - reportFieldValueData.setDataType(configReportField.getDataType()); - reportFieldValueData.setMathSymbol("="); - reportFieldValueData.setUnit(configProjectFeild.getDictionaryProjectUnit()); - assayDataJson.put(configReportField.getField(), reportFieldValueData); - } - } - businessAssayReportDataDO.setAssayData(assayDataJson.toJSONString()); - - //修改已上报数据来源 - String dataSource = businessAssayReportDataDO.getDataSource(); - Set dataSources = StringUtils.isBlank(dataSource) ? new HashSet<>() : new HashSet<>(Arrays.asList(dataSource.split(","))); - String reportedSource = businessAssayReportDataDO.getReportedSource(); - ReportedDataSource reportedDataSource = null; - if (StringUtils.isNotBlank(reportedSource)) { - reportedDataSource = JSON.parseObject(reportedSource, ReportedDataSource.class); - } else { - reportedDataSource = new ReportedDataSource(); - } - reportedDataSource.addDataSource(configAssayMethodId.toString(), nickName, LocalDateTime.now()); - Set busDataSources = reportedDataSource.getDetails().stream().map(m -> m.getSourceCode()).collect(Collectors.toSet()); - if (busDataSources.size() == dataSources.size() && busDataSources.equals(dataSources)) { - businessAssayReportDataDO.setIsAllReported(QmsCommonConstant.YES); - } - if (busDataSources.size() > 0) { - //计算 - // TODO - } - businessAssayReportDataDO.setReportedSource(JSON.toJSONString(reportedDataSource)); - - } - - - if (saveBusinessAssayReportDataDOList.size() > 0) { - businessAssayReportDataMapper.insertBatch(saveBusinessAssayReportDataDOList); - } - if (updateBusinessAssayReportDataDOList.size() > 0) { - businessAssayReportDataMapper.updateBatch(updateBusinessAssayReportDataDOList); - } - **/ - if (businessSubParentSampleAssessmentDOList.size() > 0) { businessSubParentSampleAssessmentProjectMapper.insertBatch(businessSubParentSampleAssessmentDOList); } + //修改子样判定为已上报 + businessSubSampleAssessmentDO.setIsReported(QmsCommonConstant.YES); + businessSubSampleAssessmentDO.setReporter(nickName); + businessSubSampleAssessmentDO.setReportTime(LocalDateTime.now()); + businessSubSampleAssessmentDO.setReportedStatus(QmsCommonConstant.ASMT_REPORTED); + + businessSubSampleAssessmentMapper.updateById(businessSubSampleAssessmentDO); + businessSubSampleAssessmentProjectMapper.update(new LambdaUpdateWrapper() .set(BusinessSubSampleAssessmentProjectDO::getIsReported, QmsCommonConstant.YES) .set(BusinessSubSampleAssessmentProjectDO::getReporter, nickName) @@ -894,7 +820,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic batchResultDataReportingReqVO.setBusinessSubParentSampleIds(automaticBusinessSubParentSampleIdList); batchResultDataReportingReqVO.setConfigAssayMethodId(configAssayMethodId); - sampleResultReportingService.batchResultDataReporting(null); + sampleResultReportingService.batchResultDataReporting(batchResultDataReportingReqVO); } } @@ -923,7 +849,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic List newBusinessAssayProjectDataDOList = new ArrayList<>(); List newBusinessAssayParameterDataDOList = new ArrayList<>(); - BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdsAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); BusinessAssayTaskDataDO newBusinessAssayTaskDataDO = null; List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectMaxAnalysisCountByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); @@ -1085,6 +1011,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic throw new ServiceException(1_032_100_000, "超差判定计算出错,检测项目ID: " + businessSubSampleAssessmentProjectDO.getDictionaryProjectId()); } + businessSubSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.NORMAL); // 判断相邻差值是否超差 for (int i = 0; i < sortedValues.size() - 1; i++) { BigDecimal diff = sortedValues.get(i + 1).subtract(sortedValues.get(i)).abs(); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java index f33c3c1..28c308f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java @@ -36,6 +36,7 @@ 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.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; 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; @@ -47,6 +48,7 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMa import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper; 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; @@ -409,6 +411,9 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe @Resource private BusinessSubSampleAnalysisGroupMapper businessSubSampleAnalysisGroupMapper; + + @Resource + private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper; @Resource private SampleFlowService sampleFlowService; @@ -429,7 +434,9 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe List businessSubParentSampleAssessmentExtendList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId()); - List businessSubParentSampleDOList = businessSubParentSampleMapper.selectByIds(reqVO.getBusinessSubParentSampleIds()); + List businessSubParentSampleDOList = businessSubParentSampleMapper.selectByIds(reqVO.getBusinessSubParentSampleIds()); + +// List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId()); //循环分样主样数据 for (BusinessSubParentSampleDO businessSubParentSampleDO : businessSubParentSampleDOList) { @@ -565,12 +572,20 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe } List businessSubParentSampleAssessmentIdList = businessSubParentSampleAssessmentExtendList.stream().map(m -> m.getId()).collect(Collectors.toList()); - + businessSubParentSampleAssessmentProjectMapper.update(new LambdaUpdateWrapper() .set(BusinessSubParentSampleAssessmentProjectDO::getIsReported, QmsCommonConstant.YES) .set(BusinessSubParentSampleAssessmentProjectDO::getReporter, nickName) .set(BusinessSubParentSampleAssessmentProjectDO::getReportTime, LocalDateTime.now()) .in(BusinessSubParentSampleAssessmentProjectDO::getId, businessSubParentSampleAssessmentIdList)); + + businessSubParentSampleAssessmentMapper.update(new LambdaUpdateWrapper() + .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 (updateBusinessSubSampleDOList.size() > 0) {