Browse Source

✨ feat(mes): 新增计划编码、开始时间、结束日期及频率信息字段

YunaiV 2 months ago
parent
commit
4da4ddc142

+ 3 - 1
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/checkrecord/MesDvCheckRecordController.java

@@ -138,7 +138,9 @@ public class MesDvCheckRecordController {
         // 2. 拼接 VO
         return BeanUtils.toBean(list, MesDvCheckRecordRespVO.class, vo -> {
             MapUtils.findAndThen(planMap, vo.getPlanId(),
-                    plan -> vo.setPlanName(plan.getName()));
+                    plan -> vo.setPlanName(plan.getName()).setPlanCode(plan.getCode())
+                            .setPlanStartDate(plan.getStartDate()).setPlanEndDate(plan.getEndDate())
+                            .setPlanCycleType(plan.getCycleType()).setPlanCycleCount(plan.getCycleCount()));
             MapUtils.findAndThen(machineryMap, vo.getMachineryId(), machinery -> vo
                     .setMachineryCode(machinery.getCode()).setMachineryName(machinery.getName())
                     .setMachineryBrand(machinery.getBrand()).setMachinerySpec(machinery.getSpec()));

+ 21 - 0
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/checkrecord/vo/MesDvCheckRecordRespVO.java

@@ -26,6 +26,27 @@ public class MesDvCheckRecordRespVO {
     @ExcelProperty("计划名称")
     private String planName;
 
+    @Schema(description = "计划编码", example = "P001")
+    @ExcelProperty("计划编码")
+    private String planCode;
+
+    @Schema(description = "开始时间")
+    @ExcelProperty("开始时间")
+    private LocalDateTime planStartDate;
+
+    @Schema(description = "结束日期")
+    @ExcelProperty("结束日期")
+    private LocalDateTime planEndDate;
+
+    @Schema(description = "频率类型", example = "1")
+    @ExcelProperty(value = "频率类型", converter = DictConvert.class)
+    @DictFormat(DictTypeConstants.MES_DV_CYCLE_TYPE)
+    private Integer planCycleType;
+
+    @Schema(description = "频率数量", example = "5")
+    @ExcelProperty(value = "频率数量")
+    private Integer planCycleCount;
+
     @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
     private Long machineryId;
 

+ 6 - 1
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/maintenrecord/MesDvMaintenRecordController.java

@@ -138,7 +138,12 @@ public class MesDvMaintenRecordController {
         // 2. 拼接 VO
         return BeanUtils.toBean(list, MesDvMaintenRecordRespVO.class, vo -> {
             MapUtils.findAndThen(planMap, vo.getPlanId(),
-                    plan -> vo.setPlanName(plan.getName()));
+                    plan -> vo.setPlanName(plan.getName())
+                            .setPlanCode(plan.getCode())
+                            .setPlanStartDate(plan.getStartDate())
+                            .setPlanEndDate(plan.getEndDate())
+                            .setPlanCycleType(plan.getCycleType())
+                            .setPlanCycleCount(plan.getCycleCount()));
             MapUtils.findAndThen(machineryMap, vo.getMachineryId(), machinery -> vo
                     .setMachineryCode(machinery.getCode()).setMachineryName(machinery.getName())
                     .setMachineryBrand(machinery.getBrand()).setMachinerySpec(machinery.getSpec()));

+ 21 - 0
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/maintenrecord/vo/MesDvMaintenRecordRespVO.java

@@ -26,6 +26,27 @@ public class MesDvMaintenRecordRespVO {
     @ExcelProperty("计划名称")
     private String planName;
 
+    @Schema(description = "计划编码", example = "P001")
+    @ExcelProperty("计划编码")
+    private String planCode;
+
+    @Schema(description = "开始时间")
+    @ExcelProperty("开始时间")
+    private LocalDateTime planStartDate;
+
+    @Schema(description = "结束日期")
+    @ExcelProperty("结束日期")
+    private LocalDateTime planEndDate;
+
+    @Schema(description = "频率类型", example = "1")
+    @ExcelProperty(value = "频率类型", converter = DictConvert.class)
+    @DictFormat(DictTypeConstants.MES_DV_CYCLE_TYPE)
+    private Integer planCycleType;
+
+    @Schema(description = "频率数量", example = "5")
+    @ExcelProperty(value = "频率数量")
+    private Integer planCycleCount;
+
     @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
     private Long machineryId;