diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java index 19032a0..4e0db17 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java @@ -43,8 +43,8 @@ public class SampleResultReportingController implements BusinessControllerMarker //获取方法对应的样品 @GetMapping("/getSampleResultReportingList") - public CommonResult getSampleResultReportingList(Long configAssayMethodId) { - JSONObject result = sampleResultReportingService.getSampleResultReportingList(configAssayMethodId); + public CommonResult getSampleResultReportingList(BusinessSubParentSampleAssessmentGroupReqVO reqVO) { + JSONObject result = sampleResultReportingService.getSampleResultReportingList(reqVO); return success(result); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupReqVO.java index 8df8634..85cf363 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupReqVO.java @@ -1,5 +1,11 @@ package com.zt.plat.module.qms.business.bus.controller.vo; +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +import java.time.LocalDateTime; + +import org.springframework.format.annotation.DateTimeFormat; + import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -17,4 +23,8 @@ public class BusinessSubParentSampleAssessmentGroupReqVO { @Schema(description = "分析部门名称") private String assayDepartmentName; + + @Schema(description = "收样时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] sampleReceiveTime; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/NoReportSubParentSampleAssessmentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/NoReportSubParentSampleAssessmentRespVO.java index 6726322..a6de020 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/NoReportSubParentSampleAssessmentRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/NoReportSubParentSampleAssessmentRespVO.java @@ -1,5 +1,7 @@ package com.zt.plat.module.qms.business.bus.controller.vo; +import java.time.LocalDateTime; + import lombok.Data; @Data @@ -22,4 +24,7 @@ public class NoReportSubParentSampleAssessmentRespVO { private String taskType; private String assayType; + + + private LocalDateTime sampleReceiveTime; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java index 09232ae..a85a58f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java @@ -69,7 +69,7 @@ public interface BusinessSubParentSampleAssessmentProjectMapper extends BaseMapp .eq(BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId)); } - List selectNoReportSubParentSampleAssessment(@Param("configAssayMethodId") Long configAssayMethodId); + List selectNoReportSubParentSampleAssessment(@Param("reqVO") BusinessSubParentSampleAssessmentGroupReqVO reqVO); List getRecheckAssayMethodList(@Param("baseSampleId") Long baseSampleId, @Param("businessSubParentSampleId") Long businessSubParentSampleId, @Param("configAssayMethodId") Long configAssayMethodId); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingService.java index 3c33c1d..d57ed8c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingService.java @@ -14,7 +14,7 @@ public interface SampleResultReportingService { List getUnReportMethodGroupList(BusinessSubParentSampleAssessmentGroupReqVO reqVO); - JSONObject getSampleResultReportingList(Long configAssayMethodId); + JSONObject getSampleResultReportingList(BusinessSubParentSampleAssessmentGroupReqVO reqVO); List getRecheckAssayMethodList(Long baseSampleId, Long businessSubParentSampleId, Long configAssayMethodId); 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 1e1878a..8ff8048 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 @@ -115,8 +115,8 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe } @Override - public JSONObject getSampleResultReportingList(Long configAssayMethodId) { - List configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); + public JSONObject getSampleResultReportingList(BusinessSubParentSampleAssessmentGroupReqVO reqVO) { + List configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(reqVO.getConfigAssayMethodId()); List> columnList = new ArrayList<>(); //动态字段 @@ -136,7 +136,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe List> dataList = new ArrayList<>(); //查询结果报送未上报的样品 - List noReportSubParentSampleAssessmentRespList = businessSubParentSampleAssessmentProjectMapper.selectNoReportSubParentSampleAssessment(configAssayMethodId); + List noReportSubParentSampleAssessmentRespList = businessSubParentSampleAssessmentProjectMapper.selectNoReportSubParentSampleAssessment(reqVO); if (CollUtil.isEmpty(noReportSubParentSampleAssessmentRespList)) {//没有查询到未上报的数据 JSONObject json = new JSONObject(); @@ -148,18 +148,18 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe //分样id列表 List businessSubParentSampleIds = noReportSubParentSampleAssessmentRespList.stream().map(m -> m.getBusinessSubParentSampleId()).collect(Collectors.toList()); //报送的检测项目数据 - List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, reqVO.getConfigAssayMethodId()); //获取分析任务数 - List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, reqVO.getConfigAssayMethodId()); List businessSubSampleIds = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); //获取子样数据 List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIds); //获取结果判定数据 - List businessSubSampleAssessmentExtendRespVOList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + List businessSubSampleAssessmentExtendRespVOList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, reqVO.getConfigAssayMethodId()); //获取复测业务数据 - List businessSubSampleParentRecheckDOList = businessSubSampleParentRecheckMapper.selectByRecheckBusinessSubParentSampleIdsAndRecheckConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + List businessSubSampleParentRecheckDOList = businessSubSampleParentRecheckMapper.selectByRecheckBusinessSubParentSampleIdsAndRecheckConfigAssayMethodId(businessSubParentSampleIds, reqVO.getConfigAssayMethodId()); //循环未上报的样品 for (NoReportSubParentSampleAssessmentRespVO noReportSubParentSampleAssessmentRespVO : noReportSubParentSampleAssessmentRespList) { @@ -170,6 +170,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe Map subSampleAssessmentBeforeMap = BeanUtil.copyProperties(noReportSubParentSampleAssessmentMap, Map.class); Map subSampleAssessmentMap = BeanUtil.copyProperties(noReportSubParentSampleAssessmentMap, Map.class); List curBusinessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList()); + noReportSubParentSampleAssessmentMap.put("sampleReceiveTime", noReportSubParentSampleAssessmentRespVO.getSampleReceiveTime()); noReportSubParentSampleAssessmentMap.put("configAssayMethodName", "报出结果"); StringBuilder businessSubParentSampleAssessmentIds = new StringBuilder(); for (BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentDO : curBusinessSubParentSampleAssessmentDOList) { @@ -187,6 +188,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe List businessSubSampleAssessmentExtendBeforeList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubSampleParentRecheckDO.getBusinessSubParentSampleId(), businessSubSampleParentRecheckDO.getConfigAssayMethodId()); StringBuilder businessSubSampleAssessmentIdsBefore = new StringBuilder(); for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentExtendBeforeList) { + subSampleAssessmentBeforeMap.put("sampleReceiveTime", noReportSubParentSampleAssessmentRespVO.getSampleReceiveTime()); subSampleAssessmentBeforeMap.put("configAssayMethodName", businessSubSampleAssessmentProjectExtendRespVO.getConfigAssayMethodName()); subSampleAssessmentBeforeMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue()); businessSubSampleAssessmentIdsBefore.append(businessSubSampleAssessmentProjectExtendRespVO.getId()).append(","); @@ -202,6 +204,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe List businessSubSampleAssessmentList = businessSubSampleAssessmentExtendRespVOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList()); StringBuilder businessSubSampleAssessmentIds = new StringBuilder(); for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentList) { + subSampleAssessmentMap.put("sampleReceiveTime", noReportSubParentSampleAssessmentRespVO.getSampleReceiveTime()); subSampleAssessmentMap.put("configAssayMethodName", businessSubSampleAssessmentProjectExtendRespVO.getConfigAssayMethodName()); subSampleAssessmentMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue()); businessSubSampleAssessmentIds.append(businessSubSampleAssessmentProjectExtendRespVO.getId()).append(","); diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml index 8ed7baa..64ca649 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml @@ -31,6 +31,9 @@ tbssa.BSN_SB_PRN_SMP_ASMT_ID = tbspsa.ID LEFT JOIN T_CFG_ASY_MTHD tcam ON tbssa.CFG_ASY_MTHD_ID = tcam.ID + LEFT JOIN T_BSN_SB_SMP_ANL_GRP tbssag ON + tbssa.BSN_SB_SMP_ID = tbssag.BSN_SB_SMP_ID + AND tcam.ASY_DEPT_ID = tbssag.ASY_DEPT_ID WHERE tbssa.DELETED = 0 AND tbssa.RPOD_STS = 'reported' @@ -40,6 +43,9 @@ AND tcam.ASY_DEPT_ID = #{reqVO.assayDepartmentId} + + + AND tbssag.SMP_RCV_TM BETWEEN #{reqVO.sampleReceiveTime[0]} AND #{reqVO.sampleReceiveTime[1]} GROUP BY tbspsa.TENANT_ID , @@ -66,7 +72,8 @@ tbssa.ASY_TP AS assayType, tbsps.CFG_SB_SMP_PRN_ID AS configSubSampleParentId, tbsps.SMP_NAME AS sampleName, - tbs.NAME AS baseSampleName + tbs.NAME AS baseSampleName, + tbssag.SMP_RCV_TM AS sampleReceiveTime FROM T_BSN_SB_SMP_ASMT tbssa LEFT JOIN T_BSN_SB_PRN_SMP tbsps ON @@ -75,6 +82,11 @@ tbsps.CFG_SB_SMP_PRN_ID = tcssp.ID LEFT JOIN T_BSE_SMP tbs ON tcssp.BSE_SMP_ID = tbs.ID + LEFT JOIN T_CFG_ASY_MTHD tcam ON + tbssa.CFG_ASY_MTHD_ID = tcam.ID + LEFT JOIN T_BSN_SB_SMP_ANL_GRP tbssag ON + tbssa.BSN_SB_SMP_ID = tbssag.BSN_SB_SMP_ID + AND tcam.ASY_DEPT_ID = tbssag.ASY_DEPT_ID LEFT JOIN ( SELECT tbspsa.BSN_SB_PRN_SMP_ID , @@ -84,7 +96,7 @@ T_BSN_SB_PRN_SMP_ASMT tbspsa WHERE tbspsa.IS_RPOD = 0 - AND tbspsa.CFG_ASY_MTHD_ID = #{configAssayMethodId} + AND tbspsa.CFG_ASY_MTHD_ID = #{reqVO.configAssayMethodId} GROUP BY tbspsa.BSN_SB_PRN_SMP_ID , tbspsa.CFG_ASY_MTHD_ID , @@ -94,7 +106,10 @@ WHERE tbssa.IS_RPOD = 1 AND t.IS_RPOD = 0 - AND tbssa.CFG_ASY_MTHD_ID = #{configAssayMethodId} + AND tbssa.CFG_ASY_MTHD_ID = #{reqVO.configAssayMethodId} + + AND tbssag.SMP_RCV_TM BETWEEN #{reqVO.sampleReceiveTime[0]} AND #{reqVO.sampleReceiveTime[1]} + GROUP BY tcssp.BSE_SMP_ID , tbsps.BSN_BSE_SMP_ID , @@ -104,7 +119,8 @@ tbssa.ASY_TP , tbsps.CFG_SB_SMP_PRN_ID, tbsps.SMP_NAME , - tbs.NAME + tbs.NAME, + tbssag.SMP_RCV_TM