From 5657f8cf093c5a5e8be00a60a47f3f47e6065f52 Mon Sep 17 00:00:00 2001 From: FCL Date: Tue, 25 Nov 2025 09:34:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:qms=E9=98=B6=E6=AE=B5=E6=80=A7=E6=8F=90?= =?UTF-8?q?=E4=BA=A4:=E6=A3=80=E9=AA=8C=E6=B5=81=E7=A8=8B=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E3=80=81=E6=8A=A5=E5=91=8A=E3=80=81=E6=A0=B7=E5=93=81?= =?UTF-8?q?=E5=BA=93=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessSampleDispatchController.java | 16 +- ...usinessSampleDispatchDetailController.java | 6 +- ...ssSubParentSampleAssessmentController.java | 14 +- ...rentSampleAssessmentProjectController.java | 106 +++++ ...BusinessSubSampleAssessmentController.java | 35 +- ...sSubSampleAssessmentProjectController.java | 108 +++++ .../admin/BusinessSubSampleController.java | 15 + .../admin/SampleAnalysisAuditController.java | 6 +- .../admin/SampleFlowController.java | 6 +- .../SampleResultReportingController.java | 4 +- .../admin/SampleTaskAssignController.java | 4 +- .../vo/BusinessAssayTaskDataExtendRespVO.java | 6 + .../vo/BusinessAssayTaskDataGroupRespVO.java | 14 + .../vo/BusinessAssayTaskDataPageReqVO.java | 3 + .../vo/BusinessAssayTaskDataReqVO.java | 8 + .../vo/BusinessAssayTaskDataRespVO.java | 3 + .../vo/BusinessAssayTaskDataSaveReqVO.java | 3 + .../vo/BusinessAssayTaskPageReqVO.java | 5 + .../BusinessHandoverRecordSubPageReqVO.java | 1 + ...BusinessSampleDispatchDetailPageReqVO.java | 4 +- .../vo/BusinessSampleDispatchPageReqVO.java | 6 + .../vo/BusinessSampleDispatchRespVO.java | 8 + .../vo/BusinessSampleDispatchSaveReqVO.java | 6 + ...essSampleEntrustRegistrationPageReqVO.java | 2 + .../vo/BusinessSampleHandoverPageReqVO.java | 2 + ...ssSubParentSampleAssessmentGroupReqVO.java | 20 + ...sSubParentSampleAssessmentGroupRespVO.java | 9 + ...essSubParentSampleAssessmentPageReqVO.java | 37 +- ...ntSampleAssessmentProjectExtendRespVO.java | 23 ++ ...arentSampleAssessmentProjectPageReqVO.java | 78 ++++ ...ubParentSampleAssessmentProjectRespVO.java | 94 +++++ ...arentSampleAssessmentProjectSaveReqVO.java | 84 ++++ ...sinessSubParentSampleAssessmentRespVO.java | 57 +-- ...essSubParentSampleAssessmentSaveReqVO.java | 56 +-- .../BusinessSubSampleAssessmentPageReqVO.java | 49 +-- ...ubSampleAssessmentProjectExtendRespVO.java | 24 ++ ...ssSubSampleAssessmentProjectPageReqVO.java | 84 ++++ ...inessSubSampleAssessmentProjectRespVO.java | 103 +++++ ...ssSubSampleAssessmentProjectSaveReqVO.java | 90 ++++ .../vo/BusinessSubSampleAssessmentRespVO.java | 68 ++-- .../BusinessSubSampleAssessmentSaveReqVO.java | 65 +-- .../vo/BusinessSubSampleExtendRespVO.java | 40 ++ .../vo/BusinessSubSamplePageReqVO.java | 23 +- .../controller/vo/BusinessSubSampleReqVO.java | 5 + .../vo/BusinessSubSampleRespVO.java | 3 + .../vo/BusinessSubSampleSaveReqVO.java | 3 + .../dataobject/BusinessAssayTaskDataDO.java | 11 +- .../dataobject/BusinessSampleDispatchDO.java | 9 +- .../BusinessSubParentSampleAssessmentDO.java | 47 +-- ...essSubParentSampleAssessmentProjectDO.java | 136 +++++++ .../BusinessSubSampleAssessmentDO.java | 67 ++- .../BusinessSubSampleAssessmentProjectDO.java | 141 +++++++ .../dal/dataobject/BusinessSubSampleDO.java | 5 + .../mapper/BusinessAssayTaskDataMapper.java | 68 ++-- .../dal/mapper/BusinessAssayTaskMapper.java | 4 + .../BusinessHandoverRecordSubMapper.java | 1 + .../BusinessSampleDispatchDetailMapper.java | 2 +- ...sinessSampleEntrustRegistrationMapper.java | 1 + .../mapper/BusinessSampleHandoverMapper.java | 1 + ...sinessSubParentSampleAssessmentMapper.java | 46 +-- ...ubParentSampleAssessmentProjectMapper.java | 77 ++++ .../BusinessSubSampleAnalysisGroupMapper.java | 20 + .../BusinessSubSampleAssessmentMapper.java | 80 +--- ...inessSubSampleAssessmentProjectMapper.java | 102 +++++ .../dal/mapper/BusinessSubSampleMapper.java | 93 ++++- .../SampleEntrustGenSampleDataCmp.java | 81 +++- .../sample/flow/SampleSimpleEncryptCmp.java | 1 + .../flow/SampleSubProcessUpdateCmp.java | 20 +- .../BusinessAssayTaskDataServiceImpl.java | 6 +- .../BusinessSampleDispatchServiceImpl.java | 7 +- ...bParentSampleAssessmentProjectService.java | 62 +++ ...entSampleAssessmentProjectServiceImpl.java | 86 ++++ ...sSubParentSampleAssessmentServiceImpl.java | 5 + ...nessSubSampleAssessmentProjectService.java | 66 +++ ...SubSampleAssessmentProjectServiceImpl.java | 93 +++++ .../BusinessSubSampleAssessmentService.java | 22 +- ...usinessSubSampleAssessmentServiceImpl.java | 12 +- .../bus/service/BusinessSubSampleService.java | 12 +- .../service/BusinessSubSampleServiceImpl.java | 131 +++++- .../service/SampleAnalysisAuditService.java | 2 +- .../SampleAnalysisAuditServiceImpl.java | 385 +++++++++--------- .../service/SampleResultReportingService.java | 3 +- .../SampleResultReportingServiceImpl.java | 149 +++++-- .../bus/service/SampleTaskAssignService.java | 2 +- .../service/SampleTaskAssignServiceImpl.java | 4 +- .../admin/ConfigReportTemplateController.java | 2 +- .../vo/ConfigSubSamplePageReqVO.java | 9 + .../controller/vo/ConfigSubSampleRespVO.java | 12 + .../vo/ConfigSubSampleSaveReqVO.java | 11 + .../dal/dataobject/ConfigSubSampleDO.java | 15 + .../dal/mapper/ConfigSubSampleMapper.java | 4 + .../service/ConfigPermissionService.java | 2 +- .../service/ConfigPermissionServiceImpl.java | 29 +- .../admin/ReportDocumentMainController.java | 10 +- .../vo/ReportDocumentMainRespVO.java | 6 + .../dal/mapper/ReportDocumentMainMapper.java | 11 +- .../service/ReportDocumentDataService.java | 1 + .../ReportDocumentDataServiceImpl.java | 119 +++++- .../service/ReportDocumentMainService.java | 2 +- .../ReportDocumentMainServiceImpl.java | 2 +- .../ReportDocumentTypeServiceImpl.java | 10 +- .../admin/DataTemplateController.java | 2 +- .../config/DataPermissionConfiguration.java | 12 +- .../admin/AutoIngredientsController.java | 53 +++ .../AutoIngredientsTaskAssayResultReqVO.java | 17 + ...IngredientsTaskDetailAssayResultReqVO.java | 47 +++ .../vo/AutoIngredientsTaskDetailRespVO.java | 44 ++ .../vo/AutoIngredientsTaskQueryReqVO.java | 43 ++ .../vo/AutoIngredientsTaskRespVO.java | 44 ++ .../service/AutoIngredientsService.java | 32 ++ .../service/AutoIngredientsServiceImpl.java | 79 ++++ .../mapper/BusinessAssayTaskDataMapper.xml | 81 +++- ...usinessSubParentSampleAssessmentMapper.xml | 106 ----- ...SubParentSampleAssessmentProjectMapper.xml | 128 ++++++ ...sinessSubSampleAssessmentProjectMapper.xml | 12 + .../dal/mapper/BusinessSubSampleMapper.xml | 79 ++++ .../src/main/resources/删/application-dev.yml | 2 +- .../main/resources/删/application-local1.yml | 97 +++++ .../src/main/resources/删/application.yml | 2 +- 119 files changed, 3617 insertions(+), 974 deletions(-) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentProjectController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentProjectController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentProjectDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentProjectDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentProjectMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentProjectService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentProjectServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentProjectService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentProjectServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/AutoIngredientsController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskAssayResultReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskDetailAssayResultReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskDetailRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskQueryReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentProjectMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/删/application-local1.yml diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java index 4625cc5..e4bdc09 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java @@ -64,19 +64,19 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke return success(true); } - @PutMapping("/addOrRemoveSample") + @PostMapping("/addOrRemoveSample") @Operation(summary = "增加或移除样品") public CommonResult addOrRemoveSample(@Valid @RequestBody BusinessSampleDispatchSaveReqVO updateReqVO) { businessSampleDispatchService.addOrRemoveSample(updateReqVO); return success(true); } - @PutMapping("/addBySampleCode") - @Operation(summary = "增加或移除样品") - public CommonResult addBySampleCode(HttpServletRequest request) { - String id = request.getParameter("id"); - String sampleCode = request.getParameter("sampleCode"); - BusinessSubSampleDO businessSubSampleDO = businessSubSampleService.getBySampleCode(sampleCode); + @PostMapping("/addBySampleReturnCode") + @Operation(summary = "按归库码增加样品") + public CommonResult addBySampleReturnCode(@RequestBody JSONObject param) { + String id = param.getString("id"); + String sampleReturnCode = param.getString("sampleReturnCode"); + BusinessSubSampleDO businessSubSampleDO = businessSubSampleService.getBySampleReturnCode(sampleReturnCode); if(businessSubSampleDO == null) return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到此样品!"); //判断样品状态 @@ -88,6 +88,8 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke if("1".equals(dispatchStatus)){ return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已被调拨:请归还后再调拨!"); } + //todo 重复校验 + List sampleIds = new ArrayList<>(); sampleIds.add(businessSubSampleDO.getId()); BusinessSampleDispatchSaveReqVO updateReqVO = new BusinessSampleDispatchSaveReqVO(); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchDetailController.java index d70ec9f..fcec9ee 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchDetailController.java @@ -50,11 +50,11 @@ public class BusinessSampleDispatchDetailController implements BusinessControlle @GetMapping("/searchBySampleCode") @Operation(summary = "扫码查询待归还样品") public CommonResult searchBySampleCode(HttpServletRequest request) { - String sampleCode = request.getParameter("sampleCode"); - if(ObjectUtils.isEmpty(sampleCode)) + String sampleReturnCode = request.getParameter("sampleReturnCode"); + if(ObjectUtils.isEmpty(sampleReturnCode)) return CommonResult.error(BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS.getCode(), "请输入样品编号!"); BusinessSampleDispatchDetailPageReqVO reqVO = new BusinessSampleDispatchDetailPageReqVO(); - reqVO.setSampleCode(sampleCode); + reqVO.setSampleReturnCode(sampleReturnCode); reqVO.setBorrowStatus("1"); reqVO.setGivebackStatus("0"); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentController.java index 3772c1e..30831b8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentController.java @@ -42,14 +42,14 @@ public class BusinessSubParentSampleAssessmentController implements BusinessCont @PostMapping("/create") @Operation(summary = "创建班组判定数据业务") - //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:create')") + @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:create')") public CommonResult createBusinessSubParentSampleAssessment(@Valid @RequestBody BusinessSubParentSampleAssessmentSaveReqVO createReqVO) { return success(businessSubParentSampleAssessmentService.createBusinessSubParentSampleAssessment(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新班组判定数据业务") - //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:update')") + @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:update')") public CommonResult updateBusinessSubParentSampleAssessment(@Valid @RequestBody BusinessSubParentSampleAssessmentSaveReqVO updateReqVO) { businessSubParentSampleAssessmentService.updateBusinessSubParentSampleAssessment(updateReqVO); return success(true); @@ -58,7 +58,7 @@ public class BusinessSubParentSampleAssessmentController implements BusinessCont @DeleteMapping("/delete") @Operation(summary = "删除班组判定数据业务") @Parameter(name = "id", description = "编号", required = true) - //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:delete')") + @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:delete')") public CommonResult deleteBusinessSubParentSampleAssessment(@RequestParam("id") Long id) { businessSubParentSampleAssessmentService.deleteBusinessSubParentSampleAssessment(id); return success(true); @@ -67,7 +67,7 @@ public class BusinessSubParentSampleAssessmentController implements BusinessCont @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除班组判定数据业务") - //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:delete')") + @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:delete')") public CommonResult deleteBusinessSubParentSampleAssessmentList(@RequestBody BatchDeleteReqVO req) { businessSubParentSampleAssessmentService.deleteBusinessSubParentSampleAssessmentListByIds(req.getIds()); return success(true); @@ -76,7 +76,7 @@ public class BusinessSubParentSampleAssessmentController implements BusinessCont @GetMapping("/get") @Operation(summary = "获得班组判定数据业务") @Parameter(name = "id", description = "编号", required = true, example = "1024") - //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:query')") + @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:query')") public CommonResult getBusinessSubParentSampleAssessment(@RequestParam("id") Long id) { BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessment = businessSubParentSampleAssessmentService.getBusinessSubParentSampleAssessment(id); return success(BeanUtils.toBean(businessSubParentSampleAssessment, BusinessSubParentSampleAssessmentRespVO.class)); @@ -84,7 +84,7 @@ public class BusinessSubParentSampleAssessmentController implements BusinessCont @GetMapping("/page") @Operation(summary = "获得班组判定数据业务分页") - //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:query')") + @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:query')") public CommonResult> getBusinessSubParentSampleAssessmentPage(@Valid BusinessSubParentSampleAssessmentPageReqVO pageReqVO) { PageResult pageResult = businessSubParentSampleAssessmentService.getBusinessSubParentSampleAssessmentPage(pageReqVO); return success(BeanUtils.toBean(pageResult, BusinessSubParentSampleAssessmentRespVO.class)); @@ -92,7 +92,7 @@ public class BusinessSubParentSampleAssessmentController implements BusinessCont @GetMapping("/export-excel") @Operation(summary = "导出班组判定数据业务 Excel") - //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:export')") + @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessSubParentSampleAssessmentExcel(@Valid BusinessSubParentSampleAssessmentPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentProjectController.java new file mode 100644 index 0000000..d6e9225 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentProjectController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentProjectDO; +import com.zt.plat.module.qms.business.bus.service.BusinessSubParentSampleAssessmentProjectService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 班组判定检测项目数据业务") +@RestController +@RequestMapping("/qms/business-sub-parent-sample-assessment-project") +@Validated +public class BusinessSubParentSampleAssessmentProjectController implements BusinessControllerMarker { + + + @Resource + private BusinessSubParentSampleAssessmentProjectService businessSubParentSampleAssessmentProjectService; + + @PostMapping("/create") + @Operation(summary = "创建班组判定检测项目数据业务") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:create')") + public CommonResult createBusinessSubParentSampleAssessment(@Valid @RequestBody BusinessSubParentSampleAssessmentProjectSaveReqVO createReqVO) { + return success(businessSubParentSampleAssessmentProjectService.createBusinessSubParentSampleAssessment(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新班组判定检测项目数据业务") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:update')") + public CommonResult updateBusinessSubParentSampleAssessment(@Valid @RequestBody BusinessSubParentSampleAssessmentProjectSaveReqVO updateReqVO) { + businessSubParentSampleAssessmentProjectService.updateBusinessSubParentSampleAssessment(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除班组判定检测项目数据业务") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:delete')") + public CommonResult deleteBusinessSubParentSampleAssessment(@RequestParam("id") Long id) { + businessSubParentSampleAssessmentProjectService.deleteBusinessSubParentSampleAssessment(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除班组判定检测项目数据业务") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:delete')") + public CommonResult deleteBusinessSubParentSampleAssessmentList(@RequestBody BatchDeleteReqVO req) { + businessSubParentSampleAssessmentProjectService.deleteBusinessSubParentSampleAssessmentListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得班组判定检测项目数据业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:query')") + public CommonResult getBusinessSubParentSampleAssessment(@RequestParam("id") Long id) { + BusinessSubParentSampleAssessmentProjectDO businessSubParentSampleAssessment = businessSubParentSampleAssessmentProjectService.getBusinessSubParentSampleAssessment(id); + return success(BeanUtils.toBean(businessSubParentSampleAssessment, BusinessSubParentSampleAssessmentProjectRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得班组判定检测项目数据业务分页") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:query')") + public CommonResult> getBusinessSubParentSampleAssessmentPage(@Valid BusinessSubParentSampleAssessmentProjectPageReqVO pageReqVO) { + PageResult pageResult = businessSubParentSampleAssessmentProjectService.getBusinessSubParentSampleAssessmentPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessSubParentSampleAssessmentProjectRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出班组判定检测项目数据业务 Excel") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessSubParentSampleAssessmentExcel(@Valid BusinessSubParentSampleAssessmentProjectPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessSubParentSampleAssessmentProjectService.getBusinessSubParentSampleAssessmentPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "班组判定检测项目数据业务.xls", "数据", BusinessSubParentSampleAssessmentProjectRespVO.class, + BeanUtils.toBean(list, BusinessSubParentSampleAssessmentProjectRespVO.class)); + } + +} \ 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/controller/admin/BusinessSubSampleAssessmentController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentController.java index 78e9696..de60e89 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentController.java @@ -1,8 +1,5 @@ package com.zt.plat.module.qms.business.bus.controller.admin; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentPageReqVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentRespVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -32,7 +29,7 @@ import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleAssessmentSe import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; -@Tag(name = "管理后台 - 子样判定数据业务") +@Tag(name = "管理后台 - 子样判定业务") @RestController @RequestMapping("/qms/business-sub-sample-assessment") @Validated @@ -43,24 +40,24 @@ public class BusinessSubSampleAssessmentController implements BusinessController private BusinessSubSampleAssessmentService businessSubSampleAssessmentService; @PostMapping("/create") - @Operation(summary = "创建子样判定数据业务") - //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:create')") + @Operation(summary = "创建子样判定业务") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:create')") public CommonResult createBusinessSubSampleAssessment(@Valid @RequestBody BusinessSubSampleAssessmentSaveReqVO createReqVO) { return success(businessSubSampleAssessmentService.createBusinessSubSampleAssessment(createReqVO)); } @PutMapping("/update") - @Operation(summary = "更新子样判定数据业务") - //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:update')") + @Operation(summary = "更新子样判定业务") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:update')") public CommonResult updateBusinessSubSampleAssessment(@Valid @RequestBody BusinessSubSampleAssessmentSaveReqVO updateReqVO) { businessSubSampleAssessmentService.updateBusinessSubSampleAssessment(updateReqVO); return success(true); } @DeleteMapping("/delete") - @Operation(summary = "删除子样判定数据业务") + @Operation(summary = "删除子样判定业务") @Parameter(name = "id", description = "编号", required = true) - //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:delete')") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:delete')") public CommonResult deleteBusinessSubSampleAssessment(@RequestParam("id") Long id) { businessSubSampleAssessmentService.deleteBusinessSubSampleAssessment(id); return success(true); @@ -68,40 +65,40 @@ public class BusinessSubSampleAssessmentController implements BusinessController @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) - @Operation(summary = "批量删除子样判定数据业务") - //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:delete')") + @Operation(summary = "批量删除子样判定业务") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:delete')") public CommonResult deleteBusinessSubSampleAssessmentList(@RequestBody BatchDeleteReqVO req) { businessSubSampleAssessmentService.deleteBusinessSubSampleAssessmentListByIds(req.getIds()); return success(true); } @GetMapping("/get") - @Operation(summary = "获得子样判定数据业务") + @Operation(summary = "获得子样判定业务") @Parameter(name = "id", description = "编号", required = true, example = "1024") - //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:query')") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:query')") public CommonResult getBusinessSubSampleAssessment(@RequestParam("id") Long id) { BusinessSubSampleAssessmentDO businessSubSampleAssessment = businessSubSampleAssessmentService.getBusinessSubSampleAssessment(id); return success(BeanUtils.toBean(businessSubSampleAssessment, BusinessSubSampleAssessmentRespVO.class)); } @GetMapping("/page") - @Operation(summary = "获得子样判定数据业务分页") - //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:query')") + @Operation(summary = "获得子样判定业务分页") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:query')") public CommonResult> getBusinessSubSampleAssessmentPage(@Valid BusinessSubSampleAssessmentPageReqVO pageReqVO) { PageResult pageResult = businessSubSampleAssessmentService.getBusinessSubSampleAssessmentPage(pageReqVO); return success(BeanUtils.toBean(pageResult, BusinessSubSampleAssessmentRespVO.class)); } @GetMapping("/export-excel") - @Operation(summary = "导出子样判定数据业务 Excel") - //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:export')") + @Operation(summary = "导出子样判定业务 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessSubSampleAssessmentExcel(@Valid BusinessSubSampleAssessmentPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); List list = businessSubSampleAssessmentService.getBusinessSubSampleAssessmentPage(pageReqVO).getList(); // 导出 Excel - ExcelUtils.write(response, "子样判定数据业务.xls", "数据", BusinessSubSampleAssessmentRespVO.class, + ExcelUtils.write(response, "子样判定业务.xls", "数据", BusinessSubSampleAssessmentRespVO.class, BeanUtils.toBean(list, BusinessSubSampleAssessmentRespVO.class)); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentProjectController.java new file mode 100644 index 0000000..5705318 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentProjectController.java @@ -0,0 +1,108 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentProjectSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentProjectDO; +import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleAssessmentProjectService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 子样判定检测项目数据业务") +@RestController +@RequestMapping("/qms/business-sub-sample-assessment-project") +@Validated +public class BusinessSubSampleAssessmentProjectController implements BusinessControllerMarker { + + + @Resource + private BusinessSubSampleAssessmentProjectService businessSubSampleAssessmentProjectService; + + @PostMapping("/create") + @Operation(summary = "创建子样判定检测项目数据业务") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:create')") + public CommonResult createBusinessSubSampleAssessment(@Valid @RequestBody BusinessSubSampleAssessmentProjectSaveReqVO createReqVO) { + return success(businessSubSampleAssessmentProjectService.createBusinessSubSampleAssessment(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新子样判定检测项目数据业务") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:update')") + public CommonResult updateBusinessSubSampleAssessment(@Valid @RequestBody BusinessSubSampleAssessmentProjectSaveReqVO updateReqVO) { + businessSubSampleAssessmentProjectService.updateBusinessSubSampleAssessment(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除子样判定检测项目数据业务") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:delete')") + public CommonResult deleteBusinessSubSampleAssessment(@RequestParam("id") Long id) { + businessSubSampleAssessmentProjectService.deleteBusinessSubSampleAssessment(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除子样判定检测项目数据业务") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:delete')") + public CommonResult deleteBusinessSubSampleAssessmentList(@RequestBody BatchDeleteReqVO req) { + businessSubSampleAssessmentProjectService.deleteBusinessSubSampleAssessmentListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得子样判定检测项目数据业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:query')") + public CommonResult getBusinessSubSampleAssessment(@RequestParam("id") Long id) { + BusinessSubSampleAssessmentProjectDO businessSubSampleAssessment = businessSubSampleAssessmentProjectService.getBusinessSubSampleAssessment(id); + return success(BeanUtils.toBean(businessSubSampleAssessment, BusinessSubSampleAssessmentProjectRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得子样判定检测项目数据业务分页") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:query')") + public CommonResult> getBusinessSubSampleAssessmentPage(@Valid BusinessSubSampleAssessmentProjectPageReqVO pageReqVO) { + PageResult pageResult = businessSubSampleAssessmentProjectService.getBusinessSubSampleAssessmentPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessSubSampleAssessmentProjectRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出子样判定检测项目数据业务 Excel") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessSubSampleAssessmentExcel(@Valid BusinessSubSampleAssessmentProjectPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessSubSampleAssessmentProjectService.getBusinessSubSampleAssessmentPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "子样判定检测项目数据业务.xls", "数据", BusinessSubSampleAssessmentProjectRespVO.class, + BeanUtils.toBean(list, BusinessSubSampleAssessmentProjectRespVO.class)); + } + +} \ 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/controller/admin/BusinessSubSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java index 2681015..6b45a6d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java @@ -106,6 +106,14 @@ public class BusinessSubSampleController implements BusinessControllerMarker { return success(pageResult); } + @GetMapping("/page-analysis-group") + @Operation(summary = "获得子样分析部门分页") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')") + public CommonResult> getAnalysisGroupPage(@Valid BusinessSubSamplePageReqVO pageReqVO) { + PageResult pageResult = businessSubSampleService.getAnalysisGroupPage(pageReqVO); + return success(pageResult); + } + @GetMapping("/page-stock") @Operation(summary = "查询样品库分页数据") public CommonResult> pageStock(@Valid BusinessSubSamplePageReqVO pageReqVO) { @@ -113,6 +121,13 @@ public class BusinessSubSampleController implements BusinessControllerMarker { return success(pageResult); } + @GetMapping("/selectPageForDispatch") + @Operation(summary = "查询可申请调拨子样") + public CommonResult> selectPageForDispatch(@Valid BusinessSubSamplePageReqVO pageReqVO) { + PageResult pageResult = businessSubSampleService.selectPageForDispatch(pageReqVO); + return success(pageResult); + } + @GetMapping("/page-task") @Operation(summary = "获得子样业务分页") //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java index 5b0c23d..33884a3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java @@ -47,10 +47,8 @@ public class SampleAnalysisAuditController { } @GetMapping("/getSampleResultAssessmentList") - public CommonResult getSampleResultAssessmentList(Long configAssayMethodId, String assessmentStatus) { - - JSONObject result = sampleAnalysisAuditService.getSampleResultAssessmentList(configAssayMethodId, assessmentStatus); - + public CommonResult getSampleResultAssessmentList(Long configAssayMethodId, String asmtReportedStatus) { + JSONObject result = sampleAnalysisAuditService.getSampleResultAssessmentList(configAssayMethodId, asmtReportedStatus); return success(result); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java index e1589a8..534d90f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java @@ -146,9 +146,9 @@ public class SampleFlowController { flowNodeList.add(fx); bzs.setNextFlowNodeList(new ArrayList<>() {{ - add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("样品当前分析班组结果超差,需要发起复检")); - add(BeanUtils.toBean(bzr,SampleFlowNode.class).setCondition("当前部门数据已全部判断上报")); - add(BeanUtils.toBean(ypgk,SampleFlowNode.class).setCondition("当前样品所有分析任务已全部上报完")); +// add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("样品当前分析班组结果超差,需要发起复检")); + add(BeanUtils.toBean(bzr,SampleFlowNode.class).setCondition("subSampleSelfReportedOthersPending"));//当前部门数据已全部判断上报 + add(BeanUtils.toBean(ypgk,SampleFlowNode.class).setCondition("subSampleAlldeptAnalyzed"));//当前样品所有分析任务已全部上报完 }}); flowNodeList.add(bzs); 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 a12cc29..ea4f0c1 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 @@ -35,8 +35,8 @@ public class SampleResultReportingController { //获取未上报的方法 @GetMapping("/getUnReportMethodGroupList") - public CommonResult getUnReportMethodGroupList() { - List list = sampleResultReportingService.getUnReportMethodGroupList(); + public CommonResult getUnReportMethodGroupList(BusinessSubParentSampleAssessmentGroupReqVO reqVO) { + List list = sampleResultReportingService.getUnReportMethodGroupList(reqVO); return success(list); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java index bb028ae..f9db69b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java @@ -40,8 +40,8 @@ public class SampleTaskAssignController { } @GetMapping("/getAssaySampleList") - public CommonResult getAssaySampleList() { - List list = sampleTaskAssignService.getAssaySampleList(); + public CommonResult getAssaySampleList(BusinessAssayTaskDataReqVO reqVO) { + List list = sampleTaskAssignService.getAssaySampleList(reqVO); return success(list); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java index 07d8ee4..b7a252a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java @@ -29,4 +29,10 @@ public class BusinessAssayTaskDataExtendRespVO extends BusinessAssayTaskDataResp @Schema(description = "任务单模板key") private String configReportTemplateKey; + + private Integer asmtIsReported; + + private Integer asmtIsRecheck; + + private String asmtReportedStatus; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataGroupRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataGroupRespVO.java index 8a9e48f..98186e0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataGroupRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataGroupRespVO.java @@ -13,4 +13,18 @@ public class BusinessAssayTaskDataGroupRespVO { private Integer sampleTaskCount; + /** 判定未完 **/ + private Integer asmtInitialCount; + + /** 判定待上报 **/ + private Integer asmtPendingReportCount; + + /** 判定待判定 **/ + private Integer asmtPendingAssessmentCount; + + /** 判定复测 **/ + private Integer asmtReInspectedCount; + + /** 判定已上报 **/ + private Integer asmtReportedCount; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java index f635d7a..70dcea3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java @@ -22,6 +22,9 @@ public class BusinessAssayTaskDataPageReqVO extends PageParam { @Schema(description = "分样子样ID", example = "20464") private Long businessSubSampleId; + @Schema(description = "分样子样判定ID", example = "14560") + private Long businessSubSampleAssessmentId; + @Schema(description = "检测方法配置ID", example = "9130") private Long configAssayMethodId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java index eb5545f..c91101a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java @@ -22,6 +22,9 @@ public class BusinessAssayTaskDataReqVO { @Schema(description = "分样子样ID", example = "20464") private Long businessSubSampleId; + @Schema(description = "分样子样判定ID", example = "14560") + private Long businessSubSampleAssessmentId; + @Schema(description = "检测方法配置ID", example = "9130") private Long configAssayMethodId; @@ -88,5 +91,10 @@ public class BusinessAssayTaskDataReqVO { @Schema(description = "备注") private String remark; + + //=== 扩展字段,判定上报状态 + @Schema(description = "判定上报状态") + private String asmtReportedStatus; + } \ 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/controller/vo/BusinessAssayTaskDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java index bb92eed..fb3dfc9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java @@ -28,6 +28,9 @@ public class BusinessAssayTaskDataRespVO { @ExcelProperty("分样子样ID") private Long businessSubSampleId; + @Schema(description = "分样子样判定ID", example = "14560") + private Long businessSubSampleAssessmentId; + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9130") @ExcelProperty("检测方法配置ID") private Long configAssayMethodId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java index bd7fa13..b825997 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java @@ -26,6 +26,9 @@ public class BusinessAssayTaskDataSaveReqVO { @NotNull(message = "分样子样ID不能为空") private Long businessSubSampleId; + @Schema(description = "分样子样判定ID", example = "14560") + private Long businessSubSampleAssessmentId; + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9130") @NotNull(message = "检测方法配置ID不能为空") private Long configAssayMethodId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java index 65d3703..4e31fc1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java @@ -107,4 +107,9 @@ public class BusinessAssayTaskPageReqVO extends PageParam { @Schema(description = "备注") private String remark; + @Schema(description = "不等于当前分析人") + private String neAssayOperator; + + @Schema(description = "部门id") + private Long deptId; } \ 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/controller/vo/BusinessHandoverRecordSubPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubPageReqVO.java index 9872acf..783c9a5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubPageReqVO.java @@ -64,4 +64,5 @@ public class BusinessHandoverRecordSubPageReqVO extends PageParam { @Schema(description = "备注") private String remark; + private Long deptId; } \ 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/controller/vo/BusinessSampleDispatchDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailPageReqVO.java index 4e2d30e..681174a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailPageReqVO.java @@ -60,8 +60,8 @@ public class BusinessSampleDispatchDetailPageReqVO extends PageParam { //================================扩展字段============================================= - @Schema(description = "样品号") - private String sampleCode; + @Schema(description = "样品归库码") + private String sampleReturnCode; @Schema(description = "idsList") private List idList; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchPageReqVO.java index 78ebfdc..5468cb9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchPageReqVO.java @@ -64,6 +64,12 @@ public class BusinessSampleDispatchPageReqVO extends PageParam { @Schema(description = "备注") private String remark; + @Schema(description = "仓库名称") + private String warehouseName; + + @Schema(description = "仓库编码") + private String warehouseCode; + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchRespVO.java index 5cc4f43..d7f3a31 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchRespVO.java @@ -83,6 +83,14 @@ public class BusinessSampleDispatchRespVO { @ExcelProperty("备注") private String remark; + @Schema(description = "仓库名称") + @ExcelProperty("仓库名称") + private String warehouseName; + + @Schema(description = "仓库编码") + @ExcelProperty("仓库编码") + private String warehouseCode; + @Schema(description = "创建时间") @ExcelProperty("创建时间") private LocalDateTime createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchSaveReqVO.java index 221b983..e8b4508 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchSaveReqVO.java @@ -64,6 +64,12 @@ public class BusinessSampleDispatchSaveReqVO { @Schema(description = "备注") private String remark; + @Schema(description = "仓库名称") + private String warehouseName; + + @Schema(description = "仓库编码") + private String warehouseCode; + //=========================扩展字段======================================= @Schema(description = "新增子样id") List addSubSampleIds; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationPageReqVO.java index 9b2e59d..26e7757 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationPageReqVO.java @@ -151,6 +151,8 @@ public class BusinessSampleEntrustRegistrationPageReqVO extends PageParam { @Schema(description = "备注") private String remark; + @Schema(description = "部门id") + private Long deptId; //====================扩展字段====================== @Schema(description = "委托来源名称") private String configEntrustSourceName; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverPageReqVO.java index 637fa35..26ea231 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverPageReqVO.java @@ -60,4 +60,6 @@ public class BusinessSampleHandoverPageReqVO extends PageParam { @Schema(description = "备注") private String remark; + private Long deptId; + } \ 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/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 new file mode 100644 index 0000000..8df8634 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupReqVO.java @@ -0,0 +1,20 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BusinessSubParentSampleAssessmentGroupReqVO { + + @Schema(description = "分析方法id") + private Long configAssayMethodId; + + @Schema(description = "分析方法名称") + private String configAssayMethodName; + + @Schema(description = "分析部门ID") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称") + private String assayDepartmentName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupRespVO.java index 08373a7..f4f69cf 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupRespVO.java @@ -1,13 +1,22 @@ package com.zt.plat.module.qms.business.bus.controller.vo; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data public class BusinessSubParentSampleAssessmentGroupRespVO { + @Schema(description = "分析方法id") private Long configAssayMethodId; + @Schema(description = "分析方法名称") private String configAssayMethodName; + @Schema(description = "分析部门ID") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称") + private String assayDepartmentName; + private Integer sampleCount; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentPageReqVO.java index b0ba2e4..b52abe4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentPageReqVO.java @@ -13,45 +13,21 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessSubParentSampleAssessmentPageReqVO extends PageParam { - @Schema(description = "样品分样ID", example = "23188") + @Schema(description = "样品分样ID", example = "25701") private Long businessSubParentSampleId; - @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "17642") - private Long dictionaryProjectId; - - @Schema(description = "检测方法分析项目配置ID", example = "7653") - private Long configAssayMethodProjectId; - - @Schema(description = "检测方法配置ID", example = "16271") + @Schema(description = "检测方法配置ID", example = "13131") private Long configAssayMethodId; - @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") - private String usage; - - @Schema(description = "符号,=、>、<、等") - private String symbol; - - @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "1") private String taskType; @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1") private String assayType; - @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") - private String dataType; - - @Schema(description = "小数位") - private Integer decimalPosition; - - @Schema(description = "判定值") - private String assessmentValue; - - @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "2") + @Schema(description = "判定状态,in_progress-进行中 normal-正常", example = "1") private String assessmentStatus; - @Schema(description = "方法检出下限值") - private String minimumLimitValue; - @Schema(description = "是否已上报") private Integer isReported; @@ -62,6 +38,9 @@ public class BusinessSubParentSampleAssessmentPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] reportTime; + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + private String resultTreatmentWay; + @Schema(description = "所属部门") private String systemDepartmentCode; @@ -69,7 +48,7 @@ public class BusinessSubParentSampleAssessmentPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "乐观锁", example = "16999") + @Schema(description = "乐观锁", example = "13008") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectExtendRespVO.java new file mode 100644 index 0000000..8d6001e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectExtendRespVO.java @@ -0,0 +1,23 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BusinessSubParentSampleAssessmentProjectExtendRespVO extends BusinessSubParentSampleAssessmentProjectRespVO { + + @Schema(description = "检测项目key") + private String dictionaryProjectKey; + + @Schema(description = "检测项目单位") + private String dictionaryProjectUnit; + + @Schema(description = "检测项目缩写") + private String simpleName; + + @Schema(description = "显示名称") + private String showName; + + @Schema(description = "分析方法") + private String configAssayMethodName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectPageReqVO.java new file mode 100644 index 0000000..b284293 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectPageReqVO.java @@ -0,0 +1,78 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 班组判定检测项目数据业务分页 Request VO") +@Data +public class BusinessSubParentSampleAssessmentProjectPageReqVO extends PageParam { + + @Schema(description = "样品分样ID", example = "23188") + private Long businessSubParentSampleId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "17642") + private Long dictionaryProjectId; + + @Schema(description = "检测方法分析项目配置ID", example = "7653") + private Long configAssayMethodProjectId; + + @Schema(description = "检测方法配置ID", example = "16271") + private Long configAssayMethodId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") + private String taskType; + + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1") + private String assayType; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "判定值") + private String assessmentValue; + + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "2") + private String assessmentStatus; + + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "16999") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ 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/controller/vo/BusinessSubParentSampleAssessmentProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectRespVO.java new file mode 100644 index 0000000..50f1eb4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectRespVO.java @@ -0,0 +1,94 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 班组判定检测项目数据业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessSubParentSampleAssessmentProjectRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5014") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23188") + @ExcelProperty("样品分样ID") + private Long businessSubParentSampleId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "17642") + @ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】") + private Long dictionaryProjectId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7653") + @ExcelProperty("检测方法分析项目配置ID") + private Long configAssayMethodProjectId; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16271") + @ExcelProperty("检测方法配置ID") + private Long configAssayMethodId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") + private String taskType; + + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1") + private String assayType; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "判定值") + @ExcelProperty("判定值") + private String assessmentValue; + + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差") + private String assessmentStatus; + + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + + @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否已上报") + private Integer isReported; + + @Schema(description = "上报人", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("上报人") + private String reporter; + + @Schema(description = "上报时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("上报时间") + private LocalDateTime reportTime; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "16999") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ 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/controller/vo/BusinessSubParentSampleAssessmentProjectSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectSaveReqVO.java new file mode 100644 index 0000000..78b1a6f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentProjectSaveReqVO.java @@ -0,0 +1,84 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 班组判定检测项目数据业务新增/修改 Request VO") +@Data +public class BusinessSubParentSampleAssessmentProjectSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5014") + private Long id; + + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23188") + @NotNull(message = "样品分样ID不能为空") + private Long businessSubParentSampleId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "17642") + @NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空") + private Long dictionaryProjectId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7653") + @NotNull(message = "检测方法分析项目配置ID不能为空") + private Long configAssayMethodProjectId; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16271") + @NotNull(message = "检测方法配置ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") + private String taskType; + + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1") + private String assayType; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "判定值") + private String assessmentValue; + + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差不能为空") + private String assessmentStatus; + + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + + @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否已上报不能为空") + private Integer isReported; + + @Schema(description = "上报人", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "上报人不能为空") + private String reporter; + + @Schema(description = "上报时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "上报时间不能为空") + private LocalDateTime reportTime; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "16999") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ 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/controller/vo/BusinessSubParentSampleAssessmentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentRespVO.java index 26572f0..d4155e5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentRespVO.java @@ -12,69 +12,46 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessSubParentSampleAssessmentRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5014") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29068") @ExcelProperty("ID") private Long id; - @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23188") + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25701") @ExcelProperty("样品分样ID") private Long businessSubParentSampleId; - @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "17642") - @ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】") - private Long dictionaryProjectId; - - @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7653") - @ExcelProperty("检测方法分析项目配置ID") - private Long configAssayMethodProjectId; - - @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16271") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13131") @ExcelProperty("检测方法配置ID") private Long configAssayMethodId; - @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") - private String usage; - - @Schema(description = "符号,=、>、<、等") - private String symbol; - - @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("任务类型,【字典】【jy_sample_task_type】常规、抽查...") private String taskType; - @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1") + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...") private String assayType; - @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") - private String dataType; - - @Schema(description = "小数位") - @ExcelProperty("小数位") - private Integer decimalPosition; - - @Schema(description = "判定值") - @ExcelProperty("判定值") - private String assessmentValue; - - @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @ExcelProperty("判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差") + @Schema(description = "判定状态,in_progress-进行中 normal-正常", example = "1") + @ExcelProperty("判定状态,in_progress-进行中 normal-正常") private String assessmentStatus; - @Schema(description = "方法检出下限值") - private String minimumLimitValue; - - @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "是否已上报") @ExcelProperty("是否已上报") private Integer isReported; - @Schema(description = "上报人", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "上报人") @ExcelProperty("上报人") private String reporter; - @Schema(description = "上报时间", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "上报时间") @ExcelProperty("上报时间") private LocalDateTime reportTime; + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + @ExcelProperty("结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + private String resultTreatmentWay; + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; @@ -83,7 +60,7 @@ public class BusinessSubParentSampleAssessmentRespVO { @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "16999") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "13008") @ExcelProperty("乐观锁") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentSaveReqVO.java index 436b51a..112d681 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentSaveReqVO.java @@ -11,70 +11,44 @@ import java.time.LocalDateTime; @Data public class BusinessSubParentSampleAssessmentSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5014") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29068") private Long id; - @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23188") + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25701") @NotNull(message = "样品分样ID不能为空") private Long businessSubParentSampleId; - @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "17642") - @NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空") - private Long dictionaryProjectId; - - @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7653") - @NotNull(message = "检测方法分析项目配置ID不能为空") - private Long configAssayMethodProjectId; - - @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16271") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13131") @NotNull(message = "检测方法配置ID不能为空") private Long configAssayMethodId; - @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") - private String usage; - - @Schema(description = "符号,=、>、<、等") - private String symbol; - - @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "任务类型,【字典】【jy_sample_task_type】常规、抽查...不能为空") private String taskType; - @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1") + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...不能为空") private String assayType; - @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") - private String dataType; - - @Schema(description = "小数位") - private Integer decimalPosition; - - @Schema(description = "判定值") - private String assessmentValue; - - @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotEmpty(message = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差不能为空") + @Schema(description = "判定状态,in_progress-进行中 normal-正常", example = "1") private String assessmentStatus; - @Schema(description = "方法检出下限值") - private String minimumLimitValue; - - @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "是否已上报不能为空") + @Schema(description = "是否已上报") private Integer isReported; - @Schema(description = "上报人", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "上报人不能为空") + @Schema(description = "上报人") private String reporter; - @Schema(description = "上报时间", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "上报时间不能为空") + @Schema(description = "上报时间") private LocalDateTime reportTime; + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + private String resultTreatmentWay; + @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "16999") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "13008") @NotNull(message = "乐观锁不能为空") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentPageReqVO.java index a46f4c5..2b315df 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentPageReqVO.java @@ -9,55 +9,37 @@ import java.time.LocalDateTime; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@Schema(description = "管理后台 - 子样判定数据业务分页 Request VO") +@Schema(description = "管理后台 - 子样判定业务分页 Request VO") @Data public class BusinessSubSampleAssessmentPageReqVO extends PageParam { - @Schema(description = "分样id") + @Schema(description = "样品分样ID", example = "29115") private Long businessSubParentSampleId; - - @Schema(description = "分样子样ID", example = "7025") + + @Schema(description = "分样子样ID", example = "30256") private Long businessSubSampleId; - @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "21744") - private Long dictionaryProjectId; - - @Schema(description = "检测方法分析项目配置ID", example = "14847") - private Long configAssayMethodProjectId; - - @Schema(description = "检测方法配置ID", example = "8091") + @Schema(description = "检测方法配置ID", example = "16304") private Long configAssayMethodId; - @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") - private String usage; - - @Schema(description = "符号,=、>、<、等") - private String symbol; - - @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "1") private String taskType; @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1") private String assayType; - @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "1") - private String dataType; - - @Schema(description = "小数位") - private Integer decimalPosition; - - @Schema(description = "判定值") - private String assessmentValue; - - @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "1") + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "2") private String assessmentStatus; - @Schema(description = "方法检出下限值") - private String minimumLimitValue; + @Schema(description = "是否复测,1-是,0-否") + private Integer isRecheck; - @Schema(description = "是否已上报") + @Schema(description = "是否已上报,1-是,0-否") private Integer isReported; + @Schema(description = "上报状态,初始状态-initial、待上报-pending_report、待判定-pending_assessment、已复检-re_inspected、已上报-reported", example = "1") + private String reportedStatus; + @Schema(description = "上报人") private String reporter; @@ -65,6 +47,9 @@ public class BusinessSubSampleAssessmentPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] reportTime; + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + private String resultTreatmentWay; + @Schema(description = "所属部门") private String systemDepartmentCode; @@ -72,7 +57,7 @@ public class BusinessSubSampleAssessmentPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "乐观锁", example = "12836") + @Schema(description = "乐观锁", example = "6438") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectExtendRespVO.java new file mode 100644 index 0000000..59e602a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectExtendRespVO.java @@ -0,0 +1,24 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BusinessSubSampleAssessmentProjectExtendRespVO extends BusinessSubSampleAssessmentProjectRespVO { + + /** 分析方法名称 **/ + @Schema(description = "分析方法名称") + private String configAssayMethodName; + + @Schema(description = "检测项目key") + private String dictionaryProjectKey; + + @Schema(description = "检测项目单位") + private String dictionaryProjectUnit; + + @Schema(description = "检测项目缩写") + private String simpleName; + + @Schema(description = "显示名称") + private String showName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectPageReqVO.java new file mode 100644 index 0000000..da7eb6d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectPageReqVO.java @@ -0,0 +1,84 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 子样判定检测项目数据业务分页 Request VO") +@Data +public class BusinessSubSampleAssessmentProjectPageReqVO extends PageParam { + + @Schema(description = "分样id") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", example = "7025") + private Long businessSubSampleId; + + @Schema(description = "分样子样判定ID", example = "14560") + private Long businessSubSampleAssessmentId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "21744") + private Long dictionaryProjectId; + + @Schema(description = "检测方法分析项目配置ID", example = "14847") + private Long configAssayMethodProjectId; + + @Schema(description = "检测方法配置ID", example = "8091") + private Long configAssayMethodId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") + private String taskType; + + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1") + private String assayType; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "判定值") + private String assessmentValue; + + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "1") + private String assessmentStatus; + + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "12836") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ 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/controller/vo/BusinessSubSampleAssessmentProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectRespVO.java new file mode 100644 index 0000000..57a5196 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectRespVO.java @@ -0,0 +1,103 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 子样判定检测项目数据业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessSubSampleAssessmentProjectRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23478") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "分样id") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7025") + @ExcelProperty("分样子样ID") + private Long businessSubSampleId; + + @Schema(description = "分样子样判定ID", example = "14560") + @ExcelProperty("分样子样判定ID") + private Long businessSubSampleAssessmentId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "21744") + @ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】") + private Long dictionaryProjectId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14847") + @ExcelProperty("检测方法分析项目配置ID") + private Long configAssayMethodProjectId; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8091") + @ExcelProperty("检测方法配置ID") + private Long configAssayMethodId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("任务类型,【字典】【jy_sample_task_type】常规、抽查...") + private String taskType; + + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...") + private String assayType; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "判定值") + @ExcelProperty("判定值") + private String assessmentValue; + + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "1") + @ExcelProperty("判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差") + private String assessmentStatus; + + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + + @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否已上报") + private Integer isReported; + + @Schema(description = "上报人", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("上报人") + private String reporter; + + @Schema(description = "上报时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("上报时间") + private LocalDateTime reportTime; + + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "12836") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ 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/controller/vo/BusinessSubSampleAssessmentProjectSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectSaveReqVO.java new file mode 100644 index 0000000..8d0ddbb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentProjectSaveReqVO.java @@ -0,0 +1,90 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 子样判定检测项目数据业务新增/修改 Request VO") +@Data +public class BusinessSubSampleAssessmentProjectSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23478") + private Long id; + + @Schema(description = "分样id") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7025") + @NotNull(message = "分样子样ID不能为空") + private Long businessSubSampleId; + + @Schema(description = "分样子样判定ID", example = "14560") + private Long businessSubSampleAssessmentId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "21744") + @NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空") + private Long dictionaryProjectId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14847") + @NotNull(message = "检测方法分析项目配置ID不能为空") + private Long configAssayMethodProjectId; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8091") + @NotNull(message = "检测方法配置ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "任务类型,【字典】【jy_sample_task_type】常规、抽查...不能为空") + private String taskType; + + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...不能为空") + private String assayType; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "判定值") + private String assessmentValue; + + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "1") + private String assessmentStatus; + + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + + @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否已上报不能为空") + private Integer isReported; + + @Schema(description = "上报人", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "上报人不能为空") + private String reporter; + + @Schema(description = "上报时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "上报时间不能为空") + private LocalDateTime reportTime; + + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + private String systemDepartmentCode; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "12836") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ 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/controller/vo/BusinessSubSampleAssessmentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentRespVO.java index 8a0b34a..9e13136 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentRespVO.java @@ -7,41 +7,28 @@ import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; -@Schema(description = "管理后台 - 子样判定数据业务 Response VO") +@Schema(description = "管理后台 - 子样判定业务 Response VO") @Data @ExcelIgnoreUnannotated public class BusinessSubSampleAssessmentRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23478") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5736") @ExcelProperty("ID") private Long id; - - @Schema(description = "分样id") + + @Schema(description = "样品分样ID", example = "29115") + @ExcelProperty("样品分样ID") private Long businessSubParentSampleId; - @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7025") + @Schema(description = "分样子样ID", example = "30256") @ExcelProperty("分样子样ID") private Long businessSubSampleId; - @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "21744") - @ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】") - private Long dictionaryProjectId; - - @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14847") - @ExcelProperty("检测方法分析项目配置ID") - private Long configAssayMethodProjectId; - - @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8091") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16304") @ExcelProperty("检测方法配置ID") private Long configAssayMethodId; - @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") - private String usage; - - @Schema(description = "符号,=、>、<、等") - private String symbol; - - @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @ExcelProperty("任务类型,【字典】【jy_sample_task_type】常规、抽查...") private String taskType; @@ -49,38 +36,33 @@ public class BusinessSubSampleAssessmentRespVO { @ExcelProperty("分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...") private String assayType; - @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") - private String dataType; - - @Schema(description = "小数位") - @ExcelProperty("小数位") - private Integer decimalPosition; - - @Schema(description = "判定值") - @ExcelProperty("判定值") - private String assessmentValue; - - @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "1") - @ExcelProperty("判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差") + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "2") + @ExcelProperty("判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差") private String assessmentStatus; - @Schema(description = "方法检出下限值") - private String minimumLimitValue; + @Schema(description = "是否复测,1-是,0-否") + @ExcelProperty("是否复测,1-是,0-否") + private Integer isRecheck; - @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("是否已上报") + @Schema(description = "是否已上报,1-是,0-否") + @ExcelProperty("是否已上报,1-是,0-否") private Integer isReported; - @Schema(description = "上报人", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "上报状态,初始状态-initial、待上报-pending_report、待判定-pending_assessment、已复检-re_inspected、已上报-reported", example = "1") + private String reportedStatus; + + @Schema(description = "上报人") @ExcelProperty("上报人") private String reporter; - @Schema(description = "上报时间", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "上报时间") @ExcelProperty("上报时间") private LocalDateTime reportTime; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + private String resultTreatmentWay; + + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; @@ -88,7 +70,7 @@ public class BusinessSubSampleAssessmentRespVO { @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "12836") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "6438") @ExcelProperty("乐观锁") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentSaveReqVO.java index 62f5df2..3c8a858 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentSaveReqVO.java @@ -7,39 +7,24 @@ import jakarta.validation.constraints.*; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; -@Schema(description = "管理后台 - 子样判定数据业务新增/修改 Request VO") +@Schema(description = "管理后台 - 子样判定业务新增/修改 Request VO") @Data public class BusinessSubSampleAssessmentSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23478") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5736") private Long id; - - @Schema(description = "分样id") + + @Schema(description = "样品分样ID", example = "29115") private Long businessSubParentSampleId; - @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7025") - @NotNull(message = "分样子样ID不能为空") + @Schema(description = "分样子样ID", example = "30256") private Long businessSubSampleId; - @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "21744") - @NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空") - private Long dictionaryProjectId; - - @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14847") - @NotNull(message = "检测方法分析项目配置ID不能为空") - private Long configAssayMethodProjectId; - - @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8091") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16304") @NotNull(message = "检测方法配置ID不能为空") private Long configAssayMethodId; - @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") - private String usage; - - @Schema(description = "符号,=、>、<、等") - private String symbol; - - @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotEmpty(message = "任务类型,【字典】【jy_sample_task_type】常规、抽查...不能为空") private String taskType; @@ -47,38 +32,32 @@ public class BusinessSubSampleAssessmentSaveReqVO { @NotEmpty(message = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...不能为空") private String assayType; - @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") - private String dataType; - - @Schema(description = "小数位") - private Integer decimalPosition; - - @Schema(description = "判定值") - private String assessmentValue; - - @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "1") + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "2") private String assessmentStatus; - @Schema(description = "方法检出下限值") - private String minimumLimitValue; + @Schema(description = "是否复测,1-是,0-否") + private Integer isRecheck; - @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "是否已上报不能为空") + @Schema(description = "是否已上报,1-是,0-否") private Integer isReported; - @Schema(description = "上报人", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "上报人不能为空") + @Schema(description = "上报状态,初始状态-initial、待上报-pending_report、待判定-pending_assessment、已复检-re_inspected、已上报-reported", example = "1") + private String reportedStatus; + + @Schema(description = "上报人") private String reporter; - @Schema(description = "上报时间", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "上报时间不能为空") + @Schema(description = "上报时间") private LocalDateTime reportTime; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + private String resultTreatmentWay; + + @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "12836") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "6438") + @NotNull(message = "乐观锁不能为空") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java index 81c345c..3439535 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java @@ -1,7 +1,11 @@ package com.zt.plat.module.qms.business.bus.controller.vo; import java.util.List; +import java.util.stream.Collectors; +import org.apache.commons.lang3.StringUtils; + +import cn.hutool.core.collection.CollUtil; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -17,6 +21,42 @@ public class BusinessSubSampleExtendRespVO extends BusinessSubSampleRespVO { @Schema(description = "子样检测方法") private List businessAssayTaskDataList; + + @Schema(description = "分析班组") + private List businessSubSampleAnalysisGroupList; + + @Schema(description = "样品去向") + private String sampleDestination; + + public String getSampleDestination() { + String _sampleDestination = null; + if (CollUtil.isNotEmpty(this.businessSubSampleAnalysisGroupList)) { + List collect = this.businessSubSampleAnalysisGroupList.stream().filter(f -> f.getSampleStatus().equals("待收样")).map(m -> m.getAssayDepartmentName()).collect(Collectors.toList()); + _sampleDestination = CollUtil.join(collect, ","); + } + if (StringUtils.isBlank(_sampleDestination)) {//所有分析班组已完成,去向显示为库名 + _sampleDestination = this.getWarehouseName(); + } + return _sampleDestination; + } + + @Schema(description = "样品所在位置") + private String sampleLocation; + + public String getSampleLocation() { + this.sampleLocation = null; + if (CollUtil.isNotEmpty(this.businessSubSampleAnalysisGroupList)) { + List collect = this.businessSubSampleAnalysisGroupList.stream().filter(f -> f.getSampleStatus().equals("已收样")).map(m -> m.getAssayDepartmentName()).collect(Collectors.toList()); + this.sampleLocation = CollUtil.join(collect, ","); + } + return this.sampleLocation; + } + + @Schema(description = "分析部门id") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称") + private String assayDepartmentName; @Schema(description = "是否打印") private Integer isPrint; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java index 01c5f67..cf97617 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java @@ -1,8 +1,6 @@ package com.zt.plat.module.qms.business.bus.controller.vo; -import com.alibaba.excel.annotation.ExcelProperty; import lombok.*; -import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; import com.zt.plat.framework.common.pojo.PageParam; import java.math.BigDecimal; @@ -48,6 +46,9 @@ public class BusinessSubSamplePageReqVO extends PageParam { @Schema(description = "归库编号") private String sampleReturnCode; + @Schema(description = "是否已经生成归库编号,1-已生成,0-未生成") + private Integer isGenerateReturnCode; + @Schema(description = "是否称重,1-启用,0-不启用") private Integer isWeighing; @@ -132,8 +133,24 @@ public class BusinessSubSamplePageReqVO extends PageParam { @Schema(description = "备注") private String remark; - //扩展字段 + @Schema(description = "分析部门id") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称") + private String assayDepartmentName; + + @Schema(description = "分析部门状态") + private String assayDepartmentStatus; + + //=======================================扩展字段======================================= @Schema(description = "库位编码") private String warehouseLocationCode; + @Schema(description = "仓库编码") + private String warehouseCode; + + //是否过滤已申请调拨的数据: 1-是, 其他值:否 + @Schema(description = "是否过滤已申请调拨的数据") + private String hideDispatchData; + } \ 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/controller/vo/BusinessSubSampleReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleReqVO.java index b9e404c..e116687 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleReqVO.java @@ -47,6 +47,9 @@ public class BusinessSubSampleReqVO { @Schema(description = "归库编号") private String sampleReturnCode; + @Schema(description = "是否已经生成归库编号,1-已生成,0-未生成") + private Integer isGenerateReturnCode; + @Schema(description = "是否称重,1-启用,0-不启用") private Integer isWeighing; @@ -131,4 +134,6 @@ public class BusinessSubSampleReqVO { @Schema(description = "备注") private String remark; + + } \ 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/controller/vo/BusinessSubSampleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleRespVO.java index c3d4a3d..44a0c2b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleRespVO.java @@ -62,6 +62,9 @@ public class BusinessSubSampleRespVO { @ExcelProperty("归库编号") private String sampleReturnCode; + @Schema(description = "是否已经生成归库编号,1-已生成,0-未生成") + private Integer isGenerateReturnCode; + @Schema(description = "是否称重,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("是否称重,1-启用,0-不启用") private Integer isWeighing; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleSaveReqVO.java index e41a62c..a7c851d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleSaveReqVO.java @@ -55,6 +55,9 @@ public class BusinessSubSampleSaveReqVO { @Schema(description = "归库编号") private String sampleReturnCode; + @Schema(description = "是否已经生成归库编号,1-已生成,0-未生成") + private Integer isGenerateReturnCode; + @Schema(description = "是否称重,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) // @NotNull(message = "是否称重,1-启用,0-不启用不能为空") private Integer isWeighing; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java index 2b8c07a..6121427 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java @@ -2,11 +2,7 @@ package com.zt.plat.module.qms.business.bus.dal.dataobject; import lombok.*; import java.util.*; - import java.time.LocalDateTime; - import java.time.LocalDateTime; - import java.time.LocalDateTime; - import java.time.LocalDateTime; - import java.time.LocalDateTime; +import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** @@ -50,6 +46,11 @@ public class BusinessAssayTaskDataDO extends BusinessBaseDO { @TableField("BSN_SB_SMP_ID") private Long businessSubSampleId; /** + * 分样子样判定ID + */ + @TableField("BSN_SB_SMP_ASMT_ID") + private Long businessSubSampleAssessmentId; + /** * 检测方法配置ID */ @TableField("CFG_ASY_MTHD_ID") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleDispatchDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleDispatchDO.java index c75ade9..52d58f5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleDispatchDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleDispatchDO.java @@ -71,7 +71,7 @@ public class BusinessSampleDispatchDO extends BusinessBaseDO { * 申请原因 */ @TableField("APL_CNTT") - private LocalDateTime applyContent; + private String applyContent; /** * 库管员 @@ -119,4 +119,11 @@ public class BusinessSampleDispatchDO extends BusinessBaseDO { @TableField("RMK") private String remark; + //仓库编码 + @TableField("WRH_CD") + private String warehouseCode; + + //仓库名称 + @TableField("WRH_NAME") + private String warehouseName; } \ 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/dataobject/BusinessSubParentSampleAssessmentDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentDO.java index 4db2d23..3023341 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentDO.java @@ -38,31 +38,11 @@ public class BusinessSubParentSampleAssessmentDO extends BusinessBaseDO { @TableField("BSN_SB_PRN_SMP_ID") private Long businessSubParentSampleId; /** - * 检测项目ID,字典表【T_DIC_PRJ】 - */ - @TableField("DIC_PRJ_ID") - private Long dictionaryProjectId; - /** - * 检测方法分析项目配置ID - */ - @TableField("CFG_ASY_MTHD_PRJ_ID") - private Long configAssayMethodProjectId; - /** * 检测方法配置ID */ @TableField("CFG_ASY_MTHD_ID") private Long configAssayMethodId; /** - * 用途,ingredient-配料、report-报出、ingredient_report-配料及报出 - */ - @TableField("USG") - private String usage; - /** - * 符号,=、>、<、等 - */ - @TableField("SMB") - private String symbol; - /** * 任务类型,【字典】【jy_sample_task_type】常规、抽查... */ @TableField("TSK_TP") @@ -73,31 +53,11 @@ public class BusinessSubParentSampleAssessmentDO extends BusinessBaseDO { @TableField("ASY_TP") private String assayType; /** - * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 - */ - @TableField("DAT_TP") - private String dataType; - /** - * 小数位 - */ - @TableField("DEC_POS") - private Integer decimalPosition; - /** - * 判定值 - */ - @TableField("ASMT_VAL") - private String assessmentValue; - /** - * 判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差 + * 判定状态,in_progress-进行中 normal-正常 */ @TableField("ASMT_STS") private String assessmentStatus; /** - * 方法检出下限值 - */ - @TableField("MIN_LIM_VAL") - private String minimumLimitValue; - /** * 是否已上报 */ @TableField("IS_RPOD") @@ -113,6 +73,11 @@ public class BusinessSubParentSampleAssessmentDO extends BusinessBaseDO { @TableField("RPT_TM") private LocalDateTime reportTime; /** + * 结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改 + */ + @TableField("RSLT_TMT_WY") + private String resultTreatmentWay; + /** * 所属部门 */ @TableField("SYS_DEPT_CD") 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 new file mode 100644 index 0000000..266478f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentProjectDO.java @@ -0,0 +1,136 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 班组判定检测项目数据业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_sb_prn_smp_asmt_prj") +@KeySequence("t_bsn_sb_prn_smp_asmt_prj_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessSubParentSampleAssessmentProjectDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 样品分样ID + */ + @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") + private Long dictionaryProjectId; + /** + * 检测方法分析项目配置ID + */ + @TableField("CFG_ASY_MTHD_PRJ_ID") + private Long configAssayMethodProjectId; + /** + * 检测方法配置ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 用途,ingredient-配料、report-报出、ingredient_report-配料及报出 + */ + @TableField("USG") + private String usage; + /** + * 符号,=、>、<、等 + */ + @TableField("SMB") + private String symbol; + /** + * 任务类型,【字典】【jy_sample_task_type】常规、抽查... + */ + @TableField("TSK_TP") + private String taskType; + /** + * 分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel... + */ + @TableField("ASY_TP") + private String assayType; + /** + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 判定值 + */ + @TableField("ASMT_VAL") + private String assessmentValue; + /** + * 判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差 + */ + @TableField("ASMT_STS") + private String assessmentStatus; + /** + * 方法检出下限值 + */ + @TableField("MIN_LIM_VAL") + private String minimumLimitValue; + /** + * 是否已上报 + */ + @TableField("IS_RPOD") + private Integer isReported; + /** + * 上报人 + */ + @TableField("RPTR") + private String reporter; + /** + * 上报时间 + */ + @TableField("RPT_TM") + private LocalDateTime reportTime; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ 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/dataobject/BusinessSubSampleAssessmentDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentDO.java index a8df1b7..bd737bb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentDO.java @@ -2,13 +2,11 @@ package com.zt.plat.module.qms.business.bus.dal.dataobject; import lombok.*; import java.util.*; - import java.time.LocalDateTime; - import java.time.LocalDateTime; - import java.time.LocalDateTime; +import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** -* 子样判定数据业务 DO +* 子样判定业务 DO * * @author 后台管理 */ @@ -33,6 +31,11 @@ public class BusinessSubSampleAssessmentDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** + * 样品主样ID + */ + @TableField("BSN_BSE_SMP_ID") + private Long businessBaseSampleId; + /** * 样品分样ID */ @TableField("BSN_SB_PRN_SMP_ID") @@ -43,31 +46,16 @@ public class BusinessSubSampleAssessmentDO extends BusinessBaseDO { @TableField("BSN_SB_SMP_ID") private Long businessSubSampleId; /** - * 检测项目ID,字典表【T_DIC_PRJ】 + * 班组判定数据业务ID */ - @TableField("DIC_PRJ_ID") - private Long dictionaryProjectId; - /** - * 检测方法分析项目配置ID - */ - @TableField("CFG_ASY_MTHD_PRJ_ID") - private Long configAssayMethodProjectId; + @TableField("BSN_SB_PRN_SMP_ASMT_ID") + private Long businessSubParentSampleAssessmentId; /** * 检测方法配置ID */ @TableField("CFG_ASY_MTHD_ID") private Long configAssayMethodId; /** - * 用途,ingredient-配料、report-报出、ingredient_report-配料及报出 - */ - @TableField("USG") - private String usage; - /** - * 符号,=、>、<、等 - */ - @TableField("SMB") - private String symbol; - /** * 任务类型,【字典】【jy_sample_task_type】常规、抽查... */ @TableField("TSK_TP") @@ -78,36 +66,26 @@ public class BusinessSubSampleAssessmentDO extends BusinessBaseDO { @TableField("ASY_TP") private String assayType; /** - * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 - */ - @TableField("DAT_TP") - private String dataType; - /** - * 小数位 - */ - @TableField("DEC_POS") - private Integer decimalPosition; - /** - * 判定值 - */ - @TableField(value = "ASMT_VAL", updateStrategy = FieldStrategy.ALWAYS) - private String assessmentValue; - /** - * 判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差 + * 判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差 */ @TableField("ASMT_STS") private String assessmentStatus; /** - * 方法检出下限值 + * 是否复测,1-是,0-否 */ - @TableField("MIN_LIM_VAL") - private String minimumLimitValue; + @TableField("IS_RCHK") + private Integer isRecheck; /** - * 是否已上报 + * 是否已上报,1-是,0-否 */ @TableField("IS_RPOD") private Integer isReported; /** + * 上报状态,初始状态-initial、待上报-pending_report、待判定-pending_assessment、已复检-re_inspected、已上报-reported + */ + @TableField("RPOD_STS") + private String reportedStatus; + /** * 上报人 */ @TableField("RPTR") @@ -118,6 +96,11 @@ public class BusinessSubSampleAssessmentDO extends BusinessBaseDO { @TableField("RPT_TM") private LocalDateTime reportTime; /** + * 结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改 + */ + @TableField("RSLT_TMT_WY") + private String resultTreatmentWay; + /** * 所属部门 */ @TableField("SYS_DEPT_CD") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentProjectDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentProjectDO.java new file mode 100644 index 0000000..a41230a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentProjectDO.java @@ -0,0 +1,141 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 子样判定检测项目数据业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_sb_smp_asmt_prj") +@KeySequence("t_bsn_sb_smp_asmt_prj_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessSubSampleAssessmentProjectDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 样品分样ID + */ + @TableField("BSN_SB_PRN_SMP_ID") + private Long businessSubParentSampleId; + /** + * 分样子样ID + */ + @TableField("BSN_SB_SMP_ID") + private Long businessSubSampleId; + /** + * 分样子样判定ID + */ + @TableField("BSN_SB_SMP_ASMT_ID") + private Long businessSubSampleAssessmentId; + /** + * 检测项目ID,字典表【T_DIC_PRJ】 + */ + @TableField("DIC_PRJ_ID") + private Long dictionaryProjectId; + /** + * 检测方法分析项目配置ID + */ + @TableField("CFG_ASY_MTHD_PRJ_ID") + private Long configAssayMethodProjectId; + /** + * 检测方法配置ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 用途,ingredient-配料、report-报出、ingredient_report-配料及报出 + */ + @TableField("USG") + private String usage; + /** + * 符号,=、>、<、等 + */ + @TableField("SMB") + private String symbol; + /** + * 任务类型,【字典】【jy_sample_task_type】常规、抽查... + */ + @TableField("TSK_TP") + private String taskType; + /** + * 分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel... + */ + @TableField("ASY_TP") + private String assayType; + /** + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 判定值 + */ + @TableField(value = "ASMT_VAL", updateStrategy = FieldStrategy.ALWAYS) + private String assessmentValue; + /** + * 判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差 + */ + @TableField("ASMT_STS") + private String assessmentStatus; + /** + * 方法检出下限值 + */ + @TableField("MIN_LIM_VAL") + private String minimumLimitValue; + /** + * 是否已上报 + */ + @TableField("IS_RPOD") + private Integer isReported; + /** + * 上报人 + */ + @TableField("RPTR") + private String reporter; + /** + * 上报时间 + */ + @TableField("RPT_TM") + private LocalDateTime reportTime; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ 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/dataobject/BusinessSubSampleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleDO.java index e49b280..ad97186 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleDO.java @@ -93,6 +93,11 @@ public class BusinessSubSampleDO extends BusinessBaseDO { @TableField("SMP_RTN_CD") private String sampleReturnCode; /** + * 是否已经生成归库编号,1-已生成,0-未生成 + */ + @TableField("IS_GEN_RTN_CD") + private Integer isGenerateReturnCode; + /** * 是否称重,1-启用,0-不启用 */ @TableField("IS_WG") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java index 3aa916b..2456be4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java @@ -15,6 +15,8 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataPa import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataReqVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; 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.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.enums.QmsCommonConstant; @@ -48,6 +50,7 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX mpjLambdaWrapper = new MPJLambdaWrapper() .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId) .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) + .leftJoin(BusinessSubSampleAssessmentDO.class, BusinessSubSampleAssessmentDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleAssessmentId) .leftJoin(BusinessSubSampleAnalysisGroupDO.class, on -> on .eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, BusinessAssayTaskDataDO::getBusinessSubSampleId) .eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, BusinessAssayTaskDataDO::getAssayDepartmentId)) @@ -143,6 +148,9 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX() -// .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId) -// .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) -// .selectAll(BusinessAssayTaskDataDO.class) -// .selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName) -// .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName) -// .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode) -// .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode) -// .eqIfPresent(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) -// .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) -// .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) -// .eqIfPresent(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) -// .eqIfPresent(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) -// .eqIfPresent(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType()) -// .eqIfPresent(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType()) -// .eqIfPresent(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject()) -// .eqIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) -// .likeIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) -// .eqIfPresent(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator()) -// .betweenIfPresent(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) -// .eqIfPresent(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) -// .eqIfPresent(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported()) -// .eqIfPresent(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter()) -// .betweenIfPresent(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime()) -// .eqIfPresent(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId()) -// .eqIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey()) -// .betweenIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime()) -// .eqIfPresent(BusinessAssayTaskDataDO::getAnalysisCount, reqVO.getAnalysisCount()) -// .eqIfPresent(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount()) -// .eqIfPresent(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) -// .betweenIfPresent(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime()) -// .eqIfPresent(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark()) -// .orderByAsc(BusinessAssayTaskDataDO::getBusinessSubSampleId) -// .orderByAsc(BusinessAssayTaskDataDO::getReportTime)); } /** @@ -242,6 +224,16 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX selectByBusinessSubParentSampleIds(List businessSubParentSampleIds) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, businessSubParentSampleIds)); + } + /** * 根据分样查询分析任务 * @param businessSubParentSampleId 分样样id @@ -329,7 +321,7 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX selectUnAssignTaskedSubSample(); + List selectUnAssignTaskedSubSample(@Param("reqVO") BusinessAssayTaskDataReqVO reqVO); } \ 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/BusinessAssayTaskMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java index 8ceec27..65be90b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java @@ -60,6 +60,8 @@ public interface BusinessAssayTaskMapper extends BaseMapperX { - List selectUnReportMethodGroupList(); - default PageResult selectPage(BusinessSubParentSampleAssessmentPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) - .eqIfPresent(BusinessSubParentSampleAssessmentDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) - .eqIfPresent(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) .eqIfPresent(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(BusinessSubParentSampleAssessmentDO::getUsage, reqVO.getUsage()) - .eqIfPresent(BusinessSubParentSampleAssessmentDO::getSymbol, reqVO.getSymbol()) .eqIfPresent(BusinessSubParentSampleAssessmentDO::getTaskType, reqVO.getTaskType()) .eqIfPresent(BusinessSubParentSampleAssessmentDO::getAssayType, reqVO.getAssayType()) - .eqIfPresent(BusinessSubParentSampleAssessmentDO::getDataType, reqVO.getDataType()) - .eqIfPresent(BusinessSubParentSampleAssessmentDO::getDecimalPosition, reqVO.getDecimalPosition()) - .eqIfPresent(BusinessSubParentSampleAssessmentDO::getAssessmentValue, reqVO.getAssessmentValue()) .eqIfPresent(BusinessSubParentSampleAssessmentDO::getAssessmentStatus, reqVO.getAssessmentStatus()) .eqIfPresent(BusinessSubParentSampleAssessmentDO::getIsReported, reqVO.getIsReported()) .eqIfPresent(BusinessSubParentSampleAssessmentDO::getReporter, reqVO.getReporter()) .betweenIfPresent(BusinessSubParentSampleAssessmentDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getResultTreatmentWay, reqVO.getResultTreatmentWay()) .eqIfPresent(BusinessSubParentSampleAssessmentDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .betweenIfPresent(BusinessSubParentSampleAssessmentDO::getCreateTime, reqVO.getCreateTime()) .eqIfPresent(BusinessSubParentSampleAssessmentDO::getUpdateCount, reqVO.getUpdateCount()) @@ -49,29 +35,17 @@ public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX selectByBusinessSubParentSampleIdAndConfigAssayMethodId(List businessSubParentSampleIds, Long configAssayMethodId) { - return selectJoinList(BusinessSubParentSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX() - .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubParentSampleAssessmentDO::getConfigAssayMethodProjectId) - .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubParentSampleAssessmentDO::getDictionaryProjectId) - .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId) - .selectAll(BusinessSubParentSampleAssessmentDO.class) - .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectUnit) - .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectKey) - .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentExtendRespVO::getSimpleName) - .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentExtendRespVO::getShowName) - .selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentExtendRespVO::getConfigAssayMethodName) + default BusinessSubParentSampleAssessmentDO selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) { + return selectOne(new LambdaQueryWrapperX() + .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)); } - - default List selectByConfigAssayMethodId(Long configAssayMethodId) { - return selectList(new LambdaQueryWrapper() - .eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); - } - - List selectNoReportSubParentSampleAssessment(@Param("configAssayMethodId") Long configAssayMethodId); - - List getRecheckAssayMethodList(@Param("baseSampleId") Long baseSampleId, @Param("businessSubParentSampleId") Long businessSubParentSampleId, @Param("configAssayMethodId") Long 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/BusinessSubParentSampleAssessmentProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java new file mode 100644 index 0000000..c410af6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.java @@ -0,0 +1,77 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import java.util.*; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentProjectDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 班组判定检测项目数据业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessSubParentSampleAssessmentProjectMapper extends BaseMapperX { + + List selectUnReportMethodGroupList(@Param("reqVO") BusinessSubParentSampleAssessmentGroupReqVO reqVO); + + default PageResult selectPage(BusinessSubParentSampleAssessmentProjectPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getUsage, reqVO.getUsage()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getSymbol, reqVO.getSymbol()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getTaskType, reqVO.getTaskType()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getAssayType, reqVO.getAssayType()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getAssessmentValue, reqVO.getAssessmentValue()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getAssessmentStatus, reqVO.getAssessmentStatus()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessSubParentSampleAssessmentProjectDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessSubParentSampleAssessmentProjectDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessSubParentSampleAssessmentProjectDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessSubParentSampleAssessmentProjectDO::getId)); + } + + default List selectByBusinessSubParentSampleIdAndConfigAssayMethodId(List businessSubParentSampleIds, Long configAssayMethodId) { + return selectJoinList(BusinessSubParentSampleAssessmentProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubParentSampleAssessmentProjectDO::getDictionaryProjectId) + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodId) + .selectAll(BusinessSubParentSampleAssessmentProjectDO.class) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectUnit) + .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentProjectExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentProjectExtendRespVO::getShowName) + .selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentProjectExtendRespVO::getConfigAssayMethodName) + .in(BusinessSubParentSampleAssessmentProjectDO::getBusinessSubParentSampleId, businessSubParentSampleIds) + .eq(BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default List selectByConfigAssayMethodId(Long configAssayMethodId) { + return selectList(new LambdaQueryWrapper() + .eq(BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId)); + } + + List selectNoReportSubParentSampleAssessment(@Param("configAssayMethodId") Long configAssayMethodId); + + List getRecheckAssayMethodList(@Param("baseSampleId") Long baseSampleId, @Param("businessSubParentSampleId") Long businessSubParentSampleId, @Param("configAssayMethodId") Long 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/BusinessSubSampleAnalysisGroupMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java index af60761..4680c73 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java @@ -36,6 +36,26 @@ public interface BusinessSubSampleAnalysisGroupMapper extends BaseMapperX selectByBusinessSubParentSampleId(Long businessSubParentSampleId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubParentSampleId, businessSubParentSampleId)); + } + + default List selectByBusinessSubParentSampleIds(List businessSubParentSampleIds) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessSubSampleAnalysisGroupDO::getBusinessSubParentSampleId, businessSubParentSampleIds)); + } + + default List selectByBusinessSubSampleId(Long businessSubSampleId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleId)); + } + + default List selectByBusinessSubSampleIds(List businessSubSampleIds) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleIds)); + } + default List selectByBusinessSubSampleIdsAndAssayDepartmentId(List businessSubSampleIds, Long assayDepartmentId) { return selectList(new LambdaQueryWrapperX() .in(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleIds) 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 a31f853..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 @@ -1,24 +1,16 @@ package com.zt.plat.module.qms.business.bus.dal.mapper; +import java.util.*; + import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; -import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; -import com.zt.plat.module.qms.enums.QmsCommonConstant; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; - -import java.util.List; - import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; /** - * 子样判定数据业务 Mapper + * 子样判定业务 Mapper * * @author 后台管理 */ @@ -27,20 +19,15 @@ public interface BusinessSubSampleAssessmentMapper extends BaseMapperX selectPage(BusinessSubSampleAssessmentPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) + .eqIfPresent(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) .eqIfPresent(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) - .eqIfPresent(BusinessSubSampleAssessmentDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) - .eqIfPresent(BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) .eqIfPresent(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(BusinessSubSampleAssessmentDO::getUsage, reqVO.getUsage()) - .eqIfPresent(BusinessSubSampleAssessmentDO::getSymbol, reqVO.getSymbol()) .eqIfPresent(BusinessSubSampleAssessmentDO::getTaskType, reqVO.getTaskType()) .eqIfPresent(BusinessSubSampleAssessmentDO::getAssayType, reqVO.getAssayType()) - .eqIfPresent(BusinessSubSampleAssessmentDO::getDataType, reqVO.getDataType()) - .eqIfPresent(BusinessSubSampleAssessmentDO::getDecimalPosition, reqVO.getDecimalPosition()) - .eqIfPresent(BusinessSubSampleAssessmentDO::getAssessmentValue, reqVO.getAssessmentValue()) .eqIfPresent(BusinessSubSampleAssessmentDO::getAssessmentStatus, reqVO.getAssessmentStatus()) + .eqIfPresent(BusinessSubSampleAssessmentDO::getIsRecheck, reqVO.getIsRecheck()) .eqIfPresent(BusinessSubSampleAssessmentDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessSubSampleAssessmentDO::getReportedStatus, reqVO.getReportedStatus()) .eqIfPresent(BusinessSubSampleAssessmentDO::getReporter, reqVO.getReporter()) .betweenIfPresent(BusinessSubSampleAssessmentDO::getReportTime, reqVO.getReportTime()) .eqIfPresent(BusinessSubSampleAssessmentDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) @@ -50,55 +37,16 @@ public interface BusinessSubSampleAssessmentMapper extends BaseMapperX selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) { - return selectJoinList(BusinessSubSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX() - .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodId) - .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId) - .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentDO::getDictionaryProjectId) - .selectAll(BusinessSubSampleAssessmentDO.class) - .selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentExtendRespVO::getConfigAssayMethodName) - .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectUnit) - .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectKey) - .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentExtendRespVO::getSimpleName) - .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentExtendRespVO::getShowName) - .eq(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleId) - .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); - } - - default List selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List businessSubParentSampleIds, Long configAssayMethodId) { - return selectJoinList(BusinessSubSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX() - .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodId) - .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId) - .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentDO::getDictionaryProjectId) - .selectAll(BusinessSubSampleAssessmentDO.class) - .selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentExtendRespVO::getConfigAssayMethodName) - .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectUnit) - .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectKey) - .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentExtendRespVO::getSimpleName) - .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentExtendRespVO::getShowName) - .in(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds) - .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); - } - - default List selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) { - return selectJoinList(BusinessSubSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX() - .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId) - .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentDO::getDictionaryProjectId) - .selectAll(BusinessSubSampleAssessmentDO.class) - .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectUnit) - .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectKey) - .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentExtendRespVO::getSimpleName) - .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentExtendRespVO::getShowName) - .eq(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, businessSubSampleId) - .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); - } - - default BusinessSubSampleAssessmentDO selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(Long businessSubSampleId, Long configAssayMethodId, Long configAssayMethodProjectId) { + default BusinessSubSampleAssessmentDO selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) { return selectOne(new LambdaQueryWrapperX() .eq(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, businessSubSampleId) - .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId) - .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId, configAssayMethodProjectId)); + .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default List selectByBusinessSubSampleIdsAndConfigAssayMethodId(List businessSubSampleIds, Long configAssayMethodId) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, businessSubSampleIds) + .eq(BusinessSubSampleAssessmentDO::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/BusinessSubSampleAssessmentProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentProjectMapper.java new file mode 100644 index 0000000..b7f25ab --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentProjectMapper.java @@ -0,0 +1,102 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentProjectDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 子样判定检测项目数据业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessSubSampleAssessmentProjectMapper extends BaseMapperX { + + default PageResult selectPage(BusinessSubSampleAssessmentProjectPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getBusinessSubSampleAssessmentId, reqVO.getBusinessSubSampleAssessmentId()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getUsage, reqVO.getUsage()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getSymbol, reqVO.getSymbol()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getTaskType, reqVO.getTaskType()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getAssayType, reqVO.getAssayType()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getAssessmentValue, reqVO.getAssessmentValue()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getAssessmentStatus, reqVO.getAssessmentStatus()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessSubSampleAssessmentProjectDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessSubSampleAssessmentProjectDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessSubSampleAssessmentProjectDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessSubSampleAssessmentProjectDO::getId)); + } + + default List selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) { + return selectJoinList(BusinessSubSampleAssessmentProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodId) + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentProjectDO::getDictionaryProjectId) + .selectAll(BusinessSubSampleAssessmentProjectDO.class) + .selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentProjectExtendRespVO::getConfigAssayMethodName) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectUnit) + .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentProjectExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentProjectExtendRespVO::getShowName) + .eq(BusinessSubSampleAssessmentProjectDO::getBusinessSubParentSampleId, businessSubParentSampleId) + .eq(BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default List selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List businessSubParentSampleIds, Long configAssayMethodId) { + return selectJoinList(BusinessSubSampleAssessmentProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodId) + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentProjectDO::getDictionaryProjectId) + .selectAll(BusinessSubSampleAssessmentProjectDO.class) + .selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentProjectExtendRespVO::getConfigAssayMethodName) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectUnit) + .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentProjectExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentProjectExtendRespVO::getShowName) + .in(BusinessSubSampleAssessmentProjectDO::getBusinessSubParentSampleId, businessSubParentSampleIds) + .eq(BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default List selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) { + return selectJoinList(BusinessSubSampleAssessmentProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentProjectDO::getDictionaryProjectId) + .selectAll(BusinessSubSampleAssessmentProjectDO.class) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectUnit) + .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentProjectExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentProjectExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentProjectExtendRespVO::getShowName) + .eq(BusinessSubSampleAssessmentProjectDO::getBusinessSubSampleId, businessSubSampleId) + .eq(BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default BusinessSubSampleAssessmentProjectDO selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(Long businessSubSampleId, Long configAssayMethodId, Long configAssayMethodProjectId) { + return selectOne(new LambdaQueryWrapperX() + .eq(BusinessSubSampleAssessmentProjectDO::getBusinessSubSampleId, businessSubSampleId) + .eq(BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId) + .eq(BusinessSubSampleAssessmentProjectDO::getConfigAssayMethodProjectId, configAssayMethodProjectId)); + } + + +} \ 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/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 662bad2..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 @@ -9,6 +9,7 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleExtend import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSamplePageReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleReqVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; @@ -19,6 +20,9 @@ import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant; import jakarta.validation.Valid; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; /** * 子样业务 Mapper @@ -34,17 +38,15 @@ public interface BusinessSubSampleMapper extends BaseMapperX{ -// w.eq(ConfigWarehouseLocationDO::getWarehouseType, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); -// }) -// //仓库 -// .leftJoin(ConfigWarehouseLocationParDO.class, ConfigWarehouseLocationParDO::getId, ConfigWarehouseLocationDO::getParentId) + .leftJoin(ConfigWarehouseLocationDO.class, ConfigWarehouseLocationDO::getId, BusinessSubSampleDO::getConfigWarehouseLocationInfomationId) + //仓库 + .leftJoin(ConfigWarehouseLocationParDO.class, ConfigWarehouseLocationParDO::getId, ConfigWarehouseLocationDO::getParentId) .selectAll(BusinessSubSampleDO.class) .selectAs(DictionaryBusinessDO::getName, BusinessSubSampleExtendRespVO::getDictionaryBusinessName) .selectAs(ConfigSubSampleDO::getIsPrint, BusinessSubSampleExtendRespVO::getIsPrint) .selectAs(ConfigSubSampleDO::getPrintTemplate, BusinessSubSampleExtendRespVO::getPrintTemplate) -// .selectAs(ConfigWarehouseLocationDO::getCode, BusinessSubSampleExtendRespVO::getWarehouseLocationCode) -// .selectAs(ConfigWarehouseLocationParDO::getName, BusinessSubSampleExtendRespVO::getWarehouseName) + .selectAs(ConfigWarehouseLocationDO::getCode, BusinessSubSampleExtendRespVO::getWarehouseLocationCode) + .selectAs(ConfigWarehouseLocationParDO::getName, BusinessSubSampleExtendRespVO::getWarehouseName) .eqIfPresent(BusinessSubSampleDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) .eqIfPresent(BusinessSubSampleDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) .eqIfPresent(BusinessSubSampleDO::getConfigSubSampleId, reqVO.getConfigSubSampleId()) @@ -82,10 +84,68 @@ public interface BusinessSubSampleMapper extends BaseMapperX selectAnalysisGroupPage(BusinessSubSamplePageReqVO reqVO) { + return selectJoinPage(reqVO, BusinessSubSampleExtendRespVO.class, new MPJLambdaWrapperX() + .rightJoin(BusinessSubSampleAnalysisGroupDO.class, BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, BusinessSubSampleDO::getId) + .leftJoin(ConfigSubSampleDO.class, ConfigSubSampleDO::getId, BusinessSubSampleDO::getConfigSubSampleId) + .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, BusinessSubSampleDO::getDictionaryBusinessId) + .leftJoin(ConfigWarehouseLocationDO.class, ConfigWarehouseLocationDO::getCode, ConfigSubSampleDO::getConfigWarehouseLocationCode) + .selectAll(BusinessSubSampleDO.class) + .selectAs(DictionaryBusinessDO::getName, BusinessSubSampleExtendRespVO::getDictionaryBusinessName) + .selectAs(ConfigSubSampleDO::getIsPrint, BusinessSubSampleExtendRespVO::getIsPrint) + .selectAs(ConfigSubSampleDO::getPrintTemplate, BusinessSubSampleExtendRespVO::getPrintTemplate) + .selectAs(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, BusinessSubSampleExtendRespVO::getAssayDepartmentId) + .selectAs(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentName, BusinessSubSampleExtendRespVO::getAssayDepartmentName) + .selectAs(ConfigWarehouseLocationDO::getCode, BusinessSubSampleExtendRespVO::getWarehouseLocationCode) + .selectAs(ConfigWarehouseLocationDO::getName, BusinessSubSampleExtendRespVO::getWarehouseName) + .eqIfPresent(BusinessSubSampleDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) + .eqIfPresent(BusinessSubSampleDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) + .eqIfPresent(BusinessSubSampleDO::getConfigSubSampleId, reqVO.getConfigSubSampleId()) + .eqIfPresent(BusinessSubSampleDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, reqVO.getConfigWarehouseLocationInfomationId()) + .eqIfPresent(BusinessSubSampleDO::getSampleId, reqVO.getSampleId()) + .eqIfPresent(BusinessSubSampleDO::getGroupId, reqVO.getGroupId()) + .likeIfPresent(BusinessSubSampleDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessSubSampleDO::getSampleCode, reqVO.getSampleCode()) + .eqIfPresent(BusinessSubSampleDO::getSampleAssayCode, reqVO.getSampleAssayCode()) + .eqIfPresent(BusinessSubSampleDO::getSampleReturnCode, reqVO.getSampleReturnCode()) + .eqIfPresent(BusinessSubSampleDO::getIsWeighing, reqVO.getIsWeighing()) + .eqIfPresent(BusinessSubSampleDO::getLastSampleWeight, reqVO.getLastSampleWeight()) + .eqIfPresent(BusinessSubSampleDO::getLastBalanceCode, reqVO.getLastBalanceCode()) + .eqIfPresent(BusinessSubSampleDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId()) + .eqIfPresent(BusinessSubSampleDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey()) + .betweenIfPresent(BusinessSubSampleDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime()) + .eqIfPresent(BusinessSubSampleDO::getNextSampleFlowNode, reqVO.getNextSampleFlowNode()) + .eqIfPresent(BusinessSubSampleDO::getSampleStatus, reqVO.getSampleStatus()) + .eqIfPresent(BusinessSubSampleDO::getAssayOperator, reqVO.getAssayOperator()) + .eqIfPresent(BusinessSubSampleDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .betweenIfPresent(BusinessSubSampleDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessSubSampleDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessSubSampleDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessSubSampleDO::getReportTime, reqVO.getReportTime()) + .betweenIfPresent(BusinessSubSampleDO::getReturnTime, reqVO.getReturnTime()) + .eqIfPresent(BusinessSubSampleDO::getReturnStatus, reqVO.getReturnStatus()) + .eqIfPresent(BusinessSubSampleDO::getDispatchStatus, reqVO.getDispatchStatus()) + .eqIfPresent(BusinessSubSampleDO::getReturnCodePrintCount, reqVO.getReturnCodePrintCount()) + .betweenIfPresent(BusinessSubSampleDO::getPrintLastTime, reqVO.getPrintLastTime()) + .eqIfPresent(BusinessSubSampleDO::getUpSampleRecordId, reqVO.getUpSampleRecordId()) + .eqIfPresent(BusinessSubSampleDO::getAnalysisRemark, reqVO.getAnalysisRemark()) + .eqIfPresent(BusinessSubSampleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessSubSampleDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessSubSampleDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessSubSampleDO::getRemark, reqVO.getRemark()) + .eqIfPresent(BusinessSubSampleDO::getUpSampleRecordId, reqVO.getUpSampleRecordId()) + .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getAssayDepartmentStatus()) + .orderByAsc(BusinessSubSampleDO::getSampleCode) + ); + } + default List selectList(@Valid BusinessSubSampleReqVO reqVO) { return selectJoinList(BusinessSubSampleExtendRespVO.class, new MPJLambdaWrapperX() .selectSub(BusinessAssayTaskDataDO.class, s -> s.selectCount(BusinessAssayTaskDataDO::getId).eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, BusinessSubSampleDO::getId), BusinessSubSampleExtendRespVO::getAssayTaskCount) @@ -149,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) @@ -164,4 +238,7 @@ public interface BusinessSubSampleMapper extends BaseMapperX selectPageForDispatch(IPage page, @Param("param") BusinessSubSamplePageReqVO reqVO); + } \ 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/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java index 6390054..792a155 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java @@ -13,6 +13,7 @@ import com.yomahub.liteflow.core.NodeComponent; import cn.hutool.core.collection.CollUtil; import com.zt.plat.framework.common.exception.ServiceException; +import com.zt.plat.framework.tenant.core.context.TenantContextHolder; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; @@ -22,8 +23,10 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleAssayRes import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustDetailDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustProjectDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO; +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.BusinessSubSampleAnalysisGroupDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; @@ -34,8 +37,10 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleAssayResultM import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustDetailMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustProjectMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustRegistrationMapper; +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.BusinessSubSampleAnalysisGroupMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext; @@ -68,7 +73,9 @@ import com.zt.plat.module.qms.core.sampleflow.SampleFlowDefinition; import com.zt.plat.module.qms.core.sampleflow.SampleFlowNode; import com.zt.plat.module.qms.enums.QmsCommonConstant; import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +@Slf4j @LiteflowComponent(id = "sampleEntrustGenSampleDataCmp", name = "样品委托生成系统样品数据") public class SampleEntrustGenSampleDataCmp extends NodeComponent { @@ -102,6 +109,9 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { @Resource private BusinessSubParentSampleMapper businessSubParentSampleMapper; + @Resource + private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper; + @Resource private ConfigSubSampleMapper configSubSampleMapper; @@ -126,6 +136,9 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { @Resource private BusinessAssayProjectDataMapper businessAssayProjectDataMapper; + @Resource + private BusinessSubSampleAssessmentMapper businessSubSampleAssessmentMapper; + @Resource private ConfigAssayMethodProjectParameterMapper configAssayMethodProjectParameterMapper; @@ -219,10 +232,14 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { List businessBaseSampleDOList = new ArrayList<>(); //分样 List businessSubParentSampleDOList = new ArrayList<>(); + //分样判定数据 + List businessSubParentSampleAssessmentDOList = new ArrayList<>(); //分样子样 List businessSubSampleDOList = new ArrayList<>(); //分样子样分析班组 List businessSubSampleAnalysisGroupDOList = new ArrayList<>(); + //分样子样判定数据 + List businessSubSampleAssessmentDOList = new ArrayList<>(); //子样检测任务 List businessAssayTaskDataDOList = new ArrayList<>(); //检测任务的分析项目 @@ -436,13 +453,34 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO); } - - //根据检测方法循环 - BusinessAssayTaskDataDO businessAssayTaskDataDO = null; //根据任务数判断是平行还是 String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP; + //分样判定数据 + BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO(); + businessSubParentSampleAssessmentDO.setId(IdWorker.getId()); + businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubParentSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodId); + businessSubParentSampleAssessmentDO.setAssayType(assayType); + businessSubParentSampleAssessmentDO.setTaskType("常规"); + businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO); + + //子样判定数据 + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); + businessSubSampleAssessmentDO.setId(IdWorker.getId()); + businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId()); + businessSubSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodId); + businessSubSampleAssessmentDO.setAssayType(assayType); + businessSubSampleAssessmentDO.setTaskType("常规"); + + businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + + //根据检测方法循环 + BusinessAssayTaskDataDO businessAssayTaskDataDO = null; //根据任务数循环 for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) { //子样检测任务 @@ -451,6 +489,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId()); businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId); businessAssayTaskDataDO.setAssayType(assayType); businessAssayTaskDataDO.setTaskType("常规"); @@ -517,6 +556,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { } + //判定是商检 分析金银 需要创建综合样,样品为第1个 if (isSjEntrust && isAssayAuAg && sort == 0 && isCreateZhy && configAssayMethodZhy != null) { Long configAssayMethodIdZhy = configAssayMethodZhy.getId(); Long assayDepartmentIdZhy = configAssayMethodZhy.getAssayDepartmentId(); @@ -537,13 +577,23 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO); } - - //根据检测方法循环 - BusinessAssayTaskDataDO businessAssayTaskDataDO = null; //根据任务数判断是平行还是 String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP; + + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); + businessSubSampleAssessmentDO.setId(IdWorker.getId()); + businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessSubSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodZhy.getId()); + businessSubSampleAssessmentDO.setAssayType(assayType); + businessSubSampleAssessmentDO.setTaskType("常规"); + businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + + //根据检测方法循环 + BusinessAssayTaskDataDO businessAssayTaskDataDO = null; //根据任务数循环 for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) { //子样检测任务 @@ -552,6 +602,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId());//子样判定id businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodZhy.getId()); businessAssayTaskDataDO.setAssayType(assayType); businessAssayTaskDataDO.setTaskType("常规"); @@ -618,27 +669,43 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { businessSampleAssayResultMapper.updateBatch(sampleAssayResultList); } if (CollUtil.isNotEmpty(businessBaseSampleDOList)) { + log.info("插入 businessBaseSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessBaseSampleMapper.insertBatch(businessBaseSampleDOList); } if (CollUtil.isNotEmpty(businessSubParentSampleDOList)) { + log.info("插入 businessSubParentSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessSubParentSampleMapper.insertBatch(businessSubParentSampleDOList); - } + } + if (CollUtil.isNotEmpty(businessSubParentSampleAssessmentDOList)) { + log.info("插入 businessSubParentSampleAssessmentDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); + businessSubParentSampleAssessmentMapper.insertBatch(businessSubParentSampleAssessmentDOList); + } if (CollUtil.isNotEmpty(businessSubSampleDOList)) { + log.info("插入 businessSubSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessSubSampleMapper.insertBatch(businessSubSampleDOList); } if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) { + log.info("插入 businessSubSampleAnalysisGroupDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessSubSampleAnalysisGroupMapper.insertBatch(businessSubSampleAnalysisGroupDOList); } + if (CollUtil.isNotEmpty(businessSubSampleAssessmentDOList)) { + log.info("插入 businessSubSampleAssessmentDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); + businessSubSampleAssessmentMapper.insertBatch(businessSubSampleAssessmentDOList); + } if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) { + log.info("插入 businessAssayTaskDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessAssayTaskDataMapper.insertBatch(businessAssayTaskDataDOList); } if (CollUtil.isNotEmpty(businessAssayProjectDataDOList)) { + log.info("插入 businessAssayProjectDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessAssayProjectDataMapper.insertBatch(businessAssayProjectDataDOList); } if (CollUtil.isNotEmpty(businessAssayParameterDataDOList)) { + log.info("插入 businessAssayParameterDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessAssayParameterDataMapper.insertBatch(businessAssayParameterDataDOList); } if (CollUtil.isNotEmpty(businessAssayReportDataDOList)) { + log.info("插入 businessAssayReportDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId()); businessAssayReportDataMapper.insertBatch(businessAssayReportDataDOList); } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSimpleEncryptCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSimpleEncryptCmp.java index b476b1d..22451a9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSimpleEncryptCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSimpleEncryptCmp.java @@ -28,6 +28,7 @@ public class SampleSimpleEncryptCmp extends NodeComponent { String simpleCodeRule = configSubSample.getSimpleCodeRule(); String simpleCode = sequenceUtil.genCode(simpleCodeRule); businessSubSampleDO.setSampleAssayCode(simpleCode); + businessSubSampleDO.setSampleReturnCode(simpleCode); } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java index 073c9cb..c578adf 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java @@ -31,6 +31,7 @@ import com.zt.plat.module.qms.core.sampleflow.SampleFlowDefinition; import com.zt.plat.module.qms.core.sampleflow.SampleFlowNode; import com.zt.plat.module.qms.enums.QmsCommonConstant; +import cn.hutool.core.collection.CollUtil; import jakarta.annotation.Resource; @LiteflowComponent(id = "sampleSubProcessUpdateCmp", name = "子样流程节点更新") @@ -66,6 +67,9 @@ public class SampleSubProcessUpdateCmp extends NodeComponent { List businessAssayTaskDataList = sampleFlowContext.getBusinessAssayTaskDataList(); //查询历史交接记录 List businessHandoverRecordSubDOList = businessHandoverRecordSubMapper.selectByBusinessSubSampleIds(sampleIdList); + //查询子样分析班组 + List businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleIds(sampleIdList); + for (BusinessSubSampleDO businessSubSample : busSubCsampleList) { ConfigSampleFlowDO configSampleFlow = configSampleFlowService.getConfigSampleFlow(businessSubSample.getConfigSampleFlowId()); String configSampleFlowContent = configSampleFlow.getContent(); @@ -90,6 +94,14 @@ public class SampleSubProcessUpdateCmp extends NodeComponent { Boolean hasSubSimpleCodeRule = configSubSample != null && StringUtils.isNotBlank(configSubSample.getSimpleCodeRule()); Boolean hasSubSampleEncrypt = businessHandoverRecordSubDOList.stream().anyMatch(m -> QmsCommonConstant.FlOW_NODE_SAMPLE_ENCRYPT.equals(m.getSampleFlowNodeKey())); + if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) { + List curSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSample.getId())).collect(Collectors.toList()); + Boolean hasAllDeptAnalyzed = curSubSampleAnalysisGroupDOList.stream().allMatch(m -> "已完成".equals(m.getSampleStatus())); + Boolean hasCurDeptAnalyzed = curSubSampleAnalysisGroupDOList.stream().filter(f -> f.getAssayDepartmentId().equals(loginUser.getVisitDeptId())).allMatch(m -> "已完成".equals(m.getSampleStatus())); + context.put("hasAllDeptAnalyzed", hasAllDeptAnalyzed); + context.put("hasCurDeptAnalyzed", hasCurDeptAnalyzed); + } + context.put("hasSubSimpleCodeRule", hasSubSimpleCodeRule); context.put("hasSubSampleEncrypt", hasSubSampleEncrypt); try { @@ -106,7 +118,7 @@ public class SampleSubProcessUpdateCmp extends NodeComponent { } } - + businessSubSample.setNextSampleFlowNode(nextFlowNode.getNextFlowNodeName()); businessSubSample.setSampleFlowNodeKey(nextFlowNode.getNodeKey()); businessSubSample.setSampleFlowNodeTime(currentDateTime); @@ -120,13 +132,13 @@ public class SampleSubProcessUpdateCmp extends NodeComponent { //如果是班组收样,需要更新分析班组表 if (QmsCommonConstant.FLOW_NODE_TEAM_RECEIVE.equals(currentSampleFlowKey)) { - List businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleIdsAndAssayDepartmentId(sampleIdList, loginUser.getVisitDeptId()); - for (BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO : businessSubSampleAnalysisGroupDOList) { + List curDeptSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getAssayDepartmentId().equals(loginUser.getVisitDeptId())).collect(Collectors.toList()); + for (BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO : curDeptSubSampleAnalysisGroupDOList) { businessSubSampleAnalysisGroupDO.setSampleReceiveTime(currentDateTime); businessSubSampleAnalysisGroupDO.setSampleReceiver(loginRealname); businessSubSampleAnalysisGroupDO.setSampleStatus("已收样"); } - sampleFlowContext.setBusinessSubSampleAnalysisGroupList(businessSubSampleAnalysisGroupDOList); + sampleFlowContext.setBusinessSubSampleAnalysisGroupList(curDeptSubSampleAnalysisGroupDOList); } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataServiceImpl.java index 9af6928..55ed343 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataServiceImpl.java @@ -16,6 +16,7 @@ import com.zt.plat.framework.common.pojo.PageParam; import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.framework.tenant.core.context.TenantContextHolder; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; @@ -88,10 +89,7 @@ public class BusinessAssayTaskDataServiceImpl implements BusinessAssayTaskDataSe @Override public List getUnAssayTaskGroupList(BusinessAssayTaskDataReqVO reqVO) { - //当前登录用户 - LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); - //设置当前登录用户的部门id - reqVO.setAssayDepartmentId(loginUser.getVisitDeptId()); + System.out.println("查询时租户id:" + TenantContextHolder.getTenantId()); return businessAssayTaskDataMapper.selectUnAssayTaskGroupList(reqVO); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchServiceImpl.java index 7cda5e3..9cc8ac8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchServiceImpl.java @@ -44,7 +44,7 @@ import static com.zt.plat.module.qms.enums.QmsBpmConstant.BPM_CALLBACK_BEAN_NAME * * @author 后台管理 */ -@Service +@Service("businessSampleDispatchService") @Validated @Slf4j public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatchService, BMPCallbackInterface { @@ -65,11 +65,11 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch List removeDetailIds = paramVo.getRemoveDetailIds(); //处理移除 - if(!removeDetailIds.isEmpty()){ + if(removeDetailIds != null && !removeDetailIds.isEmpty()){ businessSampleDispatchDetailService.deleteBusinessSampleDispatchDetailListByIds(removeDetailIds); } //处理新增 - if(!addSubSampleIds.isEmpty()){ + if(addSubSampleIds != null && !addSubSampleIds.isEmpty()){ List detailList = businessSampleDispatchDetailService.listByParID(id); //去除已添加过的 List hasIds = detailList.stream().map(BusinessSampleDispatchDetailDO::getBusinessSubSampleId).toList(); @@ -160,6 +160,7 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch BusinessHandoverRecordSubDO handoverRecord = new BusinessHandoverRecordSubDO(); handoverRecord.setBusinessSubSampleId(detail.getBusinessSubSampleId()); handoverRecord.setSampleCode(detail.getSampleCode()); + handoverRecord.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE); handoverRecord.setOperationTime(borrowTime); handoverRecord.setOperator(warehouseUser); handoverRecord.setOperatorId(warehouseUserId); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentProjectService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentProjectService.java new file mode 100644 index 0000000..19b0d26 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentProjectService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentProjectDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 班组判定检测项目数据业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessSubParentSampleAssessmentProjectService { + + /** + * 创建班组判定检测项目数据业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessSubParentSampleAssessmentProjectRespVO createBusinessSubParentSampleAssessment(@Valid BusinessSubParentSampleAssessmentProjectSaveReqVO createReqVO); + + /** + * 更新班组判定检测项目数据业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessSubParentSampleAssessment(@Valid BusinessSubParentSampleAssessmentProjectSaveReqVO updateReqVO); + + /** + * 删除班组判定检测项目数据业务 + * + * @param id 编号 + */ + void deleteBusinessSubParentSampleAssessment(Long id); + + /** + * 批量删除班组判定检测项目数据业务 + * + * @param ids 编号 + */ + void deleteBusinessSubParentSampleAssessmentListByIds(List ids); + + /** + * 获得班组判定检测项目数据业务 + * + * @param id 编号 + * @return 班组判定检测项目数据业务 + */ + BusinessSubParentSampleAssessmentProjectDO getBusinessSubParentSampleAssessment(Long id); + + /** + * 获得班组判定检测项目数据业务分页 + * + * @param pageReqVO 分页查询 + * @return 班组判定检测项目数据业务分页 + */ + PageResult getBusinessSubParentSampleAssessmentPage(BusinessSubParentSampleAssessmentProjectPageReqVO pageReqVO); + +} \ 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/service/BusinessSubParentSampleAssessmentProjectServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentProjectServiceImpl.java new file mode 100644 index 0000000..973035a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentProjectServiceImpl.java @@ -0,0 +1,86 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentProjectDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentProjectMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 班组判定检测项目数据业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessSubParentSampleAssessmentProjectServiceImpl implements BusinessSubParentSampleAssessmentProjectService { + + @Resource + private BusinessSubParentSampleAssessmentProjectMapper businessSubParentSampleAssessmentProjectMapper; + + @Override + public BusinessSubParentSampleAssessmentProjectRespVO createBusinessSubParentSampleAssessment(BusinessSubParentSampleAssessmentProjectSaveReqVO createReqVO) { + // 插入 + BusinessSubParentSampleAssessmentProjectDO businessSubParentSampleAssessment = BeanUtils.toBean(createReqVO, BusinessSubParentSampleAssessmentProjectDO.class); + businessSubParentSampleAssessmentProjectMapper.insert(businessSubParentSampleAssessment); + // 返回 + return BeanUtils.toBean(businessSubParentSampleAssessment, BusinessSubParentSampleAssessmentProjectRespVO.class); + } + + @Override + public void updateBusinessSubParentSampleAssessment(BusinessSubParentSampleAssessmentProjectSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessSubParentSampleAssessmentExists(updateReqVO.getId()); + // 更新 + BusinessSubParentSampleAssessmentProjectDO updateObj = BeanUtils.toBean(updateReqVO, BusinessSubParentSampleAssessmentProjectDO.class); + businessSubParentSampleAssessmentProjectMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessSubParentSampleAssessment(Long id) { + // 校验存在 + validateBusinessSubParentSampleAssessmentExists(id); + // 删除 + businessSubParentSampleAssessmentProjectMapper.deleteById(id); + } + + @Override + public void deleteBusinessSubParentSampleAssessmentListByIds(List ids) { + // 校验存在 + validateBusinessSubParentSampleAssessmentExists(ids); + // 删除 + businessSubParentSampleAssessmentProjectMapper.deleteByIds(ids); + } + + private void validateBusinessSubParentSampleAssessmentExists(List ids) { + List list = businessSubParentSampleAssessmentProjectMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_SUB_PARENT_SAMPLE_ASSESSMENT_PROJECT_NOT_EXISTS); + } + } + + private void validateBusinessSubParentSampleAssessmentExists(Long id) { + if (businessSubParentSampleAssessmentProjectMapper.selectById(id) == null) { + throw exception(BUSINESS_SUB_PARENT_SAMPLE_ASSESSMENT_PROJECT_NOT_EXISTS); + } + } + + @Override + public BusinessSubParentSampleAssessmentProjectDO getBusinessSubParentSampleAssessment(Long id) { + return businessSubParentSampleAssessmentProjectMapper.selectById(id); + } + + @Override + public PageResult getBusinessSubParentSampleAssessmentPage(BusinessSubParentSampleAssessmentProjectPageReqVO pageReqVO) { + return businessSubParentSampleAssessmentProjectMapper.selectPage(pageReqVO); + } + +} \ 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/service/BusinessSubParentSampleAssessmentServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentServiceImpl.java index 620fdbf..d2efdbb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentServiceImpl.java @@ -4,14 +4,19 @@ import cn.hutool.core.collection.CollUtil; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; /** diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentProjectService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentProjectService.java new file mode 100644 index 0000000..555c291 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentProjectService.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentProjectSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentProjectDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 子样判定检测项目数据业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessSubSampleAssessmentProjectService { + + /** + * 创建子样判定检测项目数据业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessSubSampleAssessmentProjectRespVO createBusinessSubSampleAssessment(@Valid BusinessSubSampleAssessmentProjectSaveReqVO createReqVO); + + /** + * 更新子样判定检测项目数据业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessSubSampleAssessment(@Valid BusinessSubSampleAssessmentProjectSaveReqVO updateReqVO); + + /** + * 删除子样判定检测项目数据业务 + * + * @param id 编号 + */ + void deleteBusinessSubSampleAssessment(Long id); + + /** + * 批量删除子样判定检测项目数据业务 + * + * @param ids 编号 + */ + void deleteBusinessSubSampleAssessmentListByIds(List ids); + + /** + * 获得子样判定检测项目数据业务 + * + * @param id 编号 + * @return 子样判定检测项目数据业务 + */ + BusinessSubSampleAssessmentProjectDO getBusinessSubSampleAssessment(Long id); + + /** + * 获得子样判定检测项目数据业务分页 + * + * @param pageReqVO 分页查询 + * @return 子样判定检测项目数据业务分页 + */ + PageResult getBusinessSubSampleAssessmentPage(BusinessSubSampleAssessmentProjectPageReqVO pageReqVO); + +} \ 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/service/BusinessSubSampleAssessmentProjectServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentProjectServiceImpl.java new file mode 100644 index 0000000..3fbcf25 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentProjectServiceImpl.java @@ -0,0 +1,93 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentProjectSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentProjectDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentProjectMapper; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 子样判定检测项目数据业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessSubSampleAssessmentProjectServiceImpl implements BusinessSubSampleAssessmentProjectService { + + @Resource + private BusinessSubSampleAssessmentProjectMapper businessSubSampleAssessmentProjectMapper; + + @Override + public BusinessSubSampleAssessmentProjectRespVO createBusinessSubSampleAssessment(BusinessSubSampleAssessmentProjectSaveReqVO createReqVO) { + // 插入 + BusinessSubSampleAssessmentProjectDO businessSubSampleAssessment = BeanUtils.toBean(createReqVO, BusinessSubSampleAssessmentProjectDO.class); + businessSubSampleAssessmentProjectMapper.insert(businessSubSampleAssessment); + // 返回 + return BeanUtils.toBean(businessSubSampleAssessment, BusinessSubSampleAssessmentProjectRespVO.class); + } + + @Override + public void updateBusinessSubSampleAssessment(BusinessSubSampleAssessmentProjectSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessSubSampleAssessmentExists(updateReqVO.getId()); + // 更新 + BusinessSubSampleAssessmentProjectDO updateObj = BeanUtils.toBean(updateReqVO, BusinessSubSampleAssessmentProjectDO.class); + businessSubSampleAssessmentProjectMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessSubSampleAssessment(Long id) { + // 校验存在 + validateBusinessSubSampleAssessmentExists(id); + // 删除 + businessSubSampleAssessmentProjectMapper.deleteById(id); + } + + @Override + public void deleteBusinessSubSampleAssessmentListByIds(List ids) { + // 校验存在 + validateBusinessSubSampleAssessmentExists(ids); + // 删除 + businessSubSampleAssessmentProjectMapper.deleteByIds(ids); + } + + private void validateBusinessSubSampleAssessmentExists(List ids) { + List list = businessSubSampleAssessmentProjectMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_SUB_SAMPLE_ASSESSMENT_PROJECT_NOT_EXISTS); + } + } + + private void validateBusinessSubSampleAssessmentExists(Long id) { + if (businessSubSampleAssessmentProjectMapper.selectById(id) == null) { + throw exception(BUSINESS_SUB_SAMPLE_ASSESSMENT_PROJECT_NOT_EXISTS); + } + } + + @Override + public BusinessSubSampleAssessmentProjectDO getBusinessSubSampleAssessment(Long id) { + return businessSubSampleAssessmentProjectMapper.selectById(id); + } + + @Override + public PageResult getBusinessSubSampleAssessmentPage(BusinessSubSampleAssessmentProjectPageReqVO pageReqVO) { + return businessSubSampleAssessmentProjectMapper.selectPage(pageReqVO); + } + +} \ 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/service/BusinessSubSampleAssessmentService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentService.java index 87a91ce..374d9ae 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentService.java @@ -1,10 +1,6 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; - -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentPageReqVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentRespVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentSaveReqVO; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; @@ -12,14 +8,14 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAsses import com.zt.plat.framework.common.pojo.PageParam; /** - * 子样判定数据业务 Service 接口 + * 子样判定业务 Service 接口 * * @author 后台管理 */ public interface BusinessSubSampleAssessmentService { /** - * 创建子样判定数据业务 + * 创建子样判定业务 * * @param createReqVO 创建信息 * @return 编号 @@ -27,39 +23,39 @@ public interface BusinessSubSampleAssessmentService { BusinessSubSampleAssessmentRespVO createBusinessSubSampleAssessment(@Valid BusinessSubSampleAssessmentSaveReqVO createReqVO); /** - * 更新子样判定数据业务 + * 更新子样判定业务 * * @param updateReqVO 更新信息 */ void updateBusinessSubSampleAssessment(@Valid BusinessSubSampleAssessmentSaveReqVO updateReqVO); /** - * 删除子样判定数据业务 + * 删除子样判定业务 * * @param id 编号 */ void deleteBusinessSubSampleAssessment(Long id); /** - * 批量删除子样判定数据业务 + * 批量删除子样判定业务 * * @param ids 编号 */ void deleteBusinessSubSampleAssessmentListByIds(List ids); /** - * 获得子样判定数据业务 + * 获得子样判定业务 * * @param id 编号 - * @return 子样判定数据业务 + * @return 子样判定业务 */ BusinessSubSampleAssessmentDO getBusinessSubSampleAssessment(Long id); /** - * 获得子样判定数据业务分页 + * 获得子样判定业务分页 * * @param pageReqVO 分页查询 - * @return 子样判定数据业务分页 + * @return 子样判定业务分页 */ PageResult getBusinessSubSampleAssessmentPage(BusinessSubSampleAssessmentPageReqVO pageReqVO); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentServiceImpl.java index 6460f6d..5677493 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentServiceImpl.java @@ -1,20 +1,18 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentPageReqVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentRespVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; import java.util.*; -import com.zt.plat.module.qms.business.bus.controller.vo.*; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; -import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageParam; import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; @@ -22,7 +20,7 @@ import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffL import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; /** - * 子样判定数据业务 Service 实现类 + * 子样判定业务 Service 实现类 * * @author 后台管理 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleService.java index c7970ca..18cd2e3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleService.java @@ -58,6 +58,7 @@ public interface BusinessSubSampleService { BusinessSubSampleExtendRespVO getBusinessSubSample(Long id); BusinessSubSampleDO getBySampleCode(String sampleCode); + BusinessSubSampleDO getBySampleReturnCode(String sampleReturnCode); /** * 获得子样业务分页 @@ -67,12 +68,21 @@ public interface BusinessSubSampleService { */ PageResult getBusinessSubSamplePage(BusinessSubSamplePageReqVO pageReqVO); + PageResult selectPageForDispatch(BusinessSubSamplePageReqVO pageReqVO); + + /** + * 获取子样分析班组分页 + * @param pageReqVO + * @return + */ + PageResult getAnalysisGroupPage(BusinessSubSamplePageReqVO pageReqVO); + /** * 获得子样业务列表 * @param reqVO 查询 * @return 子样业务列表 */ - List getBusinessSubSampleList(@Valid BusinessSubSampleReqVO reqVO); + List getBusinessSubSampleList(BusinessSubSampleReqVO reqVO); /** * 根据样品编号及样品流程节点获取样品信息 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 ed14947..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 @@ -3,13 +3,17 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO; -import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; +import com.zt.plat.module.qms.business.config.service.ConfigSubSampleService; import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationService; import com.zt.plat.module.qms.common.dic.service.DictionaryBusinessService; import com.zt.plat.module.qms.core.code.SequenceUtil; @@ -25,6 +29,9 @@ import org.springframework.validation.annotation.Validated; import java.time.LocalDateTime; import java.util.*; +import java.util.stream.Collectors; + +import com.zt.plat.framework.common.exception.ServiceException; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; @@ -57,6 +64,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { @Resource private BusinessSampleHandoverDetailService businessSampleHandoverDetailService; @Resource private BusinessHandoverRecordSubService businessHandoverRecordSubService; @Resource private DictionaryBusinessService dictionaryBusinessService; + @Resource private ConfigSubSampleService configSubSampleService; @Resource private SequenceUtil sequenceUtil; @Override @@ -129,23 +137,83 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { return businessSubSampleMapper.selectOne(queryWrapper); } + @Override + public BusinessSubSampleDO getBySampleReturnCode(String sampleReturnCode) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(BusinessSubSampleDO::getSampleReturnCode, sampleReturnCode); + return businessSubSampleMapper.selectOne(queryWrapper); + } + @Override public PageResult getBusinessSubSamplePage(BusinessSubSamplePageReqVO pageReqVO) { PageResult page = businessSubSampleMapper.selectPage(pageReqVO); - if (QmsCommonConstant.FLOW_NODE_TEAM_RECEIVE.equals(pageReqVO.getSampleFlowNodeKey())) {//如果是班组收样 - + List list = page.getList(); + if (CollUtil.isNotEmpty(list)) { + List subSampleIdList = list.stream().map(m -> m.getId()).collect(Collectors.toList()); + List businessSubSampleAnalysisGroupList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleIds(subSampleIdList); + + for (BusinessSubSampleExtendRespVO businessSubSampleExtendRespVO : list) { + List businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleExtendRespVO.getId())).collect(Collectors.toList()); + businessSubSampleExtendRespVO.setBusinessSubSampleAnalysisGroupList(BeanUtils.toBean(businessSubSampleAnalysisGroupDOList, BusinessSubSampleAnalysisGroupRespVO.class)); + } } return page; } + @Override + public PageResult selectPageForDispatch(BusinessSubSamplePageReqVO pageReqVO) { + IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); + Page pageList = businessSubSampleMapper.selectPageForDispatch(page, pageReqVO); + PageResult ret = new PageResult<>(pageList.getRecords(), pageList.getTotal()); + return ret; + } + + @Override + public PageResult getAnalysisGroupPage(BusinessSubSamplePageReqVO pageReqVO) { + PageResult page = businessSubSampleMapper.selectAnalysisGroupPage(pageReqVO); + List list = page.getList(); + if (CollUtil.isNotEmpty(list)) { + List subSampleIdList = list.stream().map(m -> m.getId()).collect(Collectors.toList()); + List businessSubSampleAnalysisGroupList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleIds(subSampleIdList); + + for (BusinessSubSampleExtendRespVO businessSubSampleExtendRespVO : list) { + List businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleExtendRespVO.getId())).collect(Collectors.toList()); + businessSubSampleExtendRespVO.setBusinessSubSampleAnalysisGroupList(BeanUtils.toBean(businessSubSampleAnalysisGroupDOList, BusinessSubSampleAnalysisGroupRespVO.class)); + } + } + return page; + } + @Override - public List getBusinessSubSampleList(@Valid BusinessSubSampleReqVO reqVO) { - return businessSubSampleMapper.selectList(reqVO); + public List getBusinessSubSampleList(BusinessSubSampleReqVO reqVO) { + List list = businessSubSampleMapper.selectList(reqVO); + if (CollUtil.isNotEmpty(list)) { + List subSampleIdList = list.stream().map(m -> m.getId()).collect(Collectors.toList()); + List businessSubSampleAnalysisGroupList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleIds(subSampleIdList); + + for (BusinessSubSampleExtendRespVO businessSubSampleExtendRespVO : list) { + List businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleExtendRespVO.getId())).collect(Collectors.toList()); + businessSubSampleExtendRespVO.setBusinessSubSampleAnalysisGroupList(BeanUtils.toBean(businessSubSampleAnalysisGroupDOList, BusinessSubSampleAnalysisGroupRespVO.class)); + } + } + return list; } @Override public BusinessSubSampleExtendRespVO getBySampleCodeAndFlowKey(@Valid BusinessSubSampleReqVO reqVO) { - return businessSubSampleMapper.getBySampleCodeAndFlowKey(reqVO); + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + 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; } //样品归库 @@ -154,18 +222,42 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { public BusinessSubSampleRespVO execReturnToStock(BusinessSubSampleSaveReqVO reqVo) { LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); String loginUserName = SecurityFrameworkUtils.getLoginUserNickname(); - BusinessSubSampleDO businessSubSampleDO = this.getBySampleCode(reqVo.getSampleCode()); + BusinessSubSampleDO businessSubSampleDO = this.getBySampleReturnCode(reqVo.getSampleReturnCode()); if(businessSubSampleDO == null) - throw exception(BUSINESS_SUB_SAMPLE_NOT_EXISTS); + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到子样数据,请检查:样品所处环节和是否已归库!"); //检查样品状态 if(!QmsCommonConstant.FLOW_SAMPLE_STORAGE.equals(businessSubSampleDO.getSampleFlowNodeKey())) throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "子样任务不在“归库”环节,请检查前置任务是否已完成!"); if(QmsCommonConstant.COMPLETED.equals(businessSubSampleDO.getReturnStatus())) throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已归库,请勿重复操作!"); + //判断仓库位置 + Long configSubSampleId = businessSubSampleDO.getConfigSubSampleId(); + ConfigSubSampleDO configSubSampleDO = configSubSampleService.getConfigSubSample(configSubSampleId); + String cfgLocationCode = configSubSampleDO.getConfigWarehouseLocationCode(); //子样配置表的仓库编码 ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(reqVo.getWarehouseLocationCode(), QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); if(locationDO == null) throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS); + ConfigWarehouseLocationDO warehouseDO = configWarehouseLocationService.getConfigWarehouseLocation(locationDO.getParentId()); + if(warehouseDO == null) + throw exception0(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS.getCode(), "库位编码对应的仓库不存在,请联系管理员处理!"); + if(!warehouseDO.getCode().equals(cfgLocationCode)) + throw exception0(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS.getCode(), "您归库的样品不该进入此库,请检查后再重新归库。应归入仓库(编码):" + cfgLocationCode); + //判断归库码 + Integer isGenerateSimpleCode = configSubSampleDO.getIsGenerateSimpleCode(); + Integer printFlag = 0; + if(1 == isGenerateSimpleCode){ + //生成归库码 + if(businessSubSampleDO.getIsGenerateReturnCode() == 0){ + String simpleCodeRule = configSubSampleDO.getSimpleCodeRule(); + String simpleCode = sequenceUtil.genCode(simpleCodeRule); + businessSubSampleDO.setSampleReturnCode(simpleCode); + businessSubSampleDO.setIsGenerateReturnCode(1); + printFlag = 1; + } + } + + //更新入库状态 businessSubSampleDO.setReturnStatus(QmsCommonConstant.COMPLETED); @@ -190,8 +282,9 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { * 这里不更新交接人。 调拨和归还时记录交接人 * * */ - - return BeanUtils.toBean(businessSubSampleDO, BusinessSubSampleRespVO.class); + BusinessSubSampleExtendRespVO respVO = BeanUtils.toBean(businessSubSampleDO, BusinessSubSampleExtendRespVO.class); + respVO.setIsPrint(printFlag); + return respVO; } //样品下架 @@ -200,7 +293,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { public Integer execTakeOff(JSONObject reqVo) { String actionWay = reqVo.getString("actionWay"); String warehouseLocationCode = reqVo.getString("warehouseLocationCode"); - String sampleCode = reqVo.getString("sampleCode"); + String sampleReturnCode = reqVo.getString("sampleReturnCodes"); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); String loginUserName = SecurityFrameworkUtils.getLoginUserNickname(); //查询要操作的样品 @@ -209,10 +302,10 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { queryWrapper.eq(BusinessSubSampleDO::getReturnStatus, QmsCommonConstant.COMPLETED); if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_SAMPLE.equals(actionWay)){ //按编号查询样品 - if(ObjectUtils.isEmpty(sampleCode)) + if(ObjectUtils.isEmpty(sampleReturnCode)) throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少样品编号参数!"); - List sampleCodes = Arrays.asList(sampleCode.split( ",")); - queryWrapper.in(BusinessSubSampleDO::getSampleCode, sampleCodes); + List sampleReturnCodes = Arrays.asList(sampleReturnCode.split( ",")); + queryWrapper.in(BusinessSubSampleDO::getSampleReturnCode, sampleReturnCodes); } else if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_LOCATION.equals(actionWay)){ //按库位查询样品 @@ -282,7 +375,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { String actionWay = reqVo.getString("actionWay"); String targetLocation = reqVo.getString("targetLocation"); String warehouseLocationCode = reqVo.getString("warehouseLocationCode"); - String sampleCode = reqVo.getString("sampleCode"); + String sampleReturnCode = reqVo.getString("sampleReturnCode"); if(ObjectUtils.isEmpty(targetLocation)) throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少目标库位参数!"); ConfigWarehouseLocationDO targetLocationDO = configWarehouseLocationService.getLocationByCode(targetLocation, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); @@ -292,10 +385,10 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { queryWrapper.eq(BusinessSubSampleDO::getReturnStatus, QmsCommonConstant.COMPLETED); if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_SAMPLE.equals(actionWay)){ //按编号查询样品 - if(ObjectUtils.isEmpty(sampleCode)) + if(ObjectUtils.isEmpty(sampleReturnCode)) throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少样品编号参数!"); - List sampleCodes = Arrays.asList(sampleCode.split( ",")); - queryWrapper.in(BusinessSubSampleDO::getSampleCode, sampleCodes); + List sampleReturnCodes = Arrays.asList(sampleReturnCode.split( ",")); + queryWrapper.in(BusinessSubSampleDO::getSampleReturnCode, sampleReturnCodes); } else if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_LOCATION.equals(actionWay)){ //按库位查询样品 @@ -304,7 +397,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(warehouseLocationCode, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); if(locationDO == null) throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS); - queryWrapper.eq(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, warehouseLocationCode); + queryWrapper.eq(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, locationDO.getId()); }else{ throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "actionWay参数错误!"); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java index 2b94cbe..3b180d6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java @@ -22,7 +22,7 @@ public interface SampleAnalysisAuditService { void crossAuditByByTaskId(Long businessAssayTaskId, String auditStatus); - JSONObject getSampleResultAssessmentList(Long configAssayMethodId, String assessmentStatus); + JSONObject getSampleResultAssessmentList(Long configAssayMethodId, String asmtReportedStatus); JSONObject getParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId); 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 47c4099..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 @@ -42,8 +42,10 @@ 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; +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.mapper.BusinessAssayParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; @@ -58,8 +60,10 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMa 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; +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.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectAssessmentDO; @@ -135,12 +139,12 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic @Resource private ConfigAssayMethodProjectAssessmentMapper configAssayMethodProjectAssessmentMapper; -// @Resource -// private BusinessTeamAssessmentMapper businessTeamAssessmentMapper; - @Resource private BusinessSubSampleAssessmentMapper businessSubSampleAssessmentMapper; + @Resource + private BusinessSubSampleAssessmentProjectMapper businessSubSampleAssessmentProjectMapper; + @Resource private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper; @@ -148,7 +152,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic private ConfigSubSampleMethodMapper configSubSampleMethodMapper; @Override - public JSONObject getSampleResultAssessmentList(Long configAssayMethodId, String assessmentStatus) { + public JSONObject getSampleResultAssessmentList(Long configAssayMethodId, String asmtReportedStatus) { List configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); List> columnList = new ArrayList<>(); @@ -168,6 +172,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic List> dataList = new ArrayList<>(); BusinessAssayTaskDataReqVO search = new BusinessAssayTaskDataReqVO(); search.setConfigAssayMethodId(configAssayMethodId); + search.setAsmtReportedStatus(asmtReportedStatus); List resultAssessmentList = businessAssayTaskDataMapper.selectResultAssessmentList(search); for (BusinessAssayTaskDataExtendRespVO businessAssayTaskDataExtendRespVO : resultAssessmentList) { @@ -186,8 +191,8 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic //为空则未添加过判定记录 if (assessmentMap == null) { if (QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL.equals(businessAssayTaskDataExtendRespVO.getAssayType())) {//平行 - List businessSubSampleAssessmentList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessAssayTaskDataExtendRespVO.getBusinessSubSampleId(), configAssayMethodId); - for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { + List businessSubSampleAssessmentList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessAssayTaskDataExtendRespVO.getBusinessSubSampleId(), configAssayMethodId); + for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { businessAssayTaskDataAssessmentMap.put("id", businessSubSampleAssessment.getId()); businessAssayTaskDataAssessmentMap.put("assessmentStatus", businessSubSampleAssessment.getAssessmentStatus()); businessAssayTaskDataAssessmentMap.put("assessmentStatus_" + businessSubSampleAssessment.getSimpleName(), businessSubSampleAssessment.getAssessmentStatus()); @@ -214,11 +219,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic dataList.add(businessAssayTaskDataMap); } - - if (StringUtils.isNotBlank(assessmentStatus)) { - dataList = dataList.stream().filter(f -> assessmentStatus.equals(f.get("assessmentStatus"))).collect(Collectors.toList()); - } - + JSONObject json = new JSONObject(); json.put("columns", columnList); @@ -257,9 +258,9 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic } //查询判定值 - List businessSubSampleAssessmentList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); + List businessSubSampleAssessmentList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); - for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { + for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { Map businessSubSampleAssessmentMap = BeanUtil.beanToMap(businessSubSampleAssessment); List businessAssayProjectDataSingleList = businessAssayProjectDataList.stream().filter(f -> f.getDictionaryProjectId().equals(businessSubSampleAssessment.getDictionaryProjectId())).collect(Collectors.toList()); for (BusinessAssayProjectDataExtendRespVO businessAssayProjectDataExtendRespVO : businessAssayProjectDataSingleList) { @@ -416,14 +417,19 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic } @Override + @Transactional(rollbackFor = Exception.class) public void crossAuditByByTaskId(Long businessAssayTaskId, String auditStatus) { //当前登录用户昵称 String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + //自动上报的子样 + List automaticBusinessSubSampleIdList = new ArrayList<>(); + //判定记录 - List saveBusinessSubSampleAssessmentDOList = new ArrayList<>(); List updateBusinessSubSampleAssessmentDOList = new ArrayList<>(); + List saveBusinessSubSampleAssessmentProjectDOList = new ArrayList<>(); + List updateBusinessSubSampleAssessmentProjectDOList = new ArrayList<>(); BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); if (QmsCommonConstant.APPROVE.equals(auditStatus)) { @@ -434,6 +440,8 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic //查询分析任务明细 List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessAssayTaskId(businessAssayTaskId); + List businessSubSampleIdList = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); + List businessSubSampleAssessmentDOList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdsAndConfigAssayMethodId(businessSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId()); //根据子样分组 Map> businessAssayTaskDataDOMap = businessAssayTaskDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getBusinessSubSampleId)); //循环分组 @@ -443,6 +451,10 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic List businessAssayTaskDataList = businessAssayTaskDataDOMapEntry.getValue(); List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); BusinessAssayTaskDataDO businessAssayTaskDataDO = businessAssayTaskDataList.get(0); + + BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId); + //获取子样分析方法配置 + ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId()); if (QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL.equals(businessAssayTaskDataDO.getAssayType())) { //根据子样id及分析方法id,查询未上报的分析任务 @@ -457,6 +469,14 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic businessAssayTaskDataIdList.addAll(reportedBusinessAssayTaskDataIdList); } + //查询判定业务 + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = updateBusinessSubSampleAssessmentDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleAssessmentId())).findFirst().orElse(null); + if (businessSubSampleAssessmentDO == null) { + businessSubSampleAssessmentDO = businessSubSampleAssessmentDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleAssessmentId())).findFirst().orElse(null); + updateBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + } + //状态设置为待上报 + businessSubSampleAssessmentDO.setReportedStatus(QmsCommonConstant.ASMT_PENDING_REPORT); //查询分析项目 List businessAssayProjectDataDOList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList)); Map> businessAssayProjectDataDOMap = businessAssayProjectDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayProjectDataDO::getDictionaryProjectId)); @@ -467,26 +487,26 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic List configAssayMethodProjectAssessmentDOList = configAssayMethodProjectAssessmentMapper.selectList(new LambdaQueryWrapperX().eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodId, businessAssayTaskDataDO.getConfigAssayMethodId()).eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodProjectId, businessAssayProjectDataDO.getConfigAssayMethodProjectId())); //查询判定结果数据 - BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(businessSubSampleId, businessAssayTaskDataDO.getConfigAssayMethodId(), businessAssayProjectDataDO.getConfigAssayMethodProjectId()); - if (businessSubSampleAssessmentDO == null) { - businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); + BusinessSubSampleAssessmentProjectDO businessSubSampleAssessmentProjectDO = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(businessSubSampleId, businessAssayTaskDataDO.getConfigAssayMethodId(), businessAssayProjectDataDO.getConfigAssayMethodProjectId()); + if (businessSubSampleAssessmentProjectDO == null) { + businessSubSampleAssessmentProjectDO = new BusinessSubSampleAssessmentProjectDO(); - saveBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + saveBusinessSubSampleAssessmentProjectDOList.add(businessSubSampleAssessmentProjectDO); } else { - updateBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + updateBusinessSubSampleAssessmentProjectDOList.add(businessSubSampleAssessmentProjectDO); } - businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); - businessSubSampleAssessmentDO.setBusinessSubSampleId(businessAssayTaskDataDO.getBusinessSubSampleId()); - businessSubSampleAssessmentDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId()); - businessSubSampleAssessmentDO.setConfigAssayMethodProjectId(businessAssayProjectDataDO.getConfigAssayMethodProjectId()); - businessSubSampleAssessmentDO.setDictionaryProjectId(dictionaryProjectId); - businessSubSampleAssessmentDO.setDataType(businessAssayProjectDataDO.getDataType()); - businessSubSampleAssessmentDO.setDecimalPosition(businessAssayProjectDataDO.getDecimalPosition()); - businessSubSampleAssessmentDO.setAssayType(businessAssayTaskDataDO.getAssayType()); - businessSubSampleAssessmentDO.setTaskType(businessAssayTaskDataDO.getTaskType()); - businessSubSampleAssessmentDO.setUsage(businessAssayProjectDataDO.getUsage()); - businessSubSampleAssessmentDO.setSymbol(businessAssayProjectDataDO.getSymbol()); - businessSubSampleAssessmentDO.setAssessmentStatus(QmsCommonConstant.NORMAL); + businessSubSampleAssessmentProjectDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); + businessSubSampleAssessmentProjectDO.setBusinessSubSampleId(businessAssayTaskDataDO.getBusinessSubSampleId()); + businessSubSampleAssessmentProjectDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId()); + businessSubSampleAssessmentProjectDO.setConfigAssayMethodProjectId(businessAssayProjectDataDO.getConfigAssayMethodProjectId()); + businessSubSampleAssessmentProjectDO.setDictionaryProjectId(dictionaryProjectId); + businessSubSampleAssessmentProjectDO.setDataType(businessAssayProjectDataDO.getDataType()); + businessSubSampleAssessmentProjectDO.setDecimalPosition(businessAssayProjectDataDO.getDecimalPosition()); + businessSubSampleAssessmentProjectDO.setAssayType(businessAssayTaskDataDO.getAssayType()); + businessSubSampleAssessmentProjectDO.setTaskType(businessAssayTaskDataDO.getTaskType()); + businessSubSampleAssessmentProjectDO.setUsage(businessAssayProjectDataDO.getUsage()); + businessSubSampleAssessmentProjectDO.setSymbol(businessAssayProjectDataDO.getSymbol()); + businessSubSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.NORMAL); // 排序并处理 null List sortedValues = val1.stream() @@ -503,7 +523,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic BigDecimal representativeValue = calculateRepresentativeValue(sortedValues, elementScale); //设置判定值 - businessSubSampleAssessmentDO.setAssessmentValue(representativeValue.toPlainString()); + businessSubSampleAssessmentProjectDO.setAssessmentValue(representativeValue.toPlainString()); // 查找匹配的允差规则 ConfigAssayMethodProjectAssessmentDO matchedRule = findMatchingRule(configAssayMethodProjectAssessmentDOList, representativeValue); @@ -523,14 +543,19 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic for (int i = 0; i < sortedValues.size() - 1; i++) { BigDecimal diff = sortedValues.get(i + 1).subtract(sortedValues.get(i)).abs(); if (diff.compareTo(allowValue) > 0) { - businessSubSampleAssessmentDO.setAssessmentStatus(QmsCommonConstant.EXCEEDS_TOLERANCE); + businessSubSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.EXCEEDS_TOLERANCE); + //存在超差,设置为待判定 + businessSubSampleAssessmentDO.setReportedStatus(QmsCommonConstant.ASMT_PENDING_ASSESSMENT); break; } } } - + //如果为自动上报 + if (QmsCommonConstant.AUTOMATIC.equals(configSubSampleMethodDO.getResultTreatmentWay())) { + automaticBusinessSubSampleIdList.add(businessSubSampleId); + } } @@ -539,35 +564,53 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic } else if (QmsCommonConstant.ASSAY_TYPE_DOUBLE_CUP.equals(businessAssayTaskDataDO.getAssayType())) { } else {//单杯 + + + //查询判定业务 + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = updateBusinessSubSampleAssessmentDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleAssessmentId())).findFirst().orElse(null); + if (businessSubSampleAssessmentDO == null) { + businessSubSampleAssessmentDO = businessSubSampleAssessmentDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleAssessmentId())).findFirst().orElse(null); + updateBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + } + //修改状态为待上报 + businessSubSampleAssessmentDO.setReportedStatus(QmsCommonConstant.ASMT_PENDING_REPORT); + //查询分析项目 List businessAssayProjectDataDOList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList)); for (BusinessAssayProjectDataDO businessAssayProjectDataDO : businessAssayProjectDataDOList) { //查询判定结果数据 - BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(businessSubSampleId, businessAssayTaskDataDO.getConfigAssayMethodId(), businessAssayProjectDataDO.getConfigAssayMethodProjectId()); - if (businessSubSampleAssessmentDO == null) { - businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); + BusinessSubSampleAssessmentProjectDO businessSubSampleAssessmentProjectDO = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(businessSubSampleId, businessAssayTaskDataDO.getConfigAssayMethodId(), businessAssayProjectDataDO.getConfigAssayMethodProjectId()); + if (businessSubSampleAssessmentProjectDO == null) { + businessSubSampleAssessmentProjectDO = new BusinessSubSampleAssessmentProjectDO(); - saveBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + saveBusinessSubSampleAssessmentProjectDOList.add(businessSubSampleAssessmentProjectDO); } else { - updateBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + updateBusinessSubSampleAssessmentProjectDOList.add(businessSubSampleAssessmentProjectDO); } - businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); - businessSubSampleAssessmentDO.setBusinessSubSampleId(businessAssayTaskDataDO.getBusinessSubSampleId()); - businessSubSampleAssessmentDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId()); - businessSubSampleAssessmentDO.setConfigAssayMethodProjectId(businessAssayProjectDataDO.getConfigAssayMethodProjectId()); - businessSubSampleAssessmentDO.setDictionaryProjectId(businessAssayProjectDataDO.getDictionaryProjectId()); - businessSubSampleAssessmentDO.setDataType(businessAssayProjectDataDO.getDataType()); - businessSubSampleAssessmentDO.setDecimalPosition(businessAssayProjectDataDO.getDecimalPosition()); - businessSubSampleAssessmentDO.setAssayType(businessAssayTaskDataDO.getAssayType()); - businessSubSampleAssessmentDO.setTaskType(businessAssayTaskDataDO.getTaskType()); - businessSubSampleAssessmentDO.setUsage(businessAssayProjectDataDO.getUsage()); - businessSubSampleAssessmentDO.setMinimumLimitValue(businessAssayProjectDataDO.getMinimumLimitValue()); - businessSubSampleAssessmentDO.setSymbol(businessAssayProjectDataDO.getSymbol()); - businessSubSampleAssessmentDO.setAssessmentStatus(QmsCommonConstant.NORMAL); - businessSubSampleAssessmentDO.setAssessmentValue(businessAssayProjectDataDO.getValue()); + businessSubSampleAssessmentProjectDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); + businessSubSampleAssessmentProjectDO.setBusinessSubSampleId(businessAssayTaskDataDO.getBusinessSubSampleId()); + businessSubSampleAssessmentProjectDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId()); + businessSubSampleAssessmentProjectDO.setConfigAssayMethodProjectId(businessAssayProjectDataDO.getConfigAssayMethodProjectId()); + businessSubSampleAssessmentProjectDO.setDictionaryProjectId(businessAssayProjectDataDO.getDictionaryProjectId()); + businessSubSampleAssessmentProjectDO.setDataType(businessAssayProjectDataDO.getDataType()); + businessSubSampleAssessmentProjectDO.setDecimalPosition(businessAssayProjectDataDO.getDecimalPosition()); + businessSubSampleAssessmentProjectDO.setAssayType(businessAssayTaskDataDO.getAssayType()); + businessSubSampleAssessmentProjectDO.setTaskType(businessAssayTaskDataDO.getTaskType()); + businessSubSampleAssessmentProjectDO.setUsage(businessAssayProjectDataDO.getUsage()); + businessSubSampleAssessmentProjectDO.setMinimumLimitValue(businessAssayProjectDataDO.getMinimumLimitValue()); + businessSubSampleAssessmentProjectDO.setSymbol(businessAssayProjectDataDO.getSymbol()); + businessSubSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.NORMAL); + businessSubSampleAssessmentProjectDO.setAssessmentValue(businessAssayProjectDataDO.getValue()); } + + + //如果为自动上报 + if (QmsCommonConstant.AUTOMATIC.equals(configSubSampleMethodDO.getResultTreatmentWay())) { + automaticBusinessSubSampleIdList.add(businessSubSampleId); + } + } @@ -598,18 +641,23 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic } businessAssayTaskMapper.updateById(businessAssayTaskDO); - //插入平行判定记录 - if (saveBusinessSubSampleAssessmentDOList.size() > 0) { - businessSubSampleAssessmentMapper.insertBatch(saveBusinessSubSampleAssessmentDOList); - } if (updateBusinessSubSampleAssessmentDOList.size() > 0) { businessSubSampleAssessmentMapper.updateBatch(updateBusinessSubSampleAssessmentDOList); } + if (saveBusinessSubSampleAssessmentProjectDOList.size() > 0) { + businessSubSampleAssessmentProjectMapper.insertBatch(saveBusinessSubSampleAssessmentProjectDOList); + } + if (updateBusinessSubSampleAssessmentProjectDOList.size() > 0) { + businessSubSampleAssessmentProjectMapper.updateBatch(updateBusinessSubSampleAssessmentProjectDOList); + } + + //执行自动上报 + if (automaticBusinessSubSampleIdList.size() > 0) { + for (Long automaticBusinessSubSampleId : automaticBusinessSubSampleIdList) { + this.assessmentDataReporting(automaticBusinessSubSampleId, businessAssayTaskDO.getConfigAssayMethodId()); + } + } - //插入双杯判定记录 -// if (businessTeamAssessmentDOList.size() > 0) { -// businessTeamAssessmentMapper.insertBatch(businessTeamAssessmentDOList); -// } } // 查找匹配的允差区间 @@ -681,6 +729,12 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic @Resource private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper; + + @Resource + private BusinessSubParentSampleAssessmentProjectMapper businessSubParentSampleAssessmentProjectMapper; + + @Resource + private SampleResultReportingService sampleResultReportingService; @Override @Transactional(rollbackFor = Exception.class) @@ -691,15 +745,15 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic if (unReportedList.size() > 0) { throw new ServiceException(1_032_100_000, "存在未上报的数据"); } -// List saveBusinessAssayReportDataDOList = new ArrayList<>(); -// List updateBusinessAssayReportDataDOList = new ArrayList<>(); + //自动上报 + List automaticBusinessSubParentSampleIdList = new ArrayList<>(); - List businessSubParentSampleAssessmentDOList = new ArrayList<>(); + List businessSubParentSampleAssessmentDOList = new ArrayList<>(); //分析任务已全部上报 List reportedList = businessAssayTaskDataMapper.selectIsReportedList(null, businessSubSampleId, configAssayMethodId, QmsCommonConstant.YES); //判定结果 - List businessSubSampleAssessmentList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); + List businessSubSampleAssessmentList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); List businessSubSampleAssessmentIdList = businessSubSampleAssessmentList.stream().map(m -> m.getId()).collect(Collectors.toList()); @@ -708,135 +762,66 @@ 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); + //循环判定值 - BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = null; - for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { - businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO(); - businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); - businessSubParentSampleAssessmentDO.setAssessmentStatus(QmsCommonConstant.NORMAL); - businessSubParentSampleAssessmentDO.setAssessmentValue(businessSubSampleAssessment.getAssessmentValue()); - businessSubParentSampleAssessmentDO.setTaskType(businessSubSampleAssessment.getTaskType()); - businessSubParentSampleAssessmentDO.setAssayType(businessSubSampleAssessment.getAssayType()); - businessSubParentSampleAssessmentDO.setDataType(businessSubSampleAssessment.getDataType()); - businessSubParentSampleAssessmentDO.setDecimalPosition(businessSubSampleAssessment.getDecimalPosition()); - businessSubParentSampleAssessmentDO.setUsage(businessSubSampleAssessment.getUsage()); - businessSubParentSampleAssessmentDO.setMinimumLimitValue(businessSubParentSampleAssessmentDO.getMinimumLimitValue()); - businessSubParentSampleAssessmentDO.setConfigAssayMethodId(businessSubSampleAssessment.getConfigAssayMethodId()); - businessSubParentSampleAssessmentDO.setConfigAssayMethodProjectId(businessSubSampleAssessment.getConfigAssayMethodProjectId()); - businessSubParentSampleAssessmentDO.setDictionaryProjectId(businessSubSampleAssessment.getDictionaryProjectId()); + 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()); + businessSubParentSampleAssessmentProjectDO.setTaskType(businessSubSampleAssessment.getTaskType()); + businessSubParentSampleAssessmentProjectDO.setAssayType(businessSubSampleAssessment.getAssayType()); + businessSubParentSampleAssessmentProjectDO.setDataType(businessSubSampleAssessment.getDataType()); + businessSubParentSampleAssessmentProjectDO.setDecimalPosition(businessSubSampleAssessment.getDecimalPosition()); + businessSubParentSampleAssessmentProjectDO.setUsage(businessSubSampleAssessment.getUsage()); + businessSubParentSampleAssessmentProjectDO.setMinimumLimitValue(businessSubParentSampleAssessmentProjectDO.getMinimumLimitValue()); + businessSubParentSampleAssessmentProjectDO.setConfigAssayMethodId(businessSubSampleAssessment.getConfigAssayMethodId()); + businessSubParentSampleAssessmentProjectDO.setConfigAssayMethodProjectId(businessSubSampleAssessment.getConfigAssayMethodProjectId()); + businessSubParentSampleAssessmentProjectDO.setDictionaryProjectId(businessSubSampleAssessment.getDictionaryProjectId()); - businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO); + businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentProjectDO); } - /** - //查询报表 - 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) { - businessSubParentSampleAssessmentMapper.insertBatch(businessSubParentSampleAssessmentDOList); + businessSubParentSampleAssessmentProjectMapper.insertBatch(businessSubParentSampleAssessmentDOList); } - businessSubSampleAssessmentMapper.update(new LambdaUpdateWrapper() - .set(BusinessSubSampleAssessmentDO::getIsReported, QmsCommonConstant.YES) - .set(BusinessSubSampleAssessmentDO::getReporter, nickName) - .set(BusinessSubSampleAssessmentDO::getReportTime, LocalDateTime.now()) - .in(BusinessSubSampleAssessmentDO::getId, businessSubSampleAssessmentIdList)); + //修改子样判定为已上报 + 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) + .set(BusinessSubSampleAssessmentProjectDO::getReportTime, LocalDateTime.now()) + .in(BusinessSubSampleAssessmentProjectDO::getId, businessSubSampleAssessmentIdList)); + + if (QmsCommonConstant.AUTOMATIC.equals(configSubSampleParentMethodDO.getResultTreatmentWay())) { + automaticBusinessSubParentSampleIdList.add(businessSubParentSampleDO.getId()); + BatchResultDataReportingReqVO batchResultDataReportingReqVO = new BatchResultDataReportingReqVO(); + batchResultDataReportingReqVO.setBusinessSubParentSampleIds(automaticBusinessSubParentSampleIdList); + batchResultDataReportingReqVO.setConfigAssayMethodId(configAssayMethodId); + + sampleResultReportingService.batchResultDataReporting(batchResultDataReportingReqVO); + } } @Resource @@ -863,6 +848,8 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic List newBusinessAssayTaskDataDOList = new ArrayList<>(); List newBusinessAssayProjectDataDOList = new ArrayList<>(); List newBusinessAssayParameterDataDOList = new ArrayList<>(); + + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); BusinessAssayTaskDataDO newBusinessAssayTaskDataDO = null; List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectMaxAnalysisCountByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); @@ -879,6 +866,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic newBusinessAssayTaskDataDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); newBusinessAssayTaskDataDO.setBusinessSubSampleId(businessAssayTaskDataDO.getBusinessSubSampleId()); newBusinessAssayTaskDataDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId()); + newBusinessAssayTaskDataDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId()); newBusinessAssayTaskDataDO.setAssayType(businessAssayTaskDataDO.getAssayType()); newBusinessAssayTaskDataDO.setTaskType(businessAssayTaskDataDO.getTaskType()); newBusinessAssayTaskDataDO.setConfigSampleFlowId(businessAssayTaskDataDO.getConfigSampleFlowId()); @@ -924,11 +912,15 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic //修改判定状态 //查询判定值 - List businessSubSampleAssessmentList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); - for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessmentExtendRespVO : businessSubSampleAssessmentList) { - businessSubSampleAssessmentExtendRespVO.setAssessmentValue(null); - businessSubSampleAssessmentExtendRespVO.setAssessmentStatus(QmsCommonConstant.IN_PROGRESS); + List businessSubSampleAssessmentList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); + for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentList) { + businessSubSampleAssessmentProjectExtendRespVO.setAssessmentValue(null); + businessSubSampleAssessmentProjectExtendRespVO.setAssessmentStatus(QmsCommonConstant.IN_PROGRESS); } + //修改上报状态为复测中 + businessSubSampleAssessmentDO.setReportedStatus(QmsCommonConstant.ASMT_RE_INSPECTED); + + businessSubSampleAssessmentMapper.updateById(businessSubSampleAssessmentDO); if (newBusinessAssayTaskDataDOList.size() > 0) { businessAssayTaskDataMapper.insertBatch(newBusinessAssayTaskDataDOList); @@ -940,8 +932,8 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic businessAssayParameterDataMapper.insertBatch(newBusinessAssayParameterDataDOList); } if (businessSubSampleAssessmentList.size() > 0) { - List businessSubSampleAssessmentDOList = BeanUtil.copyToList(businessSubSampleAssessmentList, BusinessSubSampleAssessmentDO.class); - businessSubSampleAssessmentMapper.updateBatch(businessSubSampleAssessmentDOList); + List businessSubSampleAssessmentDOList = BeanUtil.copyToList(businessSubSampleAssessmentList, BusinessSubSampleAssessmentProjectDO.class); + businessSubSampleAssessmentProjectMapper.updateBatch(businessSubSampleAssessmentDOList); } } @@ -952,7 +944,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic @Override @Transactional(rollbackFor = Exception.class) public JSONObject modifyParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId, Long businessSubSampleAssessmentId, List businessAssayProjectDataIds) { - BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectById(businessSubSampleAssessmentId); + BusinessSubSampleAssessmentProjectDO businessSubSampleAssessmentProjectDO = businessSubSampleAssessmentProjectMapper.selectById(businessSubSampleAssessmentId); //查询子样 BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId); //查询子样与方法的配置 @@ -964,7 +956,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic BusinessAssayProjectDataReqVO businessAssayProjectDataSearch = new BusinessAssayProjectDataReqVO(); businessAssayProjectDataSearch.setBusinessSubSampleId(businessSubSampleId); businessAssayProjectDataSearch.setConfigAssayMethodId(configAssayMethodId); - businessAssayProjectDataSearch.setConfigAssayMethodProjectId(businessSubSampleAssessmentDO.getConfigAssayMethodProjectId()); + businessAssayProjectDataSearch.setConfigAssayMethodProjectId(businessSubSampleAssessmentProjectDO.getConfigAssayMethodProjectId()); List businessAssayProjectDataList = businessAssayProjectDataMapper.selectAnalysisBy(businessAssayProjectDataSearch); List businessAssayProjectDataDOList = BeanUtil.copyToList(businessAssayProjectDataList, BusinessAssayProjectDataDO.class); for (BusinessAssayProjectDataDO businessAssayProjectDataDO : businessAssayProjectDataDOList) { @@ -985,7 +977,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic .collect(Collectors.toList()); // 获取小数精度 - int elementScale = businessSubSampleAssessmentDO.getDecimalPosition(); + int elementScale = businessSubSampleAssessmentProjectDO.getDecimalPosition(); // 计算代表值(均值\) // BigDecimal representativeValue = calculateRepresentativeValue(sortedValues, elementScale); DefaultContext context = new DefaultContext<>(); @@ -999,16 +991,16 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic } //设置判定值 - businessSubSampleAssessmentDO.setAssessmentValue(representativeValue.toPlainString()); + businessSubSampleAssessmentProjectDO.setAssessmentValue(representativeValue.toPlainString()); List configAssayMethodProjectAssessmentDOList = configAssayMethodProjectAssessmentMapper.selectList(new LambdaQueryWrapperX() - .eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodId, businessSubSampleAssessmentDO.getConfigAssayMethodId()) - .eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodProjectId, businessSubSampleAssessmentDO.getConfigAssayMethodProjectId())); + .eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodId, businessSubSampleAssessmentProjectDO.getConfigAssayMethodId()) + .eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodProjectId, businessSubSampleAssessmentProjectDO.getConfigAssayMethodProjectId())); // 查找匹配的允差规则 ConfigAssayMethodProjectAssessmentDO matchedRule = findMatchingRule(configAssayMethodProjectAssessmentDOList, representativeValue); if (matchedRule == null) { - throw new ServiceException(1_032_100_000, "未找到超差判定区间范围,元素ID: " + businessSubSampleAssessmentDO.getDictionaryProjectId() + ", 值: " + representativeValue); + throw new ServiceException(1_032_100_000, "未找到超差判定区间范围,元素ID: " + businessSubSampleAssessmentProjectDO.getDictionaryProjectId() + ", 值: " + representativeValue); } // 计算允差值 @@ -1016,20 +1008,21 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic try { allowValue = allowanceCalculatorComponent.calculateAllowableValue(new BigDecimal(matchedRule.getMinimumValue()), new BigDecimal(matchedRule.getMaximumValue()), new BigDecimal(matchedRule.getMinimumToleraanceValue()), new BigDecimal(matchedRule.getMaximumToleraanceValue()), new BigDecimal(matchedRule.getToleraanceAdjustmentValue()), representativeValue, matchedRule.getIsUseFormula(), matchedRule.getFormula(), elementScale); } catch (Exception e) { - throw new ServiceException(1_032_100_000, "超差判定计算出错,检测项目ID: " + businessSubSampleAssessmentDO.getDictionaryProjectId()); + 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(); if (diff.compareTo(allowValue) > 0) { - businessSubSampleAssessmentDO.setAssessmentStatus(QmsCommonConstant.EXCEEDS_TOLERANCE); + businessSubSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.EXCEEDS_TOLERANCE); break; } } //更新判定值 - businessSubSampleAssessmentMapper.updateById(businessSubSampleAssessmentDO); + businessSubSampleAssessmentProjectMapper.updateById(businessSubSampleAssessmentProjectDO); //更新检测项目 businessAssayProjectDataMapper.updateBatch(businessAssayProjectDataDOList); 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 5ca7ecd..3c33c1d 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 @@ -4,6 +4,7 @@ import java.util.List; import com.alibaba.fastjson2.JSONObject; import com.zt.plat.module.qms.business.bus.controller.vo.BatchResultDataReportingReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentGroupReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentGroupRespVO; import com.zt.plat.module.qms.business.bus.controller.vo.ModifySampleResultReportingReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.RecheckSubSampleParentCreateReqVO; @@ -11,7 +12,7 @@ import com.zt.plat.module.qms.business.bus.controller.vo.RecheckSubSampleParentM public interface SampleResultReportingService { - List getUnReportMethodGroupList(); + List getUnReportMethodGroupList(BusinessSubParentSampleAssessmentGroupReqVO reqVO); JSONObject getSampleResultReportingList(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 e4014bc..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 @@ -18,11 +18,13 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.qms.business.bus.controller.vo.BatchResultDataReportingReqVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentProjectExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentGroupReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentGroupRespVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentProjectExtendRespVO; import com.zt.plat.module.qms.business.bus.controller.vo.ModifySampleResultReportingReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.NoReportSubParentSampleAssessmentRespVO; import com.zt.plat.module.qms.business.bus.controller.vo.RecheckSubSampleParentCreateReqVO; @@ -35,8 +37,10 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDat 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.BusinessSubSampleAssessmentDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; +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; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper; @@ -45,10 +49,14 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMap 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.BusinessSubSampleAssessmentMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAnalysisGroupMapper; +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; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowParam; import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectExtendRespVO; @@ -81,10 +89,10 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; @Resource - private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper; + private BusinessSubParentSampleAssessmentProjectMapper businessSubParentSampleAssessmentProjectMapper; @Resource - private BusinessSubSampleAssessmentMapper businessSubSampleAssessmentMapper; + private BusinessSubSampleAssessmentProjectMapper businessSubSampleAssessmentProjectMapper; @Resource private BusinessSubParentSampleMapper businessSubParentSampleMapper; @@ -97,8 +105,8 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe @Override - public List getUnReportMethodGroupList() { - List list = businessSubParentSampleAssessmentMapper.selectUnReportMethodGroupList(); + public List getUnReportMethodGroupList(BusinessSubParentSampleAssessmentGroupReqVO reqVO) { + List list = businessSubParentSampleAssessmentProjectMapper.selectUnReportMethodGroupList(reqVO); return list; } @@ -124,11 +132,11 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe List> dataList = new ArrayList<>(); //查询结果报送未上报的样品 - List noReportSubParentSampleAssessmentRespList = businessSubParentSampleAssessmentMapper.selectNoReportSubParentSampleAssessment(configAssayMethodId); + List noReportSubParentSampleAssessmentRespList = businessSubParentSampleAssessmentProjectMapper.selectNoReportSubParentSampleAssessment(configAssayMethodId); //分样id列表 List businessSubParentSampleIds = noReportSubParentSampleAssessmentRespList.stream().map(m -> m.getBusinessSubParentSampleId()).collect(Collectors.toList()); //报送的检测项目数据 - List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); //获取分析任务数 List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); List businessSubSampleIds = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); @@ -136,7 +144,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIds); //获取结果判定数据 - List businessSubSampleAssessmentExtendRespVOList = businessSubSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + List businessSubSampleAssessmentExtendRespVOList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); //获取复测业务数据 List businessSubSampleParentRecheckDOList = businessSubSampleParentRecheckMapper.selectByRecheckBusinessSubParentSampleIdsAndRecheckConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); @@ -149,10 +157,10 @@ 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()); + List curBusinessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList()); noReportSubParentSampleAssessmentMap.put("configAssayMethodName", "报出结果"); StringBuilder businessSubParentSampleAssessmentIds = new StringBuilder(); - for (BusinessSubParentSampleAssessmentExtendRespVO businessSubParentSampleAssessmentDO : curBusinessSubParentSampleAssessmentDOList) { + for (BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentDO : curBusinessSubParentSampleAssessmentDOList) { noReportSubParentSampleAssessmentMap.put(businessSubParentSampleAssessmentDO.getSimpleName(), businessSubParentSampleAssessmentDO.getAssessmentValue()); businessSubParentSampleAssessmentIds.append(businessSubParentSampleAssessmentDO.getId()).append(","); } @@ -164,12 +172,12 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe BusinessSubSampleParentRecheckDO businessSubSampleParentRecheckDO = businessSubSampleParentRecheckDOList.stream().filter(f -> f.getRecheckBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).findFirst().orElse(null); if (businessSubSampleParentRecheckDO != null) { - List businessSubSampleAssessmentExtendBeforeList = businessSubSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubSampleParentRecheckDO.getBusinessSubParentSampleId(), businessSubSampleParentRecheckDO.getConfigAssayMethodId()); + List businessSubSampleAssessmentExtendBeforeList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubSampleParentRecheckDO.getBusinessSubParentSampleId(), businessSubSampleParentRecheckDO.getConfigAssayMethodId()); StringBuilder businessSubSampleAssessmentIdsBefore = new StringBuilder(); - for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessmentExtendRespVO : businessSubSampleAssessmentExtendBeforeList) { - subSampleAssessmentBeforeMap.put("configAssayMethodName", businessSubSampleAssessmentExtendRespVO.getConfigAssayMethodName()); - subSampleAssessmentBeforeMap.put(businessSubSampleAssessmentExtendRespVO.getSimpleName(), businessSubSampleAssessmentExtendRespVO.getAssessmentValue()); - businessSubSampleAssessmentIdsBefore.append(businessSubSampleAssessmentExtendRespVO.getId()).append(","); + for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentExtendBeforeList) { + subSampleAssessmentBeforeMap.put("configAssayMethodName", businessSubSampleAssessmentProjectExtendRespVO.getConfigAssayMethodName()); + subSampleAssessmentBeforeMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue()); + businessSubSampleAssessmentIdsBefore.append(businessSubSampleAssessmentProjectExtendRespVO.getId()).append(","); } businessSubSampleAssessmentIdsBefore.delete(businessSubSampleAssessmentIdsBefore.length() -1, businessSubSampleAssessmentIdsBefore.length()); subSampleAssessmentBeforeMap.put("businessSubParentSampleAssessmentIds", businessSubParentSampleAssessmentIds.toString()); @@ -179,12 +187,12 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe } - List businessSubSampleAssessmentList = businessSubSampleAssessmentExtendRespVOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList()); + List businessSubSampleAssessmentList = businessSubSampleAssessmentExtendRespVOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList()); StringBuilder businessSubSampleAssessmentIds = new StringBuilder(); - for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessmentExtendRespVO : businessSubSampleAssessmentList) { - subSampleAssessmentMap.put("configAssayMethodName", businessSubSampleAssessmentExtendRespVO.getConfigAssayMethodName()); - subSampleAssessmentMap.put(businessSubSampleAssessmentExtendRespVO.getSimpleName(), businessSubSampleAssessmentExtendRespVO.getAssessmentValue()); - businessSubSampleAssessmentIds.append(businessSubSampleAssessmentExtendRespVO.getId()).append(","); + for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentList) { + subSampleAssessmentMap.put("configAssayMethodName", businessSubSampleAssessmentProjectExtendRespVO.getConfigAssayMethodName()); + subSampleAssessmentMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue()); + businessSubSampleAssessmentIds.append(businessSubSampleAssessmentProjectExtendRespVO.getId()).append(","); } businessSubSampleAssessmentIds.delete(businessSubSampleAssessmentIds.length() -1, businessSubSampleAssessmentIds.length()); subSampleAssessmentMap.put("businessSubParentSampleAssessmentIds", businessSubParentSampleAssessmentIds.toString()); @@ -223,7 +231,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe @Override public List getRecheckAssayMethodList(Long baseSampleId, Long businessSubParentSampleId, Long configAssayMethodId) { //查询检查项目 - List list = businessSubParentSampleAssessmentMapper.getRecheckAssayMethodList(baseSampleId, businessSubParentSampleId, configAssayMethodId); + List list = businessSubParentSampleAssessmentProjectMapper.getRecheckAssayMethodList(baseSampleId, businessSubParentSampleId, configAssayMethodId); //过滤默认的 List resultList = list.stream().filter(f -> f.getIsRecheckDefault() != null && f.getIsRecheckDefault().equals(QmsCommonConstant.YES)).collect(Collectors.toList()); for (RecheckSubSampleParentMethodRespVO recheckSubSampleParentMethodRespVO : resultList) { @@ -400,6 +408,15 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe @Resource private BusinessBaseSampleMapper businessBaseSampleMapper; + + @Resource + private BusinessSubSampleAnalysisGroupMapper businessSubSampleAnalysisGroupMapper; + + @Resource + private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper; + + @Resource + private SampleFlowService sampleFlowService; @Override @Transactional(rollbackFor = Exception.class) @@ -407,14 +424,21 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe //当前登录用户昵称 String nickName = SecurityFrameworkUtils.getLoginUserNickname(); - + + + List updateBusinessSubSampleDOList = new ArrayList<>(); + List updateBusinessSubSampleAnalysisGroupDOList = new ArrayList<>(); + List saveBusinessAssayReportDataDOList = new ArrayList<>(); List updateBusinessAssayReportDataDOList = new ArrayList<>(); - List businessSubParentSampleAssessmentExtendList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId()); + 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) { BusinessBaseSampleDO businessBaseSampleDO = businessBaseSampleMapper.selectById(businessSubParentSampleDO.getBusinessBaseSampleId()); @@ -435,7 +459,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe //根据检测方法查询字段配置 List configProjectList = configProjectMapper.selectByConfigAssayMethodId(reqVO.getConfigAssayMethodId()); - + //处理报表数据 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) { @@ -455,8 +479,8 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe assayDataJson = JSON.parseObject(assayData); } //循环判定值 - List businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleDO.getId())).collect(Collectors.toList()); - for (BusinessSubParentSampleAssessmentExtendRespVO businessSubParentSampleAssessment : businessSubParentSampleAssessmentList) { + List businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleDO.getId())).collect(Collectors.toList()); + for (BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessment : businessSubParentSampleAssessmentList) { Long configAssayMethodProjectId = businessSubParentSampleAssessment.getConfigAssayMethodProjectId(); List configProjectFeildList = configProjectList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectId)).collect(Collectors.toList()); for (ConfigProjectExtendRespVO configProjectFeild : configProjectFeildList) { @@ -505,6 +529,35 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe } } + + //处理子样分析任务数据 + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIds(reqVO.getBusinessSubParentSampleIds()); + List businessSubSampleIdList = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); + List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList); + List businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubParentSampleIds(reqVO.getBusinessSubParentSampleIds()); + //根据子样id进行分组 + Map> businessAssayTaskDataDOMap = businessAssayTaskDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getBusinessSubSampleId)); + for (Map.Entry> businessAssayTaskDataDOEntry : businessAssayTaskDataDOMap.entrySet()) { + Long businessSubSampleId = businessAssayTaskDataDOEntry.getKey(); + //子样下的分析任务 + List valList = businessAssayTaskDataDOEntry.getValue(); + //查询子样 + BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> businessSubSampleId.equals(f.getId())).findFirst().orElse(null); + //查询子样下的分析班组 + List subSampleAnalysisGroupList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleId)).collect(Collectors.toList()); + for (BusinessSubSampleAnalysisGroupDO subSampleAnalysisGroupDO : subSampleAnalysisGroupList) { + long count = valList.stream().filter(f -> f.getIsReported().equals(QmsCommonConstant.NO) && f.getAssayDepartmentId().equals(subSampleAnalysisGroupDO.getAssayDepartmentId())).count(); + if (count > 0) {//如果还存在未上报的数据,则继续 + continue; + } + subSampleAnalysisGroupDO.setSampleStatus("已完成");//当前班组分析已完成 + updateBusinessSubSampleAnalysisGroupDOList.add(subSampleAnalysisGroupDO); + + updateBusinessSubSampleDOList.add(businessSubSampleDO); + } + + + } if (saveBusinessAssayReportDataDOList.size() > 0) { businessAssayReportDataMapper.insertBatch(saveBusinessAssayReportDataDOList); @@ -513,13 +566,35 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe businessAssayReportDataMapper.updateBatch(updateBusinessAssayReportDataDOList); } + //更新分析班组 + if (updateBusinessSubSampleAnalysisGroupDOList.size()> 0) { + businessSubSampleAnalysisGroupMapper.updateBatch(updateBusinessSubSampleAnalysisGroupDOList); + } + 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::getId, businessSubParentSampleAssessmentIdList)); + .in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleIds()) + .eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())); + + + if (updateBusinessSubSampleDOList.size() > 0) { + + SampleFlowParam sampleFlowParam = new SampleFlowParam(); + sampleFlowParam.setCurrentSampleFlowKey(QmsCommonConstant.FLOW_NODE_ANALYSIS); + sampleFlowParam.setSampleSourceType(2); + sampleFlowParam.setSampleFlowInfoList(BeanUtils.toBean(updateBusinessSubSampleDOList, SampleFlowInfo.class)); + sampleFlowService.sampleFlow(sampleFlowParam); + } } @Override @@ -532,13 +607,13 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe public void modifySampleResultReporting(ModifySampleResultReportingReqVO reqVO) { List businessSubParentSampleAssessmentIdList = Arrays.asList(reqVO.getBusinessSubParentSampleAssessmentIds().split(",")); List businessSubSampleAssessmentIdList = Arrays.asList(reqVO.getBusinessSubSampleAssessmentIds().split(",")); - List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByIds(businessSubParentSampleAssessmentIdList); - List businessSubSampleAssessmentDOList = businessSubSampleAssessmentMapper.selectByIds(businessSubSampleAssessmentIdList); - for (BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO : businessSubParentSampleAssessmentDOList) { - BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentDOList.stream().filter(f -> f.getDictionaryProjectId().equals(businessSubParentSampleAssessmentDO.getDictionaryProjectId())).findFirst().orElse(null); - businessSubParentSampleAssessmentDO.setAssessmentValue(businessSubSampleAssessmentDO.getAssessmentValue()); + List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentProjectMapper.selectByIds(businessSubParentSampleAssessmentIdList); + List businessSubSampleAssessmentDOList = businessSubSampleAssessmentProjectMapper.selectByIds(businessSubSampleAssessmentIdList); + for (BusinessSubParentSampleAssessmentProjectDO businessSubParentSampleAssessmentProjectDO : businessSubParentSampleAssessmentDOList) { + BusinessSubSampleAssessmentProjectDO businessSubSampleAssessmentProjectDO = businessSubSampleAssessmentDOList.stream().filter(f -> f.getDictionaryProjectId().equals(businessSubParentSampleAssessmentProjectDO.getDictionaryProjectId())).findFirst().orElse(null); + businessSubParentSampleAssessmentProjectDO.setAssessmentValue(businessSubSampleAssessmentProjectDO.getAssessmentValue()); } - businessSubParentSampleAssessmentMapper.updateBatch(businessSubParentSampleAssessmentDOList); + businessSubParentSampleAssessmentProjectMapper.updateBatch(businessSubParentSampleAssessmentDOList); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignService.java index b287b5e..8afa8f5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignService.java @@ -22,7 +22,7 @@ public interface SampleTaskAssignService { * 获取未指派任务子样信息 * @return */ - List getAssaySampleList(); + List getAssaySampleList(BusinessAssayTaskDataReqVO reqVO); /** * 根据子样id查询分析方法 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java index fc4c815..e70cb1d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java @@ -177,8 +177,8 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { } @Override - public List getAssaySampleList() { - List list = businessAssayTaskDataMapper.selectUnAssignTaskedSubSample(); + public List getAssaySampleList(BusinessAssayTaskDataReqVO reqVO) { + List list = businessAssayTaskDataMapper.selectUnAssignTaskedSubSample(reqVO); return list; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java index 56c515e..4cd4efd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java @@ -78,7 +78,7 @@ import gridreport.jni.Report; @RequestMapping("/qms/config-report-template") @Validated @Slf4j -public class ConfigReportTemplateController implements BusinessControllerMarker { +public class ConfigReportTemplateController { public static final String WR_PREFIX = "_WR_"; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSamplePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSamplePageReqVO.java index d42eb27..49fef26 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSamplePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSamplePageReqVO.java @@ -28,6 +28,9 @@ public class ConfigSubSamplePageReqVO extends PageParam { @Schema(description = "子样流程Key,样品流转流程key") private String flowKey; + @Schema(description = "是否生成新的归库简码,1-是,0-否") + private Integer isGenerateSimpleCode; + @Schema(description = "简码规则") private String simpleCodeRule; @@ -40,6 +43,9 @@ public class ConfigSubSamplePageReqVO extends PageParam { @Schema(description = "样品标签打印模版") private String printTemplate; + @Schema(description = "样品标签打印份数") + private Integer codePrintQuantity; + @Schema(description = "复检节点") private String recheckFlowNodeKey; @@ -49,6 +55,9 @@ public class ConfigSubSamplePageReqVO extends PageParam { @Schema(description = "样品保存天数") private Integer sampleSaveDay; + @Schema(description = "样品库编码,样品最终归属样品库,来自T_CFG_WRH_LOC,仓库类型是样品库") + private String configWarehouseLocationCode; + @Schema(description = "所属部门") private String systemDepartmentCode; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleRespVO.java index 49b6f91..6dd16e5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleRespVO.java @@ -36,6 +36,10 @@ public class ConfigSubSampleRespVO { @ExcelProperty("子样流程Key,样品流转流程key") private String flowKey; + @Schema(description = "是否生成新的归库简码,1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否生成新的归库简码,1-是,0-否") + private Integer isGenerateSimpleCode; + @Schema(description = "简码规则", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("简码规则") private String simpleCodeRule; @@ -51,6 +55,10 @@ public class ConfigSubSampleRespVO { @Schema(description = "样品标签打印模版") private String printTemplate; + @Schema(description = "样品标签打印份数", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("样品标签打印份数") + private Integer codePrintQuantity; + @Schema(description = "复检节点") @ExcelProperty("复检节点") private String recheckFlowNodeKey; @@ -63,6 +71,10 @@ public class ConfigSubSampleRespVO { @ExcelProperty("样品保存天数") private Integer sampleSaveDay; + @Schema(description = "样品库编码,样品最终归属样品库,来自T_CFG_WRH_LOC,仓库类型是样品库") + @ExcelProperty("样品库编码,样品最终归属样品库,来自T_CFG_WRH_LOC,仓库类型是样品库") + private String configWarehouseLocationCode; + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleSaveReqVO.java index 861450e..dd7568a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleSaveReqVO.java @@ -32,6 +32,10 @@ public class ConfigSubSampleSaveReqVO { @NotEmpty(message = "子样流程Key,样品流转流程key不能为空") private String flowKey; + @Schema(description = "是否生成新的归库简码,1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否生成新的归库简码,1-是,0-否不能为空") + private Integer isGenerateSimpleCode; + @Schema(description = "简码规则", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "简码规则不能为空") private String simpleCodeRule; @@ -46,6 +50,10 @@ public class ConfigSubSampleSaveReqVO { @Schema(description = "样品标签打印模版") private String printTemplate; + @Schema(description = "样品标签打印份数", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "样品标签打印份数不能为空") + private Integer codePrintQuantity; + @Schema(description = "复检节点") private String recheckFlowNodeKey; @@ -57,6 +65,9 @@ public class ConfigSubSampleSaveReqVO { @NotNull(message = "样品保存天数不能为空") private Integer sampleSaveDay; + @Schema(description = "样品库编码,样品最终归属样品库,来自T_CFG_WRH_LOC,仓库类型是样品库") + private String configWarehouseLocationCode; + @Schema(description = "所属部门") private String systemDepartmentCode; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleDO.java index e7eb8c7..62c87b4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleDO.java @@ -57,6 +57,11 @@ public class ConfigSubSampleDO extends BusinessBaseDO { @TableField("FLW_KY") private String flowKey; /** + * 是否生成新的归库简码,1-是,0-否 + */ + @TableField("IS_GEN_SMPL_CD") + private Integer isGenerateSimpleCode; + /** * 简码规则 */ @TableField("SMPL_CD_RUL") @@ -77,6 +82,11 @@ public class ConfigSubSampleDO extends BusinessBaseDO { @TableField("PRNT_TMPL") private String printTemplate; /** + * 样品标签打印份数 + */ + @TableField("CD_PRNT_QTY") + private Integer codePrintQuantity; + /** * 复检节点 */ @TableField("RCHK_FLW_NDE_KY") @@ -92,6 +102,11 @@ public class ConfigSubSampleDO extends BusinessBaseDO { @TableField("SMP_SVE_DY") private Integer sampleSaveDay; /** + * 样品库编码,样品最终归属样品库,来自T_CFG_WRH_LOC,仓库类型是样品库 + */ + @TableField("CFG_WRH_LOC_CD") + private String configWarehouseLocationCode; + /** * 所属部门 */ @TableField("SYS_DEPT_CD") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMapper.java index d6a6072..96fd270 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMapper.java @@ -23,12 +23,16 @@ public interface ConfigSubSampleMapper extends BaseMapperX { .eqIfPresent(ConfigSubSampleDO::getConfigSubSampleParentId, reqVO.getConfigSubSampleParentId()) .eqIfPresent(ConfigSubSampleDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) .eqIfPresent(ConfigSubSampleDO::getFlowKey, reqVO.getFlowKey()) + .eqIfPresent(ConfigSubSampleDO::getIsGenerateSimpleCode, reqVO.getIsGenerateSimpleCode()) .eqIfPresent(ConfigSubSampleDO::getSimpleCodeRule, reqVO.getSimpleCodeRule()) .eqIfPresent(ConfigSubSampleDO::getCodeRule, reqVO.getCodeRule()) + .eqIfPresent(ConfigSubSampleDO::getPrintTemplate, reqVO.getPrintTemplate()) + .eqIfPresent(ConfigSubSampleDO::getCodePrintQuantity, reqVO.getCodePrintQuantity()) .eqIfPresent(ConfigSubSampleDO::getIsPrint, reqVO.getIsPrint()) .eqIfPresent(ConfigSubSampleDO::getRecheckFlowNodeKey, reqVO.getRecheckFlowNodeKey()) .likeIfPresent(ConfigSubSampleDO::getSampleName, reqVO.getSampleName()) .eqIfPresent(ConfigSubSampleDO::getSampleSaveDay, reqVO.getSampleSaveDay()) + .eqIfPresent(ConfigSubSampleDO::getConfigWarehouseLocationCode, reqVO.getConfigWarehouseLocationCode()) .eqIfPresent(ConfigSubSampleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .betweenIfPresent(ConfigSubSampleDO::getCreateTime, reqVO.getCreateTime()) .eqIfPresent(ConfigSubSampleDO::getRemark, reqVO.getRemark()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionService.java index 5507083..5669459 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionService.java @@ -16,7 +16,7 @@ import com.zt.plat.framework.common.pojo.PageResult; */ public interface ConfigPermissionService { - void savePermissionListWithAutoDelete(List list); + void savePermissionListWithAutoDelete(List list, Long delSourceId, String delSourceType, String delPermissionType); void savePermission(List insertList, List updateList, List deleteList); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionServiceImpl.java index c935e80..049c357 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionServiceImpl.java @@ -37,10 +37,27 @@ public class ConfigPermissionServiceImpl implements ConfigPermissionService { private ConfigPermissionMapper configPermissionMapper; - //保存权限配置,自动判断删除 + /*** + * 保存权限,并判断删除 + * @param list: 传入的权限列表 + * 如果list为空,则按delSourceId、delSourceType、delPermissionType 删除 + * + * */ @Override @Transactional(rollbackFor = Exception.class) - public void savePermissionListWithAutoDelete(List list) { + public void savePermissionListWithAutoDelete(List list, Long delSourceId, String delSourceType, String delPermissionType) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + //如果传入权限列表为空,则按sourceId、 sourceType、 delPermissionType删除 + if(list == null || list.isEmpty()){ + if(delSourceId != null && !ObjectUtils.isEmpty(delSourceType)){ + wrapper.eq(ConfigPermissionDO::getSourceId, delSourceId); + wrapper.eq(ConfigPermissionDO::getSourceType, delSourceType); + if(delPermissionType != null) + wrapper.eq(ConfigPermissionDO::getPermissionType, delPermissionType); + configPermissionMapper.delete( wrapper); + } + return; + } //检查数据,避免误处理:按sourceId、sourceType检查 List sourceIdList = list.stream().map(ConfigPermissionSaveReqVO::getSourceId).distinct().toList(); List sourceTypeList = list.stream().map(ConfigPermissionSaveReqVO::getSourceType).distinct().toList(); @@ -48,13 +65,13 @@ public class ConfigPermissionServiceImpl implements ConfigPermissionService { if (sourceIdList.size() > 1 || sourceTypeList.size() > 1 || permissionTypeList.size() > 1) { throw exception0(CONFIG_PERMISSION_DUPLICATE.getCode(), "权限保存失败,提交的权限数据存在不一致的情况,请刷新后重试,或联系管理员处理"); } - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + ConfigPermissionSaveReqVO queryDO = list.get(0); - queryWrapper.eq(ConfigPermissionDO::getSourceId, queryDO.getSourceId()) + wrapper.eq(ConfigPermissionDO::getSourceId, queryDO.getSourceId()) .eq(ConfigPermissionDO::getSourceType, queryDO.getSourceType()); if(!ObjectUtils.isEmpty(queryDO.getPermissionType())) - queryWrapper.eq(ConfigPermissionDO::getPermissionType, queryDO.getPermissionType()); - List oldList = configPermissionMapper.selectList(queryWrapper); + wrapper.eq(ConfigPermissionDO::getPermissionType, queryDO.getPermissionType()); + List oldList = configPermissionMapper.selectList(wrapper); List insertList = new ArrayList<>(); List updateList = new ArrayList<>(); List deleteIdList = new ArrayList<>(); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java index 7af8904..9d491b7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java @@ -78,6 +78,7 @@ public class ReportDocumentMainController extends AbstractFileUploadController i if(typeDO == null){ return error(REPORT_DOCUMENT_TYPE_NOT_EXISTS, "报告类型不存在,请刷新后重试"); } + vo.setDocumentTitle(typeDO.getName()); vo.setFlowKey(typeDO.getFlowKey()); vo.setDocumentType(typeDO.getDocumentType()); vo.setConfigReportTypeId(typeDO.getConfigReportTypeId()); @@ -244,8 +245,8 @@ public class ReportDocumentMainController extends AbstractFileUploadController i @Operation(summary = "获得检测报告业务分页") //@PreAuthorize("@ss.hasPermission('qms:report-document-main:query')") public CommonResult> getReportDocumentMainPage(@Valid ReportDocumentMainPageReqVO pageReqVO) { - PageResult pageResult = reportDocumentMainService.getReportDocumentMainPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, ReportDocumentMainRespVO.class)); + PageResult pageResult = reportDocumentMainService.getReportDocumentMainPage(pageReqVO); + return success(pageResult); } @GetMapping("/export-excel") @@ -255,10 +256,9 @@ public class ReportDocumentMainController extends AbstractFileUploadController i public void exportReportDocumentMainExcel(@Valid ReportDocumentMainPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = reportDocumentMainService.getReportDocumentMainPage(pageReqVO).getList(); + List list = reportDocumentMainService.getReportDocumentMainPage(pageReqVO).getList(); // 导出 Excel - ExcelUtils.write(response, "检测报告业务.xls", "数据", ReportDocumentMainRespVO.class, - BeanUtils.toBean(list, ReportDocumentMainRespVO.class)); + ExcelUtils.write(response, "检测报告业务.xls", "数据", ReportDocumentMainRespVO.class, list); } } \ 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/reportdoc/controller/vo/ReportDocumentMainRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java index 8c2fbff..ee8dc5d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java @@ -113,4 +113,10 @@ public class ReportDocumentMainRespVO { @Schema(description = "表单设计器模板id") @ExcelProperty("表单设计器模板id") private Long dataTemplateId; + + //==============================扩展字段======================================= + @Schema(description = "记录数") + @ExcelProperty("记录数") + private Long detailDataCount; + } \ 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/reportdoc/dal/mapper/ReportDocumentMainMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentMainMapper.java index c39426b..e6ccfc1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentMainMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentMainMapper.java @@ -3,7 +3,9 @@ package com.zt.plat.module.qms.business.reportdoc.dal.mapper; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO; import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; import org.apache.ibatis.annotations.Mapper; import org.springframework.util.ObjectUtils; @@ -21,10 +23,13 @@ import java.util.List; public interface ReportDocumentMainMapper extends BaseMapperX { - default PageResult selectPage(ReportDocumentMainPageReqVO reqVO) { + default PageResult selectPage(ReportDocumentMainPageReqVO reqVO) { String flowStatus = reqVO.getFlowStatus(); - LambdaQueryWrapperX wrapper = new LambdaQueryWrapperX<>(); + MPJLambdaWrapperX wrapper = new MPJLambdaWrapperX<>(); + wrapper.selectSub(ReportDocumentDataDO.class, s-> + s.selectCount(ReportDocumentDataDO::getMainId).eq(ReportDocumentDataDO::getMainId, ReportDocumentMainDO::getId), ReportDocumentMainRespVO::getDetailDataCount); + wrapper.selectAll(ReportDocumentMainDO.class); wrapper.ne(ReportDocumentMainDO::getCancelFlag, -1); //-1为临时数据 wrapper.eqIfPresent(ReportDocumentMainDO::getFlowInstanceId, reqVO.getFlowInstanceId()); wrapper.eqIfPresent(ReportDocumentMainDO::getReportDocumentTypeId, reqVO.getReportDocumentTypeId()); @@ -49,7 +54,7 @@ public interface ReportDocumentMainMapper extends BaseMapperX> assembleDynamicData(ReportDocumentMainDO mainData, ReportDocumentTypeDO reportConfig); CommonResult> listByMainDataId(Long mainDataId); + CommonResult countMainDataId(Long mainDataId); CommonResult removeByMainIdAndDetailIds(Long mainDataId, List detailIds); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java index d44beb8..40b2521 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java @@ -50,7 +50,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService private final String name_code_code = "code"; private final String name_code_split = "split"; private final String rangeKey = "minLimitValue"; - + private final String emptyText = "以下为空白"; /* @@ -87,6 +87,8 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService for(ReportDocumentDataDO dataDO : dataList){ String documentContent = dataDO.getDocumentContent(); JSONObject dataJson = JSONObject.parseObject(documentContent); + if(dataJson == null) + continue; if(dataJson.containsKey(field)){ if(!hasFields.contains( fieldName)){ fieldList.add(fieldDO); @@ -113,17 +115,20 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService Integer dynamicColCount = 3; Integer fixedColCount = 3; Integer maxRowCount = 3; - String dynamicColCountStr = jsonObject.getString("dynamicColCount"); //动态列(检测项)数量 - String fixedColCountStr = jsonObject.getString("fixedColCount"); //固定列(样品名称、样品编号等)数量 - String maxRowCountStr = jsonObject.getString("maxRowCount"); //最大行数 - String nameCodeType = jsonObject.getString("nameCodeType"); //名称、编号处理方式:merge-合并, name-只显示名称, code-只显示编号, split-2列分开显示 - String hasRemark = jsonObject.getString("hasRemark"); //是否有备注 - String hasRange = jsonObject.getString("hasRange"); //是否有检出限 - String verticalFlag = jsonObject.getString("verticalFlag"); //vertical-纵表, 否则为横表 - if("1".equals(verticalFlag)){ + String dynamicColCountStr = jsonObject.getString("dynamicColCount"); //动态列(检测项)数量 + String fixedColCountStr = jsonObject.getString("fixedColCount"); //固定列(样品名称、样品编号等)数量 + String maxRowCountStr = jsonObject.getString("maxRowCount"); //最大行数 + String nameCodeType = jsonObject.getString("nameCodeType"); //名称、编号处理方式:merge-合并, name-只显示名称, code-只显示编号, split-2列分开显示 + String hasRemark = jsonObject.getString("hasRemark"); //是否有备注 + String hasRange = jsonObject.getString("hasRange"); //是否有检出限 + String verticalFlag = jsonObject.getString("verticalFlag"); //vertical-纵表, 否则为横表 + String fixedFields = jsonObject.getString("fixedFields"); //固定检测项。如果固定检测项,则以检测项作为数据Key + if("1".equals(verticalFlag)){ //纵表 return assembleVerticalData(fieldList, dataList, customConfig); } - + if(!ObjectUtils.isEmpty(fixedFields)){ //固定列 + return assembleFixedFieldsData(fieldList, dataList, customConfig); + } if(!ObjectUtils.isEmpty(dynamicColCountStr)) dynamicColCount = Integer.parseInt(dynamicColCountStr); if(!ObjectUtils.isEmpty(fixedColCountStr)) fixedColCount = Integer.parseInt(fixedColCountStr); @@ -147,7 +152,13 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService if(rowCountOneSample > 1){ allRowCount = (1 + dataLength + emptyRowCount + 9) * rowCountOneSample + emptyRowCount; //(标题 + 样品数 + 空行) * 但样品行数 + 末尾行 } - List rowList = new ArrayList<>(Arrays.asList(new JSONObject[allRowCount + 1])); + List rowList = new ArrayList<>(); + for(int i = 0; i < maxRowCount; i++){ + JSONObject row = new JSONObject(); + row.put("col01", " "); + rowList.add( row); + } + //=============处理表头============ JSONObject t = new JSONObject(); @@ -261,13 +272,15 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService //==============以下为空白================= //实际使用行数小于总行数,显示“”以下为空白“ - if(dataIndex < maxRowCount){ + if(dataLength < maxRowCount){ String colKey = colPrefix + "01"; t = new JSONObject(); - t.put(colKey, "以下为空白"); + t.put(colKey, emptyText); int rowIndex = (dataLength + emptyRowCount) * (rowAssist) + 2; if(rowAssist == 1) rowIndex = dataLength + emptyRowCount; + if(rowCountOneSample == 1) + rowIndex = dataLength + 2; rowList.set(rowIndex, t.clone()); } //前面的计数是从1开始,移除第一个元素 @@ -371,6 +384,77 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService return sb.append(num).toString(); } + /** + * 组装固定检测项的数据,以检测项作为数据Key + * */ + private List assembleFixedFieldsData(List fieldList, List dataList, String customConfig){ + JSONObject jsonObject = JSONObject.parseObject(customConfig); + + Integer maxRowCount = 3; + String maxRowCountStr = jsonObject.getString("maxRowCount"); //最大行数 + String hasRemark = jsonObject.getString("hasRemark"); //是否有备注 + String hasRange = jsonObject.getString("hasRange"); //是否有检出限 + String fixedFields = jsonObject.getString("fixedFields"); //固定检测项。如果固定检测项,则以检测项作为数据Key + JSONArray fixedFieldsArray = JSONArray.parseArray(fixedFields); + if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr); + + List rowList = new ArrayList<>(); + for(int i = 0; i < maxRowCount; i++){ + JSONObject row = new JSONObject(); + row.put("sampleNameCode", " "); + row.put("sampleName", " "); + row.put("sampleCode", " "); + rowList.add( row); + } + for(ReportDocumentDataDO dataDO : dataList) { + JSONObject t = new JSONObject(); + String documentContent = dataDO.getDocumentContent(); + String externalContent = dataDO.getExternalContent(); + JSONObject s = JSONObject.parseObject(documentContent); + JSONObject e = new JSONObject(); + if (!ObjectUtils.isEmpty(externalContent)) { + e = JSONObject.parseObject(externalContent); + } + String remark = e.getString("remark"); + String sampleName = dataDO.getSampleName(); + String sampleCode = dataDO.getSampleCode(); + String sampleNameCode = sampleName + " " + sampleCode; + t.put("id", dataDO.getId()); + t.put("sampleNameCode", sampleNameCode); + t.put("sampleName", sampleName); + t.put("sampleCode", sampleCode); + t.put("remark", remark); + for(ConfigReportFieldDO fieldDO : fieldList){ + String fieldName = fieldDO.getFieldName(); + String field = fieldDO.getField(); + for(int i=0;i> listByMainDataId(Long mainDataId) { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -463,6 +546,14 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService return CommonResult.success(list); } + @Override + public CommonResult countMainDataId(Long mainDataId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("MAIN_ID", mainDataId); + queryWrapper.orderByAsc("ID"); + return CommonResult.success(reportDocumentDataMapper.selectCount(queryWrapper)); + } + @Override public CommonResult removeByMainIdAndDetailIds(Long mainDataId, List detailIds) { QueryWrapper queryWrapper = new QueryWrapper<>(); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainService.java index 620e12e..baacc8b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainService.java @@ -77,7 +77,7 @@ public interface ReportDocumentMainService { * @param pageReqVO 分页查询 * @return 检测报告业务分页 */ - PageResult getReportDocumentMainPage(ReportDocumentMainPageReqVO pageReqVO); + PageResult getReportDocumentMainPage(ReportDocumentMainPageReqVO pageReqVO); //发起流程 CommonResult createProcessInstance(ReportDocumentMainSaveReqVO entity); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java index 72be504..6bb7127 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java @@ -262,7 +262,7 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, } @Override - public PageResult getReportDocumentMainPage(ReportDocumentMainPageReqVO pageReqVO) { + public PageResult getReportDocumentMainPage(ReportDocumentMainPageReqVO pageReqVO) { return reportDocumentMainMapper.selectPage(pageReqVO); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentTypeServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentTypeServiceImpl.java index 982a073..d97e22c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentTypeServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentTypeServiceImpl.java @@ -11,6 +11,7 @@ import com.zt.plat.module.qms.business.config.service.ConfigPermissionService; import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; import com.zt.plat.module.qms.business.reportdoc.dal.mapper.ReportDocumentTypeMapper; import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO; +import com.zt.plat.module.qms.enums.QmsPermissionConstant; import com.zt.plat.module.system.api.permission.PermissionApi; import jakarta.annotation.Resource; import org.springframework.stereotype.Service; @@ -43,7 +44,9 @@ public class ReportDocumentTypeServiceImpl implements ReportDocumentTypeService //处理权限 List primissionList = reqVo.getPermissionList(); - configPermissionService.savePermissionListWithAutoDelete(primissionList); + if(reqVo.getId() != null){ + configPermissionService.savePermissionListWithAutoDelete(primissionList, reqVo.getMainId(), QmsPermissionConstant.REPORT_DOCUMENT_TYPE_START, null); + } if("1".equals(newVersionFlag)) return saveWithNewVersion(reqVo); if(reqVo.getId() == null){ @@ -52,6 +55,11 @@ public class ReportDocumentTypeServiceImpl implements ReportDocumentTypeService reportDocumentTypeMapper.insert(typeDO); Long id = typeDO.getId(); typeDO.setMainId(id); + + for(ConfigPermissionSaveReqVO permission : primissionList) + permission.setSourceId( id); + configPermissionService.savePermissionListWithAutoDelete(primissionList, id, QmsPermissionConstant.REPORT_DOCUMENT_TYPE_START, null); + this.reportDocumentTypeMapper.updateById(typeDO); } else diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataTemplateController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataTemplateController.java index b73ef47..c012b56 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataTemplateController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataTemplateController.java @@ -115,7 +115,7 @@ public class DataTemplateController implements BusinessControllerMarker { @GetMapping("/getByKey") @Operation(summary = "获得表单设计器模板") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:data-template:query')") +// @PreAuthorize("@ss.hasPermission('qms:data-template:query')") public CommonResult getByKey(@RequestParam("dataKey") String dataKey) { LambdaQueryWrapper query = new LambdaQueryWrapper<>(); query.eq(DataTemplateDO::getDataKey, dataKey); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/config/DataPermissionConfiguration.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/config/DataPermissionConfiguration.java index 44ef86e..8225ea5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/config/DataPermissionConfiguration.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/config/DataPermissionConfiguration.java @@ -4,6 +4,11 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import com.zt.plat.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer; +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.BusinessSampleEntrustDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; @Configuration(proxyBeanMethods = false) public class DataPermissionConfiguration { @@ -11,8 +16,11 @@ public class DataPermissionConfiguration { @Bean public DeptDataPermissionRuleCustomizer sysDeptDataPermissionRuleCustomizer() { return rule -> { - // dept - //rule.addUserColumn(AdminUserDO.class, "id"); + rule.addDeptColumn(BusinessSampleEntrustRegistrationDO.class); + rule.addDeptColumn(BusinessSampleEntrustDetailDO.class); + rule.addDeptColumn(BusinessSubSampleDO.class); + rule.addDeptColumn(BusinessAssayTaskDO.class); + rule.addDeptColumn(BusinessAssayTaskDataDO.class); }; } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/AutoIngredientsController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/AutoIngredientsController.java new file mode 100644 index 0000000..2fe63c5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/AutoIngredientsController.java @@ -0,0 +1,53 @@ +package com.zt.plat.module.qms.thirdpartyapi.controller.admin; + +import java.util.List; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.thirdpartyapi.controller.vo.*; +import com.zt.plat.module.qms.thirdpartyapi.service.AutoIngredientsService; + +import cn.hutool.json.JSON; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; + +/** + * 自动配料接口 + */ +@Tag(name = "自动配料(自动火试金)接口") +@RestController +@RequestMapping("/qms/thirdpartyapi/auto-ingredients") +public class AutoIngredientsController { + + @Resource + private AutoIngredientsService autoIngredientsService; + + @GetMapping("/task-list") + @Operation(summary = "获取检验批列表") + public CommonResult taskList(AutoIngredientsTaskQueryReqVO reqVO) { + List list = autoIngredientsService.taskList(reqVO); + return CommonResult.success(list); + } + + @GetMapping("/task-detail-list") + @Operation(summary = "获取检验批中的检测任务") + public CommonResult taskDetailList(@RequestParam("id") Long id) { + List list = autoIngredientsService.taskDetailList(id); + return CommonResult.success(list); + } + + @PostMapping("/submit-assay-result") + @Operation(summary = "检测结果同步") + public CommonResult submitAssayResult(@RequestBody AutoIngredientsTaskAssayResultReqVO body) { + System.out.println(com.alibaba.fastjson2.JSON.toJSONString(body)); + autoIngredientsService.submitAssayResult(body); + return CommonResult.success("成功"); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskAssayResultReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskAssayResultReqVO.java new file mode 100644 index 0000000..bbe7dae --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskAssayResultReqVO.java @@ -0,0 +1,17 @@ +package com.zt.plat.module.qms.thirdpartyapi.controller.vo; + +import java.util.List; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class AutoIngredientsTaskAssayResultReqVO { + + @Schema(description = "任务id") + private Long taskId; + + @Schema(description = "样品结果列表") + private List sampleList; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskDetailAssayResultReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskDetailAssayResultReqVO.java new file mode 100644 index 0000000..cf9fa21 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskDetailAssayResultReqVO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.thirdpartyapi.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class AutoIngredientsTaskDetailAssayResultReqVO { + + @Schema(description = "样品id") + private Long id; + + @Schema(description = "任务id") + private Long taskId; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称") + private String sampleName; + + @Schema(description = "杯号(样品坩埚号)") + private String cupNumber; + + @Schema(description = "碳酸钠") + private String ingredient_Na2CO3; + + @Schema(description = "硼砂") + private String ingredient_Na2B4O7_10H2O; + + @Schema(description = "氧化铅") + private String ingredient_PbO; + + @Schema(description = "硝酸钾") + private String ingredient_KNO3; + + @Schema(description = "面粉") + private String ingredient_C; + + @Schema(description = "二氧化硅") + private String ingredient_SiO2; + + @Schema(description = "硝酸银") + private String ingredient_AgNO3; + + @Schema(description = "样品备注") + private String[] remark; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskDetailRespVO.java new file mode 100644 index 0000000..b8b43ba --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskDetailRespVO.java @@ -0,0 +1,44 @@ +package com.zt.plat.module.qms.thirdpartyapi.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class AutoIngredientsTaskDetailRespVO { + + @Schema(description = "样品id") + private Long id; + + @Schema(description = "任务id") + private Long taskId; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称") + private String sampleName; + + @Schema(description = "杯号(样品坩埚号)") + private String cupNumber; + + @Schema(description = "硫含量") + private String S; + + @Schema(description = "铜含量") + private String Cu; + + @Schema(description = "样品质量") + private String sampleWeight; + + @Schema(description = "检测项目(测定元素)") + private String assayProject; + + @Schema(description = "分析人登录名") + private String assayOperator; + + @Schema(description = "分析人姓名") + private String assayOperatorName; + + @Schema(description = "样品备注") + private String remark; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskQueryReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskQueryReqVO.java new file mode 100644 index 0000000..f093fee --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskQueryReqVO.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.thirdpartyapi.controller.vo; + +import java.time.LocalDateTime; + +import org.springframework.format.annotation.DateTimeFormat; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 自动配料 任务查询 + */ +@Data +public class AutoIngredientsTaskQueryReqVO { + + + /** + * 任务开始时间(yyyy-MM-dd HH:mm:ss) + */ + @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化(请求) + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "任务开始时间(yyyy-MM-dd HH:mm:ss)") + private LocalDateTime taskTimeStart; + + /** + * 任务结束时间(yyyy-MM-dd HH:mm:ss) + */ + @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化(请求) + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "任务结束时间(yyyy-MM-dd HH:mm:ss)") + private LocalDateTime taskTimeEnd; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskRespVO.java new file mode 100644 index 0000000..d3cd419 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/AutoIngredientsTaskRespVO.java @@ -0,0 +1,44 @@ +package com.zt.plat.module.qms.thirdpartyapi.controller.vo; + +import java.time.LocalDateTime; + +import org.springframework.format.annotation.DateTimeFormat; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 自动配料任务响应 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AutoIngredientsTaskRespVO { + + @Schema(description = "任务id(样品组别)") + private Long id; + + @Schema(description = "任务编号") + private String taskNo; + + @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化(请求) + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "任务时间(yyyy-MM-dd HH:mm:ss)") + private LocalDateTime taskTime; + + @Schema(description = "分析登录名") + private String assayOperator; + + @Schema(description = "分析人姓名") + private String assayOperatorName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsService.java new file mode 100644 index 0000000..93eacf8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsService.java @@ -0,0 +1,32 @@ +package com.zt.plat.module.qms.thirdpartyapi.service; + +import java.util.List; + +import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskAssayResultReqVO; +import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskDetailRespVO; +import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskQueryReqVO; +import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskRespVO; + +public interface AutoIngredientsService { + + /** + * 任务列表 + * @param reqVO + * @return + */ + List taskList(AutoIngredientsTaskQueryReqVO reqVO); + + /** + * 任务明细 + * @param taskId + * @return + */ + List taskDetailList(Long taskId); + + /** + * 同步检测结果 + * @param body + */ + void submitAssayResult(AutoIngredientsTaskAssayResultReqVO body); + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java new file mode 100644 index 0000000..26ebc1b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.thirdpartyapi.service; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.springframework.stereotype.Service; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskPageReqVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; +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.BusinessAssayTaskMapper; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskAssayResultReqVO; +import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskDetailRespVO; +import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskQueryReqVO; +import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskRespVO; + +import jakarta.annotation.Resource; + +@Service +public class AutoIngredientsServiceImpl implements AutoIngredientsService { + + @Resource + private BusinessAssayTaskMapper businessAssayTaskMapper; + + @Resource + private BusinessAssayTaskDetailMapper businessAssayTaskDetailMapper; + + @Resource + private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + + @Resource + private BusinessAssayProjectDataMapper businessAssayProjectDataMapper; + + @Resource + private BusinessAssayParameterDataMapper businessAssayParameterDataMapper; + + @Override + public List taskList(AutoIngredientsTaskQueryReqVO reqVO) { + BusinessAssayTaskPageReqVO search = new BusinessAssayTaskPageReqVO(); + search.setIsIngredients(QmsCommonConstant.YES); + search.setIngredientsStatus(QmsCommonConstant.IN_PROGRESS); + if (reqVO.getTaskTimeStart() != null && reqVO.getTaskTimeEnd() != null) { + LocalDateTime[] taskAssignSubmiTimes = {reqVO.getTaskTimeStart(), reqVO.getTaskTimeEnd()}; + search.setTaskAssignSubmitTime(taskAssignSubmiTimes); + } + List list = businessAssayTaskMapper.selectList(search); + List resultList = list.stream().map(m -> new AutoIngredientsTaskRespVO(m.getId(), m.getTaskNo(), m.getTaskAssignSubmitTime(), m.getAssayOperator(), m.getAssayOperator())).collect(Collectors.toList()); + return resultList; + } + + @Override + public List taskDetailList(Long taskId) { +// List list = businessAssayTaskDetailMapper.selectByBusinessAssayTaskId(taskId); +// businessAssayTaskDataMapper.selectByBusinessAssayTaskId(taskId) + List resultList = new ArrayList<>(); +// for (BusinessAssayTaskDetailDO businessAssayTaskDetailDO : list) { +// AutoIngredientsTaskDetailRespVO autoIngredientsTaskDetailRespVO = new AutoIngredientsTaskDetailRespVO(); +// autoIngredientsTaskDetailRespVO.setAssayOperator(null) +// resultList.add(autoIngredientsTaskDetailRespVO); +// +// } + + return resultList; + } + + @Override + public void submitAssayResult(AutoIngredientsTaskAssayResultReqVO body) { + + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.xml index 3f99302..9ca148d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.xml @@ -19,39 +19,78 @@ LEFT JOIN T_CFG_ASY_MTHD tcam ON tbatd.CFG_ASY_MTHD_ID = tcam.ID WHERE - tbatd.IS_ASN_TSKD = 0 + tbatd.DELETED = 0 + AND tcam.DELETED = 0 + AND tbatd.IS_ASN_TSKD = 0 AND tbatd.IS_RPOD = 0 - AND tbatd.DELETED = 0 AND tbatd.ASY_DEPT_ID = #{reqVO.assayDepartmentId} AND tbatd.SMP_FLW_NDE_KY = #{reqVO.sampleFlowNodeKey} - + AND tbatd.SMP_FLW_NDE_TM #{reqVO.sampleFlowNodeTime[0]} and #{reqVO.sampleFlowNodeTime[1]} GROUP BY tbatd.CFG_ASY_MTHD_ID, tcam.NAME - + @@ -73,8 +112,18 @@ T_BSN_ASY_TSK_DAT tbatd LEFT JOIN T_BSN_SB_SMP tbss ON tbatd.BSN_SB_SMP_ID = tbss.ID - WHERE tbatd.IS_ASN_TSKD = 0 - AND tbatd.SMP_FLW_NDE_KY = 'flw_analysis' + WHERE + tbatd.DELETED = 0 + AND tbatd.IS_ASN_TSKD = 0 + + AND tbatd.ASY_DEPT_ID = #{reqVO.assayDepartmentId} + + + AND tbatd.SMP_FLW_NDE_KY = #{reqVO.sampleFlowNodeKey} + + + AND tbatd.SMP_FLW_NDE_TM #{reqVO.sampleFlowNodeTime[0]} and #{reqVO.sampleFlowNodeTime[1]} + GROUP BY tbss.ID , tbss.SMP_NAME , tbss.SMP_CD , diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.xml index fe113bc..4cc6b5c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.xml @@ -9,110 +9,4 @@ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> - - - - - - - \ No newline at end of file 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 new file mode 100644 index 0000000..2433995 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentProjectMapper.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentProjectMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentProjectMapper.xml new file mode 100644 index 0000000..88bf980 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentProjectMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.xml index b9a6678..5c3c893 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.xml @@ -9,4 +9,83 @@ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/删/application-dev.yml b/zt-module-qms/zt-module-qms-server/src/main/resources/删/application-dev.yml index 499327f..86eef9b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/删/application-dev.yml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/删/application-dev.yml @@ -49,7 +49,7 @@ spring: # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 data: redis: - host: 172.16.46.63 # 地址 + host: 172.16.46.163 # 地址 port: 30379 # 端口 database: 0 # 数据库索引 # password: 123456 # 密码,建议生产环境开启 diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/删/application-local1.yml b/zt-module-qms/zt-module-qms-server/src/main/resources/删/application-local1.yml new file mode 100644 index 0000000..8a402b1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/删/application-local1.yml @@ -0,0 +1,97 @@ +spring: + # 数据源配置项 + autoconfigure: + # noinspection SpringBootApplicationYaml + exclude: + - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源 + datasource: + druid: # Druid 【监控】相关的全局配置 + web-stat-filter: + enabled: true + stat-view-servlet: + enabled: true + allow: # 设置白名单,不填则允许所有访问 + url-pattern: /druid/* + login-username: # 控制台管理用户名和密码 + login-password: + filter: + stat: + enabled: true + log-slow-sql: true # 慢 SQL 记录 + slow-sql-millis: 100 + merge-sql: true + wall: + config: + multi-statement-allow: true + dynamic: # 多数据源配置 + druid: # Druid 【连接池】相关的全局配置 + initial-size: 1 # 初始连接数 + min-idle: 1 # 最小连接池数量 + max-active: 20 # 最大连接池数量 + max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒 + time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒 + min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒 + max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒 + validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效 + test-while-idle: true + test-on-borrow: false + test-on-return: false + primary: master + datasource: + master: + url: jdbc:dm://172.16.46.247:1050?schema=ZGTY-QMS-DEV + username: SYSDBA + password: pgbsci6ddJ6Sqj@e + slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 + lazy: true # 开启懒加载,保证启动速度 + url: jdbc:dm://172.16.46.247:1050?schema=ZGTY-QMS-DEV + username: SYSDBA + password: pgbsci6ddJ6Sqj@e + + # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 + data: + redis: + host: 172.16.46.163 # 地址 + port: 30379 # 端口 + database: 0 # 数据库索引 +# password: 123456 # 密码,建议生产环境开启 + +xxl: + job: + admin: + addresses: http://172.16.46.63:30082/xxl-job-admin # 调度中心部署跟地址 + +# Lock4j 配置项 +lock4j: + acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒 + expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒 + +# Actuator 监控端点的配置项 +management: + endpoints: + web: + base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator + exposure: + include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。 + +# 日志文件配置 +logging: + level: + # 配置自己写的 MyBatis Mapper 打印日志 + com.zt.plat.module.jybusiness.dal.mysql: debug + org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR + +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + + +# 芋道配置项,设置当前项目所有自定义的配置 +zt: + env: # 多环境的配置项 + tag: ${HOSTNAME} + security: + mock-enable: true + access-log: # 访问日志的配置项 + enable: true + diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/删/application.yml b/zt-module-qms/zt-module-qms-server/src/main/resources/删/application.yml index 455139c..1fbd64b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/删/application.yml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/删/application.yml @@ -24,7 +24,7 @@ spring: config: import: - - optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置 +# - optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置 - optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置 # Servlet 配置