Commit d843c5d0c19f55df0fc18ab98f65d93f16ac1b99
1 parent
84965cff
feat(mes): 调整设备状态枚举为停机/生产中/维护中,SaveReqVO 增加点检保养时间
1. MesDvMachineryStatusEnum 枚举值从 RUNNING/STOP/FAULT 改为 STOP(1,停机)/PRODUCING(2,生产中)/MAINTENANCE(3,维护中) 2. MesDvMachinerySaveReqVO 新增 lastMaintenTime、lastCheckTime 字段,支持新增/修改时保存点检保养时间
Showing
5 changed files
with
16 additions
and
6 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/machinery/MesDvMachineryController.java
| @@ -84,9 +84,7 @@ public class MesDvMachineryController { | @@ -84,9 +84,7 @@ public class MesDvMachineryController { | ||
| 84 | if (machinery == null) { | 84 | if (machinery == null) { |
| 85 | return success(null); | 85 | return success(null); |
| 86 | } | 86 | } |
| 87 | - // 复用 buildMachineryRespVOList 拼接设备类型名称和车间名称 | ||
| 88 | - List<MesDvMachineryRespVO> list = buildMachineryRespVOList(Collections.singletonList(machinery)); | ||
| 89 | - return success(list.get(0)); | 87 | + return success(buildMachineryRespVOList(Collections.singletonList(machinery)).get(0)); |
| 90 | } | 88 | } |
| 91 | 89 | ||
| 92 | @GetMapping("/page") | 90 | @GetMapping("/page") |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/machinery/vo/MesDvMachinerySaveReqVO.java
| @@ -5,6 +5,8 @@ import jakarta.validation.constraints.NotEmpty; | @@ -5,6 +5,8 @@ import jakarta.validation.constraints.NotEmpty; | ||
| 5 | import jakarta.validation.constraints.NotNull; | 5 | import jakarta.validation.constraints.NotNull; |
| 6 | import lombok.Data; | 6 | import lombok.Data; |
| 7 | 7 | ||
| 8 | +import java.time.LocalDateTime; | ||
| 9 | + | ||
| 8 | @Schema(description = "管理后台 - MES 设备台账新增/修改 Request VO") | 10 | @Schema(description = "管理后台 - MES 设备台账新增/修改 Request VO") |
| 9 | @Data | 11 | @Data |
| 10 | public class MesDvMachinerySaveReqVO { | 12 | public class MesDvMachinerySaveReqVO { |
| @@ -38,6 +40,12 @@ public class MesDvMachinerySaveReqVO { | @@ -38,6 +40,12 @@ public class MesDvMachinerySaveReqVO { | ||
| 38 | @NotNull(message = "设备状态不能为空") | 40 | @NotNull(message = "设备状态不能为空") |
| 39 | private Integer status; | 41 | private Integer status; |
| 40 | 42 | ||
| 43 | + @Schema(description = "最近保养时间") | ||
| 44 | + private LocalDateTime lastMaintenTime; | ||
| 45 | + | ||
| 46 | + @Schema(description = "最近点检时间") | ||
| 47 | + private LocalDateTime lastCheckTime; | ||
| 48 | + | ||
| 41 | @Schema(description = "备注", example = "备注") | 49 | @Schema(description = "备注", example = "备注") |
| 42 | private String remark; | 50 | private String remark; |
| 43 | 51 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/DictTypeConstants.java
| @@ -17,5 +17,7 @@ public interface DictTypeConstants { | @@ -17,5 +17,7 @@ public interface DictTypeConstants { | ||
| 17 | String MES_CAL_CALENDAR_TYPE = "mes_cal_calendar_type"; // MES 班组类型 | 17 | String MES_CAL_CALENDAR_TYPE = "mes_cal_calendar_type"; // MES 班组类型 |
| 18 | String MES_CAL_PLAN_STATUS = "mes_cal_plan_status"; // MES 排班计划状态 | 18 | String MES_CAL_PLAN_STATUS = "mes_cal_plan_status"; // MES 排班计划状态 |
| 19 | String MES_DV_MACHINERY_STATUS = "mes_dv_machinery_status"; // MES 设备状态 | 19 | String MES_DV_MACHINERY_STATUS = "mes_dv_machinery_status"; // MES 设备状态 |
| 20 | + String MES_INDEX_TYPE = "mes_index_type"; // MES 检测项类型 | ||
| 21 | + String MES_DEFECT_LEVEL = "mes_defect_level"; // MES 缺陷等级 | ||
| 20 | 22 | ||
| 21 | } | 23 | } |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/ErrorCodeConstants.java
| @@ -152,6 +152,8 @@ public interface ErrorCodeConstants { | @@ -152,6 +152,8 @@ public interface ErrorCodeConstants { | ||
| 152 | 152 | ||
| 153 | // ========== MES 质量管理-缺陷类型(1-040-602-000) ========== | 153 | // ========== MES 质量管理-缺陷类型(1-040-602-000) ========== |
| 154 | ErrorCode QC_DEFECT_NOT_EXISTS = new ErrorCode(1_040_602_000, "缺陷类型不存在"); | 154 | ErrorCode QC_DEFECT_NOT_EXISTS = new ErrorCode(1_040_602_000, "缺陷类型不存在"); |
| 155 | + ErrorCode QC_DEFECT_CODE_DUPLICATE = new ErrorCode(1_040_602_001, "缺陷类型编码已存在"); | ||
| 156 | + ErrorCode QC_DEFECT_NAME_DUPLICATE = new ErrorCode(1_040_602_002, "缺陷类型名称已存在"); | ||
| 155 | 157 | ||
| 156 | // ========== MES 仓库管理-仓库(1-040-700-000) ========== | 158 | // ========== MES 仓库管理-仓库(1-040-700-000) ========== |
| 157 | ErrorCode WM_WAREHOUSE_NOT_EXISTS = new ErrorCode(1_040_700_000, "仓库不存在"); | 159 | ErrorCode WM_WAREHOUSE_NOT_EXISTS = new ErrorCode(1_040_700_000, "仓库不存在"); |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/dv/MesDvMachineryStatusEnum.java
| @@ -15,9 +15,9 @@ import java.util.Arrays; | @@ -15,9 +15,9 @@ import java.util.Arrays; | ||
| 15 | @AllArgsConstructor | 15 | @AllArgsConstructor |
| 16 | public enum MesDvMachineryStatusEnum implements ArrayValuable<Integer> { | 16 | public enum MesDvMachineryStatusEnum implements ArrayValuable<Integer> { |
| 17 | 17 | ||
| 18 | - RUNNING(1, "运行中"), | ||
| 19 | - STOP(2, "停机"), | ||
| 20 | - FAULT(3, "故障"); | 18 | + STOP(1, "停机"), |
| 19 | + PRODUCING(2, "生产中"), | ||
| 20 | + MAINTENANCE(3, "维护中"); | ||
| 21 | 21 | ||
| 22 | public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesDvMachineryStatusEnum::getStatus).toArray(Integer[]::new); | 22 | public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesDvMachineryStatusEnum::getStatus).toArray(Integer[]::new); |
| 23 | 23 |