From f13e72d8d07d7f4d2b6fcbd86b83487f2bab064f Mon Sep 17 00:00:00 2001 From: shusir <497819738@qq.com> Date: Tue, 10 Feb 2026 18:07:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=BA=B6=E6=B6=B2=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/qms/enums/ErrorCodeConstants.java | 2 + .../MaterialLifecycleDetailController.java | 18 ++- .../admin/MaterialProductController.java | 18 +-- .../MaterialStandardSolutionController.java | 114 ++++++++++++++++++ .../vo/MaterialInfomationRespVO.java | 36 ++++++ .../vo/MaterialLifecycleDetailPageReqVO.java | 4 +- .../vo/MaterialLifecycleDetailRespVO.java | 24 ++++ .../vo/MaterialLifecycleRespVO.java | 1 + .../vo/MaterialStandardSolutionPageReqVO.java | 73 +++++++++++ .../vo/MaterialStandardSolutionRespVO.java | 95 +++++++++++++++ .../vo/MaterialStandardSolutionSaveReqVO.java | 63 ++++++++++ .../vo/query/MaterialProductQueryVO.java | 49 ++++++++ .../MaterialStandardSolutionDO.java | 114 ++++++++++++++++++ .../dal/mapper/MaterialInfomationMapper.java | 15 ++- .../mapper/MaterialLifecycleDetailMapper.java | 33 ++++- .../MaterialStandardSolutionMapper.java | 71 +++++++++++ .../service/MaterialBatchServiceImpl.java | 3 +- .../MaterialInventoryInboundServiceImpl.java | 3 +- .../MaterialLifecycleDetailService.java | 16 +++ .../MaterialLifecycleDetailServiceImpl.java | 10 ++ .../service/MaterialLifecycleServiceImpl.java | 58 +++++++-- .../service/MaterialProductService.java | 14 ++- .../service/MaterialProductServiceImpl.java | 23 ++-- .../MaterialStandardSolutionService.java | 71 +++++++++++ .../MaterialStandardSolutionServiceImpl.java | 95 +++++++++++++++ .../mapper/MaterialStandardSolutionMapper.xml | 12 ++ 26 files changed, 989 insertions(+), 46 deletions(-) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialStandardSolutionController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialStandardSolutionPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialStandardSolutionRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialStandardSolutionSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/query/MaterialProductQueryVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialStandardSolutionDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialStandardSolutionMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialStandardSolutionService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialStandardSolutionServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialStandardSolutionMapper.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 1f38d2a3..31a92206 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 @@ -200,6 +200,8 @@ public interface ErrorCodeConstants { ErrorCode MATERIAL_INVENTORY_OUTBOUND_NOT_EXISTS = new ErrorCode(1_032_160_000, "出库不存在"); ErrorCode MATERIAL_INVENTORY_OUTBOUND_DETAIL_NOT_EXISTS = new ErrorCode(1_032_160_000, "出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等不存在"); + ErrorCode MATERIAL_STANDARD_SOLUTION_NOT_EXISTS = new ErrorCode(1_032_160_000, "标准溶液不存在"); + diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleDetailController.java index 546a421f..c620147f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialLifecycleDetailController.java @@ -39,14 +39,14 @@ public class MaterialLifecycleDetailController implements BusinessControllerMark @Resource private MaterialLifecycleDetailService materialLifecycleDetailService; - @PostMapping("/create") +// @PostMapping("/create") @Operation(summary = "创建物料通用流程明细") @PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:create')") public CommonResult createMaterialLifecycleDetail(@Valid @RequestBody MaterialLifecycleDetailSaveReqVO createReqVO) { return success(materialLifecycleDetailService.createMaterialLifecycleDetail(createReqVO)); } - @PutMapping("/update") +// @PutMapping("/update") @Operation(summary = "更新物料通用流程明细") @PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:update')") public CommonResult updateMaterialLifecycleDetail(@Valid @RequestBody MaterialLifecycleDetailSaveReqVO updateReqVO) { @@ -54,7 +54,7 @@ public class MaterialLifecycleDetailController implements BusinessControllerMark return success(true); } - @DeleteMapping("/delete") +// @DeleteMapping("/delete") @Operation(summary = "删除物料通用流程明细") @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:delete')") @@ -63,7 +63,7 @@ public class MaterialLifecycleDetailController implements BusinessControllerMark return success(true); } - @DeleteMapping("/delete-list") +// @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除物料通用流程明细") @PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:delete')") @@ -83,12 +83,20 @@ public class MaterialLifecycleDetailController implements BusinessControllerMark @GetMapping("/page") @Operation(summary = "获得物料通用流程明细分页") - @PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:query')") +// @PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:query')") public CommonResult> getMaterialLifecycleDetailPage(@Valid MaterialLifecycleDetailPageReqVO pageReqVO) { PageResult pageResult = materialLifecycleDetailService.getMaterialLifecycleDetailPage(pageReqVO); return success(BeanUtils.toBean(pageResult, MaterialLifecycleDetailRespVO.class)); } + @GetMapping("/list") + @Operation(summary = "获取未配置的溶液配置申请") +// @PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:query')") + public CommonResult> getNotMakeLifecycleDetailList(@Valid MaterialLifecycleDetailPageReqVO reqVO) { + List detailList = materialLifecycleDetailService.getNotMakeLifecycleDetailList(reqVO); + return success(detailList); + } + @GetMapping("/export-excel") @Operation(summary = "导出物料通用流程明细 Excel") @PreAuthorize("@ss.hasPermission('t:material-lifecycle-detail:export')") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialProductController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialProductController.java index baea25dd..20d6122c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialProductController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialProductController.java @@ -14,6 +14,7 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductPageReqVO; import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductRespVO; import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductSaveReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.query.MaterialProductQueryVO; import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialProductDO; import com.zt.plat.module.qms.resource.material.service.MaterialProductService; import io.swagger.v3.oas.annotations.Operation; @@ -89,19 +90,18 @@ public class MaterialProductController extends AbstractFileUploadController impl @GetMapping("category-data") @Operation(summary = "获得物料分类和大类") - @Parameter(name = "type", description = "category-分类,data-全部") - public CommonResult> getCategoryAndData(@RequestParam("type") String type) { - return success(materialProductService.getCategoryAndData(type)); + public CommonResult> getCategoryAndData(@Valid MaterialProductQueryVO queryVO) { + return success(materialProductService.getCategoryAndData(queryVO)); } // @PutMapping("/update") -// @Operation(summary = "更新物料") -// @PreAuthorize("@ss.hasPermission('qms:material-product:update')") -// public CommonResult updateMaterialProduct(@Valid @RequestBody MaterialProductSaveReqVO updateReqVO) { -// materialProductService.updateMaterialProduct(updateReqVO); -// return success(true); -// } + @Operation(summary = "更新物料") + @PreAuthorize("@ss.hasPermission('qms:material-product:update')") + public CommonResult updateMaterialProduct(@Valid @RequestBody MaterialProductSaveReqVO updateReqVO) { + materialProductService.updateMaterialProduct(updateReqVO); + return success(true); + } @DeleteMapping("/delete") @Operation(summary = "删除物料分类或大类") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialStandardSolutionController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialStandardSolutionController.java new file mode 100644 index 00000000..a7a0c39d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialStandardSolutionController.java @@ -0,0 +1,114 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import com.zt.plat.framework.business.annotation.FileUploadController; +import com.zt.plat.framework.business.controller.AbstractFileUploadController; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialStandardSolutionPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialStandardSolutionRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialStandardSolutionSaveReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialStandardSolutionDO; +import com.zt.plat.module.qms.resource.material.service.MaterialStandardSolutionService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.util.List; + +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 物料标液,标准溶液,包含配置信息") +@RestController +@RequestMapping("/qms/resource/material-standard-solution") +@Validated +@FileUploadController(source = "qms.materialstandardsolution") +public class MaterialStandardSolutionController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = MaterialStandardSolutionController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private MaterialStandardSolutionService materialStandardSolutionService; + + @PostMapping("/create") + @Operation(summary = "新建配置") +// @PreAuthorize("@ss.hasPermission('qms:material-standard-solution:create')") + public CommonResult createMaterialStandardSolution(@Valid @RequestBody MaterialStandardSolutionSaveReqVO createReqVO) { + return success(materialStandardSolutionService.createMaterialStandardSolution(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新标液,标准溶液,包含配置信息") +// @PreAuthorize("@ss.hasPermission('qms:material-standard-solution:update')") + public CommonResult updateMaterialStandardSolution(@Valid @RequestBody MaterialStandardSolutionSaveReqVO updateReqVO) { + materialStandardSolutionService.updateMaterialStandardSolution(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除标液,标准溶液,包含配置信息") + @Parameter(name = "id", description = "编号", required = true) +// @PreAuthorize("@ss.hasPermission('qms:material-standard-solution:delete')") + public CommonResult deleteMaterialStandardSolution(@RequestParam("id") Long id) { + materialStandardSolutionService.deleteMaterialStandardSolution(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除标液,标准溶液,包含配置信息") +// @PreAuthorize("@ss.hasPermission('qms:material-standard-solution:delete')") + public CommonResult deleteMaterialStandardSolutionList(@RequestBody BatchDeleteReqVO req) { + materialStandardSolutionService.deleteMaterialStandardSolutionListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得标液,标准溶液,包含配置信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") +// @PreAuthorize("@ss.hasPermission('qms:material-standard-solution:query')") + public CommonResult getMaterialStandardSolution(@RequestParam("id") Long id) { + MaterialStandardSolutionDO materialStandardSolution = materialStandardSolutionService.getMaterialStandardSolution(id); + return success(BeanUtils.toBean(materialStandardSolution, MaterialStandardSolutionRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得标液,标准溶液,包含配置信息分页") +// @PreAuthorize("@ss.hasPermission('qms:material-standard-solution:query')") + public CommonResult> getStandardSolutionPageWithMaterialInfo(@Valid MaterialStandardSolutionPageReqVO pageReqVO) { + PageResult pageResult = materialStandardSolutionService.getStandardSolutionPageWithMaterialInfo(pageReqVO); + return success(pageResult); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出标液,标准溶液,包含配置信息 Excel") + @PreAuthorize("@ss.hasPermission('qms:material-standard-solution:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialStandardSolutionExcel(@Valid MaterialStandardSolutionPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialStandardSolutionService.getMaterialStandardSolutionPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "标液,标准溶液,包含配置信息.xls", "数据", MaterialStandardSolutionRespVO.class, + BeanUtils.toBean(list, MaterialStandardSolutionRespVO.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/resource/material/controller/vo/MaterialInfomationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationRespVO.java index edd8be51..8b9b498e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationRespVO.java @@ -108,6 +108,42 @@ public class MaterialInfomationRespVO { @ExcelProperty("负责人") private String managerUserName; + @Schema(description = "是否危险品,1-是,0-否") + @ExcelProperty("是否危险品,1-是,0-否") + private Integer hazardous; + + @Schema(description = "是否标准溶液,1-是,0-否") + @ExcelProperty("是否标准溶液,1-是,0-否") + private Integer standardSolutionFlag; + + @Schema(description = "是否标准物质,1-是,0-否") + @ExcelProperty("是否标准物质,1-是,0-否") + private Integer standardMaterialFlag; + + @Schema(description = "配置人") + @ExcelProperty("配置人") + private String makeUser; + + @Schema(description = "配置人id", example = "5428") + @ExcelProperty("配置人id") + private Long makeUserId; + + @Schema(description = "配置日期") + @ExcelProperty("配置日期") + private LocalDateTime makeDate; + + @Schema(description = "到期日期") + @ExcelProperty("到期日期") + private LocalDateTime dueDate; + + @Schema(description = "浓度") + @ExcelProperty("浓度") + private String concentration; + + @Schema(description = "滴定度") + @ExcelProperty("滴定度") + private String titer; + @Schema(description = "开封状态,0-未开封,1-已开封", example = "2") @ExcelProperty("开封状态,0-未开封,1-已开封") private Integer openStatus; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailPageReqVO.java index 516c6dfb..0e810066 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailPageReqVO.java @@ -14,10 +14,10 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH public class MaterialLifecycleDetailPageReqVO extends PageParam { @Schema(description = "父id", example = "6294") - private Long materialLifecycleId; + private Long lifecycleId; @Schema(description = "物料大类id", example = "31283") - private String categoryProductId; + private String productId; @Schema(description = "物料批次id", example = "12948") private Long batchId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailRespVO.java index 7a29e576..cc7221e8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleDetailRespVO.java @@ -34,6 +34,10 @@ public class MaterialLifecycleDetailRespVO { @ExcelProperty("物料大类编码") private String productCode; + @Schema(description = "单位") + @ExcelProperty("单位") + private String unit; + @Schema(description = "物料大类型号") @ExcelProperty("物料大类型号") private String productModelNo; @@ -54,6 +58,26 @@ public class MaterialLifecycleDetailRespVO { @ExcelProperty("批次工段-部门名称") private String assignDepartmentName; + @Schema(description = "申请人") + @ExcelProperty("申请人") + private String applyUser; + + @Schema(description = "申请人id", example = "4976") + @ExcelProperty("申请人id") + private Long applyUserId; + + @Schema(description = "申请部门") + @ExcelProperty("申请部门") + private String applyDepartment; + + @Schema(description = "申请部门id", example = "19765") + @ExcelProperty("申请部门id") + private Long applyDepartmentId; + + @Schema(description = "申请时间") + @ExcelProperty("申请时间") + private LocalDateTime applyTime; + @Schema(description = "是否检化验,1-是,0-否") @ExcelProperty("是否检化验,1-是,0-否") private Integer assayFlag; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleRespVO.java index 87631534..19031eac 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialLifecycleRespVO.java @@ -60,6 +60,7 @@ public class MaterialLifecycleRespVO { @Schema(description = "提交状态,提交状态,0-未提交,1-已提交", example = "1") @ExcelProperty("提交状态,提交状态,0-未提交,1-已提交") + @Dict(dicCode = "submit_status") private Integer submitStatus; @Schema(description = "流程审批状态", example = "1") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialStandardSolutionPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialStandardSolutionPageReqVO.java new file mode 100644 index 00000000..7bb6db1a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialStandardSolutionPageReqVO.java @@ -0,0 +1,73 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import com.zt.plat.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +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 MaterialStandardSolutionPageReqVO extends PageParam { + + @Schema(description = "分类或大类id", example = "438") + private Long productId; + + @Schema(description = "配置申请明细ID", example = "438") + private Long detailId; + + @Schema(description = "物料实例id", example = "14530") + private Long infomationId; + + @Schema(description = "配置人") + private String makeUser; + + @Schema(description = "配置人id", example = "5428") + private Long makeUserId; + + @Schema(description = "配置日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] makeDate; + + @Schema(description = "总体积") + private String volumeTotal; + + @Schema(description = "配置记录") + private String makeRecord; + + @Schema(description = "有效期") + private Integer due; + + @Schema(description = "到期日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] dueDate; + + @Schema(description = "滴定管编号") + private String buretteNo; + + @Schema(description = "浓度") + private String concentration; + + @Schema(description = "滴定度") + private String titer; + + @Schema(description = "标定流程类型", example = "2") + private Long standardFlowType; + + @Schema(description = "标定状态") + private String standardFlow; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialStandardSolutionRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialStandardSolutionRespVO.java new file mode 100644 index 00000000..21afeef1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialStandardSolutionRespVO.java @@ -0,0 +1,95 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 标液,标准溶液,包含配置信息 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialStandardSolutionRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "19766") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "配置申请明细ID", example = "438") + @ExcelProperty("配置申请明细ID") + private Long detailId; + + @Schema(description = "物料实例id", example = "14530") + @ExcelProperty("物料实例id") + private Long infomationId; + + @Schema(description = "物料名称") + @ExcelProperty("物料名称") + private String infomationName; + + @Schema(description = "物料编号") + @ExcelProperty("物料编号") + private String infomationCode; + + @Schema(description = "配置人") + @ExcelProperty("配置人") + private String makeUser; + + @Schema(description = "配置人id", example = "5428") + @ExcelProperty("配置人id") + private Long makeUserId; + + @Schema(description = "配置日期") + @ExcelProperty("配置日期") + private LocalDateTime makeDate; + + @Schema(description = "总体积") + @ExcelProperty("总体积") + private String volumeTotal; + + @Schema(description = "配置记录") + @ExcelProperty("配置记录") + private String makeRecord; + + @Schema(description = "有效期") + @ExcelProperty("有效期") + private Integer due; + + @Schema(description = "到期日期") + @ExcelProperty("到期日期") + private LocalDateTime dueDate; + + @Schema(description = "滴定管编号") + @ExcelProperty("滴定管编号") + private String buretteNo; + + @Schema(description = "浓度") + @ExcelProperty("浓度") + private String concentration; + + @Schema(description = "滴定度") + @ExcelProperty("滴定度") + private String titer; + + @Schema(description = "标定流程类型", example = "2") + @ExcelProperty("标定流程类型") + private Long standardFlowType; + + @Schema(description = "标定状态") + @ExcelProperty("标定状态") + private String standardFlow; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialStandardSolutionSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialStandardSolutionSaveReqVO.java new file mode 100644 index 00000000..1ab86341 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialStandardSolutionSaveReqVO.java @@ -0,0 +1,63 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 标液,标准溶液,包含配置信息新增/修改 Request VO") +@Data +public class MaterialStandardSolutionSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "19766") + private Long id; + + @Schema(description = "配置申请明细ID", example = "438") + private Long detailId; + + @Schema(description = "物料实例id", example = "14530") + private Long infomationId; + + @Schema(description = "配置人") + private String makeUser; + + @Schema(description = "配置人id", example = "5428") + private Long makeUserId; + + @Schema(description = "配置日期") + private LocalDateTime makeDate; + + @Schema(description = "总体积") + private String volumeTotal; + + @Schema(description = "配置记录") + private String makeRecord; + + @Schema(description = "有效期") + private Integer due; + + @Schema(description = "到期日期") + private LocalDateTime dueDate; + + @Schema(description = "滴定管编号") + private String buretteNo; + + @Schema(description = "浓度") + private String concentration; + + @Schema(description = "滴定度") + private String titer; + + @Schema(description = "标定流程类型", example = "2") + private Long standardFlowType; + + @Schema(description = "标定状态") + private String standardFlow; + + @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/resource/material/controller/vo/query/MaterialProductQueryVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/query/MaterialProductQueryVO.java new file mode 100644 index 00000000..b00a5fc1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/query/MaterialProductQueryVO.java @@ -0,0 +1,49 @@ +package com.zt.plat.module.qms.resource.material.controller.vo.query; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +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 MaterialProductQueryVO { + + @Schema(description = "category-分类,data-大类sku,空-全部数据") + private String nodeType; + + @Schema(description = "允许按量领取,1-领用时输入量,按量领取;0-领用时不能输入量,整个领走") + private Integer enablePartial; + + @Schema(description = "开封后保质期是否变化,1-是,0-否") + private Integer openDueFlag; + + @Schema(description = "是否危险品,1-是,0-否") + private Integer hazardous; + + @Schema(description = "是否标准溶液,1-是,0-否") + private Integer standardSolutionFlag; + + @Schema(description = "是否标准物质,1-是,0-否") + private Integer standardMaterialFlag; + + @Schema(description = "禁用标识") + private Integer cancelFlag; + + @Schema(description = "是否检化验,1-是,0-否") + private Integer assayFlag; + + @Schema(description = "是否进行库存预警,1-是,0-否") + private Integer InventoryAlarmFlag; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialStandardSolutionDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialStandardSolutionDO.java new file mode 100644 index 00000000..e3d482ff --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialStandardSolutionDO.java @@ -0,0 +1,114 @@ +package com.zt.plat.module.qms.resource.material.dal.dataobject; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +import lombok.*; + +import java.time.LocalDateTime; +/** +* 标液,标准溶液,包含配置信息 DO +* +* @author 后台管理 +*/ +@TableName("t_mtrl_std_sol") +@KeySequence("t_mtrl_std_sol_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialStandardSolutionDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 配置申请明细ID + */ + @TableField("DTL_ID") + private Long detailId; + /** + * 物料实例id + */ + @TableField("INF_ID") + private Long infomationId; + /** + * 配置人 + */ + @TableField("MKE_USER") + private String makeUser; + /** + * 配置人id + */ + @TableField("MKE_USER_ID") + private Long makeUserId; + /** + * 配置日期 + */ + @TableField("MKE_DT") + private LocalDateTime makeDate; + /** + * 总体积 + */ + @TableField("VOL_TOT") + private String volumeTotal; + /** + * 配置记录 + */ + @TableField("MKE_RCD") + private String makeRecord; + /** + * 有效期 + */ + @TableField("DUE") + private Integer due; + /** + * 到期日期 + */ + @TableField("DUE_DT") + private LocalDateTime dueDate; + /** + * 滴定管编号 + */ + @TableField("BRT_NO") + private String buretteNo; + /** + * 浓度 + */ + @TableField("CNC") + private String concentration; + /** + * 滴定度 + */ + @TableField("TTR") + private String titer; + /** + * 标定流程类型 + */ + @TableField("STD_FLW_TP") + private Long standardFlowType; + /** + * 标定状态 + */ + @TableField("STD_FLW") + private String standardFlow; + /** + * 所属部门 + */ + @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/resource/material/dal/mapper/MaterialInfomationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInfomationMapper.java index db3348d1..a0f88158 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInfomationMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInfomationMapper.java @@ -11,6 +11,7 @@ import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomation import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchDO; import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInfomationDO; import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialProductDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialStandardSolutionDO; import org.apache.ibatis.annotations.Mapper; /** @@ -62,7 +63,11 @@ public interface MaterialInfomationMapper extends BaseMapperX selectPage(MaterialLifecycleDetailPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(MaterialLifecycleDetailDO::getLifecycleId, reqVO.getMaterialLifecycleId()) - .eqIfPresent(MaterialLifecycleDetailDO::getProductId, reqVO.getCategoryProductId()) + .eqIfPresent(MaterialLifecycleDetailDO::getLifecycleId, reqVO.getLifecycleId()) + .eqIfPresent(MaterialLifecycleDetailDO::getProductId, reqVO.getProductId()) .eqIfPresent(MaterialLifecycleDetailDO::getBatchId, reqVO.getBatchId()) .eqIfPresent(MaterialLifecycleDetailDO::getBatchGongduanId, reqVO.getBatchGongduanId()) .eqIfPresent(MaterialLifecycleDetailDO::getInfomationId, reqVO.getInfomationId()) @@ -45,6 +45,7 @@ public interface MaterialLifecycleDetailMapper extends BaseMapperX selectNotMakeList(MaterialLifecycleDetailPageReqVO reqVO) { + MPJLambdaWrapper wrapper = new MPJLambdaWrapper() + .selectAll(MaterialLifecycleDetailDO.class) + .selectAs(MaterialProductDO::getName, MaterialLifecycleDetailRespVO::getProductName) + .selectAs(MaterialProductDO::getCode, MaterialLifecycleDetailRespVO::getProductCode) + .selectAs(MaterialProductDO::getModelNo, MaterialLifecycleDetailRespVO::getProductModelNo) + .selectAs(MaterialProductDO::getUnit, MaterialLifecycleDetailRespVO::getUnit) + .select(MaterialLifecycleDO::getApplyUserId, MaterialLifecycleDO::getApplyUser, + MaterialLifecycleDO::getApplyDepartmentId, MaterialLifecycleDO::getApplyDepartment, + MaterialLifecycleDO::getApplyTime) + .leftJoin(MaterialProductDO.class, MaterialProductDO::getId, MaterialLifecycleDetailDO::getProductId) + .leftJoin(MaterialLifecycleDO.class, MaterialLifecycleDO::getId, MaterialLifecycleDetailDO::getLifecycleId) + .eqIfExists(MaterialLifecycleDetailDO::getProductId, reqVO.getProductId()) + .eqIfExists(MaterialLifecycleDetailDO::getBusinessType, reqVO.getBusinessType()) + .eqIfExists(MaterialLifecycleDetailDO::getTreatmentStatus, reqVO.getTreatmentStatus()) + .likeIfExists(MaterialLifecycleDetailDO::getFormData, reqVO.getFormData()) + .likeIfExists(MaterialLifecycleDetailDO::getRemark, reqVO.getRemark()) + .orderByDesc(MaterialLifecycleDetailDO::getId); + + return selectJoinList(MaterialLifecycleDetailRespVO.class, wrapper); + } + + default List selectDetailRespVOListByLfcIds(List lfcIds) { + return List.of(); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialStandardSolutionMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialStandardSolutionMapper.java new file mode 100644 index 00000000..74069bac --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialStandardSolutionMapper.java @@ -0,0 +1,71 @@ +package com.zt.plat.module.qms.resource.material.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialStandardSolutionPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialStandardSolutionRespVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInfomationDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialProductDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialStandardSolutionDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标液,标准溶液,包含配置信息 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialStandardSolutionMapper extends BaseMapperX { + + default PageResult selectPage(MaterialStandardSolutionPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialStandardSolutionDO::getDetailId, reqVO.getDetailId()) + .eqIfPresent(MaterialStandardSolutionDO::getInfomationId, reqVO.getInfomationId()) + .eqIfPresent(MaterialStandardSolutionDO::getMakeUser, reqVO.getMakeUser()) + .eqIfPresent(MaterialStandardSolutionDO::getMakeUserId, reqVO.getMakeUserId()) + .betweenIfPresent(MaterialStandardSolutionDO::getMakeDate, reqVO.getMakeDate()) + .eqIfPresent(MaterialStandardSolutionDO::getVolumeTotal, reqVO.getVolumeTotal()) + .eqIfPresent(MaterialStandardSolutionDO::getMakeRecord, reqVO.getMakeRecord()) + .eqIfPresent(MaterialStandardSolutionDO::getDue, reqVO.getDue()) + .betweenIfPresent(MaterialStandardSolutionDO::getDueDate, reqVO.getDueDate()) + .eqIfPresent(MaterialStandardSolutionDO::getBuretteNo, reqVO.getBuretteNo()) + .eqIfPresent(MaterialStandardSolutionDO::getConcentration, reqVO.getConcentration()) + .eqIfPresent(MaterialStandardSolutionDO::getTiter, reqVO.getTiter()) + .eqIfPresent(MaterialStandardSolutionDO::getStandardFlowType, reqVO.getStandardFlowType()) + .eqIfPresent(MaterialStandardSolutionDO::getStandardFlow, reqVO.getStandardFlow()) + .eqIfPresent(MaterialStandardSolutionDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialStandardSolutionDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialStandardSolutionDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialStandardSolutionDO::getId)); + } + + default PageResult selectPageWithMaterialInfo(MaterialStandardSolutionPageReqVO reqVO) { + MPJLambdaWrapperX wrapperX = new MPJLambdaWrapperX() + .selectAll(MaterialStandardSolutionDO.class) + .selectAs(MaterialInfomationDO::getCode, MaterialStandardSolutionRespVO::getInfomationCode) + .selectAs(MaterialProductDO::getName, MaterialStandardSolutionRespVO::getInfomationName) + .leftJoin(MaterialInfomationDO.class, MaterialInfomationDO::getId, MaterialStandardSolutionDO::getInfomationId) + .leftJoin(MaterialProductDO.class, MaterialProductDO::getId, MaterialInfomationDO::getProductId) + .eqIfPresent(MaterialStandardSolutionDO::getDetailId, reqVO.getDetailId()) + .eqIfPresent(MaterialStandardSolutionDO::getInfomationId, reqVO.getInfomationId()) + .eqIfPresent(MaterialStandardSolutionDO::getMakeUser, reqVO.getMakeUser()) + .eqIfPresent(MaterialStandardSolutionDO::getMakeUserId, reqVO.getMakeUserId()) + .betweenIfPresent(MaterialStandardSolutionDO::getMakeDate, reqVO.getMakeDate()) + .eqIfPresent(MaterialStandardSolutionDO::getVolumeTotal, reqVO.getVolumeTotal()) + .eqIfPresent(MaterialStandardSolutionDO::getMakeRecord, reqVO.getMakeRecord()) + .eqIfPresent(MaterialStandardSolutionDO::getDue, reqVO.getDue()) + .betweenIfPresent(MaterialStandardSolutionDO::getDueDate, reqVO.getDueDate()) + .eqIfPresent(MaterialStandardSolutionDO::getBuretteNo, reqVO.getBuretteNo()) + .eqIfPresent(MaterialStandardSolutionDO::getConcentration, reqVO.getConcentration()) + .eqIfPresent(MaterialStandardSolutionDO::getTiter, reqVO.getTiter()) + .eqIfPresent(MaterialStandardSolutionDO::getStandardFlowType, reqVO.getStandardFlowType()) + .eqIfPresent(MaterialStandardSolutionDO::getStandardFlow, reqVO.getStandardFlow()) + .eqIfPresent(MaterialStandardSolutionDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialStandardSolutionDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialStandardSolutionDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialStandardSolutionDO::getId); + return selectJoinPage(reqVO, MaterialStandardSolutionRespVO.class, wrapperX); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchServiceImpl.java index 031e5a55..5b9198a3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialBatchServiceImpl.java @@ -212,7 +212,8 @@ public class MaterialBatchServiceImpl implements MaterialBatchService { // 3. 保存工段 List gongEts = createReqVOs.stream().map(batAsn -> { MaterialBatchDO bean = BeanUtils.toBean(batAsn, MaterialBatchDO.class); - bean.setProductId(mtrlBat.getProductId()).setBatchNo(mtrlBat.getBatchNo()); + bean.setProductId(mtrlBat.getProductId()).setBatchNo(mtrlBat.getBatchNo()) + .setAcceptanceStatus(MaterialAcceptStatus.notAccepted.name()); return bean; }).toList(); materialBatchMapper.insertBatch(gongEts); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundServiceImpl.java index 5150e3c9..79d5c51a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInventoryInboundServiceImpl.java @@ -15,6 +15,7 @@ import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryI import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundSaveReqVO; import com.zt.plat.module.qms.resource.material.dal.dataobject.*; import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryInboundMapper; +import com.zt.plat.module.qms.resource.material.enums.MaterialAcceptStatus; import jakarta.annotation.Resource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -67,7 +68,7 @@ public class MaterialInventoryInboundServiceImpl implements MaterialInventoryInb MaterialBatchDO gongDO = materialBatchService.getMaterialBatch(gongduanId); if (gongDO == null) throw exception(MATERIAL_BATCH_GONG_NOT_EXISTS); // 1.检查工段是否已经验收 - if (!QmsCommonConstant.COMPLETED.equals(gongDO.getAcceptanceStatus())) + if (!MaterialAcceptStatus.accepted.name().equals(gongDO.getAcceptanceStatus())) throw new ServiceException(1_032_160_000, "工段未验收,不能入库"); // 2.入库数量不大于批次工段数量 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailService.java index 5d8a9de8..fba23232 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailService.java @@ -112,4 +112,20 @@ public interface MaterialLifecycleDetailService { * @return 明细列表 */ List getDetailListByLfcId(Long lfcId); + + /** + * 获取未配置的溶液配置申请 + * + * @param reqVO 查询条件 + * @return 明细列表 + */ + List getNotMakeLifecycleDetailList(@Valid MaterialLifecycleDetailPageReqVO reqVO); + + /** + * 根据流程ids 获取流程明细数据 + * + * @param lfcIds 流程ids + * @return 明细列表 + */ + List getDetailRespVOListByLfcIds(List lfcIds); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailServiceImpl.java index 26a638cb..e8ce13c1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleDetailServiceImpl.java @@ -138,4 +138,14 @@ public class MaterialLifecycleDetailServiceImpl implements MaterialLifecycleDeta .eq(MaterialLifecycleDetailDO::getLifecycleId, lfcId)); } + @Override + public List getNotMakeLifecycleDetailList(MaterialLifecycleDetailPageReqVO reqVO) { + return materialLifecycleDetailMapper.selectNotMakeList(reqVO); + } + + @Override + public List getDetailRespVOListByLfcIds(List lfcIds) { + return materialLifecycleDetailMapper.selectDetailRespVOListByLfcIds(lfcIds); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleServiceImpl.java index f932c4e5..4b7595a6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialLifecycleServiceImpl.java @@ -29,6 +29,7 @@ import com.zt.plat.module.qms.resource.material.controller.vo.*; import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchDO; import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO; import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialProductDO; import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialLifecycleMapper; import com.zt.plat.module.qms.resource.material.enums.MaterialAcceptStatus; import com.zt.plat.module.qms.resource.material.enums.MaterialFlowType; @@ -84,6 +85,8 @@ public class MaterialLifecycleServiceImpl implements MaterialLifecycleService , @Autowired private DictionaryBusinessService dictionaryBusinessService; + @Autowired + private MaterialProductService materialProductService; @Transactional @Override @@ -97,23 +100,44 @@ public class MaterialLifecycleServiceImpl implements MaterialLifecycleService , mtrlLfc.setApplyUser(loginUserNickname) .setApplyUserId(loginUser.getId()) .setApplyDepartment(loginUser.getVisitDeptName()) - .setApplyDepartmentId(loginUser.getVisitDeptId()); + .setApplyDepartmentId(loginUser.getVisitDeptId()) + .setApplyTime(LocalDateTime.now()); mtrlLfc.setFlowStatus(QmsCommonConstant.NOT_START); materialLifecycleMapper.insert(mtrlLfc); List detailList = createReqVO.getDetailList(); if (CollUtil.isEmpty(detailList)) return BeanUtils.toBean(mtrlLfc, MaterialLifecycleRespVO.class); - // 保存工段明细 - List gongIds = detailList.stream().map(MaterialLifecycleDetailSaveReqVO::getBatchGongduanId).toList(); - Map gongAssayMap = detailList.stream().collect(Collectors.toMap( - MaterialLifecycleDetailSaveReqVO::getBatchGongduanId, MaterialLifecycleDetailSaveReqVO::getAssayFlag)); - List gongs = materialBatchService.getGongduanListByGongIds(gongIds); - if (CollUtil.isEmpty(gongs) || gongs.size() != gongIds.size()) - throw new ServiceException(1_032_160_000, "工段不存在或与传入的工段数量不匹配"); - for (MaterialBatchDO gong : gongs) { - gong.setAssayFlag(gongAssayMap.get(gong.getId())); + List detailDOS = List.of(); + if (MaterialFlowType.acceptance.getName().equals(mtrlLfc.getBusinessType())) { + // 保存工段明细 + List gongIds = detailList.stream().map(MaterialLifecycleDetailSaveReqVO::getBatchGongduanId).toList(); + Map gongAssayMap = detailList.stream().collect(Collectors.toMap( + MaterialLifecycleDetailSaveReqVO::getBatchGongduanId, MaterialLifecycleDetailSaveReqVO::getAssayFlag)); + List gongs = materialBatchService.getGongduanListByGongIds(gongIds); + if (CollUtil.isEmpty(gongs) || gongs.size() != gongIds.size()) + throw new ServiceException(1_032_160_000, "工段不存在或与传入的工段数量不匹配"); + for (MaterialBatchDO gong : gongs) { + gong.setAssayFlag(gongAssayMap.get(gong.getId())); + } + detailDOS = getLifecycleDetailDOsByGongs(gongs, gongIds, mtrlLfc); + } else if (MaterialFlowType.config_apply.getName().equals(mtrlLfc.getBusinessType())) { + // 保存物料大类明细 + List pdtIds = detailList.stream().map(MaterialLifecycleDetailSaveReqVO::getProductId).toList(); + List products = materialProductService.getMaterialProductListByPdtIds(pdtIds); + if (CollUtil.isEmpty(products) || products.size() != pdtIds.size()) + throw new ServiceException(1_032_160_000, "物料大类不存在或与传入的数量不匹配"); + + detailDOS = detailList.stream().map(detail -> { + MaterialLifecycleDetailDO detailDO = new MaterialLifecycleDetailDO(); + detailDO.setLifecycleId(mtrlLfc.getId()) + .setProductId(detail.getProductId()) + .setInfluenceCount(detail.getInfluenceCount()) + .setBusinessType(mtrlLfc.getBusinessType()) + .setTreatmentStatus(0) + .setRemark(detail.getRemark()); + return detailDO; + }).toList(); } - List detailDOS = getLifecycleDetailDOsByGongs(gongs, gongIds, mtrlLfc); materialLifecycleDetailService.saveBatch(detailDOS); return BeanUtils.toBean(mtrlLfc, MaterialLifecycleRespVO.class); } @@ -234,6 +258,12 @@ public class MaterialLifecycleServiceImpl implements MaterialLifecycleService , mtrlLfc.setTitle(title); } }); + // 组装明细 + List lfcIds = list.stream().map(MaterialLifecycleDO::getId).toList(); + List detailRespVOS = materialLifecycleDetailService.getDetailRespVOListByLfcIds(lfcIds); + if (CollUtil.isNotEmpty(detailRespVOS)) { + + } pageResult.setList(list); return pageResult; } @@ -245,8 +275,10 @@ public class MaterialLifecycleServiceImpl implements MaterialLifecycleService , Integer submitStatus = lifecycleDO.getSubmitStatus(); if (submitStatus == 1) throw new ServiceException(1_032_160_000, "申请已经提交过"); lifecycleDO.setApplyTime(LocalDateTime.now()); - // 发起流程 - this.createProcessInstance(lifecycleDO); + if (MaterialFlowType.acceptance.getName().equals(lifecycleDO.getBusinessType())) { + // 如果是验收需要发起流程 + this.createProcessInstance(lifecycleDO); + } lifecycleDO.setSubmitStatus(1); materialLifecycleMapper.updateById(lifecycleDO); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductService.java index cf4063b4..138761c7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductService.java @@ -4,6 +4,7 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductPageReqVO; import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductRespVO; import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductSaveReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.query.MaterialProductQueryVO; import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialProductDO; import jakarta.validation.Valid; @@ -87,10 +88,10 @@ public interface MaterialProductService { /** * 获得物料分类和大类 * - * @param type 节点类型 + * @param queryVO 查询参数 * @return 列表 */ - List getCategoryAndData(String type); + List getCategoryAndData(MaterialProductQueryVO queryVO); /** * 获得物料大类的库存分页信息 @@ -102,8 +103,17 @@ public interface MaterialProductService { /** * 获取id在 idPath中的全部数据 + * * @param pdtId id * @return 物料数据 */ List getMaterialProductsByLikeIdPath(Long pdtId); + + /** + * 根据ids获取大类数据 + * + * @param pdtIds id + * @return 物料数据 + */ + List getMaterialProductListByPdtIds(List pdtIds); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductServiceImpl.java index 0cdcba2f..d5318da7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductServiceImpl.java @@ -10,6 +10,7 @@ import com.zt.plat.module.qms.core.constant.DataTypeConstant; import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductPageReqVO; import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductRespVO; import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductSaveReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.query.MaterialProductQueryVO; import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialProductDO; import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialProductMapper; import jakarta.annotation.Resource; @@ -305,14 +306,14 @@ public class MaterialProductServiceImpl implements MaterialProductService { @Override - public List getCategoryAndData(String type) { - List mtrlDos; - if (DataTypeConstant.DATA_TYPE_CATEGORY.equals(type)) { - mtrlDos = materialProductMapper.selectList(Wrappers.lambdaQuery(MaterialProductDO.class) - .eq(MaterialProductDO::getNodeType, DataTypeConstant.DATA_TYPE_CATEGORY)); - } else { - mtrlDos = materialProductMapper.selectList(); - } + public List getCategoryAndData(MaterialProductQueryVO queryVO) { + LambdaQueryWrapperX wrapperX = new LambdaQueryWrapperX() + .eqIfPresent(MaterialProductDO::getNodeType, queryVO.getNodeType()) + .eqIfPresent(MaterialProductDO::getHazardous, queryVO.getHazardous()) + .eqIfPresent(MaterialProductDO::getStandardSolutionFlag, queryVO.getStandardSolutionFlag()) + .eqIfPresent(MaterialProductDO::getStandardMaterialFlag, queryVO.getStandardMaterialFlag()); + List mtrlDos = materialProductMapper.selectList(wrapperX); + if (CollUtil.isEmpty(mtrlDos)) return List.of(); return mtrlDos.stream().map(m -> BeanUtils.toBean(m, MaterialProductRespVO.class)).toList(); @@ -345,4 +346,10 @@ public class MaterialProductServiceImpl implements MaterialProductService { .eq(MaterialProductDO::getNodeType, DataTypeConstant.DATA_TYPE_DATA)); } + @Override + public List getMaterialProductListByPdtIds(List pdtIds) { + + return materialProductMapper.selectByIds(pdtIds); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialStandardSolutionService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialStandardSolutionService.java new file mode 100644 index 00000000..59412d6c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialStandardSolutionService.java @@ -0,0 +1,71 @@ +package com.zt.plat.module.qms.resource.material.service; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialStandardSolutionPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialStandardSolutionRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialStandardSolutionSaveReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialStandardSolutionDO; +import jakarta.validation.Valid; + +import java.util.List; + +/** + * 标液,标准溶液,包含配置信息 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialStandardSolutionService { + + /** + * 创建标液,标准溶液,包含配置信息 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialStandardSolutionRespVO createMaterialStandardSolution(@Valid MaterialStandardSolutionSaveReqVO createReqVO); + + /** + * 更新标液,标准溶液,包含配置信息 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialStandardSolution(@Valid MaterialStandardSolutionSaveReqVO updateReqVO); + + /** + * 删除标液,标准溶液,包含配置信息 + * + * @param id 编号 + */ + void deleteMaterialStandardSolution(Long id); + + /** + * 批量删除标液,标准溶液,包含配置信息 + * + * @param ids 编号 + */ + void deleteMaterialStandardSolutionListByIds(List ids); + + /** + * 获得标液,标准溶液,包含配置信息 + * + * @param id 编号 + * @return 标液,标准溶液,包含配置信息 + */ + MaterialStandardSolutionDO getMaterialStandardSolution(Long id); + + /** + * 获得标液,标准溶液,包含配置信息分页 + * + * @param pageReqVO 分页查询 + * @return 标液,标准溶液,包含配置信息分页 + */ + PageResult getMaterialStandardSolutionPage(MaterialStandardSolutionPageReqVO pageReqVO); + + /** + * 获得标液分页 - 含物料信息 + * + * @param pageReqVO 分页查询 + * @return 标液分页 + */ + PageResult getStandardSolutionPageWithMaterialInfo(@Valid MaterialStandardSolutionPageReqVO 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/resource/material/service/MaterialStandardSolutionServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialStandardSolutionServiceImpl.java new file mode 100644 index 00000000..ee0160a9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialStandardSolutionServiceImpl.java @@ -0,0 +1,95 @@ +package com.zt.plat.module.qms.resource.material.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialStandardSolutionPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialStandardSolutionRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialStandardSolutionSaveReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialStandardSolutionDO; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialStandardSolutionMapper; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.util.List; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.MATERIAL_STANDARD_SOLUTION_NOT_EXISTS; + +/** + * 标液,标准溶液,包含配置信息 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class MaterialStandardSolutionServiceImpl implements MaterialStandardSolutionService { + + @Resource + private MaterialStandardSolutionMapper materialStandardSolutionMapper; + + @Override + public MaterialStandardSolutionRespVO createMaterialStandardSolution(MaterialStandardSolutionSaveReqVO createReqVO) { + // 插入 + MaterialStandardSolutionDO materialStandardSolution = BeanUtils.toBean(createReqVO, MaterialStandardSolutionDO.class); + materialStandardSolutionMapper.insert(materialStandardSolution); + // 返回 + return BeanUtils.toBean(materialStandardSolution, MaterialStandardSolutionRespVO.class); + } + + @Override + public void updateMaterialStandardSolution(MaterialStandardSolutionSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialStandardSolutionExists(updateReqVO.getId()); + // 更新 + MaterialStandardSolutionDO updateObj = BeanUtils.toBean(updateReqVO, MaterialStandardSolutionDO.class); + materialStandardSolutionMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialStandardSolution(Long id) { + // 校验存在 + validateMaterialStandardSolutionExists(id); + // 删除 + materialStandardSolutionMapper.deleteById(id); + } + + @Override + public void deleteMaterialStandardSolutionListByIds(List ids) { + // 校验存在 + validateMaterialStandardSolutionExists(ids); + // 删除 + materialStandardSolutionMapper.deleteByIds(ids); + } + + private void validateMaterialStandardSolutionExists(List ids) { + List list = materialStandardSolutionMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_STANDARD_SOLUTION_NOT_EXISTS); + } + } + + private void validateMaterialStandardSolutionExists(Long id) { + if (materialStandardSolutionMapper.selectById(id) == null) { + throw exception(MATERIAL_STANDARD_SOLUTION_NOT_EXISTS); + } + } + + @Override + public MaterialStandardSolutionDO getMaterialStandardSolution(Long id) { + return materialStandardSolutionMapper.selectById(id); + } + + @Override + public PageResult getMaterialStandardSolutionPage(MaterialStandardSolutionPageReqVO pageReqVO) { + return materialStandardSolutionMapper.selectPage(pageReqVO); + } + + @Override + public PageResult getStandardSolutionPageWithMaterialInfo(MaterialStandardSolutionPageReqVO pageReqVO) { + + return materialStandardSolutionMapper.selectPageWithMaterialInfo(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialStandardSolutionMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialStandardSolutionMapper.xml new file mode 100644 index 00000000..3d7db7bd --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialStandardSolutionMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file