浏览代码

修改检修计划实体

tl 8 月之前
父节点
当前提交
96bc373248

+ 1 - 1
cpp-admin/src/main/java/com/cpp/web/controller/overhaulPlan/OverhaulPlanController.java

@@ -77,7 +77,7 @@ public class OverhaulPlanController {
     @PostMapping("/updateStatus")
     public R updateStatus(@RequestBody OverhaulPlan overhaulPlan) {
         overhaulPlan.setStatus(2);
-        overhaulPlan.setMcTime(new Date());
+//        overhaulPlan.setMcTime(new Date());
         return R.ok(overhaulPlanService.updateById(overhaulPlan));
     }
 }

+ 3 - 19
cpp-admin/src/main/java/com/cpp/web/domain/overhaulplan/OverhaulPlan.java

@@ -30,7 +30,7 @@ public class OverhaulPlan extends BaseCppEntity {
     private String description;
 
     /**
-     * 描述
+     * 检修名称
      */
     @ApiModelProperty(value = "检修名称")
     private String name;
@@ -56,16 +56,10 @@ public class OverhaulPlan extends BaseCppEntity {
     private BigDecimal overhaulCapacity = new BigDecimal(-99);
 
     /**
-     * 检修个数
-     */
-    @ApiModelProperty(value = "检修台数")
-    private Integer maintenanceQuantity;
-
-    /**
-     *  1 执行中 2 已完成
+     *  1 执行中 2 已废弃
      */
     @ApiModelProperty(value = "状态")
-    private Integer status;
+    private Integer status = 1;
 
     /**
      * 生效时间
@@ -73,15 +67,5 @@ public class OverhaulPlan extends BaseCppEntity {
     @ApiModelProperty(value = "生效时间")
     private Date finalEntryTime;
 
-    /**
-     * 手动完成时间
-     */
-    @ApiModelProperty(value = "手动完成时间")
-    private Date mcTime;
 
-    /**
-     * 是否使用
-     */
-    @ApiModelProperty(value = "是否使用")
-    private boolean isUse;
 }

+ 16 - 4
cpp-admin/src/main/java/com/cpp/web/service/datafactory/impl/ParsingStatusServiceImpl.java

@@ -1,14 +1,14 @@
 package com.cpp.web.service.datafactory.impl;
 
 import cn.hutool.json.JSONUtil;
-import com.cpp.web.domain.alarm.AbnormalAlarm;
 import com.cpp.web.domain.datafactory.BaseParsing;
 import com.cpp.web.domain.datafactory.dto.ParsingResultDto;
 import com.cpp.web.domain.datafactory.enums.FileTypeEnum;
 import com.cpp.web.domain.enums.AlarmEnum;
 import com.cpp.web.domain.enums.DataSourcesEnum;
-import com.cpp.web.service.alarm.AbnormalAlarmService;
+import com.cpp.web.domain.overhaulplan.OverhaulPlan;
 import com.cpp.web.service.datafactory.ParsingInterface;
+import com.cpp.web.service.overhaulplan.OverhaulPlanService;
 import com.cpp.web.utils.LogUtil;
 import com.cpp.web.utils.ParsingFileUtil;
 import lombok.AllArgsConstructor;
@@ -35,7 +35,7 @@ import java.util.List;
 @Transactional
 public class ParsingStatusServiceImpl implements ParsingInterface {
 
-    private final AbnormalAlarmService abnormalAlarmService;
+    private final OverhaulPlanService overhaulPlanService;
 
     @Override
     public boolean save(BaseParsing parsingInfo) {
@@ -108,8 +108,20 @@ public class ParsingStatusServiceImpl implements ParsingInterface {
                     LogUtil.info(DataSourcesEnum.E1, AlarmEnum.E3, LogUtil.format("站端磁盘空间达到 {}%,请关注!", this.hardDiskCapacity), stationCode);
                 }
             }
-            if (this.restrictedPlans != null&&restrictedPlans.size()>0) {
+            if (this.restrictedPlans != null && restrictedPlans.size() > 0) {
+                List<OverhaulPlan> overhaulPlans = new ArrayList<>();
+                for (RestrictedPlan restrictedPlan : restrictedPlans) {
+                    OverhaulPlan overhaulPlan = new OverhaulPlan();
+                    overhaulPlan.setDescription(restrictedPlan.getDescribe());
+                    overhaulPlan.setEndTime(restrictedPlan.getEndTime());
+                    overhaulPlan.setStartTime(restrictedPlan.startTime);
+                    overhaulPlan.setOverhaulCapacity(restrictedPlan.getCapacity());
+                    overhaulPlan.setStationCode(stationCode);
+                    overhaulPlan.setName(restrictedPlan.getPlanName());
+                    overhaulPlans.add(overhaulPlan);
+                }
 
+                overhaulPlanService.saveBatch(overhaulPlans);
             }
 
         }