Commit 1ebc0a080bdbff2b82d069a70dd189788999cee1
1 parent
0c3c271c
✨ feat(mes): 增加客户和供应商请求VO的字段验证
为客户和供应商新增/修改请求VO添加字段长度限制和邮箱格式验证,确保数据的有效性和完整性。
Showing
8 changed files
with
80 additions
and
16 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/md/client/vo/MesMdClientSaveReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.mes.controller.admin.md.client.vo; |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | +import jakarta.validation.constraints.Email; | |
| 4 | 5 | import jakarta.validation.constraints.NotEmpty; |
| 5 | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | +import jakarta.validation.constraints.Size; | |
| 6 | 8 | import lombok.Data; |
| 7 | 9 | |
| 8 | 10 | @Schema(description = "管理后台 - MES 客户新增/修改 Request VO") |
| ... | ... | @@ -14,22 +16,28 @@ public class MesMdClientSaveReqVO { |
| 14 | 16 | |
| 15 | 17 | @Schema(description = "客户编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "C00184") |
| 16 | 18 | @NotEmpty(message = "客户编码不能为空") |
| 19 | + @Size(max = 64, message = "客户编码长度不能超过 64 个字符") | |
| 17 | 20 | private String code; |
| 18 | 21 | |
| 19 | 22 | @Schema(description = "客户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "比亚迪") |
| 20 | 23 | @NotEmpty(message = "客户名称不能为空") |
| 24 | + @Size(max = 255, message = "客户名称长度不能超过 255 个字符") | |
| 21 | 25 | private String name; |
| 22 | 26 | |
| 23 | 27 | @Schema(description = "客户简称", example = "比亚迪") |
| 28 | + @Size(max = 255, message = "客户简称长度不能超过 255 个字符") | |
| 24 | 29 | private String nickname; |
| 25 | 30 | |
| 26 | 31 | @Schema(description = "客户英文名称", example = "BYD") |
| 32 | + @Size(max = 255, message = "客户英文名称长度不能超过 255 个字符") | |
| 27 | 33 | private String englishName; |
| 28 | 34 | |
| 29 | 35 | @Schema(description = "客户简介", example = "比亚迪品牌诞生于深圳") |
| 36 | + @Size(max = 500, message = "客户简介长度不能超过 500 个字符") | |
| 30 | 37 | private String description; |
| 31 | 38 | |
| 32 | 39 | @Schema(description = "客户LOGO地址", example = "https://xxx.com/logo.png") |
| 40 | + @Size(max = 255, message = "客户LOGO地址长度不能超过 255 个字符") | |
| 33 | 41 | private String logo; |
| 34 | 42 | |
| 35 | 43 | @Schema(description = "客户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| ... | ... | @@ -37,36 +45,50 @@ public class MesMdClientSaveReqVO { |
| 37 | 45 | private Integer type; |
| 38 | 46 | |
| 39 | 47 | @Schema(description = "客户地址", example = "深圳南山区") |
| 48 | + @Size(max = 500, message = "客户地址长度不能超过 500 个字符") | |
| 40 | 49 | private String address; |
| 41 | 50 | |
| 42 | 51 | @Schema(description = "客户官网地址", example = "https://www.bydglobal.com") |
| 52 | + @Size(max = 255, message = "客户官网地址长度不能超过 255 个字符") | |
| 43 | 53 | private String website; |
| 44 | 54 | |
| 45 | 55 | @Schema(description = "客户邮箱地址", example = "salse@bydglobal.com") |
| 56 | + @Size(max = 255, message = "客户邮箱地址长度不能超过 255 个字符") | |
| 57 | + @Email(message = "客户邮箱地址格式不正确") | |
| 46 | 58 | private String email; |
| 47 | 59 | |
| 48 | 60 | @Schema(description = "客户电话", example = "123432222") |
| 61 | + @Size(max = 64, message = "客户电话长度不能超过 64 个字符") | |
| 49 | 62 | private String telephone; |
| 50 | 63 | |
| 51 | 64 | @Schema(description = "联系人1", example = "张三") |
| 65 | + @Size(max = 64, message = "联系人1长度不能超过 64 个字符") | |
| 52 | 66 | private String contact1Name; |
| 53 | 67 | |
| 54 | 68 | @Schema(description = "联系人1-电话", example = "122212312") |
| 69 | + @Size(max = 64, message = "联系人1-电话长度不能超过 64 个字符") | |
| 55 | 70 | private String contact1Telephone; |
| 56 | 71 | |
| 57 | 72 | @Schema(description = "联系人1-邮箱", example = "s1@bydglobal.com") |
| 73 | + @Size(max = 255, message = "联系人1-邮箱长度不能超过 255 个字符") | |
| 74 | + @Email(message = "联系人1-邮箱格式不正确") | |
| 58 | 75 | private String contact1Email; |
| 59 | 76 | |
| 60 | 77 | @Schema(description = "联系人2", example = "李四") |
| 78 | + @Size(max = 64, message = "联系人2长度不能超过 64 个字符") | |
| 61 | 79 | private String contact2Name; |
| 62 | 80 | |
| 63 | 81 | @Schema(description = "联系人2-电话", example = "1132323232") |
| 82 | + @Size(max = 64, message = "联系人2-电话长度不能超过 64 个字符") | |
| 64 | 83 | private String contact2Telephone; |
| 65 | 84 | |
| 66 | 85 | @Schema(description = "联系人2-邮箱", example = "s2@bydglobal.com") |
| 86 | + @Size(max = 255, message = "联系人2-邮箱长度不能超过 255 个字符") | |
| 87 | + @Email(message = "联系人2-邮箱格式不正确") | |
| 67 | 88 | private String contact2Email; |
| 68 | 89 | |
| 69 | 90 | @Schema(description = "统一社会信用代码", example = "11212121") |
| 91 | + @Size(max = 64, message = "统一社会信用代码长度不能超过 64 个字符") | |
| 70 | 92 | private String creditCode; |
| 71 | 93 | |
| 72 | 94 | @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") |
| ... | ... | @@ -74,6 +96,7 @@ public class MesMdClientSaveReqVO { |
| 74 | 96 | private Integer status; |
| 75 | 97 | |
| 76 | 98 | @Schema(description = "备注", example = "备注") |
| 99 | + @Size(max = 500, message = "备注长度不能超过 500 个字符") | |
| 77 | 100 | private String remark; |
| 78 | 101 | |
| 79 | 102 | } | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/md/vendor/vo/MesMdVendorSaveReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.mes.controller.admin.md.vendor.vo; |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | +import jakarta.validation.constraints.Email; | |
| 4 | 5 | import jakarta.validation.constraints.NotEmpty; |
| 5 | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | +import jakarta.validation.constraints.Size; | |
| 6 | 8 | import lombok.Data; |
| 7 | 9 | |
| 8 | 10 | @Schema(description = "管理后台 - MES 供应商新增/修改 Request VO") |
| ... | ... | @@ -14,61 +16,82 @@ public class MesMdVendorSaveReqVO { |
| 14 | 16 | |
| 15 | 17 | @Schema(description = "供应商编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "V00101") |
| 16 | 18 | @NotEmpty(message = "供应商编码不能为空") |
| 19 | + @Size(max = 64, message = "供应商编码长度不能超过 64 个字符") | |
| 17 | 20 | private String code; |
| 18 | 21 | |
| 19 | 22 | @Schema(description = "供应商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "海力德电子") |
| 20 | 23 | @NotEmpty(message = "供应商名称不能为空") |
| 24 | + @Size(max = 255, message = "供应商名称长度不能超过 255 个字符") | |
| 21 | 25 | private String name; |
| 22 | 26 | |
| 23 | 27 | @Schema(description = "供应商简称", example = "海力德") |
| 28 | + @Size(max = 255, message = "供应商简称长度不能超过 255 个字符") | |
| 24 | 29 | private String nickname; |
| 25 | 30 | |
| 26 | 31 | @Schema(description = "供应商英文名称", example = "HLD Electronics") |
| 32 | + @Size(max = 255, message = "供应商英文名称长度不能超过 255 个字符") | |
| 27 | 33 | private String englishName; |
| 28 | 34 | |
| 29 | 35 | @Schema(description = "供应商简介", example = "专业从事电子元器件生产与销售") |
| 36 | + @Size(max = 500, message = "供应商简介长度不能超过 500 个字符") | |
| 30 | 37 | private String description; |
| 31 | 38 | |
| 32 | 39 | @Schema(description = "供应商LOGO地址", example = "https://xxx.com/logo.png") |
| 40 | + @Size(max = 255, message = "供应商LOGO地址长度不能超过 255 个字符") | |
| 33 | 41 | private String logo; |
| 34 | 42 | |
| 35 | 43 | @Schema(description = "供应商等级", example = "A") |
| 44 | + @Size(max = 64, message = "供应商等级长度不能超过 64 个字符") | |
| 36 | 45 | private String level; |
| 37 | 46 | |
| 38 | 47 | @Schema(description = "供应商评分", example = "95") |
| 39 | 48 | private Integer score; |
| 40 | 49 | |
| 41 | 50 | @Schema(description = "供应商地址", example = "深圳市宝安区") |
| 51 | + @Size(max = 500, message = "供应商地址长度不能超过 500 个字符") | |
| 42 | 52 | private String address; |
| 43 | 53 | |
| 44 | 54 | @Schema(description = "供应商官网地址", example = "https://www.hld-elec.com") |
| 55 | + @Size(max = 255, message = "供应商官网地址长度不能超过 255 个字符") | |
| 45 | 56 | private String website; |
| 46 | 57 | |
| 47 | 58 | @Schema(description = "供应商邮箱地址", example = "info@hld-elec.com") |
| 59 | + @Size(max = 255, message = "供应商邮箱地址长度不能超过 255 个字符") | |
| 60 | + @Email(message = "供应商邮箱地址格式不正确") | |
| 48 | 61 | private String email; |
| 49 | 62 | |
| 50 | 63 | @Schema(description = "供应商电话", example = "0755-12345678") |
| 64 | + @Size(max = 64, message = "供应商电话长度不能超过 64 个字符") | |
| 51 | 65 | private String telephone; |
| 52 | 66 | |
| 53 | 67 | @Schema(description = "联系人1", example = "王经理") |
| 68 | + @Size(max = 64, message = "联系人1长度不能超过 64 个字符") | |
| 54 | 69 | private String contact1Name; |
| 55 | 70 | |
| 56 | 71 | @Schema(description = "联系人1-电话", example = "13800138001") |
| 72 | + @Size(max = 64, message = "联系人1-电话长度不能超过 64 个字符") | |
| 57 | 73 | private String contact1Telephone; |
| 58 | 74 | |
| 59 | 75 | @Schema(description = "联系人1-邮箱", example = "wang@hld-elec.com") |
| 76 | + @Size(max = 255, message = "联系人1-邮箱长度不能超过 255 个字符") | |
| 77 | + @Email(message = "联系人1-邮箱格式不正确") | |
| 60 | 78 | private String contact1Email; |
| 61 | 79 | |
| 62 | 80 | @Schema(description = "联系人2", example = "赵助理") |
| 81 | + @Size(max = 64, message = "联系人2长度不能超过 64 个字符") | |
| 63 | 82 | private String contact2Name; |
| 64 | 83 | |
| 65 | 84 | @Schema(description = "联系人2-电话", example = "13800138002") |
| 85 | + @Size(max = 64, message = "联系人2-电话长度不能超过 64 个字符") | |
| 66 | 86 | private String contact2Telephone; |
| 67 | 87 | |
| 68 | 88 | @Schema(description = "联系人2-邮箱", example = "zhao@hld-elec.com") |
| 89 | + @Size(max = 255, message = "联系人2-邮箱长度不能超过 255 个字符") | |
| 90 | + @Email(message = "联系人2-邮箱格式不正确") | |
| 69 | 91 | private String contact2Email; |
| 70 | 92 | |
| 71 | 93 | @Schema(description = "统一社会信用代码", example = "91440300MA5EXAMPLE") |
| 94 | + @Size(max = 64, message = "统一社会信用代码长度不能超过 64 个字符") | |
| 72 | 95 | private String creditCode; |
| 73 | 96 | |
| 74 | 97 | @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") |
| ... | ... | @@ -76,6 +99,7 @@ public class MesMdVendorSaveReqVO { |
| 76 | 99 | private Integer status; |
| 77 | 100 | |
| 78 | 101 | @Schema(description = "备注", example = "备注") |
| 102 | + @Size(max = 500, message = "备注长度不能超过 500 个字符") | |
| 79 | 103 | private String remark; |
| 80 | 104 | |
| 81 | 105 | } | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/qc/ipqc/MesQcIpqcLineServiceImpl.java
| ... | ... | @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.qc.indicator.MesQcIndicatorDO; |
| 9 | 9 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.ipqc.MesQcIpqcLineDO; |
| 10 | 10 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.template.MesQcTemplateIndicatorDO; |
| 11 | 11 | import cn.iocoder.yudao.module.mes.dal.mysql.qc.ipqc.MesQcIpqcLineMapper; |
| 12 | -import cn.iocoder.yudao.module.mes.dal.mysql.qc.template.MesQcTemplateIndicatorMapper; | |
| 13 | 12 | import cn.iocoder.yudao.module.mes.enums.qc.MesQcDefectLevelEnum; |
| 14 | 13 | import cn.iocoder.yudao.module.mes.service.qc.indicator.MesQcIndicatorService; |
| 14 | +import cn.iocoder.yudao.module.mes.service.qc.template.MesQcTemplateIndicatorService; | |
| 15 | 15 | import jakarta.annotation.Resource; |
| 16 | 16 | import org.springframework.stereotype.Service; |
| 17 | 17 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -37,11 +37,11 @@ public class MesQcIpqcLineServiceImpl implements MesQcIpqcLineService { |
| 37 | 37 | |
| 38 | 38 | @Resource |
| 39 | 39 | private MesQcIpqcLineMapper ipqcLineMapper; |
| 40 | - @Resource | |
| 41 | - private MesQcTemplateIndicatorMapper templateIndicatorMapper; | |
| 42 | 40 | |
| 43 | 41 | @Resource |
| 44 | 42 | private MesQcIndicatorService indicatorService; |
| 43 | + @Resource | |
| 44 | + private MesQcTemplateIndicatorService templateIndicatorService; | |
| 45 | 45 | |
| 46 | 46 | @Override |
| 47 | 47 | public MesQcIpqcLineDO validateIpqcLineExists(Long id) { |
| ... | ... | @@ -64,7 +64,7 @@ public class MesQcIpqcLineServiceImpl implements MesQcIpqcLineService { |
| 64 | 64 | |
| 65 | 65 | @Override |
| 66 | 66 | public void createLinesFromTemplate(Long ipqcId, Long templateId) { |
| 67 | - List<MesQcTemplateIndicatorDO> templateIndicators = templateIndicatorMapper.selectListByTemplateId(templateId); | |
| 67 | + List<MesQcTemplateIndicatorDO> templateIndicators = templateIndicatorService.getTemplateIndicatorListByTemplateId(templateId); | |
| 68 | 68 | if (CollUtil.isEmpty(templateIndicators)) { |
| 69 | 69 | return; |
| 70 | 70 | } | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/qc/iqc/MesQcIqcLineServiceImpl.java
| ... | ... | @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.qc.iqc.MesQcIqcLineDO; |
| 9 | 9 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.indicator.MesQcIndicatorDO; |
| 10 | 10 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.template.MesQcTemplateIndicatorDO; |
| 11 | 11 | import cn.iocoder.yudao.module.mes.dal.mysql.qc.iqc.MesQcIqcLineMapper; |
| 12 | -import cn.iocoder.yudao.module.mes.dal.mysql.qc.template.MesQcTemplateIndicatorMapper; | |
| 13 | 12 | import cn.iocoder.yudao.module.mes.enums.qc.MesQcDefectLevelEnum; |
| 14 | 13 | import cn.iocoder.yudao.module.mes.service.qc.indicator.MesQcIndicatorService; |
| 14 | +import cn.iocoder.yudao.module.mes.service.qc.template.MesQcTemplateIndicatorService; | |
| 15 | 15 | import jakarta.annotation.Resource; |
| 16 | 16 | import org.springframework.stereotype.Service; |
| 17 | 17 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -37,11 +37,11 @@ public class MesQcIqcLineServiceImpl implements MesQcIqcLineService { |
| 37 | 37 | |
| 38 | 38 | @Resource |
| 39 | 39 | private MesQcIqcLineMapper iqcLineMapper; |
| 40 | - @Resource | |
| 41 | - private MesQcTemplateIndicatorMapper templateIndicatorMapper; | |
| 42 | 40 | |
| 43 | 41 | @Resource |
| 44 | 42 | private MesQcIndicatorService indicatorService; |
| 43 | + @Resource | |
| 44 | + private MesQcTemplateIndicatorService templateIndicatorService; | |
| 45 | 45 | |
| 46 | 46 | @Override |
| 47 | 47 | public MesQcIqcLineDO validateIqcLineExists(Long id) { |
| ... | ... | @@ -64,7 +64,7 @@ public class MesQcIqcLineServiceImpl implements MesQcIqcLineService { |
| 64 | 64 | |
| 65 | 65 | @Override |
| 66 | 66 | public void createLinesFromTemplate(Long iqcId, Long templateId) { |
| 67 | - List<MesQcTemplateIndicatorDO> templateIndicators = templateIndicatorMapper.selectListByTemplateId(templateId); | |
| 67 | + List<MesQcTemplateIndicatorDO> templateIndicators = templateIndicatorService.getTemplateIndicatorListByTemplateId(templateId); | |
| 68 | 68 | if (CollUtil.isEmpty(templateIndicators)) { |
| 69 | 69 | return; |
| 70 | 70 | } | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/qc/oqc/MesQcOqcLineServiceImpl.java
| ... | ... | @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.qc.indicator.MesQcIndicatorDO; |
| 9 | 9 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.oqc.MesQcOqcLineDO; |
| 10 | 10 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.template.MesQcTemplateIndicatorDO; |
| 11 | 11 | import cn.iocoder.yudao.module.mes.dal.mysql.qc.oqc.MesQcOqcLineMapper; |
| 12 | -import cn.iocoder.yudao.module.mes.dal.mysql.qc.template.MesQcTemplateIndicatorMapper; | |
| 13 | 12 | import cn.iocoder.yudao.module.mes.enums.qc.MesQcDefectLevelEnum; |
| 14 | 13 | import cn.iocoder.yudao.module.mes.service.qc.indicator.MesQcIndicatorService; |
| 14 | +import cn.iocoder.yudao.module.mes.service.qc.template.MesQcTemplateIndicatorService; | |
| 15 | 15 | import jakarta.annotation.Resource; |
| 16 | 16 | import org.springframework.stereotype.Service; |
| 17 | 17 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -38,9 +38,9 @@ public class MesQcOqcLineServiceImpl implements MesQcOqcLineService { |
| 38 | 38 | @Resource |
| 39 | 39 | private MesQcOqcLineMapper oqcLineMapper; |
| 40 | 40 | @Resource |
| 41 | - private MesQcTemplateIndicatorMapper templateIndicatorMapper; | |
| 42 | - @Resource | |
| 43 | 41 | private MesQcIndicatorService indicatorService; |
| 42 | + @Resource | |
| 43 | + private MesQcTemplateIndicatorService templateIndicatorService; | |
| 44 | 44 | |
| 45 | 45 | @Override |
| 46 | 46 | public MesQcOqcLineDO validateOqcLineExists(Long id) { |
| ... | ... | @@ -63,7 +63,7 @@ public class MesQcOqcLineServiceImpl implements MesQcOqcLineService { |
| 63 | 63 | |
| 64 | 64 | @Override |
| 65 | 65 | public void createLinesFromTemplate(Long oqcId, Long templateId) { |
| 66 | - List<MesQcTemplateIndicatorDO> templateIndicators = templateIndicatorMapper.selectListByTemplateId(templateId); | |
| 66 | + List<MesQcTemplateIndicatorDO> templateIndicators = templateIndicatorService.getTemplateIndicatorListByTemplateId(templateId); | |
| 67 | 67 | if (CollUtil.isEmpty(templateIndicators)) { |
| 68 | 68 | return; |
| 69 | 69 | } | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/qc/rqc/MesQcRqcLineServiceImpl.java
| ... | ... | @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.qc.indicator.MesQcIndicatorDO; |
| 9 | 9 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.rqc.MesQcRqcLineDO; |
| 10 | 10 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.template.MesQcTemplateIndicatorDO; |
| 11 | 11 | import cn.iocoder.yudao.module.mes.dal.mysql.qc.rqc.MesQcRqcLineMapper; |
| 12 | -import cn.iocoder.yudao.module.mes.dal.mysql.qc.template.MesQcTemplateIndicatorMapper; | |
| 13 | 12 | import cn.iocoder.yudao.module.mes.enums.qc.MesQcDefectLevelEnum; |
| 14 | 13 | import cn.iocoder.yudao.module.mes.service.qc.indicator.MesQcIndicatorService; |
| 14 | +import cn.iocoder.yudao.module.mes.service.qc.template.MesQcTemplateIndicatorService; | |
| 15 | 15 | import jakarta.annotation.Resource; |
| 16 | 16 | import org.springframework.stereotype.Service; |
| 17 | 17 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -37,11 +37,11 @@ public class MesQcRqcLineServiceImpl implements MesQcRqcLineService { |
| 37 | 37 | |
| 38 | 38 | @Resource |
| 39 | 39 | private MesQcRqcLineMapper rqcLineMapper; |
| 40 | - @Resource | |
| 41 | - private MesQcTemplateIndicatorMapper templateIndicatorMapper; | |
| 42 | 40 | |
| 43 | 41 | @Resource |
| 44 | 42 | private MesQcIndicatorService indicatorService; |
| 43 | + @Resource | |
| 44 | + private MesQcTemplateIndicatorService templateIndicatorService; | |
| 45 | 45 | |
| 46 | 46 | @Override |
| 47 | 47 | public MesQcRqcLineDO validateRqcLineExists(Long id) { |
| ... | ... | @@ -64,7 +64,7 @@ public class MesQcRqcLineServiceImpl implements MesQcRqcLineService { |
| 64 | 64 | |
| 65 | 65 | @Override |
| 66 | 66 | public void createLinesFromTemplate(Long rqcId, Long templateId) { |
| 67 | - List<MesQcTemplateIndicatorDO> templateIndicators = templateIndicatorMapper.selectListByTemplateId(templateId); | |
| 67 | + List<MesQcTemplateIndicatorDO> templateIndicators = templateIndicatorService.getTemplateIndicatorListByTemplateId(templateId); | |
| 68 | 68 | if (CollUtil.isEmpty(templateIndicators)) { |
| 69 | 69 | return; |
| 70 | 70 | } | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/qc/template/MesQcTemplateIndicatorService.java
| ... | ... | @@ -6,6 +6,8 @@ import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.indicator.Mes |
| 6 | 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.template.MesQcTemplateIndicatorDO; |
| 7 | 7 | import jakarta.validation.Valid; |
| 8 | 8 | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 9 | 11 | /** |
| 10 | 12 | * MES 质检方案-检测指标项 Service 接口 |
| 11 | 13 | * |
| ... | ... | @@ -58,4 +60,12 @@ public interface MesQcTemplateIndicatorService { |
| 58 | 60 | */ |
| 59 | 61 | void deleteTemplateIndicatorByTemplateId(Long templateId); |
| 60 | 62 | |
| 63 | + /** | |
| 64 | + * 根据方案编号,获得检测指标项列表 | |
| 65 | + * | |
| 66 | + * @param templateId 质检方案编号 | |
| 67 | + * @return 检测指标项列表 | |
| 68 | + */ | |
| 69 | + List<MesQcTemplateIndicatorDO> getTemplateIndicatorListByTemplateId(Long templateId); | |
| 70 | + | |
| 61 | 71 | } | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/qc/template/MesQcTemplateIndicatorServiceImpl.java
| ... | ... | @@ -11,6 +11,8 @@ import org.springframework.context.annotation.Lazy; |
| 11 | 11 | import org.springframework.stereotype.Service; |
| 12 | 12 | import org.springframework.validation.annotation.Validated; |
| 13 | 13 | |
| 14 | +import java.util.List; | |
| 15 | + | |
| 14 | 16 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 15 | 17 | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.QC_TEMPLATE_INDICATOR_NOT_EXISTS; |
| 16 | 18 | |
| ... | ... | @@ -80,4 +82,9 @@ public class MesQcTemplateIndicatorServiceImpl implements MesQcTemplateIndicator |
| 80 | 82 | templateIndicatorMapper.deleteByTemplateId(templateId); |
| 81 | 83 | } |
| 82 | 84 | |
| 85 | + @Override | |
| 86 | + public List<MesQcTemplateIndicatorDO> getTemplateIndicatorListByTemplateId(Long templateId) { | |
| 87 | + return templateIndicatorMapper.selectListByTemplateId(templateId); | |
| 88 | + } | |
| 89 | + | |
| 83 | 90 | } | ... | ... |