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