Commit b50ca061d1bf2a576e36540d4b2c700dd5da02f3
1 parent
9ac2bb26
♻️ refactor(mes): 使用 MesOrderStatusConstants 替代状态枚举值
重构采购入库单和领料申请单状态枚举,统一使用 MesOrderStatusConstants 中的常量,提升代码可维护性和一致性。
Showing
2 changed files
with
40 additions
and
11 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/wm/MesWmItemReceiptStatusEnum.java
| 1 | package cn.iocoder.yudao.module.mes.enums.wm; | 1 | package cn.iocoder.yudao.module.mes.enums.wm; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.core.ArrayValuable; | 3 | import cn.iocoder.yudao.framework.common.core.ArrayValuable; |
| 4 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.itemreceipt.vo.MesWmItemReceiptSaveReqVO; | ||
| 5 | +import cn.iocoder.yudao.module.mes.enums.MesOrderStatusConstants; | ||
| 6 | +import cn.iocoder.yudao.module.mes.service.wm.itemreceipt.MesWmItemReceiptService; | ||
| 4 | import lombok.AllArgsConstructor; | 7 | import lombok.AllArgsConstructor; |
| 5 | import lombok.Getter; | 8 | import lombok.Getter; |
| 6 | 9 | ||
| 7 | import java.util.Arrays; | 10 | import java.util.Arrays; |
| 8 | 11 | ||
| 9 | -// TODO @AI:应该使用 MesOrderStatusEnum 替代掉,只是使用其中的部分状态。需要在对应的 DO 说明下;当然,字典还是独立的! | ||
| 10 | /** | 12 | /** |
| 11 | * MES 采购入库单状态枚举 | 13 | * MES 采购入库单状态枚举 |
| 12 | * | 14 | * |
| @@ -16,11 +18,36 @@ import java.util.Arrays; | @@ -16,11 +18,36 @@ import java.util.Arrays; | ||
| 16 | @AllArgsConstructor | 18 | @AllArgsConstructor |
| 17 | public enum MesWmItemReceiptStatusEnum implements ArrayValuable<Integer> { | 19 | public enum MesWmItemReceiptStatusEnum implements ArrayValuable<Integer> { |
| 18 | 20 | ||
| 19 | - PREPARE(0, "草稿"), | ||
| 20 | - APPROVING(1, "待上架"), | ||
| 21 | - APPROVED(2, "待入库"), | ||
| 22 | - FINISHED(3, "已完成"), | ||
| 23 | - CANCELED(4, "已取消"); | 21 | + /** |
| 22 | + * 草稿 | ||
| 23 | + * | ||
| 24 | + * 对应方法:{@link MesWmItemReceiptService#createItemReceipt(MesWmItemReceiptSaveReqVO)} | ||
| 25 | + */ | ||
| 26 | + PREPARE(MesOrderStatusConstants.PREPARE, "草稿"), | ||
| 27 | + /** | ||
| 28 | + * 待上架 | ||
| 29 | + * | ||
| 30 | + * 对应方法:{@link MesWmItemReceiptService#submitItemReceipt(Long)} | ||
| 31 | + */ | ||
| 32 | + APPROVING(MesOrderStatusConstants.APPROVING, "待上架"), | ||
| 33 | + /** | ||
| 34 | + * 待入库 | ||
| 35 | + * | ||
| 36 | + * 对应方法:{@link MesWmItemReceiptService#stockItemReceipt(Long)} | ||
| 37 | + */ | ||
| 38 | + APPROVED(MesOrderStatusConstants.APPROVED, "待执行入库"), | ||
| 39 | + /** | ||
| 40 | + * 已完成 | ||
| 41 | + * | ||
| 42 | + * 对应方法:{@link MesWmItemReceiptService#executeItemReceipt(Long)} | ||
| 43 | + */ | ||
| 44 | + FINISHED(MesOrderStatusConstants.FINISHED, "已完成"), | ||
| 45 | + /** | ||
| 46 | + * 已取消 | ||
| 47 | + * | ||
| 48 | + * 对应方法:{@link MesWmItemReceiptService#cancelItemReceipt(Long)} | ||
| 49 | + */ | ||
| 50 | + CANCELED(MesOrderStatusConstants.CANCELLED, "已取消"); | ||
| 24 | 51 | ||
| 25 | public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesWmItemReceiptStatusEnum::getStatus).toArray(Integer[]::new); | 52 | public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesWmItemReceiptStatusEnum::getStatus).toArray(Integer[]::new); |
| 26 | 53 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/wm/MesWmMaterialRequestStatusEnum.java
| 1 | package cn.iocoder.yudao.module.mes.enums.wm; | 1 | package cn.iocoder.yudao.module.mes.enums.wm; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.core.ArrayValuable; | 3 | import cn.iocoder.yudao.framework.common.core.ArrayValuable; |
| 4 | +import cn.iocoder.yudao.module.mes.enums.MesOrderStatusConstants; | ||
| 4 | import lombok.AllArgsConstructor; | 5 | import lombok.AllArgsConstructor; |
| 5 | import lombok.Getter; | 6 | import lombok.Getter; |
| 6 | 7 | ||
| 7 | import java.util.Arrays; | 8 | import java.util.Arrays; |
| 8 | 9 | ||
| 10 | +// TODO @AI:这里需要迁移下; | ||
| 9 | /** | 11 | /** |
| 10 | * MES 领料申请单状态枚举 | 12 | * MES 领料申请单状态枚举 |
| 11 | * | 13 | * |
| @@ -15,11 +17,11 @@ import java.util.Arrays; | @@ -15,11 +17,11 @@ import java.util.Arrays; | ||
| 15 | @AllArgsConstructor | 17 | @AllArgsConstructor |
| 16 | public enum MesWmMaterialRequestStatusEnum implements ArrayValuable<Integer> { | 18 | public enum MesWmMaterialRequestStatusEnum implements ArrayValuable<Integer> { |
| 17 | 19 | ||
| 18 | - PREPARE(0, "草稿"), | ||
| 19 | - PREPARING(1, "备料中"), | ||
| 20 | - WAITING(2, "待领料"), | ||
| 21 | - FINISHED(3, "已完成"), | ||
| 22 | - CANCELED(4, "已取消"); | 20 | + PREPARE(MesOrderStatusConstants.PREPARE, "草稿"), |
| 21 | + PREPARING(MesOrderStatusConstants.APPROVING, "备料中"), | ||
| 22 | + WAITING(MesOrderStatusConstants.APPROVED, "待领料"), | ||
| 23 | + FINISHED(MesOrderStatusConstants.FINISHED, "已完成"), | ||
| 24 | + CANCELED(MesOrderStatusConstants.CANCELLED, "已取消"); | ||
| 23 | 25 | ||
| 24 | public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesWmMaterialRequestStatusEnum::getStatus).toArray(Integer[]::new); | 26 | public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesWmMaterialRequestStatusEnum::getStatus).toArray(Integer[]::new); |
| 25 | 27 |