Commit 68cbb1ac5165ef6289caf2717145815e36456df0

Authored by YunaiV
1 parent 933c7ada

review(mes):qc-template 的代码实现,功能测试

yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/MesQcTemplateController.java
@@ -16,8 +16,6 @@ import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.item.MesQcTem @@ -16,8 +16,6 @@ import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.item.MesQcTem
16 import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.item.MesQcTemplateItemRespVO; 16 import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.item.MesQcTemplateItemRespVO;
17 import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.item.MesQcTemplateItemSaveReqVO; 17 import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.item.MesQcTemplateItemSaveReqVO;
18 import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcTemplateDO; 18 import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcTemplateDO;
19 -import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcTemplateIndicatorDO;  
20 -import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcTemplateItemDO;  
21 import cn.iocoder.yudao.module.mes.service.qc.MesQcTemplateService; 19 import cn.iocoder.yudao.module.mes.service.qc.MesQcTemplateService;
22 import io.swagger.v3.oas.annotations.Operation; 20 import io.swagger.v3.oas.annotations.Operation;
23 import io.swagger.v3.oas.annotations.Parameter; 21 import io.swagger.v3.oas.annotations.Parameter;
@@ -75,16 +73,16 @@ public class MesQcTemplateController { @@ -75,16 +73,16 @@ public class MesQcTemplateController {
75 @Parameter(name = "id", description = "编号", required = true, example = "1024") 73 @Parameter(name = "id", description = "编号", required = true, example = "1024")
76 @PreAuthorize("@ss.hasPermission('mes:qc-template:query')") 74 @PreAuthorize("@ss.hasPermission('mes:qc-template:query')")
77 public CommonResult<MesQcTemplateRespVO> getTemplate(@RequestParam("id") Long id) { 75 public CommonResult<MesQcTemplateRespVO> getTemplate(@RequestParam("id") Long id) {
78 - MesQcTemplateDO template = templateService.getTemplate(id);  
79 - return success(BeanUtils.toBean(template, MesQcTemplateRespVO.class)); 76 + // TODO @AI:service 只返回 do;数据拼接放在 controller 里;
  77 + return success(templateService.getTemplate(id));
80 } 78 }
81 79
82 @GetMapping("/page") 80 @GetMapping("/page")
83 @Operation(summary = "获得质检方案分页") 81 @Operation(summary = "获得质检方案分页")
84 @PreAuthorize("@ss.hasPermission('mes:qc-template:query')") 82 @PreAuthorize("@ss.hasPermission('mes:qc-template:query')")
85 public CommonResult<PageResult<MesQcTemplateRespVO>> getTemplatePage(@Valid MesQcTemplatePageReqVO pageReqVO) { 83 public CommonResult<PageResult<MesQcTemplateRespVO>> getTemplatePage(@Valid MesQcTemplatePageReqVO pageReqVO) {
86 - PageResult<MesQcTemplateDO> pageResult = templateService.getTemplatePage(pageReqVO);  
87 - return success(BeanUtils.toBean(pageResult, MesQcTemplateRespVO.class)); 84 + // TODO @AI:service 只返回 do;数据拼接放在 controller 里;
  85 + return success(templateService.getTemplatePage(pageReqVO));
88 } 86 }
89 87
90 @GetMapping("/simple-list") 88 @GetMapping("/simple-list")
@@ -101,9 +99,9 @@ public class MesQcTemplateController { @@ -101,9 +99,9 @@ public class MesQcTemplateController {
101 public void exportTemplateExcel(@Valid MesQcTemplatePageReqVO pageReqVO, 99 public void exportTemplateExcel(@Valid MesQcTemplatePageReqVO pageReqVO,
102 HttpServletResponse response) throws IOException { 100 HttpServletResponse response) throws IOException {
103 pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); 101 pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
104 - List<MesQcTemplateDO> list = templateService.getTemplatePage(pageReqVO).getList();  
105 - ExcelUtils.write(response, "质检方案.xls", "数据", MesQcTemplateRespVO.class,  
106 - BeanUtils.toBean(list, MesQcTemplateRespVO.class)); 102 + List<MesQcTemplateRespVO> list = templateService.getTemplatePage(pageReqVO).getList();
  103 + // TODO @AI:service 只返回 do;数据拼接放在 controller 里;
  104 + ExcelUtils.write(response, "质检方案.xls", "数据", MesQcTemplateRespVO.class, list);
107 } 105 }
108 106
109 // ========== 质检方案-检测指标项 ========== 107 // ========== 质检方案-检测指标项 ==========
@@ -139,8 +137,8 @@ public class MesQcTemplateController { @@ -139,8 +137,8 @@ public class MesQcTemplateController {
139 @Parameter(name = "id", description = "编号", required = true, example = "1024") 137 @Parameter(name = "id", description = "编号", required = true, example = "1024")
140 @PreAuthorize("@ss.hasPermission('mes:qc-template:query')") 138 @PreAuthorize("@ss.hasPermission('mes:qc-template:query')")
141 public CommonResult<MesQcTemplateIndicatorRespVO> getTemplateIndicator(@RequestParam("id") Long id) { 139 public CommonResult<MesQcTemplateIndicatorRespVO> getTemplateIndicator(@RequestParam("id") Long id) {
142 - MesQcTemplateIndicatorDO indicator = templateService.getTemplateIndicator(id);  
143 - return success(BeanUtils.toBean(indicator, MesQcTemplateIndicatorRespVO.class)); 140 + // TODO @AI:service 只返回 do;数据拼接放在 controller 里;
  141 + return success(templateService.getTemplateIndicator(id));
144 } 142 }
145 143
146 @GetMapping("/indicator/page") 144 @GetMapping("/indicator/page")
@@ -148,8 +146,8 @@ public class MesQcTemplateController { @@ -148,8 +146,8 @@ public class MesQcTemplateController {
148 @PreAuthorize("@ss.hasPermission('mes:qc-template:query')") 146 @PreAuthorize("@ss.hasPermission('mes:qc-template:query')")
149 public CommonResult<PageResult<MesQcTemplateIndicatorRespVO>> getTemplateIndicatorPage( 147 public CommonResult<PageResult<MesQcTemplateIndicatorRespVO>> getTemplateIndicatorPage(
150 @Valid MesQcTemplateIndicatorPageReqVO pageReqVO) { 148 @Valid MesQcTemplateIndicatorPageReqVO pageReqVO) {
151 - PageResult<MesQcTemplateIndicatorDO> pageResult = templateService.getTemplateIndicatorPage(pageReqVO);  
152 - return success(BeanUtils.toBean(pageResult, MesQcTemplateIndicatorRespVO.class)); 149 + // TODO @AI:service 只返回 do;数据拼接放在 controller 里;
  150 + return success(templateService.getTemplateIndicatorPage(pageReqVO));
153 } 151 }
154 152
155 // ========== 质检方案-产品关联 ========== 153 // ========== 质检方案-产品关联 ==========
@@ -185,8 +183,8 @@ public class MesQcTemplateController { @@ -185,8 +183,8 @@ public class MesQcTemplateController {
185 @Parameter(name = "id", description = "编号", required = true, example = "1024") 183 @Parameter(name = "id", description = "编号", required = true, example = "1024")
186 @PreAuthorize("@ss.hasPermission('mes:qc-template:query')") 184 @PreAuthorize("@ss.hasPermission('mes:qc-template:query')")
187 public CommonResult<MesQcTemplateItemRespVO> getTemplateItem(@RequestParam("id") Long id) { 185 public CommonResult<MesQcTemplateItemRespVO> getTemplateItem(@RequestParam("id") Long id) {
188 - MesQcTemplateItemDO item = templateService.getTemplateItem(id);  
189 - return success(BeanUtils.toBean(item, MesQcTemplateItemRespVO.class)); 186 + // TODO @AI:service 只返回 do;数据拼接放在 controller 里;
  187 + return success(templateService.getTemplateItem(id));
190 } 188 }
191 189
192 @GetMapping("/item/page") 190 @GetMapping("/item/page")
@@ -194,8 +192,8 @@ public class MesQcTemplateController { @@ -194,8 +192,8 @@ public class MesQcTemplateController {
194 @PreAuthorize("@ss.hasPermission('mes:qc-template:query')") 192 @PreAuthorize("@ss.hasPermission('mes:qc-template:query')")
195 public CommonResult<PageResult<MesQcTemplateItemRespVO>> getTemplateItemPage( 193 public CommonResult<PageResult<MesQcTemplateItemRespVO>> getTemplateItemPage(
196 @Valid MesQcTemplateItemPageReqVO pageReqVO) { 194 @Valid MesQcTemplateItemPageReqVO pageReqVO) {
197 - PageResult<MesQcTemplateItemDO> pageResult = templateService.getTemplateItemPage(pageReqVO);  
198 - return success(BeanUtils.toBean(pageResult, MesQcTemplateItemRespVO.class)); 195 + // TODO @AI:service 只返回 do;数据拼接放在 controller 里;
  196 + return success(templateService.getTemplateItemPage(pageReqVO));
199 } 197 }
200 198
201 } 199 }
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/MesQcTemplatePageReqVO.java
@@ -6,6 +6,8 @@ import lombok.Data; @@ -6,6 +6,8 @@ import lombok.Data;
6 import lombok.EqualsAndHashCode; 6 import lombok.EqualsAndHashCode;
7 import lombok.ToString; 7 import lombok.ToString;
8 8
  9 +import java.util.List;
  10 +
9 @Schema(description = "管理后台 - MES 质检方案分页 Request VO") 11 @Schema(description = "管理后台 - MES 质检方案分页 Request VO")
10 @Data 12 @Data
11 @EqualsAndHashCode(callSuper = true) 13 @EqualsAndHashCode(callSuper = true)
@@ -18,12 +20,10 @@ public class MesQcTemplatePageReqVO extends PageParam { @@ -18,12 +20,10 @@ public class MesQcTemplatePageReqVO extends PageParam {
18 @Schema(description = "方案名称", example = "出货检验") 20 @Schema(description = "方案名称", example = "出货检验")
19 private String name; 21 private String name;
20 22
21 - // TODO @AI:会用 List<String>  
22 - @Schema(description = "检测种类(模糊匹配)", example = "IQC")  
23 - private String types; 23 + @Schema(description = "检测种类", example = "[1, 3]")
  24 + private List<Integer> types;
24 25
25 - // TODO @AI:使用 Boolean;  
26 - @Schema(description = "是否启用(Y/N)", example = "Y")  
27 - private String enableFlag; 26 + @Schema(description = "是否启用", example = "true")
  27 + private Boolean enableFlag;
28 28
29 } 29 }
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/MesQcTemplateRespVO.java
@@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema; @@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
6 import lombok.Data; 6 import lombok.Data;
7 7
8 import java.time.LocalDateTime; 8 import java.time.LocalDateTime;
  9 +import java.util.List;
9 10
10 @Schema(description = "管理后台 - MES 质检方案 Response VO") 11 @Schema(description = "管理后台 - MES 质检方案 Response VO")
11 @Data 12 @Data
@@ -24,15 +25,13 @@ public class MesQcTemplateRespVO { @@ -24,15 +25,13 @@ public class MesQcTemplateRespVO {
24 @ExcelProperty("方案名称") 25 @ExcelProperty("方案名称")
25 private String name; 26 private String name;
26 27
27 - // TODO @AI:会用 List<String>;这里不用 (逗号分隔:IQC,IPQC,OQC,RQC) 注释;  
28 - @Schema(description = "检测种类(逗号分隔:IQC,IPQC,OQC,RQC)", requiredMode = Schema.RequiredMode.REQUIRED, example = "IQC,OQC") 28 + @Schema(description = "检测种类", requiredMode = Schema.RequiredMode.REQUIRED, example = "[1, 3]")
29 @ExcelProperty("检测种类") 29 @ExcelProperty("检测种类")
30 - private String types; 30 + private List<Integer> types;
31 31
32 - // TODO @AI:Boolean;  
33 - @Schema(description = "是否启用(Y/N)", requiredMode = Schema.RequiredMode.REQUIRED, example = "Y") 32 + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
34 @ExcelProperty("是否启用") 33 @ExcelProperty("是否启用")
35 - private String enableFlag; 34 + private Boolean enableFlag;
36 35
37 @Schema(description = "备注", example = "备注") 36 @Schema(description = "备注", example = "备注")
38 @ExcelProperty("备注") 37 @ExcelProperty("备注")
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/MesQcTemplateSaveReqVO.java
@@ -2,8 +2,12 @@ package cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo; @@ -2,8 +2,12 @@ package cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo;
2 2
3 import io.swagger.v3.oas.annotations.media.Schema; 3 import io.swagger.v3.oas.annotations.media.Schema;
4 import jakarta.validation.constraints.NotEmpty; 4 import jakarta.validation.constraints.NotEmpty;
  5 +import jakarta.validation.constraints.NotNull;
  6 +import jakarta.validation.constraints.Size;
5 import lombok.Data; 7 import lombok.Data;
6 8
  9 +import java.util.List;
  10 +
7 @Schema(description = "管理后台 - MES 质检方案新增/修改 Request VO") 11 @Schema(description = "管理后台 - MES 质检方案新增/修改 Request VO")
8 @Data 12 @Data
9 public class MesQcTemplateSaveReqVO { 13 public class MesQcTemplateSaveReqVO {
@@ -19,15 +23,14 @@ public class MesQcTemplateSaveReqVO { @@ -19,15 +23,14 @@ public class MesQcTemplateSaveReqVO {
19 @NotEmpty(message = "方案名称不能为空") 23 @NotEmpty(message = "方案名称不能为空")
20 private String name; 24 private String name;
21 25
22 - // TODO @AI:会用 List<String>;这里不用 (逗号分隔:IQC,IPQC,OQC,RQC) 注释;  
23 - @Schema(description = "检测种类(逗号分隔:IQC,IPQC,OQC,RQC)", requiredMode = Schema.RequiredMode.REQUIRED, example = "IQC,OQC")  
24 - @NotEmpty(message = "检测种类不能为空")  
25 - private String types; 26 + @Schema(description = "检测种类(1-IQC 2-IPQC 3-OQC 4-RQC,字典 mes_qc_type)", requiredMode = Schema.RequiredMode.REQUIRED, example = "[1, 3]")
  27 + @NotNull(message = "检测种类不能为空")
  28 + @Size(min = 1, message = "检测种类至少选择一项")
  29 + private List<Integer> types;
26 30
27 - // TODO @AI:Boolean;  
28 - @Schema(description = "是否启用(Y/N)", requiredMode = Schema.RequiredMode.REQUIRED, example = "Y")  
29 - @NotEmpty(message = "是否启用不能为空")  
30 - private String enableFlag; 31 + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
  32 + @NotNull(message = "是否启用不能为空")
  33 + private Boolean enableFlag;
31 34
32 @Schema(description = "备注", example = "备注") 35 @Schema(description = "备注", example = "备注")
33 private String remark; 36 private String remark;
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/indicator/MesQcTemplateIndicatorRespVO.java
@@ -21,10 +21,9 @@ public class MesQcTemplateIndicatorRespVO { @@ -21,10 +21,9 @@ public class MesQcTemplateIndicatorRespVO {
21 private Long templateId; 21 private Long templateId;
22 22
23 @Schema(description = "质检指标ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") 23 @Schema(description = "质检指标ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
24 - @ExcelProperty("质检指标ID")  
25 private Long indicatorId; 24 private Long indicatorId;
26 25
27 - @Schema(description = "检测方法/检测要求", example = "目视检查外观") 26 + @Schema(description = "检测方法", example = "目视检查外观")
28 @ExcelProperty("检测方法") 27 @ExcelProperty("检测方法")
29 private String checkMethod; 28 private String checkMethod;
30 29
@@ -55,4 +54,22 @@ public class MesQcTemplateIndicatorRespVO { @@ -55,4 +54,22 @@ public class MesQcTemplateIndicatorRespVO {
55 @ExcelProperty("创建时间") 54 @ExcelProperty("创建时间")
56 private LocalDateTime createTime; 55 private LocalDateTime createTime;
57 56
  57 + // ========== JOIN mes_qc_indicator ==========
  58 +
  59 + @Schema(description = "检测项编码", example = "QI001")
  60 + @ExcelProperty("检测项编码")
  61 + private String indicatorCode;
  62 +
  63 + @Schema(description = "检测项名称", example = "长度")
  64 + @ExcelProperty("检测项名称")
  65 + private String indicatorName;
  66 +
  67 + @Schema(description = "检测项类型(字典 mes_index_type)", example = "SIZE")
  68 + @ExcelProperty("检测项类型")
  69 + private String indicatorType;
  70 +
  71 + @Schema(description = "检测工具", example = "卡尺")
  72 + @ExcelProperty("检测工具")
  73 + private String indicatorTool;
  74 +
58 } 75 }
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/item/MesQcTemplateItemRespVO.java
@@ -21,25 +21,21 @@ public class MesQcTemplateItemRespVO { @@ -21,25 +21,21 @@ public class MesQcTemplateItemRespVO {
21 private Long templateId; 21 private Long templateId;
22 22
23 @Schema(description = "产品物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") 23 @Schema(description = "产品物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
24 - @ExcelProperty("产品物料ID")  
25 private Long itemId; 24 private Long itemId;
26 25
27 @Schema(description = "最低检测数", example = "5") 26 @Schema(description = "最低检测数", example = "5")
28 @ExcelProperty("最低检测数") 27 @ExcelProperty("最低检测数")
29 private Integer quantityCheck; 28 private Integer quantityCheck;
30 29
31 - // TODO @AI:VO 里,(0=不启用) 去掉  
32 - @Schema(description = "最大不合格数(0=不启用)", example = "0") 30 + @Schema(description = "最大不合格数", example = "0")
33 @ExcelProperty("最大不合格数") 31 @ExcelProperty("最大不合格数")
34 private Integer quantityUnqualified; 32 private Integer quantityUnqualified;
35 33
36 - // TODO @AI:VO 里,(0=不允许) 去掉  
37 - @Schema(description = "最大致命缺陷率(%,0=不允许)", example = "0") 34 + @Schema(description = "最大致命缺陷率(%)", example = "0")
38 @ExcelProperty("致命缺陷率%") 35 @ExcelProperty("致命缺陷率%")
39 private BigDecimal criticalRate; 36 private BigDecimal criticalRate;
40 37
41 - // TODO @AI:VO 里,(0=不允许) 去掉  
42 - @Schema(description = "最大严重缺陷率(%,0=不允许)", example = "0") 38 + @Schema(description = "最大严重缺陷率(%)", example = "0")
43 @ExcelProperty("严重缺陷率%") 39 @ExcelProperty("严重缺陷率%")
44 private BigDecimal majorRate; 40 private BigDecimal majorRate;
45 41
@@ -55,4 +51,22 @@ public class MesQcTemplateItemRespVO { @@ -55,4 +51,22 @@ public class MesQcTemplateItemRespVO {
55 @ExcelProperty("创建时间") 51 @ExcelProperty("创建时间")
56 private LocalDateTime createTime; 52 private LocalDateTime createTime;
57 53
  54 + // ========== JOIN mes_md_item ==========
  55 +
  56 + @Schema(description = "物料编码", example = "ITEM001")
  57 + @ExcelProperty("物料编码")
  58 + private String itemCode;
  59 +
  60 + @Schema(description = "物料名称", example = "螺丝")
  61 + @ExcelProperty("物料名称")
  62 + private String itemName;
  63 +
  64 + @Schema(description = "规格型号", example = "M3x10")
  65 + @ExcelProperty("规格型号")
  66 + private String specification;
  67 +
  68 + @Schema(description = "计量单位名称", example = "个")
  69 + @ExcelProperty("计量单位")
  70 + private String unitMeasureName;
  71 +
58 } 72 }
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/qc/MesQcTemplateMapper.java
@@ -18,12 +18,21 @@ import java.util.List; @@ -18,12 +18,21 @@ import java.util.List;
18 public interface MesQcTemplateMapper extends BaseMapperX<MesQcTemplateDO> { 18 public interface MesQcTemplateMapper extends BaseMapperX<MesQcTemplateDO> {
19 19
20 default PageResult<MesQcTemplateDO> selectPage(MesQcTemplatePageReqVO reqVO) { 20 default PageResult<MesQcTemplateDO> selectPage(MesQcTemplatePageReqVO reqVO) {
21 - return selectPage(reqVO, new LambdaQueryWrapperX<MesQcTemplateDO>() 21 + LambdaQueryWrapperX<MesQcTemplateDO> query = new LambdaQueryWrapperX<MesQcTemplateDO>()
22 .likeIfPresent(MesQcTemplateDO::getCode, reqVO.getCode()) 22 .likeIfPresent(MesQcTemplateDO::getCode, reqVO.getCode())
23 .likeIfPresent(MesQcTemplateDO::getName, reqVO.getName()) 23 .likeIfPresent(MesQcTemplateDO::getName, reqVO.getName())
24 - .likeIfPresent(MesQcTemplateDO::getTypes, reqVO.getTypes())  
25 - .eqIfPresent(MesQcTemplateDO::getEnableFlag, reqVO.getEnableFlag())  
26 - .orderByDesc(MesQcTemplateDO::getId)); 24 + .orderByDesc(MesQcTemplateDO::getId);
  25 + // types: 取第一个值做 LIKE 匹配(简单实现,支持单值过滤)
  26 + // TODO @AI:find in set;你看看 mybatisutils 有类似的;
  27 + if (reqVO.getTypes() != null && !reqVO.getTypes().isEmpty()) {
  28 + query.like(MesQcTemplateDO::getTypes, String.valueOf(reqVO.getTypes().get(0)));
  29 + }
  30 + // TODO @AI:是不是里面就是 boolean
  31 + // enableFlag: 转为 Y/N 已经改成 boolean 了,数据库里也是 boolean
  32 + if (reqVO.getEnableFlag() != null) {
  33 + query.eq(MesQcTemplateDO::getEnableFlag, Boolean.TRUE.equals(reqVO.getEnableFlag()) ? "Y" : "N");
  34 + }
  35 + return selectPage(reqVO, query);
27 } 36 }
28 37
29 default MesQcTemplateDO selectByCode(String code) { 38 default MesQcTemplateDO selectByCode(String code) {
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/DictTypeConstants.java
@@ -20,9 +20,9 @@ public interface DictTypeConstants { @@ -20,9 +20,9 @@ public interface DictTypeConstants {
20 String MES_INDEX_TYPE = "mes_index_type"; // MES 检测项类型 20 String MES_INDEX_TYPE = "mes_index_type"; // MES 检测项类型
21 String MES_QC_RESULT_TYPE = "mes_qc_result_type"; // MES 质检结果值类型 21 String MES_QC_RESULT_TYPE = "mes_qc_result_type"; // MES 质检结果值类型
22 String MES_DEFECT_LEVEL = "mes_defect_level"; // MES 缺陷等级 22 String MES_DEFECT_LEVEL = "mes_defect_level"; // MES 缺陷等级
23 - String MES_PRO_WORKORDER_STATUS = "mes_pro_workorder_status"; // MES 生产工单状态  
24 - String MES_PRO_WORKORDER_SOURCE_TYPE = "mes_pro_workorder_source_type"; // MES 工单来源类型  
25 - String MES_PRO_WORKORDER_TYPE = "mes_pro_workorder_type"; // MES 工单类型 23 + String MES_PRO_WORK_ORDER_STATUS = "mes_pro_work_order_status"; // MES 生产工单状态
  24 + String MES_PRO_WORK_ORDER_SOURCE_TYPE = "mes_pro_work_order_source_type"; // MES 工单来源类型
  25 + String MES_PRO_WORK_ORDER_TYPE = "mes_pro_work_order_type"; // MES 工单类型
26 String MES_QC_TYPE = "mes_qc_type"; // MES 检测种类(IQC/IPQC/OQC/RQC) 26 String MES_QC_TYPE = "mes_qc_type"; // MES 检测种类(IQC/IPQC/OQC/RQC)
27 27
28 } 28 }
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/ErrorCodeConstants.java
@@ -87,6 +87,12 @@ public interface ErrorCodeConstants { @@ -87,6 +87,12 @@ public interface ErrorCodeConstants {
87 87
88 // ========== MES 日历排班-班组(1-040-201-000) ========== 88 // ========== MES 日历排班-班组(1-040-201-000) ==========
89 ErrorCode CAL_TEAM_NOT_EXISTS = new ErrorCode(1_040_201_000, "班组不存在"); 89 ErrorCode CAL_TEAM_NOT_EXISTS = new ErrorCode(1_040_201_000, "班组不存在");
  90 + ErrorCode CAL_TEAM_CODE_DUPLICATE = new ErrorCode(1_040_201_001, "班组编码已存在");
  91 + // ========== MES 日历排班-班组成员(1-040-201-100) ==========
  92 + ErrorCode CAL_TEAM_MEMBER_NOT_EXISTS = new ErrorCode(1_040_201_100, "班组成员不存在");
  93 + ErrorCode CAL_TEAM_MEMBER_USER_DUPLICATE = new ErrorCode(1_040_201_101, "该用户已分配到其他班组");
  94 + // ========== MES 日历排班-班组排班(1-040-201-200) ==========
  95 + ErrorCode CAL_TEAM_SHIFT_NOT_EXISTS = new ErrorCode(1_040_201_200, "班组排班记录不存在");
90 96
91 // ========== MES 日历排班-排班计划(1-040-202-000) ========== 97 // ========== MES 日历排班-排班计划(1-040-202-000) ==========
92 ErrorCode CAL_PLAN_NOT_EXISTS = new ErrorCode(1_040_202_000, "排班计划不存在"); 98 ErrorCode CAL_PLAN_NOT_EXISTS = new ErrorCode(1_040_202_000, "排班计划不存在");
@@ -132,15 +138,16 @@ public interface ErrorCodeConstants { @@ -132,15 +138,16 @@ public interface ErrorCodeConstants {
132 138
133 // ========== MES 生产管理-工序(1-040-500-000) ========== 139 // ========== MES 生产管理-工序(1-040-500-000) ==========
134 ErrorCode PRO_PROCESS_NOT_EXISTS = new ErrorCode(1_040_500_000, "工序不存在"); 140 ErrorCode PRO_PROCESS_NOT_EXISTS = new ErrorCode(1_040_500_000, "工序不存在");
  141 + ErrorCode PRO_PROCESS_CODE_EXISTS = new ErrorCode(1_040_500_001, "工序编码已存在");
135 142
136 // ========== MES 生产管理-工艺路线(1-040-501-000) ========== 143 // ========== MES 生产管理-工艺路线(1-040-501-000) ==========
137 ErrorCode PRO_ROUTE_NOT_EXISTS = new ErrorCode(1_040_501_000, "工艺路线不存在"); 144 ErrorCode PRO_ROUTE_NOT_EXISTS = new ErrorCode(1_040_501_000, "工艺路线不存在");
138 145
139 // ========== MES 生产管理-生产工单(1-040-502-000) ========== 146 // ========== MES 生产管理-生产工单(1-040-502-000) ==========
140 - ErrorCode PRO_WORKORDER_NOT_EXISTS = new ErrorCode(1_040_502_000, "生产工单不存在");  
141 - ErrorCode PRO_WORKORDER_CODE_DUPLICATE = new ErrorCode(1_040_502_001, "生产工单编码已存在");  
142 - ErrorCode PRO_WORKORDER_NOT_PREPARE = new ErrorCode(1_040_502_002, "只能删除草稿状态的工单");  
143 - ErrorCode PRO_WORKORDER_BOM_NOT_EXISTS = new ErrorCode(1_040_502_100, "生产工单BOM不存在"); 147 + ErrorCode PRO_WORK_ORDER_NOT_EXISTS = new ErrorCode(1_040_502_000, "生产工单不存在");
  148 + ErrorCode PRO_WORK_ORDER_CODE_DUPLICATE = new ErrorCode(1_040_502_001, "生产工单编码已存在");
  149 + ErrorCode PRO_WORK_ORDER_NOT_PREPARE = new ErrorCode(1_040_502_002, "只能删除草稿状态的工单");
  150 + ErrorCode PRO_WORK_ORDER_BOM_NOT_EXISTS = new ErrorCode(1_040_502_100, "生产工单BOM不存在");
144 151
145 // ========== MES 生产管理-生产任务(1-040-503-000) ========== 152 // ========== MES 生产管理-生产任务(1-040-503-000) ==========
146 ErrorCode PRO_TASK_NOT_EXISTS = new ErrorCode(1_040_503_000, "生产任务不存在"); 153 ErrorCode PRO_TASK_NOT_EXISTS = new ErrorCode(1_040_503_000, "生产任务不存在");
@@ -166,14 +173,33 @@ public interface ErrorCodeConstants { @@ -166,14 +173,33 @@ public interface ErrorCodeConstants {
166 173
167 // ========== MES 仓库管理-仓库(1-040-700-000) ========== 174 // ========== MES 仓库管理-仓库(1-040-700-000) ==========
168 ErrorCode WM_WAREHOUSE_NOT_EXISTS = new ErrorCode(1_040_700_000, "仓库不存在"); 175 ErrorCode WM_WAREHOUSE_NOT_EXISTS = new ErrorCode(1_040_700_000, "仓库不存在");
  176 + ErrorCode WM_WAREHOUSE_CODE_DUPLICATE = new ErrorCode(1_040_700_001, "仓库编码已存在");
  177 + ErrorCode WM_WAREHOUSE_NAME_DUPLICATE = new ErrorCode(1_040_700_002, "仓库名称已存在");
  178 + ErrorCode WM_WAREHOUSE_HAS_LOCATION = new ErrorCode(1_040_700_003, "仓库下存在库区,无法删除");
  179 + ErrorCode WM_WAREHOUSE_HAS_WORKSTATION = new ErrorCode(1_040_700_004, "仓库已被工作站引用,无法删除");
169 180
170 // ========== MES 仓库管理-库区(1-040-701-000) ========== 181 // ========== MES 仓库管理-库区(1-040-701-000) ==========
171 - ErrorCode WM_STORAGE_AREA_NOT_EXISTS = new ErrorCode(1_040_701_000, "库区不存在"); 182 + ErrorCode WM_WAREHOUSE_LOCATION_NOT_EXISTS = new ErrorCode(1_040_701_000, "库区不存在");
  183 + ErrorCode WM_WAREHOUSE_LOCATION_CODE_DUPLICATE = new ErrorCode(1_040_701_001, "同一仓库下库区编码已存在");
  184 + ErrorCode WM_WAREHOUSE_LOCATION_NAME_DUPLICATE = new ErrorCode(1_040_701_002, "同一仓库下库区名称已存在");
  185 + ErrorCode WM_WAREHOUSE_LOCATION_HAS_AREA = new ErrorCode(1_040_701_003, "库区下存在库位,无法删除");
  186 + ErrorCode WM_WAREHOUSE_LOCATION_HAS_WORKSTATION = new ErrorCode(1_040_701_004, "库区已被工作站引用,无法删除");
  187 + ErrorCode WM_WAREHOUSE_REQUIRED = new ErrorCode(1_040_701_005, "选择库区时,仓库不能为空");
  188 + ErrorCode WM_WAREHOUSE_LOCATION_RELATION_INVALID = new ErrorCode(1_040_701_006, "库区不属于所选仓库");
172 189
173 // ========== MES 仓库管理-库位(1-040-702-000) ========== 190 // ========== MES 仓库管理-库位(1-040-702-000) ==========
174 - ErrorCode WM_STORAGE_LOCATION_NOT_EXISTS = new ErrorCode(1_040_702_000, "库位不存在"); 191 + ErrorCode WM_WAREHOUSE_AREA_NOT_EXISTS = new ErrorCode(1_040_702_000, "库位不存在");
  192 + ErrorCode WM_WAREHOUSE_AREA_CODE_DUPLICATE = new ErrorCode(1_040_702_001, "同一库区下库位编码已存在");
  193 + ErrorCode WM_WAREHOUSE_AREA_NAME_DUPLICATE = new ErrorCode(1_040_702_002, "同一库区下库位名称已存在");
  194 + ErrorCode WM_WAREHOUSE_AREA_HAS_WORKSTATION = new ErrorCode(1_040_702_003, "库位已被工作站引用,无法删除");
  195 + ErrorCode WM_WAREHOUSE_LOCATION_REQUIRED = new ErrorCode(1_040_702_004, "选择库位时,库区不能为空");
  196 + ErrorCode WM_WAREHOUSE_AREA_RELATION_INVALID = new ErrorCode(1_040_702_005, "库位不属于所选库区");
175 197
176 // ========== MES 仓库管理-库存(1-040-703-000) ========== 198 // ========== MES 仓库管理-库存(1-040-703-000) ==========
177 ErrorCode WM_MATERIAL_STOCK_NOT_EXISTS = new ErrorCode(1_040_703_000, "库存记录不存在"); 199 ErrorCode WM_MATERIAL_STOCK_NOT_EXISTS = new ErrorCode(1_040_703_000, "库存记录不存在");
178 200
  201 + // ========== 兼容旧命名(storage_area=库区,storage_location=库位) ==========
  202 + ErrorCode WM_STORAGE_AREA_NOT_EXISTS = WM_WAREHOUSE_LOCATION_NOT_EXISTS;
  203 + ErrorCode WM_STORAGE_LOCATION_NOT_EXISTS = WM_WAREHOUSE_AREA_NOT_EXISTS;
  204 +
179 } 205 }