From 6e0886ca5b5ed073bdc2f9d864e8cf3e8941f5ed Mon Sep 17 00:00:00 2001 From: wxr Date: Thu, 13 Nov 2025 13:54:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8D=A7=E5=85=89=E9=87=87=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/qms/enums/ErrorCodeConstants.java | 6 + .../admin/BusinessXRFDataController.java | 105 ++++++++++++++ .../vo/BusinessXRFDataPageReqVO.java | 79 +++++++++++ .../controller/vo/BusinessXRFDataRespVO.java | 99 +++++++++++++ .../vo/BusinessXRFDataSaveReqVO.java | 81 +++++++++++ .../bus/dal/dataobject/BusinessXRFDataDO.java | 132 ++++++++++++++++++ .../bus/dal/mapper/BusinessXRFDataMapper.java | 42 ++++++ .../bus/service/BusinessXRFDataService.java | 61 ++++++++ .../service/BusinessXRFDataServiceImpl.java | 91 ++++++++++++ .../ConfigXRFConversionRateController.java | 106 ++++++++++++++ .../admin/ConfigXRFLineController.java | 106 ++++++++++++++ .../admin/ConfigXRFProjectController.java | 106 ++++++++++++++ .../vo/ConfigXRFConversionRatePageReqVO.java | 38 +++++ .../vo/ConfigXRFConversionRateRespVO.java | 47 +++++++ .../vo/ConfigXRFConversionRateSaveReqVO.java | 35 +++++ .../controller/vo/ConfigXRFLinePageReqVO.java | 49 +++++++ .../controller/vo/ConfigXRFLineRespVO.java | 59 ++++++++ .../controller/vo/ConfigXRFLineSaveReqVO.java | 46 ++++++ .../vo/ConfigXRFProjectPageReqVO.java | 53 +++++++ .../controller/vo/ConfigXRFProjectRespVO.java | 67 +++++++++ .../vo/ConfigXRFProjectSaveReqVO.java | 50 +++++++ .../dataobject/ConfigXRFConversionRateDO.java | 65 +++++++++ .../dal/dataobject/ConfigXRFLineDO.java | 82 +++++++++++ .../dal/dataobject/ConfigXRFProjectDO.java | 90 ++++++++++++ .../mapper/ConfigXRFConversionRateMapper.java | 32 +++++ .../dal/mapper/ConfigXRFLineMapper.java | 35 +++++ .../dal/mapper/ConfigXRFProjectMapper.java | 37 +++++ .../ConfigXRFConversionRateService.java | 61 ++++++++ .../ConfigXRFConversionRateServiceImpl.java | 91 ++++++++++++ .../config/service/ConfigXRFLineService.java | 61 ++++++++ .../service/ConfigXRFLineServiceImpl.java | 91 ++++++++++++ .../service/ConfigXRFProjectService.java | 61 ++++++++ .../service/ConfigXRFProjectServiceImpl.java | 91 ++++++++++++ .../config/DataPermissionConfiguration.java | 18 +++ .../datapermission/package-info.java | 4 + .../bus/dal/mapper/BusinessXRFDataMapper.xml | 12 ++ .../mapper/ConfigXRFConversionRateMapper.xml | 12 ++ .../config/dal/mapper/ConfigXRFLineMapper.xml | 12 ++ .../dal/mapper/ConfigXRFProjectMapper.xml | 12 ++ 39 files changed, 2325 insertions(+) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessXRFDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessXRFDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFConversionRateController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFLineController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFProjectController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRatePageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLinePageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFConversionRateDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFLineDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFProjectDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFConversionRateMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFLineMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFProjectMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/config/DataPermissionConfiguration.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/package-info.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFConversionRateMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFLineMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFProjectMapper.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 d710404..ce8d579 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 @@ -61,6 +61,10 @@ public interface ErrorCodeConstants { ErrorCode CONFIG_SIMPLE_FLOW_RULE_NOT_EXISTS = new ErrorCode(1_032_050_000, "LiteFlow规则配置不存在"); ErrorCode CONFIG_SIMPLE_FLOW_CODE_NOT_EXISTS = new ErrorCode(1_032_050_000, "LiteFlow脚本配置不存在"); ErrorCode CONFIG_RULE_NOT_EXISTS = new ErrorCode(1_032_050_000, "规则配置不存在"); + + ErrorCode CONFIG_XRF_LINE_NOT_EXISTS = new ErrorCode(1_032_050_000, "荧光分析线不存在"); + ErrorCode CONFIG_XRF_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "荧光采集检测项目配置不存在"); + ErrorCode CONFIG_XRF_CONVERSION_RATE_NOT_EXISTS = new ErrorCode(1_032_050_000, "荧光数据采集特殊检测项目转换率配置不存在"); ErrorCode BASE_SAMPLE_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品大类管理不存在"); ErrorCode MATERIAL_ASSAY_STANDARD_DETAIL_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测标准明细不存在"); @@ -123,6 +127,8 @@ public interface ErrorCodeConstants { ErrorCode BUSINESS_QC_MANAGEMENT_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测参数数据业务不存在"); ErrorCode BUSINESS_QC_COEFFICIENT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测系数任务数据,空白样、标样不存在"); ErrorCode BUSINESS_QC_COEFFICIENT_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测系数参数业务不存在"); + + ErrorCode BUSINESS_XRF_DATA_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/BusinessXRFDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessXRFDataController.java new file mode 100644 index 0000000..1b1401a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessXRFDataController.java @@ -0,0 +1,105 @@ +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.*; +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.BusinessXRFDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessXRFDataService; +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-XRF-data") +@Validated +public class BusinessXRFDataController implements BusinessControllerMarker { + + + @Resource + private BusinessXRFDataService businessXRFDataService; + + @PostMapping("/create") + @Operation(summary = "创建荧光采集记录") + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:create')") + public CommonResult createBusinessXRFData(@Valid @RequestBody BusinessXRFDataSaveReqVO createReqVO) { + return success(businessXRFDataService.createBusinessXRFData(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新荧光采集记录") + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:update')") + public CommonResult updateBusinessXRFData(@Valid @RequestBody BusinessXRFDataSaveReqVO updateReqVO) { + businessXRFDataService.updateBusinessXRFData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除荧光采集记录") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:delete')") + public CommonResult deleteBusinessXRFData(@RequestParam("id") Long id) { + businessXRFDataService.deleteBusinessXRFData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除荧光采集记录") + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:delete')") + public CommonResult deleteBusinessXRFDataList(@RequestBody BatchDeleteReqVO req) { + businessXRFDataService.deleteBusinessXRFDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得荧光采集记录") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:query')") + public CommonResult getBusinessXRFData(@RequestParam("id") Long id) { + BusinessXRFDataDO businessXRFData = businessXRFDataService.getBusinessXRFData(id); + return success(BeanUtils.toBean(businessXRFData, BusinessXRFDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得荧光采集记录分页") + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:query')") + public CommonResult> getBusinessXRFDataPage(@Valid BusinessXRFDataPageReqVO pageReqVO) { + PageResult pageResult = businessXRFDataService.getBusinessXRFDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessXRFDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出荧光采集记录 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessXRFDataExcel(@Valid BusinessXRFDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessXRFDataService.getBusinessXRFDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "荧光采集记录.xls", "数据", BusinessXRFDataRespVO.class, + BeanUtils.toBean(list, BusinessXRFDataRespVO.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/vo/BusinessXRFDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataPageReqVO.java new file mode 100644 index 0000000..db1a9af --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataPageReqVO.java @@ -0,0 +1,79 @@ +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 BusinessXRFDataPageReqVO extends PageParam { + + @Schema(description = "设备编号") + private Long deviceNo; + + @Schema(description = "荧光线名称", example = "王五") + private String lineName; + + @Schema(description = "荧光样品id", example = "13273") + private String xRFSampleId; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "李四") + private String sampleName; + + @Schema(description = "样品时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] sampleTime; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "样品主样ID", example = "29288") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", example = "4878") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", example = "13189") + private Long businessSubSampleId; + + @Schema(description = "检测数据") + private String assayData; + + @Schema(description = "是否为检查创建数据") + private Integer isCheckCreate; + + @Schema(description = "是否已匹配") + private Integer isMatched; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "乐观锁", example = "4171") + 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/BusinessXRFDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataRespVO.java new file mode 100644 index 0000000..4359cd8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataRespVO.java @@ -0,0 +1,99 @@ +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 BusinessXRFDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18701") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("设备编号") + private Long deviceNo; + + @Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("荧光线名称") + private String lineName; + + @Schema(description = "荧光样品id", example = "13273") + @ExcelProperty("荧光样品id") + private String xRFSampleId; + + @Schema(description = "样品编号") + @ExcelProperty("样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "李四") + @ExcelProperty("样品名称") + private String sampleName; + + @Schema(description = "样品时间") + @ExcelProperty("样品时间") + private LocalDateTime sampleTime; + + @Schema(description = "分析人") + @ExcelProperty("分析人") + private String assayOperator; + + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29288") + @ExcelProperty("样品主样ID") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4878") + @ExcelProperty("样品分样ID") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13189") + @ExcelProperty("分样子样ID") + private Long businessSubSampleId; + + @Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("检测数据") + private String assayData; + + @Schema(description = "是否为检查创建数据") + @ExcelProperty("是否为检查创建数据") + private Integer isCheckCreate; + + @Schema(description = "是否已匹配") + @ExcelProperty("是否已匹配") + private Integer isMatched; + + @Schema(description = "是否已上报") + @ExcelProperty("是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + @ExcelProperty("上报人") + private String reporter; + + @Schema(description = "上报时间") + @ExcelProperty("上报时间") + private LocalDateTime reportTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "4171") + @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/BusinessXRFDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataSaveReqVO.java new file mode 100644 index 0000000..720198d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataSaveReqVO.java @@ -0,0 +1,81 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 荧光采集记录新增/修改 Request VO") +@Data +public class BusinessXRFDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18701") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "设备编号不能为空") + private Long deviceNo; + + @Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "荧光线名称不能为空") + private String lineName; + + @Schema(description = "荧光样品id", example = "13273") + private String xRFSampleId; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "李四") + private String sampleName; + + @Schema(description = "样品时间") + private LocalDateTime sampleTime; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29288") + @NotNull(message = "样品主样ID不能为空") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4878") + @NotNull(message = "样品分样ID不能为空") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13189") + @NotNull(message = "分样子样ID不能为空") + private Long businessSubSampleId; + + @Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "检测数据不能为空") + private String assayData; + + @Schema(description = "是否为检查创建数据") + private Integer isCheckCreate; + + @Schema(description = "是否已匹配") + private Integer isMatched; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + private LocalDateTime reportTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "4171") + @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/dal/dataobject/BusinessXRFDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessXRFDataDO.java new file mode 100644 index 0000000..c2f11e4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessXRFDataDO.java @@ -0,0 +1,132 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 荧光采集记录 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_xrf_dat") +@KeySequence("t_bsn_xrf_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessXRFDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 设备编号 + */ + @TableField("DEV_NO") + private Long deviceNo; + /** + * 荧光线名称 + */ + @TableField("LINE_NAME") + private String lineName; + /** + * 荧光样品id + */ + @TableField("XRF_SMP_ID") + private String xRFSampleId; + /** + * 样品编号 + */ + @TableField("SMP_CD") + private String sampleCode; + /** + * 样品名称 + */ + @TableField("SMP_NAME") + private String sampleName; + /** + * 样品时间 + */ + @TableField("SMP_TM") + private LocalDateTime sampleTime; + /** + * 分析人 + */ + @TableField("ASY_OPTR") + private String assayOperator; + /** + * 样品主样ID + */ + @TableField("BSN_BSE_SMP_ID") + private Long businessBaseSampleId; + /** + * 样品分样ID + */ + @TableField("BSN_SB_PRN_SMP_ID") + private Long businessSubParentSampleId; + /** + * 分样子样ID + */ + @TableField("BSN_SB_SMP_ID") + private Long businessSubSampleId; + /** + * 检测数据 + */ + @TableField("ASY_DAT") + private String assayData; + /** + * 是否为检查创建数据 + */ + @TableField("IS_CHK_CRT") + private Integer isCheckCreate; + /** + * 是否已匹配 + */ + @TableField("IS_MATD") + private Integer isMatched; + /** + * 是否已上报 + */ + @TableField("IS_RPOD") + private Integer isReported; + /** + * 上报人 + */ + @TableField("RPTR") + private String reporter; + /** + * 上报时间 + */ + @TableField("RPT_TM") + private LocalDateTime reportTime; + /** + * 乐观锁 + */ + @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/BusinessXRFDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.java new file mode 100644 index 0000000..7935121 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.java @@ -0,0 +1,42 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; +/** + * 荧光采集记录 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessXRFDataMapper extends BaseMapperX { + + default PageResult selectPage(BusinessXRFDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessXRFDataDO::getDeviceNo, reqVO.getDeviceNo()) + .likeIfPresent(BusinessXRFDataDO::getLineName, reqVO.getLineName()) + .eqIfPresent(BusinessXRFDataDO::getXRFSampleId, reqVO.getXRFSampleId()) + .eqIfPresent(BusinessXRFDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessXRFDataDO::getSampleName, reqVO.getSampleName()) + .betweenIfPresent(BusinessXRFDataDO::getSampleTime, reqVO.getSampleTime()) + .eqIfPresent(BusinessXRFDataDO::getAssayOperator, reqVO.getAssayOperator()) + .eqIfPresent(BusinessXRFDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) + .eqIfPresent(BusinessXRFDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) + .eqIfPresent(BusinessXRFDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) + .eqIfPresent(BusinessXRFDataDO::getAssayData, reqVO.getAssayData()) + .eqIfPresent(BusinessXRFDataDO::getIsCheckCreate, reqVO.getIsCheckCreate()) + .eqIfPresent(BusinessXRFDataDO::getIsMatched, reqVO.getIsMatched()) + .eqIfPresent(BusinessXRFDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessXRFDataDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessXRFDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessXRFDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessXRFDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessXRFDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessXRFDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessXRFDataDO::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/service/BusinessXRFDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataService.java new file mode 100644 index 0000000..c553c49 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataService.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.BusinessXRFDataDO; + +/** + * 荧光采集记录 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessXRFDataService { + + /** + * 创建荧光采集记录 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessXRFDataRespVO createBusinessXRFData(@Valid BusinessXRFDataSaveReqVO createReqVO); + + /** + * 更新荧光采集记录 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessXRFData(@Valid BusinessXRFDataSaveReqVO updateReqVO); + + /** + * 删除荧光采集记录 + * + * @param id 编号 + */ + void deleteBusinessXRFData(Long id); + + /** + * 批量删除荧光采集记录 + * + * @param ids 编号 + */ + void deleteBusinessXRFDataListByIds(List ids); + + /** + * 获得荧光采集记录 + * + * @param id 编号 + * @return 荧光采集记录 + */ + BusinessXRFDataDO getBusinessXRFData(Long id); + + /** + * 获得荧光采集记录分页 + * + * @param pageReqVO 分页查询 + * @return 荧光采集记录分页 + */ + PageResult getBusinessXRFDataPage(BusinessXRFDataPageReqVO 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/BusinessXRFDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataServiceImpl.java new file mode 100644 index 0000000..1077ba3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataServiceImpl.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.BusinessXRFDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessXRFDataMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 荧光采集记录 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessXRFDataServiceImpl implements BusinessXRFDataService { + + @Resource + private BusinessXRFDataMapper businessXRFDataMapper; + + @Override + public BusinessXRFDataRespVO createBusinessXRFData(BusinessXRFDataSaveReqVO createReqVO) { + // 插入 + BusinessXRFDataDO businessXRFData = BeanUtils.toBean(createReqVO, BusinessXRFDataDO.class); + businessXRFDataMapper.insert(businessXRFData); + // 返回 + return BeanUtils.toBean(businessXRFData, BusinessXRFDataRespVO.class); + } + + @Override + public void updateBusinessXRFData(BusinessXRFDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessXRFDataExists(updateReqVO.getId()); + // 更新 + BusinessXRFDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessXRFDataDO.class); + businessXRFDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessXRFData(Long id) { + // 校验存在 + validateBusinessXRFDataExists(id); + // 删除 + businessXRFDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessXRFDataListByIds(List ids) { + // 校验存在 + validateBusinessXRFDataExists(ids); + // 删除 + businessXRFDataMapper.deleteByIds(ids); + } + + private void validateBusinessXRFDataExists(List ids) { + List list = businessXRFDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_XRF_DATA_NOT_EXISTS); + } + } + + private void validateBusinessXRFDataExists(Long id) { + if (businessXRFDataMapper.selectById(id) == null) { + throw exception(BUSINESS_XRF_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessXRFDataDO getBusinessXRFData(Long id) { + return businessXRFDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessXRFDataPage(BusinessXRFDataPageReqVO pageReqVO) { + return businessXRFDataMapper.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/config/controller/admin/ConfigXRFConversionRateController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFConversionRateController.java new file mode 100644 index 0000000..50e1bc4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFConversionRateController.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.ConfigXRFConversionRateDO; +import com.zt.plat.module.qms.business.config.service.ConfigXRFConversionRateService; +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-XRF-conversion-rate") +@Validated +public class ConfigXRFConversionRateController implements BusinessControllerMarker { + + + @Resource + private ConfigXRFConversionRateService configXRFConversionRateService; + + @PostMapping("/create") + @Operation(summary = "创建荧光数据采集特殊检测项目转换率配置") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:create')") + public CommonResult createConfigXRFConversionRate(@Valid @RequestBody ConfigXRFConversionRateSaveReqVO createReqVO) { + return success(configXRFConversionRateService.createConfigXRFConversionRate(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新荧光数据采集特殊检测项目转换率配置") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:update')") + public CommonResult updateConfigXRFConversionRate(@Valid @RequestBody ConfigXRFConversionRateSaveReqVO updateReqVO) { + configXRFConversionRateService.updateConfigXRFConversionRate(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除荧光数据采集特殊检测项目转换率配置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:delete')") + public CommonResult deleteConfigXRFConversionRate(@RequestParam("id") Long id) { + configXRFConversionRateService.deleteConfigXRFConversionRate(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除荧光数据采集特殊检测项目转换率配置") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:delete')") + public CommonResult deleteConfigXRFConversionRateList(@RequestBody BatchDeleteReqVO req) { + configXRFConversionRateService.deleteConfigXRFConversionRateListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得荧光数据采集特殊检测项目转换率配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:query')") + public CommonResult getConfigXRFConversionRate(@RequestParam("id") Long id) { + ConfigXRFConversionRateDO configXRFConversionRate = configXRFConversionRateService.getConfigXRFConversionRate(id); + return success(BeanUtils.toBean(configXRFConversionRate, ConfigXRFConversionRateRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得荧光数据采集特殊检测项目转换率配置分页") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:query')") + public CommonResult> getConfigXRFConversionRatePage(@Valid ConfigXRFConversionRatePageReqVO pageReqVO) { + PageResult pageResult = configXRFConversionRateService.getConfigXRFConversionRatePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigXRFConversionRateRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出荧光数据采集特殊检测项目转换率配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigXRFConversionRateExcel(@Valid ConfigXRFConversionRatePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configXRFConversionRateService.getConfigXRFConversionRatePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "荧光数据采集特殊检测项目转换率配置.xls", "数据", ConfigXRFConversionRateRespVO.class, + BeanUtils.toBean(list, ConfigXRFConversionRateRespVO.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/admin/ConfigXRFLineController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFLineController.java new file mode 100644 index 0000000..e665f6c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFLineController.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.ConfigXRFLineDO; +import com.zt.plat.module.qms.business.config.service.ConfigXRFLineService; +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-XRF-line") +@Validated +public class ConfigXRFLineController implements BusinessControllerMarker { + + + @Resource + private ConfigXRFLineService configXRFLineService; + + @PostMapping("/create") + @Operation(summary = "创建荧光分析线") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:create')") + public CommonResult createConfigXRFLine(@Valid @RequestBody ConfigXRFLineSaveReqVO createReqVO) { + return success(configXRFLineService.createConfigXRFLine(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新荧光分析线") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:update')") + public CommonResult updateConfigXRFLine(@Valid @RequestBody ConfigXRFLineSaveReqVO updateReqVO) { + configXRFLineService.updateConfigXRFLine(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除荧光分析线") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:delete')") + public CommonResult deleteConfigXRFLine(@RequestParam("id") Long id) { + configXRFLineService.deleteConfigXRFLine(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除荧光分析线") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:delete')") + public CommonResult deleteConfigXRFLineList(@RequestBody BatchDeleteReqVO req) { + configXRFLineService.deleteConfigXRFLineListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得荧光分析线") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:query')") + public CommonResult getConfigXRFLine(@RequestParam("id") Long id) { + ConfigXRFLineDO configXRFLine = configXRFLineService.getConfigXRFLine(id); + return success(BeanUtils.toBean(configXRFLine, ConfigXRFLineRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得荧光分析线分页") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:query')") + public CommonResult> getConfigXRFLinePage(@Valid ConfigXRFLinePageReqVO pageReqVO) { + PageResult pageResult = configXRFLineService.getConfigXRFLinePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigXRFLineRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出荧光分析线 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigXRFLineExcel(@Valid ConfigXRFLinePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configXRFLineService.getConfigXRFLinePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "荧光分析线.xls", "数据", ConfigXRFLineRespVO.class, + BeanUtils.toBean(list, ConfigXRFLineRespVO.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/admin/ConfigXRFProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFProjectController.java new file mode 100644 index 0000000..712f56a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFProjectController.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.ConfigXRFProjectDO; +import com.zt.plat.module.qms.business.config.service.ConfigXRFProjectService; +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-XRF-project") +@Validated +public class ConfigXRFProjectController implements BusinessControllerMarker { + + + @Resource + private ConfigXRFProjectService configXRFProjectService; + + @PostMapping("/create") + @Operation(summary = "创建荧光采集检测项目配置") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:create')") + public CommonResult createConfigXRFProject(@Valid @RequestBody ConfigXRFProjectSaveReqVO createReqVO) { + return success(configXRFProjectService.createConfigXRFProject(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新荧光采集检测项目配置") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:update')") + public CommonResult updateConfigXRFProject(@Valid @RequestBody ConfigXRFProjectSaveReqVO updateReqVO) { + configXRFProjectService.updateConfigXRFProject(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除荧光采集检测项目配置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:delete')") + public CommonResult deleteConfigXRFProject(@RequestParam("id") Long id) { + configXRFProjectService.deleteConfigXRFProject(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除荧光采集检测项目配置") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:delete')") + public CommonResult deleteConfigXRFProjectList(@RequestBody BatchDeleteReqVO req) { + configXRFProjectService.deleteConfigXRFProjectListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得荧光采集检测项目配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:query')") + public CommonResult getConfigXRFProject(@RequestParam("id") Long id) { + ConfigXRFProjectDO configXRFProject = configXRFProjectService.getConfigXRFProject(id); + return success(BeanUtils.toBean(configXRFProject, ConfigXRFProjectRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得荧光采集检测项目配置分页") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:query')") + public CommonResult> getConfigXRFProjectPage(@Valid ConfigXRFProjectPageReqVO pageReqVO) { + PageResult pageResult = configXRFProjectService.getConfigXRFProjectPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigXRFProjectRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出荧光采集检测项目配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigXRFProjectExcel(@Valid ConfigXRFProjectPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configXRFProjectService.getConfigXRFProjectPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "荧光采集检测项目配置.xls", "数据", ConfigXRFProjectRespVO.class, + BeanUtils.toBean(list, ConfigXRFProjectRespVO.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/ConfigXRFConversionRatePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRatePageReqVO.java new file mode 100644 index 0000000..a06d6a6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRatePageReqVO.java @@ -0,0 +1,38 @@ +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 ConfigXRFConversionRatePageReqVO extends PageParam { + + @Schema(description = "设备编号") + private Long deviceNo; + + @Schema(description = "荧光线名称", example = "张三") + private String lineName; + + @Schema(description = "荧光仪器采集系统检测项目名称", example = "张三") + private String xRFProjectName; + + @Schema(description = "转换率(乘数)") + private Integer conversionRate; + + @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/config/controller/vo/ConfigXRFConversionRateRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateRespVO.java new file mode 100644 index 0000000..d59e1f9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateRespVO.java @@ -0,0 +1,47 @@ +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 ConfigXRFConversionRateRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12818") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("设备编号") + private Long deviceNo; + + @Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("荧光线名称") + private String lineName; + + @Schema(description = "荧光仪器采集系统检测项目名称", example = "张三") + @ExcelProperty("荧光仪器采集系统检测项目名称") + private String xRFProjectName; + + @Schema(description = "转换率(乘数)") + @ExcelProperty("转换率(乘数)") + private Integer conversionRate; + + @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/config/controller/vo/ConfigXRFConversionRateSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateSaveReqVO.java new file mode 100644 index 0000000..ce86783 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateSaveReqVO.java @@ -0,0 +1,35 @@ +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 ConfigXRFConversionRateSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12818") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "设备编号不能为空") + private Long deviceNo; + + @Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "荧光线名称不能为空") + private String lineName; + + @Schema(description = "荧光仪器采集系统检测项目名称", example = "张三") + private String xRFProjectName; + + @Schema(description = "转换率(乘数)") + private Integer conversionRate; + + @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/config/controller/vo/ConfigXRFLinePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLinePageReqVO.java new file mode 100644 index 0000000..5cae94c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLinePageReqVO.java @@ -0,0 +1,49 @@ +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 ConfigXRFLinePageReqVO extends PageParam { + + @Schema(description = "设备编号") + private Long deviceNo; + + @Schema(description = "荧光线名称", example = "芋艿") + private String lineName; + + @Schema(description = "是否启用,0、未启用;1、启用;") + private Integer isUse; + + @Schema(description = "连接字符串") + private String connectString; + + @Schema(description = "数据源类型,(1:rdb,2:mdb)", example = "1") + private Integer dataSourceType; + + @Schema(description = "末次同步数据时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] lastSynchronousDataTime; + + @Schema(description = "末次检查数据时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] lastCheckDataTime; + + @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/config/controller/vo/ConfigXRFLineRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineRespVO.java new file mode 100644 index 0000000..ea9db11 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineRespVO.java @@ -0,0 +1,59 @@ +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 ConfigXRFLineRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10711") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("设备编号") + private Long deviceNo; + + @Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("荧光线名称") + private String lineName; + + @Schema(description = "是否启用,0、未启用;1、启用;") + @ExcelProperty("是否启用,0、未启用;1、启用;") + private Integer isUse; + + @Schema(description = "连接字符串") + @ExcelProperty("连接字符串") + private String connectString; + + @Schema(description = "数据源类型,(1:rdb,2:mdb)", example = "1") + @ExcelProperty("数据源类型,(1:rdb,2:mdb)") + private Integer dataSourceType; + + @Schema(description = "末次同步数据时间") + @ExcelProperty("末次同步数据时间") + private LocalDateTime lastSynchronousDataTime; + + @Schema(description = "末次检查数据时间") + @ExcelProperty("末次检查数据时间") + private LocalDateTime lastCheckDataTime; + + @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/config/controller/vo/ConfigXRFLineSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineSaveReqVO.java new file mode 100644 index 0000000..aa16a6c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineSaveReqVO.java @@ -0,0 +1,46 @@ +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.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 荧光分析线新增/修改 Request VO") +@Data +public class ConfigXRFLineSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10711") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "设备编号不能为空") + private Long deviceNo; + + @Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "荧光线名称不能为空") + private String lineName; + + @Schema(description = "是否启用,0、未启用;1、启用;") + private Integer isUse; + + @Schema(description = "连接字符串") + private String connectString; + + @Schema(description = "数据源类型,(1:rdb,2:mdb)", example = "1") + private Integer dataSourceType; + + @Schema(description = "末次同步数据时间") + private LocalDateTime lastSynchronousDataTime; + + @Schema(description = "末次检查数据时间") + private LocalDateTime lastCheckDataTime; + + @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/config/controller/vo/ConfigXRFProjectPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectPageReqVO.java new file mode 100644 index 0000000..0abc015 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectPageReqVO.java @@ -0,0 +1,53 @@ +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 ConfigXRFProjectPageReqVO extends PageParam { + + @Schema(description = "设备编号") + private Long deviceNo; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "12325") + private Long dictionaryProjectId; + + @Schema(description = "检测项目显示名称", example = "李四") + private String showName; + + @Schema(description = "荧光仪器采集系统检测项目名称", example = "赵六") + private String xRFProjectName; + + @Schema(description = "荧光仪器采集系统检测项目单位") + private String xRFProjectUnit; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "转换率(乘数)") + private Integer conversionRate; + + @Schema(description = "排序号") + private Integer sortNo; + + @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/config/controller/vo/ConfigXRFProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectRespVO.java new file mode 100644 index 0000000..6c8b3cf --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectRespVO.java @@ -0,0 +1,67 @@ +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 ConfigXRFProjectRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15989") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("设备编号") + private Long deviceNo; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "12325") + @ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】") + private Long dictionaryProjectId; + + @Schema(description = "检测项目显示名称", example = "李四") + @ExcelProperty("检测项目显示名称") + private String showName; + + @Schema(description = "荧光仪器采集系统检测项目名称", example = "赵六") + @ExcelProperty("荧光仪器采集系统检测项目名称") + private String xRFProjectName; + + @Schema(description = "荧光仪器采集系统检测项目单位") + @ExcelProperty("荧光仪器采集系统检测项目单位") + private String xRFProjectUnit; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + @ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "转换率(乘数)") + @ExcelProperty("转换率(乘数)") + private Integer conversionRate; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @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/config/controller/vo/ConfigXRFProjectSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectSaveReqVO.java new file mode 100644 index 0000000..ce5efb6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectSaveReqVO.java @@ -0,0 +1,50 @@ +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 ConfigXRFProjectSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15989") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "设备编号不能为空") + private Long deviceNo; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "12325") + @NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空") + private Long dictionaryProjectId; + + @Schema(description = "检测项目显示名称", example = "李四") + private String showName; + + @Schema(description = "荧光仪器采集系统检测项目名称", example = "赵六") + private String xRFProjectName; + + @Schema(description = "荧光仪器采集系统检测项目单位") + private String xRFProjectUnit; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "转换率(乘数)") + private Integer conversionRate; + + @Schema(description = "排序号") + private Integer sortNo; + + @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/config/dal/dataobject/ConfigXRFConversionRateDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFConversionRateDO.java new file mode 100644 index 0000000..3e13a9a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFConversionRateDO.java @@ -0,0 +1,65 @@ +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 后台管理 +*/ +@TableName("t_cfg_xrf_cnv_rte") +@KeySequence("t_cfg_xrf_cnv_rte_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigXRFConversionRateDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 设备编号 + */ + @TableField("DEV_NO") + private Long deviceNo; + /** + * 荧光线名称 + */ + @TableField("LINE_NAME") + private String lineName; + /** + * 荧光仪器采集系统检测项目名称 + */ + @TableField("XRF_PRJ_NAME") + private String xRFProjectName; + /** + * 转换率(乘数) + */ + @TableField("CNV_RTE") + private Integer conversionRate; + /** + * 所属部门 + */ + @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/config/dal/dataobject/ConfigXRFLineDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFLineDO.java new file mode 100644 index 0000000..0b1a216 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFLineDO.java @@ -0,0 +1,82 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 荧光分析线 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_xrf_line") +@KeySequence("t_cfg_xrf_line_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigXRFLineDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 设备编号 + */ + @TableField("DEV_NO") + private Long deviceNo; + /** + * 荧光线名称 + */ + @TableField("LINE_NAME") + private String lineName; + /** + * 是否启用,0、未启用;1、启用; + */ + @TableField("IS_USE") + private Integer isUse; + /** + * 连接字符串 + */ + @TableField("CONN_STR") + private String connectString; + /** + * 数据源类型,(1:rdb,2:mdb) + */ + @TableField("DAT_SRC_TP") + private Integer dataSourceType; + /** + * 末次同步数据时间 + */ + @TableField("LST_SYNC_DAT_TM") + private LocalDateTime lastSynchronousDataTime; + /** + * 末次检查数据时间 + */ + @TableField("LST_CHK_DAT_TM") + private LocalDateTime lastCheckDataTime; + /** + * 所属部门 + */ + @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/config/dal/dataobject/ConfigXRFProjectDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFProjectDO.java new file mode 100644 index 0000000..96a38fe --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFProjectDO.java @@ -0,0 +1,90 @@ +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 后台管理 +*/ +@TableName("t_cfg_xrf_prj") +@KeySequence("t_cfg_xrf_prj_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigXRFProjectDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 设备编号 + */ + @TableField("DEV_NO") + private Long deviceNo; + /** + * 检测项目ID,字典表【T_DIC_PRJ】 + */ + @TableField("DIC_PRJ_ID") + private Long dictionaryProjectId; + /** + * 检测项目显示名称 + */ + @TableField("SHW_NAME") + private String showName; + /** + * 荧光仪器采集系统检测项目名称 + */ + @TableField("XRF_PRJ_NAME") + private String xRFProjectName; + /** + * 荧光仪器采集系统检测项目单位 + */ + @TableField("XRF_PRJ_UNT") + private String xRFProjectUnit; + /** + * 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 转换率(乘数) + */ + @TableField("CNV_RTE") + private Integer conversionRate; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 所属部门 + */ + @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/config/dal/mapper/ConfigXRFConversionRateMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFConversionRateMapper.java new file mode 100644 index 0000000..cefbe6b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFConversionRateMapper.java @@ -0,0 +1,32 @@ +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.ConfigXRFConversionRateDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 荧光数据采集特殊检测项目转换率配置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigXRFConversionRateMapper extends BaseMapperX { + + default PageResult selectPage(ConfigXRFConversionRatePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigXRFConversionRateDO::getDeviceNo, reqVO.getDeviceNo()) + .likeIfPresent(ConfigXRFConversionRateDO::getLineName, reqVO.getLineName()) + .likeIfPresent(ConfigXRFConversionRateDO::getXRFProjectName, reqVO.getXRFProjectName()) + .eqIfPresent(ConfigXRFConversionRateDO::getConversionRate, reqVO.getConversionRate()) + .eqIfPresent(ConfigXRFConversionRateDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigXRFConversionRateDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigXRFConversionRateDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigXRFConversionRateDO::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/ConfigXRFLineMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFLineMapper.java new file mode 100644 index 0000000..05a3dd2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFLineMapper.java @@ -0,0 +1,35 @@ +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.ConfigXRFLineDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 荧光分析线 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigXRFLineMapper extends BaseMapperX { + + default PageResult selectPage(ConfigXRFLinePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigXRFLineDO::getDeviceNo, reqVO.getDeviceNo()) + .likeIfPresent(ConfigXRFLineDO::getLineName, reqVO.getLineName()) + .eqIfPresent(ConfigXRFLineDO::getIsUse, reqVO.getIsUse()) + .eqIfPresent(ConfigXRFLineDO::getConnectString, reqVO.getConnectString()) + .eqIfPresent(ConfigXRFLineDO::getDataSourceType, reqVO.getDataSourceType()) + .betweenIfPresent(ConfigXRFLineDO::getLastSynchronousDataTime, reqVO.getLastSynchronousDataTime()) + .betweenIfPresent(ConfigXRFLineDO::getLastCheckDataTime, reqVO.getLastCheckDataTime()) + .eqIfPresent(ConfigXRFLineDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigXRFLineDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigXRFLineDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigXRFLineDO::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/ConfigXRFProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFProjectMapper.java new file mode 100644 index 0000000..d3de415 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFProjectMapper.java @@ -0,0 +1,37 @@ +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.ConfigXRFProjectDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 荧光采集检测项目配置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigXRFProjectMapper extends BaseMapperX { + + default PageResult selectPage(ConfigXRFProjectPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigXRFProjectDO::getDeviceNo, reqVO.getDeviceNo()) + .eqIfPresent(ConfigXRFProjectDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .likeIfPresent(ConfigXRFProjectDO::getShowName, reqVO.getShowName()) + .likeIfPresent(ConfigXRFProjectDO::getXRFProjectName, reqVO.getXRFProjectName()) + .eqIfPresent(ConfigXRFProjectDO::getXRFProjectUnit, reqVO.getXRFProjectUnit()) + .eqIfPresent(ConfigXRFProjectDO::getDataType, reqVO.getDataType()) + .eqIfPresent(ConfigXRFProjectDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(ConfigXRFProjectDO::getConversionRate, reqVO.getConversionRate()) + .eqIfPresent(ConfigXRFProjectDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(ConfigXRFProjectDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigXRFProjectDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigXRFProjectDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigXRFProjectDO::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/service/ConfigXRFConversionRateService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateService.java new file mode 100644 index 0000000..42c9844 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateService.java @@ -0,0 +1,61 @@ +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.ConfigXRFConversionRateDO; + +/** + * 荧光数据采集特殊检测项目转换率配置 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigXRFConversionRateService { + + /** + * 创建荧光数据采集特殊检测项目转换率配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigXRFConversionRateRespVO createConfigXRFConversionRate(@Valid ConfigXRFConversionRateSaveReqVO createReqVO); + + /** + * 更新荧光数据采集特殊检测项目转换率配置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigXRFConversionRate(@Valid ConfigXRFConversionRateSaveReqVO updateReqVO); + + /** + * 删除荧光数据采集特殊检测项目转换率配置 + * + * @param id 编号 + */ + void deleteConfigXRFConversionRate(Long id); + + /** + * 批量删除荧光数据采集特殊检测项目转换率配置 + * + * @param ids 编号 + */ + void deleteConfigXRFConversionRateListByIds(List ids); + + /** + * 获得荧光数据采集特殊检测项目转换率配置 + * + * @param id 编号 + * @return 荧光数据采集特殊检测项目转换率配置 + */ + ConfigXRFConversionRateDO getConfigXRFConversionRate(Long id); + + /** + * 获得荧光数据采集特殊检测项目转换率配置分页 + * + * @param pageReqVO 分页查询 + * @return 荧光数据采集特殊检测项目转换率配置分页 + */ + PageResult getConfigXRFConversionRatePage(ConfigXRFConversionRatePageReqVO 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/ConfigXRFConversionRateServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateServiceImpl.java new file mode 100644 index 0000000..697f3aa --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateServiceImpl.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.ConfigXRFConversionRateDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFConversionRateMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 荧光数据采集特殊检测项目转换率配置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigXRFConversionRateServiceImpl implements ConfigXRFConversionRateService { + + @Resource + private ConfigXRFConversionRateMapper configXRFConversionRateMapper; + + @Override + public ConfigXRFConversionRateRespVO createConfigXRFConversionRate(ConfigXRFConversionRateSaveReqVO createReqVO) { + // 插入 + ConfigXRFConversionRateDO configXRFConversionRate = BeanUtils.toBean(createReqVO, ConfigXRFConversionRateDO.class); + configXRFConversionRateMapper.insert(configXRFConversionRate); + // 返回 + return BeanUtils.toBean(configXRFConversionRate, ConfigXRFConversionRateRespVO.class); + } + + @Override + public void updateConfigXRFConversionRate(ConfigXRFConversionRateSaveReqVO updateReqVO) { + // 校验存在 + validateConfigXRFConversionRateExists(updateReqVO.getId()); + // 更新 + ConfigXRFConversionRateDO updateObj = BeanUtils.toBean(updateReqVO, ConfigXRFConversionRateDO.class); + configXRFConversionRateMapper.updateById(updateObj); + } + + @Override + public void deleteConfigXRFConversionRate(Long id) { + // 校验存在 + validateConfigXRFConversionRateExists(id); + // 删除 + configXRFConversionRateMapper.deleteById(id); + } + + @Override + public void deleteConfigXRFConversionRateListByIds(List ids) { + // 校验存在 + validateConfigXRFConversionRateExists(ids); + // 删除 + configXRFConversionRateMapper.deleteByIds(ids); + } + + private void validateConfigXRFConversionRateExists(List ids) { + List list = configXRFConversionRateMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_XRF_CONVERSION_RATE_NOT_EXISTS); + } + } + + private void validateConfigXRFConversionRateExists(Long id) { + if (configXRFConversionRateMapper.selectById(id) == null) { + throw exception(CONFIG_XRF_CONVERSION_RATE_NOT_EXISTS); + } + } + + @Override + public ConfigXRFConversionRateDO getConfigXRFConversionRate(Long id) { + return configXRFConversionRateMapper.selectById(id); + } + + @Override + public PageResult getConfigXRFConversionRatePage(ConfigXRFConversionRatePageReqVO pageReqVO) { + return configXRFConversionRateMapper.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/config/service/ConfigXRFLineService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineService.java new file mode 100644 index 0000000..74ce3ba --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineService.java @@ -0,0 +1,61 @@ +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.ConfigXRFLineDO; + +/** + * 荧光分析线 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigXRFLineService { + + /** + * 创建荧光分析线 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigXRFLineRespVO createConfigXRFLine(@Valid ConfigXRFLineSaveReqVO createReqVO); + + /** + * 更新荧光分析线 + * + * @param updateReqVO 更新信息 + */ + void updateConfigXRFLine(@Valid ConfigXRFLineSaveReqVO updateReqVO); + + /** + * 删除荧光分析线 + * + * @param id 编号 + */ + void deleteConfigXRFLine(Long id); + + /** + * 批量删除荧光分析线 + * + * @param ids 编号 + */ + void deleteConfigXRFLineListByIds(List ids); + + /** + * 获得荧光分析线 + * + * @param id 编号 + * @return 荧光分析线 + */ + ConfigXRFLineDO getConfigXRFLine(Long id); + + /** + * 获得荧光分析线分页 + * + * @param pageReqVO 分页查询 + * @return 荧光分析线分页 + */ + PageResult getConfigXRFLinePage(ConfigXRFLinePageReqVO 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/ConfigXRFLineServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineServiceImpl.java new file mode 100644 index 0000000..1777a1a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineServiceImpl.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.ConfigXRFLineDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFLineMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 荧光分析线 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigXRFLineServiceImpl implements ConfigXRFLineService { + + @Resource + private ConfigXRFLineMapper configXRFLineMapper; + + @Override + public ConfigXRFLineRespVO createConfigXRFLine(ConfigXRFLineSaveReqVO createReqVO) { + // 插入 + ConfigXRFLineDO configXRFLine = BeanUtils.toBean(createReqVO, ConfigXRFLineDO.class); + configXRFLineMapper.insert(configXRFLine); + // 返回 + return BeanUtils.toBean(configXRFLine, ConfigXRFLineRespVO.class); + } + + @Override + public void updateConfigXRFLine(ConfigXRFLineSaveReqVO updateReqVO) { + // 校验存在 + validateConfigXRFLineExists(updateReqVO.getId()); + // 更新 + ConfigXRFLineDO updateObj = BeanUtils.toBean(updateReqVO, ConfigXRFLineDO.class); + configXRFLineMapper.updateById(updateObj); + } + + @Override + public void deleteConfigXRFLine(Long id) { + // 校验存在 + validateConfigXRFLineExists(id); + // 删除 + configXRFLineMapper.deleteById(id); + } + + @Override + public void deleteConfigXRFLineListByIds(List ids) { + // 校验存在 + validateConfigXRFLineExists(ids); + // 删除 + configXRFLineMapper.deleteByIds(ids); + } + + private void validateConfigXRFLineExists(List ids) { + List list = configXRFLineMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_XRF_LINE_NOT_EXISTS); + } + } + + private void validateConfigXRFLineExists(Long id) { + if (configXRFLineMapper.selectById(id) == null) { + throw exception(CONFIG_XRF_LINE_NOT_EXISTS); + } + } + + @Override + public ConfigXRFLineDO getConfigXRFLine(Long id) { + return configXRFLineMapper.selectById(id); + } + + @Override + public PageResult getConfigXRFLinePage(ConfigXRFLinePageReqVO pageReqVO) { + return configXRFLineMapper.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/config/service/ConfigXRFProjectService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectService.java new file mode 100644 index 0000000..0fdc8e6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectService.java @@ -0,0 +1,61 @@ +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.ConfigXRFProjectDO; + +/** + * 荧光采集检测项目配置 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigXRFProjectService { + + /** + * 创建荧光采集检测项目配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigXRFProjectRespVO createConfigXRFProject(@Valid ConfigXRFProjectSaveReqVO createReqVO); + + /** + * 更新荧光采集检测项目配置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigXRFProject(@Valid ConfigXRFProjectSaveReqVO updateReqVO); + + /** + * 删除荧光采集检测项目配置 + * + * @param id 编号 + */ + void deleteConfigXRFProject(Long id); + + /** + * 批量删除荧光采集检测项目配置 + * + * @param ids 编号 + */ + void deleteConfigXRFProjectListByIds(List ids); + + /** + * 获得荧光采集检测项目配置 + * + * @param id 编号 + * @return 荧光采集检测项目配置 + */ + ConfigXRFProjectDO getConfigXRFProject(Long id); + + /** + * 获得荧光采集检测项目配置分页 + * + * @param pageReqVO 分页查询 + * @return 荧光采集检测项目配置分页 + */ + PageResult getConfigXRFProjectPage(ConfigXRFProjectPageReqVO 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/ConfigXRFProjectServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectServiceImpl.java new file mode 100644 index 0000000..cd49d2f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectServiceImpl.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.ConfigXRFProjectDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFProjectMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 荧光采集检测项目配置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigXRFProjectServiceImpl implements ConfigXRFProjectService { + + @Resource + private ConfigXRFProjectMapper configXRFProjectMapper; + + @Override + public ConfigXRFProjectRespVO createConfigXRFProject(ConfigXRFProjectSaveReqVO createReqVO) { + // 插入 + ConfigXRFProjectDO configXRFProject = BeanUtils.toBean(createReqVO, ConfigXRFProjectDO.class); + configXRFProjectMapper.insert(configXRFProject); + // 返回 + return BeanUtils.toBean(configXRFProject, ConfigXRFProjectRespVO.class); + } + + @Override + public void updateConfigXRFProject(ConfigXRFProjectSaveReqVO updateReqVO) { + // 校验存在 + validateConfigXRFProjectExists(updateReqVO.getId()); + // 更新 + ConfigXRFProjectDO updateObj = BeanUtils.toBean(updateReqVO, ConfigXRFProjectDO.class); + configXRFProjectMapper.updateById(updateObj); + } + + @Override + public void deleteConfigXRFProject(Long id) { + // 校验存在 + validateConfigXRFProjectExists(id); + // 删除 + configXRFProjectMapper.deleteById(id); + } + + @Override + public void deleteConfigXRFProjectListByIds(List ids) { + // 校验存在 + validateConfigXRFProjectExists(ids); + // 删除 + configXRFProjectMapper.deleteByIds(ids); + } + + private void validateConfigXRFProjectExists(List ids) { + List list = configXRFProjectMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_XRF_PROJECT_NOT_EXISTS); + } + } + + private void validateConfigXRFProjectExists(Long id) { + if (configXRFProjectMapper.selectById(id) == null) { + throw exception(CONFIG_XRF_PROJECT_NOT_EXISTS); + } + } + + @Override + public ConfigXRFProjectDO getConfigXRFProject(Long id) { + return configXRFProjectMapper.selectById(id); + } + + @Override + public PageResult getConfigXRFProjectPage(ConfigXRFProjectPageReqVO pageReqVO) { + return configXRFProjectMapper.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/framework/datapermission/config/DataPermissionConfiguration.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/config/DataPermissionConfiguration.java new file mode 100644 index 0000000..44ef86e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/config/DataPermissionConfiguration.java @@ -0,0 +1,18 @@ +package com.zt.plat.module.qms.framework.datapermission.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import com.zt.plat.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer; + +@Configuration(proxyBeanMethods = false) +public class DataPermissionConfiguration { + + @Bean + public DeptDataPermissionRuleCustomizer sysDeptDataPermissionRuleCustomizer() { + return rule -> { + // dept + //rule.addUserColumn(AdminUserDO.class, "id"); + }; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/package-info.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/package-info.java new file mode 100644 index 0000000..ee6e48b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/package-info.java @@ -0,0 +1,4 @@ +/** + * qms 模块的数据权限配置 + */ +package com.zt.plat.module.qms.framework.datapermission; diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.xml new file mode 100644 index 0000000..cf9930b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.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/ConfigXRFConversionRateMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFConversionRateMapper.xml new file mode 100644 index 0000000..d36d04e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFConversionRateMapper.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/ConfigXRFLineMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFLineMapper.xml new file mode 100644 index 0000000..bde9549 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFLineMapper.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/ConfigXRFProjectMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFProjectMapper.xml new file mode 100644 index 0000000..33c34cd --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFProjectMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file