Commit f57da4473d85d0d0cf9cc7de3a9be75dda31684c

Authored by YunaiV
1 parent 7d45f862

feat(mes): 优化到货通知单字段验证

- 移除用户不应填写的字段(qualifiedQuantity、iqcId 由 IQC 回调设置)
- 添加必填验证(通知单名称、是否检验)
- 添加到货数量必须大于 0 的验证
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/arrivalnotice/vo/MesWmArrivalNoticeSaveReqVO.java
... ... @@ -17,7 +17,8 @@ public class MesWmArrivalNoticeSaveReqVO {
17 17 @NotEmpty(message = "通知单编码不能为空")
18 18 private String code;
19 19  
20   - @Schema(description = "通知单名称", example = "2 月份钢板到货")
  20 + @Schema(description = "通知单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "2 月份钢板到货")
  21 + @NotEmpty(message = "通知单名称不能为空")
21 22 private String name;
22 23  
23 24 @Schema(description = "采购订单编号", example = "PO20260101")
... ...
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/arrivalnotice/vo/line/MesWmArrivalNoticeLineSaveReqVO.java
1 1 package cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.line;
2 2  
3 3 import io.swagger.v3.oas.annotations.media.Schema;
  4 +import jakarta.validation.constraints.DecimalMin;
4 5 import jakarta.validation.constraints.NotNull;
5 6 import lombok.Data;
6 7  
... ... @@ -21,20 +22,15 @@ public class MesWmArrivalNoticeLineSaveReqVO {
21 22 @NotNull(message = "物料编号不能为空")
22 23 private Long itemId;
23 24  
24   - // TODO @AI:必须大于 0;前端也校验下;
25 25 @Schema(description = "到货数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "500.00")
26 26 @NotNull(message = "到货数量不能为空")
  27 + @DecimalMin(value = "0.01", message = "到货数量必须大于 0")
27 28 private BigDecimal arrivalQuantity;
28 29  
29   - @Schema(description = "合格数量", example = "500.00")
30   - private BigDecimal qualifiedQuantity;
31   -
32   - @Schema(description = "是否需要来料检验", example = "true")
  30 + @Schema(description = "是否需要来料检验", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
  31 + @NotNull(message = "是否需要来料检验不能为空")
33 32 private Boolean iqcCheckFlag;
34 33  
35   - @Schema(description = "来料检验单编号", example = "1")
36   - private Long iqcId;
37   -
38 34 @Schema(description = "备注", example = "备注")
39 35 private String remark;
40 36  
... ...