Commit c7c296371f96ab9e513437422246c128f4984d62
1 parent
90ca6e4a
feat(mes-dv): 新增 MesDvMachineryStatusEnum 设备状态枚举
新增 RUNNING(运行中)/STOP(停机)/FAULT(故障) 三个状态枚举值, 并在 MesDvMachineryDO 的 status 字段上添加 @link 引用。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Showing
2 changed files
with
39 additions
and
2 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/dv/machinery/MesDvMachineryDO.java
| ... | ... | @@ -56,11 +56,10 @@ public class MesDvMachineryDO extends BaseDO { |
| 56 | 56 | * 关联 {@link cn.iocoder.yudao.module.mes.dal.dataobject.md.workstation.MesMdWorkshopDO#getId()} |
| 57 | 57 | */ |
| 58 | 58 | private Long workshopId; |
| 59 | - // TODO @AI:搞个枚举类,然后 @下; | |
| 60 | 59 | /** |
| 61 | 60 | * 设备状态 |
| 62 | 61 | * |
| 63 | - * 字典 mes_dv_machinery_status | |
| 62 | + * 枚举 {@link cn.iocoder.yudao.module.mes.enums.dv.MesDvMachineryStatusEnum} | |
| 64 | 63 | */ |
| 65 | 64 | private Integer status; |
| 66 | 65 | /** | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvMachineryStatusEnum.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.enums.dv; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.core.ArrayValuable; | |
| 4 | +import lombok.AllArgsConstructor; | |
| 5 | +import lombok.Getter; | |
| 6 | + | |
| 7 | +import java.util.Arrays; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * MES 设备状态枚举 | |
| 11 | + * | |
| 12 | + * @author 芋道源码 | |
| 13 | + */ | |
| 14 | +@Getter | |
| 15 | +@AllArgsConstructor | |
| 16 | +public enum MesDvMachineryStatusEnum implements ArrayValuable<Integer> { | |
| 17 | + | |
| 18 | + RUNNING(1, "运行中"), | |
| 19 | + STOP(2, "停机"), | |
| 20 | + FAULT(3, "故障"); | |
| 21 | + | |
| 22 | + public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesDvMachineryStatusEnum::getStatus).toArray(Integer[]::new); | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 状态值 | |
| 26 | + */ | |
| 27 | + private final Integer status; | |
| 28 | + /** | |
| 29 | + * 状态名 | |
| 30 | + */ | |
| 31 | + private final String name; | |
| 32 | + | |
| 33 | + @Override | |
| 34 | + public Integer[] array() { | |
| 35 | + return ARRAYS; | |
| 36 | + } | |
| 37 | + | |
| 38 | +} | ... | ... |