From 6607abd6c52d70d16cd92ccdf040493ec76ac393 Mon Sep 17 00:00:00 2001 From: wxr Date: Fri, 19 Dec 2025 09:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=88=86=E9=85=8D-=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=AE=A1=E7=90=86=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/qms/enums/ErrorCodeConstants.java | 2 + ...inessAssayTaskParameterDataController.java | 106 ++++++++++++++++ .../BusinessQCCoefficientDataController.java | 16 +-- .../BusinessQCManagementDataController.java | 14 +- ...sinessAssayTaskParameterDataPageReqVO.java | 44 +++++++ .../BusinessAssayTaskParameterDataRespVO.java | 55 ++++++++ ...sinessAssayTaskParameterDataSaveReqVO.java | 43 +++++++ ...BusinessQCCoefficientDataExtendRespVO.java | 16 +++ .../BusinessQCManagementDataExtendRespVO.java | 16 +++ .../controller/vo/CreateQcSampleReqVO.java | 3 + .../controller/vo/DeleteQcSampleReqVO.java | 3 + .../BusinessAssayTaskParameterDataDO.java | 75 +++++++++++ .../BusinessAssayProjectDataMapper.java | 13 ++ .../BusinessAssayTaskParameterDataMapper.java | 34 +++++ .../BusinessQCCoefficientDataMapper.java | 120 ++++++++++-------- .../BusinessQCManagementDataMapper.java | 119 +++++++++-------- .../SampleTaskAssignQCSampleCmp.java | 34 ++++- ...BusinessAssayTaskParameterDataService.java | 61 +++++++++ ...nessAssayTaskParameterDataServiceImpl.java | 91 +++++++++++++ .../BusinessQCCoefficientDataService.java | 4 +- .../BusinessQCCoefficientDataServiceImpl.java | 4 +- .../BusinessQCManagementDataService.java | 4 +- .../BusinessQCManagementDataServiceImpl.java | 4 +- .../service/SampleTaskAssignServiceImpl.java | 30 ++++- .../ConfigAssayMethodParameterController.java | 106 ++++++++++++++++ .../ConfigAssayMethodParameterPageReqVO.java | 71 +++++++++++ .../vo/ConfigAssayMethodParameterRespVO.java | 91 +++++++++++++ .../ConfigAssayMethodParameterSaveReqVO.java | 74 +++++++++++ .../vo/ConfigQCSampleMethodExtendRespVO.java | 6 + .../vo/ConfigQCSampleMethodPageReqVO.java | 3 + .../vo/ConfigQCSampleMethodRespVO.java | 4 + .../vo/ConfigQCSampleMethodSaveReqVO.java | 3 + .../ConfigAssayMethodParameterDO.java | 120 ++++++++++++++++++ .../dataobject/ConfigQCSampleMethodDO.java | 5 + .../ConfigAssayMethodParameterMapper.java | 43 +++++++ .../mapper/ConfigQCSampleMethodMapper.java | 11 +- .../ConfigAssayMethodParameterService.java | 62 +++++++++ ...ConfigAssayMethodParameterServiceImpl.java | 91 +++++++++++++ .../BusinessAssayTaskParameterDataMapper.xml | 12 ++ .../ConfigAssayMethodParameterMapper.xml | 12 ++ 40 files changed, 1491 insertions(+), 134 deletions(-) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskParameterDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskParameterDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskParameterDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodParameterController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodParameterDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodParameterMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskParameterDataMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodParameterMapper.xml diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/ErrorCodeConstants.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/ErrorCodeConstants.java index d512974..59959e2 100644 --- a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/ErrorCodeConstants.java +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/ErrorCodeConstants.java @@ -37,6 +37,7 @@ public interface ErrorCodeConstants { /*==============================config 配置模块 1_032_050_000 ~ 1_032_099_999 ===============================*/ ErrorCode CONFIG_REPORT_TEMPLATE_NOT_EXISTS = new ErrorCode(1_032_050_000, "报表模版配置不存在"); ErrorCode CONFIG_ASSAY_METHOD_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法配置不存在"); + ErrorCode CONFIG_ASSAY_METHOD_PARAMETER_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法参数配置不存在"); ErrorCode CONFIG_ASSAY_METHOD_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法分析项目配置不存在"); ErrorCode CONFIG_ASSAY_METHOD_PROJECT_RANGE_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法分析项目区间不存在"); ErrorCode CONFIG_ASSAY_METHOD_PROJECT_ASSESSMENT_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法分析项目判定不存在"); @@ -101,6 +102,7 @@ public interface ErrorCodeConstants { ErrorCode BUSINESS_HANDOVER_RECORD_SUB_NOT_EXISTS = new ErrorCode(1_032_100_000, "子样交接记录业务不存在"); ErrorCode BUSINESS_SAMPLE_ASSAY_RESULT_NOT_EXISTS = new ErrorCode(1_032_100_000, "委检登记来样品位不存在"); ErrorCode BUSINESS_ASSAY_TASK_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "子样检测任务业务不存在"); + ErrorCode BUSINESS_ASSAY_TASK_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "子样检测任务参数业务不存在"); ErrorCode BUSINESS_ASSAY_PROJECT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测项目数据业务不存在"); ErrorCode BUSINESS_ASSAY_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测参数数据业务不存在"); ErrorCode BUSINESS_SUB_SAMPLE_ASSESSMENT_NOT_EXISTS = new ErrorCode(1_032_100_000, "子样判定业务不存在"); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskParameterDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskParameterDataController.java new file mode 100644 index 0000000..b62186b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskParameterDataController.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.BusinessAssayTaskParameterDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessAssayTaskParameterDataService; +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-assay-task-parameter-data") +@Validated +public class BusinessAssayTaskParameterDataController implements BusinessControllerMarker { + + + @Resource + private BusinessAssayTaskParameterDataService businessAssayTaskParameterDataService; + + @PostMapping("/create") + @Operation(summary = "创建子样检测任务参数业务") + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:create')") + public CommonResult createBusinessAssayTaskParameterData(@Valid @RequestBody BusinessAssayTaskParameterDataSaveReqVO createReqVO) { + return success(businessAssayTaskParameterDataService.createBusinessAssayTaskParameterData(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新子样检测任务参数业务") + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:update')") + public CommonResult updateBusinessAssayTaskParameterData(@Valid @RequestBody BusinessAssayTaskParameterDataSaveReqVO updateReqVO) { + businessAssayTaskParameterDataService.updateBusinessAssayTaskParameterData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除子样检测任务参数业务") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:delete')") + public CommonResult deleteBusinessAssayTaskParameterData(@RequestParam("id") Long id) { + businessAssayTaskParameterDataService.deleteBusinessAssayTaskParameterData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除子样检测任务参数业务") + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:delete')") + public CommonResult deleteBusinessAssayTaskParameterDataList(@RequestBody BatchDeleteReqVO req) { + businessAssayTaskParameterDataService.deleteBusinessAssayTaskParameterDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得子样检测任务参数业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:query')") + public CommonResult getBusinessAssayTaskParameterData(@RequestParam("id") Long id) { + BusinessAssayTaskParameterDataDO businessAssayTaskParameterData = businessAssayTaskParameterDataService.getBusinessAssayTaskParameterData(id); + return success(BeanUtils.toBean(businessAssayTaskParameterData, BusinessAssayTaskParameterDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得子样检测任务参数业务分页") + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:query')") + public CommonResult> getBusinessAssayTaskParameterDataPage(@Valid BusinessAssayTaskParameterDataPageReqVO pageReqVO) { + PageResult pageResult = businessAssayTaskParameterDataService.getBusinessAssayTaskParameterDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessAssayTaskParameterDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出子样检测任务参数业务 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-assay-task-parameter-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessAssayTaskParameterDataExcel(@Valid BusinessAssayTaskParameterDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessAssayTaskParameterDataService.getBusinessAssayTaskParameterDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "子样检测任务参数业务.xls", "数据", BusinessAssayTaskParameterDataRespVO.class, + BeanUtils.toBean(list, BusinessAssayTaskParameterDataRespVO.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/BusinessQCCoefficientDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java index 59b1305..c8ca6be 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java @@ -84,18 +84,18 @@ public class BusinessQCCoefficientDataController implements BusinessControllerMa @GetMapping("/page") @Operation(summary = "获得质控样检测系数任务数据,空白样、标样分页") - @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:query')") - public CommonResult> getBusinessQCCoefficientDataPage(@Valid BusinessQCCoefficientDataPageReqVO pageReqVO) { - PageResult pageResult = businessQCCoefficientDataService.getBusinessQCCoefficientDataPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, BusinessQCCoefficientDataRespVO.class)); +// @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:query')") + public CommonResult> getBusinessQCCoefficientDataPage(@Valid BusinessQCCoefficientDataPageReqVO pageReqVO) { + PageResult pageResult = businessQCCoefficientDataService.getBusinessQCCoefficientDataPage(pageReqVO); + return success(pageResult); } @GetMapping("/list") @Operation(summary = "获得质控样检测系数任务数据,空白样、标样分页") // @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:query')") - public CommonResult> getBusinessQCCoefficientDataPage(@Valid BusinessQCCoefficientDataReqVO reqVO) { - List pageResult = businessQCCoefficientDataService.getBusinessQCCoefficientDataList(reqVO); - return success(BeanUtils.toBean(pageResult, BusinessQCCoefficientDataRespVO.class)); + public CommonResult> getBusinessQCCoefficientDataPage(@Valid BusinessQCCoefficientDataReqVO reqVO) { + List listResult = businessQCCoefficientDataService.getBusinessQCCoefficientDataList(reqVO); + return success(listResult); } @GetMapping("/export-excel") @@ -105,7 +105,7 @@ public class BusinessQCCoefficientDataController implements BusinessControllerMa public void exportBusinessQCCoefficientDataExcel(@Valid BusinessQCCoefficientDataPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = businessQCCoefficientDataService.getBusinessQCCoefficientDataPage(pageReqVO).getList(); + List list = businessQCCoefficientDataService.getBusinessQCCoefficientDataPage(pageReqVO).getList(); // 导出 Excel ExcelUtils.write(response, "质控样检测系数任务数据,空白样、标样.xls", "数据", BusinessQCCoefficientDataRespVO.class, BeanUtils.toBean(list, BusinessQCCoefficientDataRespVO.class)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java index f3e667e..28c20ab 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java @@ -85,17 +85,17 @@ public class BusinessQCManagementDataController implements BusinessControllerMar @GetMapping("/page") @Operation(summary = "获得质控管理样检测任务数据,管理样、标准样分页") @PreAuthorize("@ss.hasPermission('qms:business-QC-management-data:query')") - public CommonResult> getBusinessQCManagementDataPage(@Valid BusinessQCManagementDataPageReqVO pageReqVO) { - PageResult pageResult = businessQCManagementDataService.getBusinessQCManagementDataPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, BusinessQCManagementDataRespVO.class)); + public CommonResult> getBusinessQCManagementDataPage(@Valid BusinessQCManagementDataPageReqVO pageReqVO) { + PageResult pageResult = businessQCManagementDataService.getBusinessQCManagementDataPage(pageReqVO); + return success(pageResult); } @GetMapping("/list") @Operation(summary = "获得质控管理样检测任务数据,管理样、标准样列表") // @PreAuthorize("@ss.hasPermission('qms:business-QC-management-data:query')") - public CommonResult> getBusinessQCManagementDataList(@Valid BusinessQCManagementDataReqVO reqVO) { - List pageResult = businessQCManagementDataService.getBusinessQCManagementDataList(reqVO); - return success(BeanUtils.toBean(pageResult, BusinessQCManagementDataRespVO.class)); + public CommonResult> getBusinessQCManagementDataList(@Valid BusinessQCManagementDataReqVO reqVO) { + List listResult = businessQCManagementDataService.getBusinessQCManagementDataList(reqVO); + return success(listResult); } @GetMapping("/export-excel") @@ -105,7 +105,7 @@ public class BusinessQCManagementDataController implements BusinessControllerMar public void exportBusinessQCManagementDataExcel(@Valid BusinessQCManagementDataPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = businessQCManagementDataService.getBusinessQCManagementDataPage(pageReqVO).getList(); + List list = businessQCManagementDataService.getBusinessQCManagementDataPage(pageReqVO).getList(); // 导出 Excel ExcelUtils.write(response, "质控管理样检测任务数据,管理样、标准样.xls", "数据", BusinessQCManagementDataRespVO.class, BeanUtils.toBean(list, BusinessQCManagementDataRespVO.class)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataPageReqVO.java new file mode 100644 index 0000000..c14ae8a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataPageReqVO.java @@ -0,0 +1,44 @@ +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 BusinessAssayTaskParameterDataPageReqVO extends PageParam { + + @Schema(description = "检测任务ID", example = "11383") + private Long businessAssayTaskDataId; + + @Schema(description = "检测方法参数配置ID", example = "9000") + private Long configAssayMethodParameterId; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "乐观锁", example = "3750") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @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/BusinessAssayTaskParameterDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataRespVO.java new file mode 100644 index 0000000..120708d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataRespVO.java @@ -0,0 +1,55 @@ +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 BusinessAssayTaskParameterDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2727") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11383") + @ExcelProperty("检测任务ID") + private Long businessAssayTaskDataId; + + @Schema(description = "检测方法参数配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9000") + @ExcelProperty("检测方法参数配置ID") + private Long configAssayMethodParameterId; + + @Schema(description = "值") + @ExcelProperty("值") + private String value; + + @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 = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "3750") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @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/BusinessAssayTaskParameterDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataSaveReqVO.java new file mode 100644 index 0000000..39a18c4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskParameterDataSaveReqVO.java @@ -0,0 +1,43 @@ +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.*; + +@Schema(description = "管理后台 - 子样检测任务参数业务新增/修改 Request VO") +@Data +public class BusinessAssayTaskParameterDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2727") + private Long id; + + @Schema(description = "检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11383") + @NotNull(message = "检测任务ID不能为空") + private Long businessAssayTaskDataId; + + @Schema(description = "检测方法参数配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9000") + @NotNull(message = "检测方法参数配置ID不能为空") + private Long configAssayMethodParameterId; + + @Schema(description = "值") + private String value; + + @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 = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "3750") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @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/BusinessQCCoefficientDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataExtendRespVO.java new file mode 100644 index 0000000..3a55146 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataExtendRespVO.java @@ -0,0 +1,16 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.Data; + +@Data +public class BusinessQCCoefficientDataExtendRespVO extends BusinessQCCoefficientDataRespVO { + + private String dictionaryBusinessName; + + private String parentDictionaryBusinessId; + + private String parentDictionaryBusinessName; + + private String parentDictionaryBusinesskey; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataExtendRespVO.java new file mode 100644 index 0000000..bdf61b8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataExtendRespVO.java @@ -0,0 +1,16 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.Data; + +@Data +public class BusinessQCManagementDataExtendRespVO extends BusinessQCManagementDataRespVO { + + private String dictionaryBusinessName; + + private String parentDictionaryBusinessId; + + private String parentDictionaryBusinessName; + + private String parentDictionaryBusinesskey; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/CreateQcSampleReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/CreateQcSampleReqVO.java index 791ac1c..6afd2e7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/CreateQcSampleReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/CreateQcSampleReqVO.java @@ -26,4 +26,7 @@ public class CreateQcSampleReqVO { @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") private String dictionaryBusinessKey; + + @Schema(description = "质控类型_父类_Key,字典表【T_DIC_BSN】质控类型:带检测项-withProject 不带检测项目-withoutProject") + private String parentDictionaryBusinesskey; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/DeleteQcSampleReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/DeleteQcSampleReqVO.java index 370da2d..8228ca7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/DeleteQcSampleReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/DeleteQcSampleReqVO.java @@ -13,6 +13,9 @@ public class DeleteQcSampleReqVO { @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") private String dictionaryBusinessKey; + + @Schema(description = "质控类型_父类_Key,字典表【T_DIC_BSN】质控类型:带检测项-withProject 不带检测项目-withoutProject") + private String parentDictionaryBusinesskey; @Schema(description = "质控样id") private List qcSampleIdList; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskParameterDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskParameterDataDO.java new file mode 100644 index 0000000..e47bf67 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskParameterDataDO.java @@ -0,0 +1,75 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 子样检测任务参数业务 DO +* +* @author 后台管理-1 +*/ +@TableName("t_bsn_asy_tsk_prm_dat") +@KeySequence("t_bsn_asy_tsk_prm_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessAssayTaskParameterDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测任务ID + */ + @TableField("BSN_ASY_TSK_DAT_ID") + private Long businessAssayTaskDataId; + /** + * 检测方法参数配置ID + */ + @TableField("CFG_ASY_MTHD_PRM_ID") + private Long configAssayMethodParameterId; + /** + * 值 + */ + @TableField("VAL") + private String value; + /** + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @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/mapper/BusinessAssayProjectDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java index 7d3e037..712e614 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java @@ -12,6 +12,7 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; 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.common.dic.dal.dataobject.DictionaryBusinessDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -83,6 +84,18 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX selectByBusinessAssayTaskId(Long businessAssayTaskId) { + return selectJoinList(BusinessAssayProjectDataExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessAssayTaskDataDO.class, BusinessAssayTaskDataDO::getId, BusinessAssayProjectDataDO::getBusinessAssayTaskDataId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId) + .selectAll(BusinessAssayProjectDataDO.class) + .selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectDataExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectDataExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessAssayProjectDataExtendRespVO::getShowName) + .eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId) + .eq(BusinessAssayProjectDataDO::getIsEnabled, QmsCommonConstant.YES)); + } + default List selectByBusinessAssayTaskDataId(Long businessAssayTaskDataId) { return selectJoinList(BusinessAssayProjectDataExtendRespVO.class, new MPJLambdaWrapperX() .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskParameterDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskParameterDataMapper.java new file mode 100644 index 0000000..a2d21ce --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskParameterDataMapper.java @@ -0,0 +1,34 @@ +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.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 子样检测任务参数业务 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface BusinessAssayTaskParameterDataMapper extends BaseMapperX { + + default PageResult selectPage(BusinessAssayTaskParameterDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessAssayTaskParameterDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getConfigAssayMethodParameterId, reqVO.getConfigAssayMethodParameterId()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getValue, reqVO.getValue()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessAssayTaskParameterDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessAssayTaskParameterDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessAssayTaskParameterDataDO::getId)); + } + +} \ 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/BusinessQCCoefficientDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientDataMapper.java index a081272..b509345 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientDataMapper.java @@ -6,7 +6,10 @@ 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.BusinessQCCoefficientDataDO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodDO; +import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; import com.zt.plat.module.qms.enums.QmsCommonConstant; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -19,58 +22,75 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface BusinessQCCoefficientDataMapper extends BaseMapperX { - default PageResult selectPage(BusinessQCCoefficientDataPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(BusinessQCCoefficientDataDO::getSampleCode, reqVO.getSampleCode()) - .likeIfPresent(BusinessQCCoefficientDataDO::getSampleName, reqVO.getSampleName()) - .eqIfPresent(BusinessQCCoefficientDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayProject, reqVO.getAssayProject()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) - .likeIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperator, reqVO.getAssayOperator()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) - .betweenIfPresent(BusinessQCCoefficientDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) - .eqIfPresent(BusinessQCCoefficientDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) - .eqIfPresent(BusinessQCCoefficientDataDO::getIsReported, reqVO.getIsReported()) - .eqIfPresent(BusinessQCCoefficientDataDO::getReporter, reqVO.getReporter()) - .eqIfPresent(BusinessQCCoefficientDataDO::getReporterId, reqVO.getReporterId()) - .betweenIfPresent(BusinessQCCoefficientDataDO::getReportTime, reqVO.getReportTime()) - .eqIfPresent(BusinessQCCoefficientDataDO::getUpdateCount, reqVO.getUpdateCount()) - .eqIfPresent(BusinessQCCoefficientDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) - .betweenIfPresent(BusinessQCCoefficientDataDO::getCreateTime, reqVO.getCreateTime()) - .eqIfPresent(BusinessQCCoefficientDataDO::getRemark, reqVO.getRemark()) - .orderByDesc(BusinessQCCoefficientDataDO::getId)); + default PageResult selectPage(BusinessQCCoefficientDataPageReqVO reqVO) { + MPJLambdaWrapperX queryLambdaWrapperX = new MPJLambdaWrapperX(); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd1", DictionaryBusinessDO::getId, BusinessQCCoefficientDataDO::getDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd2", DictionaryBusinessDO::getId, "dbd1", DictionaryBusinessDO::getParentId); + queryLambdaWrapperX = queryLambdaWrapperX.selectAll(BusinessQCCoefficientDataDO.class); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getParentId, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getKey, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinesskey); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessName); + queryLambdaWrapperX.eqIfPresent(BusinessQCCoefficientDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessQCCoefficientDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCCoefficientDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperator, reqVO.getAssayOperator()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCCoefficientDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCCoefficientDataDO::getReporter, reqVO.getReporter()) + .eqIfPresent(BusinessQCCoefficientDataDO::getReporterId, reqVO.getReporterId()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCCoefficientDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCCoefficientDataDO::getId); + + return selectJoinPage(reqVO, BusinessQCCoefficientDataExtendRespVO.class, queryLambdaWrapperX); } - default List selectList(BusinessQCCoefficientDataReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(BusinessQCCoefficientDataDO::getSampleCode, reqVO.getSampleCode()) - .likeIfPresent(BusinessQCCoefficientDataDO::getSampleName, reqVO.getSampleName()) - .eqIfPresent(BusinessQCCoefficientDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) - .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayProject, reqVO.getAssayProject()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) - .likeIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperator, reqVO.getAssayOperator()) - .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) - .betweenIfPresent(BusinessQCCoefficientDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) - .eqIfPresent(BusinessQCCoefficientDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) - .eqIfPresent(BusinessQCCoefficientDataDO::getIsReported, reqVO.getIsReported()) - .eqIfPresent(BusinessQCCoefficientDataDO::getReporter, reqVO.getReporter()) - .eqIfPresent(BusinessQCCoefficientDataDO::getReporterId, reqVO.getReporterId()) - .betweenIfPresent(BusinessQCCoefficientDataDO::getReportTime, reqVO.getReportTime()) - .eqIfPresent(BusinessQCCoefficientDataDO::getUpdateCount, reqVO.getUpdateCount()) - .eqIfPresent(BusinessQCCoefficientDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) - .betweenIfPresent(BusinessQCCoefficientDataDO::getCreateTime, reqVO.getCreateTime()) - .eqIfPresent(BusinessQCCoefficientDataDO::getRemark, reqVO.getRemark()) - .orderByDesc(BusinessQCCoefficientDataDO::getId)); + default List selectList(BusinessQCCoefficientDataReqVO reqVO) { + MPJLambdaWrapperX queryLambdaWrapperX = new MPJLambdaWrapperX(); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd1", DictionaryBusinessDO::getId, BusinessQCCoefficientDataDO::getDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd2", DictionaryBusinessDO::getId, "dbd1", DictionaryBusinessDO::getParentId); + queryLambdaWrapperX = queryLambdaWrapperX.selectAll(BusinessQCCoefficientDataDO.class); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getParentId, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getKey, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinesskey); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessName); + queryLambdaWrapperX.eqIfPresent(BusinessQCCoefficientDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessQCCoefficientDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCCoefficientDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperator, reqVO.getAssayOperator()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCCoefficientDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCCoefficientDataDO::getReporter, reqVO.getReporter()) + .eqIfPresent(BusinessQCCoefficientDataDO::getReporterId, reqVO.getReporterId()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCCoefficientDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCCoefficientDataDO::getId); + return selectJoinList(BusinessQCCoefficientDataExtendRespVO.class, queryLambdaWrapperX); } default List selectByBusinessAssayTaskId(Long businessAssayTaskId) { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.java index c5c2727..9d64dff 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.java @@ -7,7 +7,9 @@ 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.BusinessQCManagementDataDO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; import com.zt.plat.module.qms.enums.QmsCommonConstant; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -20,58 +22,75 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface BusinessQCManagementDataMapper extends BaseMapperX { - default PageResult selectPage(BusinessQCManagementDataPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(BusinessQCManagementDataDO::getSampleCode, reqVO.getSampleCode()) - .likeIfPresent(BusinessQCManagementDataDO::getSampleName, reqVO.getSampleName()) - .eqIfPresent(BusinessQCManagementDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(BusinessQCManagementDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) - .eqIfPresent(BusinessQCManagementDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) - .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) - .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayProject, reqVO.getAssayProject()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) - .likeIfPresent(BusinessQCManagementDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayOperator, reqVO.getAssayOperator()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) - .betweenIfPresent(BusinessQCManagementDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) - .eqIfPresent(BusinessQCManagementDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) - .eqIfPresent(BusinessQCManagementDataDO::getIsReported, reqVO.getIsReported()) - .eqIfPresent(BusinessQCManagementDataDO::getReporter, reqVO.getReporter()) - .eqIfPresent(BusinessQCManagementDataDO::getReporterId, reqVO.getReporterId()) - .betweenIfPresent(BusinessQCManagementDataDO::getReportTime, reqVO.getReportTime()) - .eqIfPresent(BusinessQCManagementDataDO::getUpdateCount, reqVO.getUpdateCount()) - .eqIfPresent(BusinessQCManagementDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) - .betweenIfPresent(BusinessQCManagementDataDO::getCreateTime, reqVO.getCreateTime()) - .eqIfPresent(BusinessQCManagementDataDO::getRemark, reqVO.getRemark()) - .orderByDesc(BusinessQCManagementDataDO::getId)); + default PageResult selectPage(BusinessQCManagementDataPageReqVO reqVO) { + MPJLambdaWrapperX queryLambdaWrapperX = new MPJLambdaWrapperX<>(); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd1", DictionaryBusinessDO::getId, BusinessQCManagementDataDO::getDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd2", DictionaryBusinessDO::getId, "dbd1", DictionaryBusinessDO::getParentId); + queryLambdaWrapperX = queryLambdaWrapperX.selectAll(BusinessQCManagementDataDO.class); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getParentId, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getKey, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinesskey); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessName); + queryLambdaWrapperX.eqIfPresent(BusinessQCManagementDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessQCManagementDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCManagementDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCManagementDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCManagementDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCManagementDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayOperator, reqVO.getAssayOperator()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) + .betweenIfPresent(BusinessQCManagementDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCManagementDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCManagementDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCManagementDataDO::getReporter, reqVO.getReporter()) + .eqIfPresent(BusinessQCManagementDataDO::getReporterId, reqVO.getReporterId()) + .betweenIfPresent(BusinessQCManagementDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCManagementDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCManagementDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCManagementDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCManagementDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCManagementDataDO::getId); + + return selectJoinPage(reqVO, BusinessQCManagementDataExtendRespVO.class, queryLambdaWrapperX); } - default List selectList(BusinessQCManagementDataReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(BusinessQCManagementDataDO::getSampleCode, reqVO.getSampleCode()) - .likeIfPresent(BusinessQCManagementDataDO::getSampleName, reqVO.getSampleName()) - .eqIfPresent(BusinessQCManagementDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(BusinessQCManagementDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) - .eqIfPresent(BusinessQCManagementDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) - .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) - .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayProject, reqVO.getAssayProject()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) - .likeIfPresent(BusinessQCManagementDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayOperator, reqVO.getAssayOperator()) - .eqIfPresent(BusinessQCManagementDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) - .betweenIfPresent(BusinessQCManagementDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) - .eqIfPresent(BusinessQCManagementDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) - .eqIfPresent(BusinessQCManagementDataDO::getIsReported, reqVO.getIsReported()) - .eqIfPresent(BusinessQCManagementDataDO::getReporter, reqVO.getReporter()) - .eqIfPresent(BusinessQCManagementDataDO::getReporterId, reqVO.getReporterId()) - .betweenIfPresent(BusinessQCManagementDataDO::getReportTime, reqVO.getReportTime()) - .eqIfPresent(BusinessQCManagementDataDO::getUpdateCount, reqVO.getUpdateCount()) - .eqIfPresent(BusinessQCManagementDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) - .betweenIfPresent(BusinessQCManagementDataDO::getCreateTime, reqVO.getCreateTime()) - .eqIfPresent(BusinessQCManagementDataDO::getRemark, reqVO.getRemark()) - .orderByDesc(BusinessQCManagementDataDO::getId)); + default List selectList(BusinessQCManagementDataReqVO reqVO) { + MPJLambdaWrapperX queryLambdaWrapperX = new MPJLambdaWrapperX<>(); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd1", DictionaryBusinessDO::getId, BusinessQCManagementDataDO::getDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.leftJoin(DictionaryBusinessDO.class, "dbd2", DictionaryBusinessDO::getId, "dbd1", DictionaryBusinessDO::getParentId); + queryLambdaWrapperX = queryLambdaWrapperX.selectAll(BusinessQCManagementDataDO.class); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd1", DictionaryBusinessDO::getParentId, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessId); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getKey, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinesskey); + queryLambdaWrapperX = (MPJLambdaWrapperX) queryLambdaWrapperX.selectAs("dbd2", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessName); + queryLambdaWrapperX.eqIfPresent(BusinessQCManagementDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessQCManagementDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCManagementDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCManagementDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCManagementDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCManagementDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayOperator, reqVO.getAssayOperator()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayOperatorId, reqVO.getAssayOperatorId()) + .betweenIfPresent(BusinessQCManagementDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCManagementDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCManagementDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCManagementDataDO::getReporter, reqVO.getReporter()) + .eqIfPresent(BusinessQCManagementDataDO::getReporterId, reqVO.getReporterId()) + .betweenIfPresent(BusinessQCManagementDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCManagementDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCManagementDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCManagementDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCManagementDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCManagementDataDO::getId); + return selectJoinList(BusinessQCManagementDataExtendRespVO.class, queryLambdaWrapperX); } default List selectByBusinessAssayTaskId(Long businessAssayTaskId) { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java index baea2ae..6bfbc6b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java @@ -8,12 +8,15 @@ import org.apache.commons.lang3.StringUtils; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataExtendRespVO; 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.BusinessQCCoefficientDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; @@ -56,6 +59,9 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent { @Resource private ConfigAssayMethodProjectParameterMapper configAssayMethodProjectParameterMapper; + + @Resource + private BusinessAssayProjectDataMapper businessAssayProjectDataMapper; @Resource private BusinessQCCoefficientDataMapper businessQCCoefficientDataMapper; @@ -93,6 +99,9 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent { businessAssayTaskList.addAll(saveBusinessAssayTaskList); businessAssayTaskList.addAll(updateBusinessAssayTaskList); + //检测任务 + List businessAssayTaskDataList = sampleTaskAssignContext.getBusinessAssayTaskDataList(); + //获取分配任务的分析方法id列表 List configAssayMethodIdList = businessAssayTaskList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList()); @@ -170,10 +179,28 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent { if (CollUtil.isNotEmpty(businessQCManagementDataList)) { continue; } - //分析项目 List configAssayMethodProjectExtendRespList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); - List configAssayMethodProjectIds = configAssayMethodProjectExtendRespList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().filter(f -> f.getBusinessAssayTaskId().equals(businessAssayTaskDO.getId())).map(m -> m.getId()).collect(Collectors.toList()); + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList); + //检测项目id + List dictionaryProjectIdList = new ArrayList<>(); + //必须要检测的项目 + String mustProject = configQCSampleMethodExtendRespVO.getMustProject(); + if (StringUtils.isNotBlank(mustProject)) { + String[] mustProjects = mustProject.split(","); + for (String dicProjectId : mustProjects) { + dictionaryProjectIdList.add(Long.parseLong(dicProjectId)); + } + } + + //获取当前任务的检测项目id列表 + List busTaskDictionaryProjectIdList = businessAssayProjectDataList.stream().map(m -> m.getDictionaryProjectId()).distinct().collect(Collectors.toList()); + dictionaryProjectIdList.addAll(busTaskDictionaryProjectIdList); + //获取需要创建的检测项目id + List configAssayMethodProjectIds = configAssayMethodProjectExtendRespList.stream().filter(f -> dictionaryProjectIdList.contains(f.getDictionaryProjectId())).map(m -> m.getId()).collect(Collectors.toList()); + //分析项目参数 List configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectIds(configAssayMethodProjectIds); //分析项目 @@ -205,6 +232,9 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent { businessQCManagementDataDOList.add(businessQCManagementDataDO); for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectExtendRespVO : configAssayMethodProjectExtendRespList) { + if (!dictionaryProjectIdList.contains(configAssayMethodProjectExtendRespVO.getDictionaryProjectId())) {//不存在则跳过 + continue; + } BusinessQCManagementProjectDataDO businessQCManagementProjectDataDO = new BusinessQCManagementProjectDataDO(); businessQCManagementProjectDataDO.setId(IdWorker.getId()); businessQCManagementProjectDataDO.setBusinessQCManagementDataId(businessQCManagementDataDO.getId()); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataService.java new file mode 100644 index 0000000..ef56197 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataService.java @@ -0,0 +1,61 @@ +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.BusinessAssayTaskParameterDataDO; + +/** + * 子样检测任务参数业务 Service 接口 + * + * @author 后台管理-1 + */ +public interface BusinessAssayTaskParameterDataService { + + /** + * 创建子样检测任务参数业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessAssayTaskParameterDataRespVO createBusinessAssayTaskParameterData(@Valid BusinessAssayTaskParameterDataSaveReqVO createReqVO); + + /** + * 更新子样检测任务参数业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessAssayTaskParameterData(@Valid BusinessAssayTaskParameterDataSaveReqVO updateReqVO); + + /** + * 删除子样检测任务参数业务 + * + * @param id 编号 + */ + void deleteBusinessAssayTaskParameterData(Long id); + + /** + * 批量删除子样检测任务参数业务 + * + * @param ids 编号 + */ + void deleteBusinessAssayTaskParameterDataListByIds(List ids); + + /** + * 获得子样检测任务参数业务 + * + * @param id 编号 + * @return 子样检测任务参数业务 + */ + BusinessAssayTaskParameterDataDO getBusinessAssayTaskParameterData(Long id); + + /** + * 获得子样检测任务参数业务分页 + * + * @param pageReqVO 分页查询 + * @return 子样检测任务参数业务分页 + */ + PageResult getBusinessAssayTaskParameterDataPage(BusinessAssayTaskParameterDataPageReqVO 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/BusinessAssayTaskParameterDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataServiceImpl.java new file mode 100644 index 0000000..6e872f0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskParameterDataServiceImpl.java @@ -0,0 +1,91 @@ +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 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.BusinessAssayTaskParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskParameterDataMapper; + +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 后台管理-1 + */ +@Service +@Validated +public class BusinessAssayTaskParameterDataServiceImpl implements BusinessAssayTaskParameterDataService { + + @Resource + private BusinessAssayTaskParameterDataMapper businessAssayTaskParameterDataMapper; + + @Override + public BusinessAssayTaskParameterDataRespVO createBusinessAssayTaskParameterData(BusinessAssayTaskParameterDataSaveReqVO createReqVO) { + // 插入 + BusinessAssayTaskParameterDataDO businessAssayTaskParameterData = BeanUtils.toBean(createReqVO, BusinessAssayTaskParameterDataDO.class); + businessAssayTaskParameterDataMapper.insert(businessAssayTaskParameterData); + // 返回 + return BeanUtils.toBean(businessAssayTaskParameterData, BusinessAssayTaskParameterDataRespVO.class); + } + + @Override + public void updateBusinessAssayTaskParameterData(BusinessAssayTaskParameterDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessAssayTaskParameterDataExists(updateReqVO.getId()); + // 更新 + BusinessAssayTaskParameterDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessAssayTaskParameterDataDO.class); + businessAssayTaskParameterDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessAssayTaskParameterData(Long id) { + // 校验存在 + validateBusinessAssayTaskParameterDataExists(id); + // 删除 + businessAssayTaskParameterDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessAssayTaskParameterDataListByIds(List ids) { + // 校验存在 + validateBusinessAssayTaskParameterDataExists(ids); + // 删除 + businessAssayTaskParameterDataMapper.deleteByIds(ids); + } + + private void validateBusinessAssayTaskParameterDataExists(List ids) { + List list = businessAssayTaskParameterDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_ASSAY_TASK_PARAMETER_DATA_NOT_EXISTS); + } + } + + private void validateBusinessAssayTaskParameterDataExists(Long id) { + if (businessAssayTaskParameterDataMapper.selectById(id) == null) { + throw exception(BUSINESS_ASSAY_TASK_PARAMETER_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessAssayTaskParameterDataDO getBusinessAssayTaskParameterData(Long id) { + return businessAssayTaskParameterDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessAssayTaskParameterDataPage(BusinessAssayTaskParameterDataPageReqVO pageReqVO) { + return businessAssayTaskParameterDataMapper.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/BusinessQCCoefficientDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataService.java index dc59a8b..5a480bf 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataService.java @@ -57,8 +57,8 @@ public interface BusinessQCCoefficientDataService { * @param pageReqVO 分页查询 * @return 质控样检测系数任务数据,空白样、标样分页 */ - PageResult getBusinessQCCoefficientDataPage(BusinessQCCoefficientDataPageReqVO pageReqVO); + PageResult getBusinessQCCoefficientDataPage(BusinessQCCoefficientDataPageReqVO pageReqVO); - List getBusinessQCCoefficientDataList(BusinessQCCoefficientDataReqVO reqVO); + List getBusinessQCCoefficientDataList(BusinessQCCoefficientDataReqVO 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/service/BusinessQCCoefficientDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataServiceImpl.java index 339ce33..3a5878c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataServiceImpl.java @@ -84,12 +84,12 @@ public class BusinessQCCoefficientDataServiceImpl implements BusinessQCCoefficie } @Override - public PageResult getBusinessQCCoefficientDataPage(BusinessQCCoefficientDataPageReqVO pageReqVO) { + public PageResult getBusinessQCCoefficientDataPage(BusinessQCCoefficientDataPageReqVO pageReqVO) { return businessQCCoefficientDataMapper.selectPage(pageReqVO); } @Override - public List getBusinessQCCoefficientDataList(BusinessQCCoefficientDataReqVO reqVO) { + public List getBusinessQCCoefficientDataList(BusinessQCCoefficientDataReqVO reqVO) { return businessQCCoefficientDataMapper.selectList(reqVO); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataService.java index 9ab773f..c11500a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataService.java @@ -57,8 +57,8 @@ public interface BusinessQCManagementDataService { * @param pageReqVO 分页查询 * @return 质控管理样检测任务数据,管理样、标准样分页 */ - PageResult getBusinessQCManagementDataPage(BusinessQCManagementDataPageReqVO pageReqVO); + PageResult getBusinessQCManagementDataPage(BusinessQCManagementDataPageReqVO pageReqVO); - List getBusinessQCManagementDataList(BusinessQCManagementDataReqVO reqVO); + List getBusinessQCManagementDataList(BusinessQCManagementDataReqVO 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/service/BusinessQCManagementDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataServiceImpl.java index 7601b09..6be5261 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataServiceImpl.java @@ -84,12 +84,12 @@ public class BusinessQCManagementDataServiceImpl implements BusinessQCManagement } @Override - public PageResult getBusinessQCManagementDataPage(BusinessQCManagementDataPageReqVO pageReqVO) { + public PageResult getBusinessQCManagementDataPage(BusinessQCManagementDataPageReqVO pageReqVO) { return businessQCManagementDataMapper.selectPage(pageReqVO); } @Override - public List getBusinessQCManagementDataList(BusinessQCManagementDataReqVO reqVO) { + public List getBusinessQCManagementDataList(BusinessQCManagementDataReqVO reqVO) { return businessQCManagementDataMapper.selectList(reqVO); } 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 2fcfd04..549a98e 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 @@ -769,7 +769,7 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { ConfigQCSampleMethodExtendRespVO configQCSampleMethod = configQCSampleMethodMapper.selectByConfigAssayMethodIdAndDictionaryBusinessKey(businessAssayTaskDO.getConfigAssayMethodId(), req.getDictionaryBusinessKey()); - if ("kby".equals(req.getDictionaryBusinessKey()) || "by".equals(req.getDictionaryBusinessKey())) {//空白样和标样 + if ("withoutProject".equals(req.getParentDictionaryBusinesskey())) {//不带检测项目的:如 空白样和标样 BusinessQCCoefficientDataDO businessQCCoefficientDataDO = new BusinessQCCoefficientDataDO(); businessQCCoefficientDataDO.setId(IdWorker.getId()); @@ -813,10 +813,26 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { businessQCCoefficientParameterDataDOList.add(businessQCCoefficientParameterDataDO); } - } else {//管理样与标准样 + } else {//带检测项目的 如: 管理样、标准样、质控空白样、监控样 //分析项目 List configAssayMethodProjectExtendRespList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); - List configAssayMethodProjectIds = configAssayMethodProjectExtendRespList.stream().map(m -> m.getId()).collect(Collectors.toList()); + //检测项目id + List dictionaryProjectIdList = new ArrayList<>(); + //必须要检测的项目 + String mustProject = configQCSampleMethod.getMustProject(); + if (StringUtils.isNotBlank(mustProject)) { + String[] mustProjects = mustProject.split(","); + for (String dicProjectId : mustProjects) { + dictionaryProjectIdList.add(Long.parseLong(dicProjectId)); + } + } + //当前任务的检测项目列表 + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskId(req.getBusinessAssayTaskId()); + //获取当前任务的检测项目id列表 + List busTaskDictionaryProjectIdList = businessAssayProjectDataList.stream().map(m -> m.getDictionaryProjectId()).distinct().collect(Collectors.toList()); + dictionaryProjectIdList.addAll(busTaskDictionaryProjectIdList); + //获取需要创建的检测项目id + List configAssayMethodProjectIds = configAssayMethodProjectExtendRespList.stream().filter(f -> dictionaryProjectIdList.contains(f.getDictionaryProjectId())).map(m -> m.getId()).collect(Collectors.toList()); //分析项目参数 List configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectIds(configAssayMethodProjectIds); //分析项目 @@ -845,6 +861,10 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { businessQCManagementDataDOList.add(businessQCManagementDataDO); for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectExtendRespVO : configAssayMethodProjectExtendRespList) { + if (!dictionaryProjectIdList.contains(configAssayMethodProjectExtendRespVO.getDictionaryProjectId())) {//不存在则跳过 + continue; + } + BusinessQCManagementProjectDataDO businessQCManagementProjectDataDO = new BusinessQCManagementProjectDataDO(); businessQCManagementProjectDataDO.setId(IdWorker.getId()); businessQCManagementProjectDataDO.setBusinessQCManagementDataId(businessQCManagementDataDO.getId()); @@ -894,10 +914,10 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { @Override @Transactional(rollbackFor = Exception.class) public void deleteQcSample(DeleteQcSampleReqVO req) { - if ("kby".equals(req.getDictionaryBusinessKey()) || "by".equals(req.getDictionaryBusinessKey())) {//空白样和标样 + if ("withoutProject".equals(req.getParentDictionaryBusinesskey())) {//不带检测项目的 空白样和标样 businessQCCoefficientDataMapper.deleteByIds(req.getQcSampleIdList()); businessQCCoefficientParameterDataMapper.delete(new LambdaQueryWrapperX().in(BusinessQCCoefficientParameterDataDO::getBusinessQCCoefficientDataId, req.getQcSampleIdList())); - } else { //管理样和标准样 + } else { //带检测项目的 管理样和标准样 businessQCManagementDataMapper.deleteByIds(req.getQcSampleIdList()); List businessQCManagementProjectDataList = businessQCManagementProjectDataMapper.selectByBusinessQCManagementDataIds(req.getQcSampleIdList()); List businessQCManagementProjectDataIdList = businessQCManagementProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodParameterController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodParameterController.java new file mode 100644 index 0000000..b68d6f1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodParameterController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.config.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.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO; +import com.zt.plat.module.qms.business.config.service.ConfigAssayMethodParameterService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 检测方法参数配置") +@RestController +@RequestMapping("/qms/config-assay-method-parameter") +@Validated +public class ConfigAssayMethodParameterController implements BusinessControllerMarker { + + + @Resource + private ConfigAssayMethodParameterService configAssayMethodParameterService; + + @PostMapping("/create") + @Operation(summary = "创建检测方法参数配置") + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:create')") + public CommonResult createConfigAssayMethodParameter(@Valid @RequestBody ConfigAssayMethodParameterSaveReqVO createReqVO) { + return success(configAssayMethodParameterService.createConfigAssayMethodParameter(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新检测方法参数配置") + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:update')") + public CommonResult updateConfigAssayMethodParameter(@Valid @RequestBody ConfigAssayMethodParameterSaveReqVO updateReqVO) { + configAssayMethodParameterService.updateConfigAssayMethodParameter(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除检测方法参数配置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:delete')") + public CommonResult deleteConfigAssayMethodParameter(@RequestParam("id") Long id) { + configAssayMethodParameterService.deleteConfigAssayMethodParameter(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除检测方法参数配置") + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:delete')") + public CommonResult deleteConfigAssayMethodParameterList(@RequestBody BatchDeleteReqVO req) { + configAssayMethodParameterService.deleteConfigAssayMethodParameterListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得检测方法参数配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:query')") + public CommonResult getConfigAssayMethodParameter(@RequestParam("id") Long id) { + ConfigAssayMethodParameterDO configAssayMethodParameter = configAssayMethodParameterService.getConfigAssayMethodParameter(id); + return success(BeanUtils.toBean(configAssayMethodParameter, ConfigAssayMethodParameterRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得检测方法参数配置分页") + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:query')") + public CommonResult> getConfigAssayMethodParameterPage(@Valid ConfigAssayMethodParameterPageReqVO pageReqVO) { + PageResult pageResult = configAssayMethodParameterService.getConfigAssayMethodParameterPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigAssayMethodParameterRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出检测方法参数配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-assay-method-parameter:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigAssayMethodParameterExcel(@Valid ConfigAssayMethodParameterPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configAssayMethodParameterService.getConfigAssayMethodParameterPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "检测方法参数配置.xls", "数据", ConfigAssayMethodParameterRespVO.class, + BeanUtils.toBean(list, ConfigAssayMethodParameterRespVO.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/config/controller/vo/ConfigAssayMethodParameterPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterPageReqVO.java new file mode 100644 index 0000000..a23f3ef --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterPageReqVO.java @@ -0,0 +1,71 @@ +package com.zt.plat.module.qms.business.config.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 ConfigAssayMethodParameterPageReqVO extends PageParam { + + @Schema(description = "检测方法ID", example = "29823") + private Long configAssayMethodId; + + @Schema(description = "参数名称", example = "张三") + private String parameterName; + + @Schema(description = "参数简称", example = "张三") + private String shortName; + + @Schema(description = "参数序号") + private Integer no; + + @Schema(description = "键值") + private String key; + + @Schema(description = "填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算") + private String fillingWay; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "默认值") + private String defaultValue; + + @Schema(description = "是否允许为空") + private Integer isNull; + + @Schema(description = "pc界面是否显示") + private Integer isShow; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "参数分组_ID,字典表【T_DIC_BSN】参数分组", example = "14680") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key,字典表【T_DIC_BSN】参数分组") + private String dictionaryBusinessKey; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本") + private Integer version; + +} \ 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/config/controller/vo/ConfigAssayMethodParameterRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterRespVO.java new file mode 100644 index 0000000..154813e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterRespVO.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.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 ConfigAssayMethodParameterRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12031") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测方法ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29823") + @ExcelProperty("检测方法ID") + private Long configAssayMethodId; + + @Schema(description = "参数名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("参数名称") + private String parameterName; + + @Schema(description = "参数简称", example = "张三") + @ExcelProperty("参数简称") + private String shortName; + + @Schema(description = "参数序号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("参数序号") + private Integer no; + + @Schema(description = "键值") + @ExcelProperty("键值") + private String key; + + @Schema(description = "填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算") + private String fillingWay; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "默认值") + @ExcelProperty("默认值") + private String defaultValue; + + @Schema(description = "是否允许为空", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否允许为空") + private Integer isNull; + + @Schema(description = "pc界面是否显示", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("pc界面是否显示") + private Integer isShow; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "参数分组_ID,字典表【T_DIC_BSN】参数分组", example = "14680") + @ExcelProperty("参数分组_ID,字典表【T_DIC_BSN】参数分组") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key,字典表【T_DIC_BSN】参数分组") + @ExcelProperty("参数分组_Key,字典表【T_DIC_BSN】参数分组") + private String dictionaryBusinessKey; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("版本") + private Integer version; + +} \ 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/config/controller/vo/ConfigAssayMethodParameterSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterSaveReqVO.java new file mode 100644 index 0000000..f390c28 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodParameterSaveReqVO.java @@ -0,0 +1,74 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 检测方法参数配置新增/修改 Request VO") +@Data +public class ConfigAssayMethodParameterSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12031") + private Long id; + + @Schema(description = "检测方法ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29823") + @NotNull(message = "检测方法ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "参数名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "参数名称不能为空") + private String parameterName; + + @Schema(description = "参数简称", example = "张三") + private String shortName; + + @Schema(description = "参数序号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "参数序号不能为空") + private Integer no; + + @Schema(description = "键值") + private String key; + + @Schema(description = "填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算不能为空") + private String fillingWay; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "默认值") + private String defaultValue; + + @Schema(description = "是否允许为空", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否允许为空不能为空") + private Integer isNull; + + @Schema(description = "pc界面是否显示", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "pc界面是否显示不能为空") + private Integer isShow; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "参数分组_ID,字典表【T_DIC_BSN】参数分组", example = "14680") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key,字典表【T_DIC_BSN】参数分组") + private String dictionaryBusinessKey; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "版本不能为空") + private Integer version; + +} \ 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/config/controller/vo/ConfigQCSampleMethodExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodExtendRespVO.java index 277078a..b5032d1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodExtendRespVO.java @@ -6,6 +6,12 @@ import lombok.Data; public class ConfigQCSampleMethodExtendRespVO extends ConfigQCSampleMethodRespVO { private String dictionaryBusinessName; + + private String parentDictionaryBusinessId; + + private String parentDictionaryBusinessName; + + private String parentDictionaryBusinesskey; private String configAssayMethodName; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodPageReqVO.java index 71fa079..37eaf64 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodPageReqVO.java @@ -40,6 +40,9 @@ public class ConfigQCSampleMethodPageReqVO extends PageParam { @Schema(description = "映射检测信息配置") private String configInfomation; + @Schema(description = "必要检测项目") + private String mustProject; + @Schema(description = "排序号") private Integer sortNo; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodRespVO.java index 34eb738..18dba20 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodRespVO.java @@ -52,6 +52,10 @@ public class ConfigQCSampleMethodRespVO { @ExcelProperty("映射检测信息配置") private String configInfomation; + @Schema(description = "必要检测项目") + @ExcelProperty("必要检测项目") + private String mustProject; + @Schema(description = "排序号") private Integer sortNo; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodSaveReqVO.java index 2be5344..ca46435 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodSaveReqVO.java @@ -46,6 +46,9 @@ public class ConfigQCSampleMethodSaveReqVO { @Schema(description = "映射检测信息配置") private String configInfomation; + @Schema(description = "必要检测项目") + private String mustProject; + @Schema(description = "排序号") private Integer sortNo; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodParameterDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodParameterDO.java new file mode 100644 index 0000000..817c5e9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodParameterDO.java @@ -0,0 +1,120 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 检测方法参数配置 DO +* +* @author 后台管理-1 +*/ +@TableName("t_cfg_asy_mthd_prm") +@KeySequence("t_cfg_asy_mthd_prm_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigAssayMethodParameterDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测方法ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 参数名称 + */ + @TableField("PRM_NAME") + private String parameterName; + /** + * 参数简称 + */ + @TableField("SHRT_NAME") + private String shortName; + /** + * 参数序号 + */ + @TableField("NO") + private Integer no; + /** + * 键值 + */ + @TableField("KY") + private String key; + /** + * 填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算 + */ + @TableField("FIL_WY") + private String fillingWay; + /** + * 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 默认值 + */ + @TableField("DFT_VAL") + private String defaultValue; + /** + * 是否允许为空 + */ + @TableField("IS_NLL") + private Integer isNull; + /** + * pc界面是否显示 + */ + @TableField("IS_SHW") + private Integer isShow; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 参数分组_ID,字典表【T_DIC_BSN】参数分组 + */ + @TableField("DIC_BSN_ID") + private Long dictionaryBusinessId; + /** + * 参数分组_Key,字典表【T_DIC_BSN】参数分组 + */ + @TableField("DIC_BSN_KY") + private String dictionaryBusinessKey; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + /** + * 版本 + */ + @TableField("VER") + private Integer version; + +} \ 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/config/dal/dataobject/ConfigQCSampleMethodDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodDO.java index ba8720c..5703ae0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodDO.java @@ -77,6 +77,11 @@ public class ConfigQCSampleMethodDO extends BusinessBaseDO { @TableField("CFG_INF") private String configInfomation; /** + * 必要检测项目 + */ + @TableField("MUST_PRJ") + private String mustProject; + /** * 排序号 */ @TableField("SRT_NO") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodParameterMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodParameterMapper.java new file mode 100644 index 0000000..5d6668b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodParameterMapper.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.business.config.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.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 检测方法参数配置 Mapper + * + * @author 后台管理-1 + */ +@Mapper +public interface ConfigAssayMethodParameterMapper extends BaseMapperX { + + default PageResult selectPage(ConfigAssayMethodParameterPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigAssayMethodParameterDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .likeIfPresent(ConfigAssayMethodParameterDO::getParameterName, reqVO.getParameterName()) + .likeIfPresent(ConfigAssayMethodParameterDO::getShortName, reqVO.getShortName()) + .eqIfPresent(ConfigAssayMethodParameterDO::getNo, reqVO.getNo()) + .eqIfPresent(ConfigAssayMethodParameterDO::getKey, reqVO.getKey()) + .eqIfPresent(ConfigAssayMethodParameterDO::getFillingWay, reqVO.getFillingWay()) + .eqIfPresent(ConfigAssayMethodParameterDO::getDataType, reqVO.getDataType()) + .eqIfPresent(ConfigAssayMethodParameterDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(ConfigAssayMethodParameterDO::getDefaultValue, reqVO.getDefaultValue()) + .eqIfPresent(ConfigAssayMethodParameterDO::getIsNull, reqVO.getIsNull()) + .eqIfPresent(ConfigAssayMethodParameterDO::getIsShow, reqVO.getIsShow()) + .eqIfPresent(ConfigAssayMethodParameterDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(ConfigAssayMethodParameterDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(ConfigAssayMethodParameterDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(ConfigAssayMethodParameterDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigAssayMethodParameterDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigAssayMethodParameterDO::getRemark, reqVO.getRemark()) + .eqIfPresent(ConfigAssayMethodParameterDO::getVersion, reqVO.getVersion()) + .orderByDesc(ConfigAssayMethodParameterDO::getId)); + } + +} \ 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/config/dal/mapper/ConfigQCSampleMethodMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodMapper.java index 5a0fc14..1b88f58 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodMapper.java @@ -6,9 +6,7 @@ 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.config.controller.vo.*; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodDO; -import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionarySampleTypeDO; import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -32,6 +30,7 @@ public interface ConfigQCSampleMethodMapper extends BaseMapperX selectByConfigAssayMethodId(Long configAssayMethodId) { return selectJoinList(ConfigQCSampleMethodExtendRespVO.class, new MPJLambdaWrapperX() - .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigQCSampleMethodDO::getDictionaryBusinessId) + .leftJoin(DictionaryBusinessDO.class, "dbd1", DictionaryBusinessDO::getId, ConfigQCSampleMethodDO::getDictionaryBusinessId) + .leftJoin(DictionaryBusinessDO.class, "dbd2", DictionaryBusinessDO::getId, "dbd1", DictionaryBusinessDO::getParentId) .selectAll(ConfigQCSampleMethodDO.class) - .selectAs(DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName) + .selectAs("dbd1", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName) + .selectAs("dbd1", DictionaryBusinessDO::getParentId, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessId) + .selectAs("dbd2", DictionaryBusinessDO::getKey, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinesskey) + .selectAs("dbd2", DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getParentDictionaryBusinessName) .eq(ConfigQCSampleMethodDO::getConfigAssayMethodId, configAssayMethodId) .orderByAsc(ConfigQCSampleMethodDO::getSortNo)); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterService.java new file mode 100644 index 0000000..0044938 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 检测方法参数配置 Service 接口 + * + * @author 后台管理-1 + */ +public interface ConfigAssayMethodParameterService { + + /** + * 创建检测方法参数配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigAssayMethodParameterRespVO createConfigAssayMethodParameter(@Valid ConfigAssayMethodParameterSaveReqVO createReqVO); + + /** + * 更新检测方法参数配置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigAssayMethodParameter(@Valid ConfigAssayMethodParameterSaveReqVO updateReqVO); + + /** + * 删除检测方法参数配置 + * + * @param id 编号 + */ + void deleteConfigAssayMethodParameter(Long id); + + /** + * 批量删除检测方法参数配置 + * + * @param ids 编号 + */ + void deleteConfigAssayMethodParameterListByIds(List ids); + + /** + * 获得检测方法参数配置 + * + * @param id 编号 + * @return 检测方法参数配置 + */ + ConfigAssayMethodParameterDO getConfigAssayMethodParameter(Long id); + + /** + * 获得检测方法参数配置分页 + * + * @param pageReqVO 分页查询 + * @return 检测方法参数配置分页 + */ + PageResult getConfigAssayMethodParameterPage(ConfigAssayMethodParameterPageReqVO 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/config/service/ConfigAssayMethodParameterServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterServiceImpl.java new file mode 100644 index 0000000..311e2e3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodParameterServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.service; + +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.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodParameterMapper; + +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 后台管理-1 + */ +@Service +@Validated +public class ConfigAssayMethodParameterServiceImpl implements ConfigAssayMethodParameterService { + + @Resource + private ConfigAssayMethodParameterMapper configAssayMethodParameterMapper; + + @Override + public ConfigAssayMethodParameterRespVO createConfigAssayMethodParameter(ConfigAssayMethodParameterSaveReqVO createReqVO) { + // 插入 + ConfigAssayMethodParameterDO configAssayMethodParameter = BeanUtils.toBean(createReqVO, ConfigAssayMethodParameterDO.class); + configAssayMethodParameterMapper.insert(configAssayMethodParameter); + // 返回 + return BeanUtils.toBean(configAssayMethodParameter, ConfigAssayMethodParameterRespVO.class); + } + + @Override + public void updateConfigAssayMethodParameter(ConfigAssayMethodParameterSaveReqVO updateReqVO) { + // 校验存在 + validateConfigAssayMethodParameterExists(updateReqVO.getId()); + // 更新 + ConfigAssayMethodParameterDO updateObj = BeanUtils.toBean(updateReqVO, ConfigAssayMethodParameterDO.class); + configAssayMethodParameterMapper.updateById(updateObj); + } + + @Override + public void deleteConfigAssayMethodParameter(Long id) { + // 校验存在 + validateConfigAssayMethodParameterExists(id); + // 删除 + configAssayMethodParameterMapper.deleteById(id); + } + + @Override + public void deleteConfigAssayMethodParameterListByIds(List ids) { + // 校验存在 + validateConfigAssayMethodParameterExists(ids); + // 删除 + configAssayMethodParameterMapper.deleteByIds(ids); + } + + private void validateConfigAssayMethodParameterExists(List ids) { + List list = configAssayMethodParameterMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_ASSAY_METHOD_PARAMETER_NOT_EXISTS); + } + } + + private void validateConfigAssayMethodParameterExists(Long id) { + if (configAssayMethodParameterMapper.selectById(id) == null) { + throw exception(CONFIG_ASSAY_METHOD_PARAMETER_NOT_EXISTS); + } + } + + @Override + public ConfigAssayMethodParameterDO getConfigAssayMethodParameter(Long id) { + return configAssayMethodParameterMapper.selectById(id); + } + + @Override + public PageResult getConfigAssayMethodParameterPage(ConfigAssayMethodParameterPageReqVO pageReqVO) { + return configAssayMethodParameterMapper.selectPage(pageReqVO); + } + +} \ 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/BusinessAssayTaskParameterDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskParameterDataMapper.xml new file mode 100644 index 0000000..7eb5d39 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskParameterDataMapper.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/config/dal/mapper/ConfigAssayMethodParameterMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodParameterMapper.xml new file mode 100644 index 0000000..b219367 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodParameterMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file