Parcourir la source

检修计划去掉新增功能,上报数据查询增加根据参数判断是否统计调控短期、超短期,预测发电量展示名称修改

fanxiaoyu il y a 8 mois
Parent
commit
5f4379ec9e

+ 14 - 4
cpp-admin/src/main/java/com/cpp/web/controller/reportData/ReportDataController.java

@@ -1,6 +1,7 @@
 package com.cpp.web.controller.reportData;
 
 import com.cpp.common.core.domain.R;
+import com.cpp.system.service.ISysConfigService;
 import com.cpp.web.domain.datafactory.ParsingLog;
 import com.cpp.web.domain.datafactory.enums.FileTypeEnum;
 import com.cpp.web.domain.enums.DataSourcesEnum;
@@ -29,6 +30,8 @@ public class ReportDataController {
 
     private final ReportDataService reportDataService;
 
+    private final ISysConfigService iSysConfigService;
+
     private static final SimpleDateFormat TIMESTAMP_FORMAT = new SimpleDateFormat("yyyyMMddHHmm");
 
 
@@ -114,9 +117,9 @@ public class ReportDataController {
 
     public List<ParsingLog> getAllFileName(String fileType, Long startTime, Long endTime, String stationCode) {
         List<ParsingLog> resultList = new ArrayList<>();
-
+        String rCdqKey = iSysConfigService.selectConfigByKey("sync_regulation");
         // 获取应上报文件名
-        List<String> shouldFileName = reportDataService.shouldFileName(fileType, startTime, endTime, stationCode);
+        List<String> shouldFileName = reportDataService.shouldFileName(fileType, startTime, endTime, stationCode,rCdqKey);
         List<ParsingLog> parsingLogList = parsingLogService.findByTimeBetweenAndFileTypeAndStationCode(new Date(startTime), new Date(endTime), fileType, stationCode);
         if (parsingLogList.size() > 0) {
             resultList.addAll(parsingLogList);
@@ -128,9 +131,16 @@ public class ReportDataController {
                     if ("rdq".equals(fileType) || "dq".equals(fileType) || "nwp".equals(fileType)) {
                         parsingLogs.setFileName("sign_" + s + "_0000_" + fileType.toUpperCase() + ".WPD");
                     }
-                    if ("rcdq".equals(fileType) || "cdq".equals(fileType) || "status".equals(fileType) || "nbq".equals(fileType) || "qxz".equals(fileType) || "rp".equals(fileType) || "fj".equals(fileType) || "cft".equals(fileType)) {
-                        parsingLogs.setFileName("sign_" + s + "_" + fileType.toUpperCase() + ".WPD");
+                    if (!rCdqKey.equals("true")){
+                        if ("rcdq".equals(fileType) || "cdq".equals(fileType) || "status".equals(fileType) || "nbq".equals(fileType) || "qxz".equals(fileType) || "rp".equals(fileType) || "fj".equals(fileType) || "cft".equals(fileType)) {
+                            parsingLogs.setFileName("sign_" + s + "_" + fileType.toUpperCase() + ".WPD");
+                        }
+                    }else {
+                        if ("cdq".equals(fileType) || "status".equals(fileType) || "nbq".equals(fileType) || "qxz".equals(fileType) || "rp".equals(fileType) || "fj".equals(fileType) || "cft".equals(fileType)) {
+                            parsingLogs.setFileName("sign_" + s + "_" + fileType.toUpperCase() + ".WPD");
+                        }
                     }
+
                     parsingLogs.setFileType(FileTypeEnum.valueOf(fileType));
                     parsingLogs.setParsingFileStatus("失败");
                     parsingLogs.setStationCode(stationCode);

+ 2 - 7
cpp-admin/src/main/java/com/cpp/web/domain/overhaulplan/OverhaulPlanRecords.java

@@ -7,10 +7,8 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
 
-import javax.validation.constraints.Digits;
-import java.math.BigDecimal;
-import java.util.Date;
 
 /**
  * cpp_overhaul_plan_records
@@ -22,6 +20,7 @@ import java.util.Date;
 @TableName("cpp_overhaul_plan_records")
 @EqualsAndHashCode(callSuper = true)
 @ApiModel(value = "cpp_overhaul_plan_records")
+@NoArgsConstructor
 public class OverhaulPlanRecords extends BaseCppEntity {
     /**
      * 检修计划id
@@ -57,8 +56,4 @@ public class OverhaulPlanRecords extends BaseCppEntity {
         this.details = details;
         super.setStationCode(stationCode);
     }
-
-
-    public OverhaulPlanRecords() {
-    }
 }

+ 15 - 6
cpp-admin/src/main/java/com/cpp/web/service/datafactory/impl/ParsingStatusServiceImpl.java

@@ -1,7 +1,6 @@
 package com.cpp.web.service.datafactory.impl;
 
 import cn.hutool.json.JSONUtil;
-import com.cpp.common.utils.spring.SpringUtils;
 import com.cpp.web.domain.datafactory.BaseParsing;
 import com.cpp.web.domain.datafactory.dto.ParsingResultDto;
 import com.cpp.web.domain.datafactory.enums.FileTypeEnum;
@@ -14,7 +13,6 @@ import com.cpp.web.utils.LogUtil;
 import com.cpp.web.utils.ParsingFileUtil;
 import lombok.AllArgsConstructor;
 import lombok.Data;
-import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -33,10 +31,12 @@ import java.util.List;
  */
 @Service("statusParsing")
 @Slf4j
-@RequiredArgsConstructor
+@AllArgsConstructor
 @Transactional
 public class ParsingStatusServiceImpl implements ParsingInterface {
 
+    private final OverhaulPlanService overhaulPlanService;
+
     @Override
     public boolean save(BaseParsing parsingInfo) {
         return true;
@@ -50,18 +50,21 @@ public class ParsingStatusServiceImpl implements ParsingInterface {
 
     @Override
     public ParsingResultDto parsing(File file, String stationCode) {
+
         ParsingResultDto parsingResultDto = new ParsingResultDto();
         parsingResultDto.setFileName(file.getName());
         parsingResultDto.setFileType(FileTypeEnum.status.name());
         try {
+
             String json = ParsingFileUtil.getStr(file);
             StationStatusDto stationStatusDto = JSONUtil.parse(json).toBean(StationStatusDto.class);
             stationStatusDto.generateAbnormalAlarm(stationCode);
-            log.info("[" + stationCode + "]解析状态文件:{} 成功! O(∩_∩)O", file.getName());
+
+            log.info("解析RP文件:{} 成功! O(∩_∩)O", file.getName());
             parsingResultDto.setStatus("success");
         } catch (Exception e) {
             parsingResultDto.setMessage("解析站端状态数据失败!");
-            log.error("[" + stationCode + "]解析站端状态数据失败! /(ㄒoㄒ)/~~,fileName:{}", file.getName(), e);
+            log.error("解析站端状态数据失败! /(ㄒoㄒ)/~~", e);
         } finally {
             return parsingResultDto;
         }
@@ -86,16 +89,20 @@ public class ParsingStatusServiceImpl implements ParsingInterface {
          * @return
          */
         private void generateAbnormalAlarm(String stationCode) {
+
             if (this.channelErrors != null) {
                 for (ChannelError channelError : this.channelErrors) {
                     LogUtil.info(DataSourcesEnum.E1, AlarmEnum.E1, channelError.getMsg(), stationCode);
                 }
             }
+
+
             if (this.uploadFiles != null) {
                 for (UploadFile uploadFile : this.uploadFiles) {
                     LogUtil.info(DataSourcesEnum.E1, AlarmEnum.E2, LogUtil.format("站端[{}]类型文件:【{}】未上报!", uploadFile.getType(), uploadFile.getName()), stationCode);
                 }
             }
+
             if (this.hardDiskCapacity != null) {
                 if (this.hardDiskCapacity.compareTo(new BigDecimal(95)) > -1) {
                     LogUtil.info(DataSourcesEnum.E1, AlarmEnum.E3, LogUtil.format("站端磁盘空间达到 {}%,请关注!", this.hardDiskCapacity), stationCode);
@@ -113,8 +120,10 @@ public class ParsingStatusServiceImpl implements ParsingInterface {
                     overhaulPlan.setName(restrictedPlan.getPlanName());
                     overhaulPlans.add(overhaulPlan);
                 }
-                SpringUtils.getBean(OverhaulPlanService.class).saveBatch(overhaulPlans);
+
+                overhaulPlanService.saveBatch(overhaulPlans);
             }
+
         }
     }
 

+ 2 - 4
cpp-admin/src/main/java/com/cpp/web/service/overhaulplan/OverhaulPlanRecordsService.java

@@ -2,7 +2,6 @@ package com.cpp.web.service.overhaulplan;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.cpp.web.domain.overhaulplan.OverhaulPlan;
 import com.cpp.web.domain.overhaulplan.OverhaulPlanRecords;
 
 import java.util.Date;
@@ -18,10 +17,9 @@ public interface OverhaulPlanRecordsService extends IService<OverhaulPlanRecords
 
     QueryWrapper<OverhaulPlanRecords> getByStationCode(String stationCode);
 
-    OverhaulPlanRecords findByStationCodeAndForecastModel(String stationCode, String forecastModel, Date startTime,Date endTime);
 
-    List<OverhaulPlanRecords> findByOpId(Long opId);
+    List findByOpId(Long opId);
 
-    List<OverhaulPlanRecords> findByStationCodeAndCreatTimeBetween(String stationCode,Date startTime,Date endTime);
+    List findByStationCodeAndCreatTimeBetween(String stationCode,Date startTime,Date endTime);
 
 }

+ 7 - 0
cpp-admin/src/main/java/com/cpp/web/service/overhaulplan/OverhaulPlanService.java

@@ -27,4 +27,11 @@ public interface OverhaulPlanService extends IService<OverhaulPlan> {
 
     List getCorrectionData(List<BaseForecastCloudEntity> list, String fileType, String fileName, String stationCode);
 
+    void save(String stationCode,List<OverhaulPlan> overhaulPlanList);
+
+    List<OverhaulPlan> findById(Long id);
+
+
+    List<OverhaulPlan> findByAllId(List<Long> id);
+
 }

+ 68 - 28
cpp-admin/src/main/java/com/cpp/web/service/overhaulplan/impl/OverhaulPlanRecordsServiceImpl.java

@@ -2,14 +2,24 @@ package com.cpp.web.service.overhaulplan.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cpp.common.utils.spring.SpringUtils;
+import com.cpp.web.domain.BaseForecastEntity;
+import com.cpp.web.domain.datafactory.enums.FileTypeEnum;
+import com.cpp.web.domain.overhaulplan.OverhaulPlan;
 import com.cpp.web.domain.overhaulplan.OverhaulPlanRecords;
 import com.cpp.web.mapper.overhaulplan.OverhaulPlanRecordsMapper;
 import com.cpp.web.service.overhaulplan.OverhaulPlanRecordsService;
+import com.cpp.web.service.overhaulplan.OverhaulPlanService;
+import lombok.Data;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * cpp_overhaul_plan_records
@@ -22,6 +32,7 @@ import java.util.List;
 public class OverhaulPlanRecordsServiceImpl extends ServiceImpl<OverhaulPlanRecordsMapper, OverhaulPlanRecords> implements OverhaulPlanRecordsService {
 
     private final OverhaulPlanRecordsMapper overhaulPlanRecordsMapper;
+
     @Override
     public QueryWrapper<OverhaulPlanRecords> getByStationCode(String stationCode) {
         QueryWrapper<OverhaulPlanRecords> wrapper = new QueryWrapper<>();
@@ -32,42 +43,71 @@ public class OverhaulPlanRecordsServiceImpl extends ServiceImpl<OverhaulPlanReco
     }
 
     @Override
-    public OverhaulPlanRecords findByStationCodeAndForecastModel(String stationCode, String forecastModel, Date startTime, Date endTime) {
-        QueryWrapper wrapper = new QueryWrapper<>();
-        if (null != stationCode && !"".equals(stationCode)){
-            wrapper.eq("station_code",stationCode);
-        }
-        if (null != forecastModel && !"".equals(forecastModel)){
-            wrapper.eq("forecast_model",forecastModel);
-        }
-        if (null != startTime){
-            wrapper.eq("start_time",startTime);
-        }
-        if (null != endTime){
-            wrapper.eq("end_time",endTime);
+    public List<PlanAndRecordDto> findByOpId(Long opId) {
+        QueryWrapper<OverhaulPlanRecords> wrapper = new QueryWrapper<>();
+        if (null != opId) {
+            wrapper.eq("op_id", opId);
         }
-        OverhaulPlanRecords overhaulPlanRecords = overhaulPlanRecordsMapper.selectOne(wrapper);
-        return overhaulPlanRecords;
+        List<OverhaulPlan> overhaulPlanList = SpringUtils.getBean(OverhaulPlanService.class).findById(opId);
+
+        List<OverhaulPlanRecords> overhaulPlanRecordsList = list(wrapper);
+
+        return needList(overhaulPlanList, overhaulPlanRecordsList);
     }
 
     @Override
-    public List<OverhaulPlanRecords> findByOpId(Long opId) {
+    public List<PlanAndRecordDto> findByStationCodeAndCreatTimeBetween(String stationCode, Date startTime, Date endTime) {
         QueryWrapper<OverhaulPlanRecords> wrapper = new QueryWrapper<>();
-        if (null != opId){
-            wrapper.eq("op_id",opId);
+        if (null != stationCode && !"".equals(stationCode)) {
+            wrapper.eq("station_code", stationCode);
+        }
+        if (null != startTime && !"".equals(startTime) && null != endTime && !"".equals(endTime)) {
+            wrapper.between("create_time", startTime, endTime);
         }
-        return overhaulPlanRecordsMapper.selectList(wrapper);
+        List<OverhaulPlanRecords> overhaulPlanRecordsList = list(wrapper);
+        List<Long> list = overhaulPlanRecordsList.stream().map(OverhaulPlanRecords::getOpId).collect(Collectors.toList());
+
+        List<OverhaulPlan> overhaulPlanList = SpringUtils.getBean(OverhaulPlanService.class).findByAllId(list);
+
+        return needList(overhaulPlanList, list(wrapper));
     }
 
-    @Override
-    public List<OverhaulPlanRecords> findByStationCodeAndCreatTimeBetween(String stationCode, Date startTime, Date endTime) {
-        QueryWrapper<OverhaulPlanRecords> wrapper = new QueryWrapper<>();
-        if (null != stationCode && !"".equals(stationCode)){
-            wrapper.eq("station_code",stationCode);
-        }
-        if (null != startTime && !"".equals(startTime) && null != endTime && !"".equals(endTime)){
-            wrapper.between("create_time",startTime,endTime);
+
+    @Data
+    public class PlanAndRecordDto {
+
+        private BigDecimal overPlanCapacity;
+
+        private String name;
+
+        private String stationCode;
+
+        private String forecastModel;
+
+        private FileTypeEnum forecastType;
+
+        private String details;
+
+        private Date createTime;
+    }
+
+    public List<PlanAndRecordDto> needList(List<OverhaulPlan> overhaulPlanList, List<OverhaulPlanRecords> overhaulPlanRecordsList) {
+        List<PlanAndRecordDto> planAndRecordDtos = new ArrayList<>();
+        for (OverhaulPlanRecords overhaulPlanRecords : overhaulPlanRecordsList) {
+            PlanAndRecordDto planAndRecordDto = new PlanAndRecordDto();
+            planAndRecordDto.setStationCode(overhaulPlanRecords.getStationCode());
+            planAndRecordDto.setForecastModel(overhaulPlanRecords.getForecastModel());
+            planAndRecordDto.setForecastType(overhaulPlanRecords.getForecastType());
+            planAndRecordDto.setDetails(overhaulPlanRecords.getDetails());
+            planAndRecordDto.setCreateTime(overhaulPlanRecords.getCreateTime());
+            for (OverhaulPlan overhaulPlan : overhaulPlanList) {
+                if (overhaulPlan.getId() == overhaulPlanRecords.getOpId()) {
+                    planAndRecordDto.setName(overhaulPlan.getName());
+                    planAndRecordDto.setOverPlanCapacity(overhaulPlan.getOverhaulCapacity());
+                }
+            }
+            planAndRecordDtos.add(planAndRecordDto);
         }
-        return list(wrapper);
+        return planAndRecordDtos;
     }
 }

+ 62 - 2
cpp-admin/src/main/java/com/cpp/web/service/overhaulplan/impl/OverhaulPlanServiceImpl.java

@@ -153,7 +153,7 @@ public class OverhaulPlanServiceImpl extends ServiceImpl<OverhaulPlanMapper, Ove
                     baseForecastEntity.setCapacity(capacity);
                     baseForecastEntity.setOpenCapacity(capacity.subtract(planDto.getOverhaulPlan().getOverhaulCapacity()));
                     baseForecastEntity.setFpValue(baseForecastEntity.getFpValue().subtract(baseForecastEntity.getFpValue().multiply(planDto.getRadio())));
-                }else {
+                } else {
                     baseForecastEntity.setOpenCapacity(capacity);
                     baseForecastEntity.setCapacity(capacity);
 
@@ -165,6 +165,65 @@ public class OverhaulPlanServiceImpl extends ServiceImpl<OverhaulPlanMapper, Ove
     }
 
 
+    /**
+     *  保存
+     * @param stationCode
+     * @param overhaulPlanList
+     */
+    @Override
+    public void save(String stationCode, List<OverhaulPlan> overhaulPlanList) {
+
+        List<OverhaulPlan> useOverPlanList = getUsePlan(stationCode);
+        // 将执行中的检修计划置为废弃
+        useOverPlanList.forEach(plan -> plan.setStatus(2));
+        saveOrUpdateBatch(useOverPlanList);
+        saveBatch(overhaulPlanList);
+    }
+
+    @Override
+    public List<OverhaulPlan> findById(Long id) {
+        QueryWrapper<OverhaulPlan> wrapper = new QueryWrapper<>();
+        if (null != id && !"".equals(id)){
+            wrapper.eq("id",id);
+        }
+        return list(wrapper);
+    }
+
+
+    @Override
+    public List<OverhaulPlan> findByAllId(List<Long> idList) {
+        List<OverhaulPlan> overhaulPlanList = new ArrayList<>();
+
+        QueryWrapper<OverhaulPlan> wrapper = new QueryWrapper<>();
+        for (Long l : idList) {
+            if (null != l && !"".equals(l)){
+                wrapper.eq("id",l);
+            }
+            overhaulPlanList.add(overhaulPlanMapper.selectOne(wrapper));
+        }
+
+        return overhaulPlanList;
+    }
+
+
+    /**
+     *  获取使用中的检修计划
+     * @param stationCode
+     * @return
+     */
+    public List<OverhaulPlan> getUsePlan(String stationCode) {
+
+        QueryWrapper<OverhaulPlan> wrapper = new QueryWrapper<>();
+
+        if (!"".equals(stationCode) && null != stationCode) {
+            wrapper.eq("station_code", stationCode);
+            wrapper.eq("status", 1);
+            wrapper.le("end_time", new Date());
+        }
+        return list(wrapper);
+    }
+
+
     @Data
     public class PlanDto {
         private Date startTime;
@@ -178,11 +237,12 @@ public class OverhaulPlanServiceImpl extends ServiceImpl<OverhaulPlanMapper, Ove
             }
             return false;
         }
+
         public PlanDto(Date startTime, Date endTime, OverhaulPlan overhaulPlan, BigDecimal capacity) {
             this.startTime = startTime;
             this.endTime = endTime;
             this.overhaulPlan = overhaulPlan;
-            this.radio = BigDecimal.ONE.subtract(overhaulPlan.getOverhaulCapacity().divide(capacity,2, RoundingMode.HALF_UP));
+            this.radio = BigDecimal.ONE.subtract(overhaulPlan.getOverhaulCapacity().divide(capacity, 2, RoundingMode.HALF_UP));
         }
     }
 

+ 1 - 1
cpp-admin/src/main/java/com/cpp/web/service/reprtdata/ReportDataService.java

@@ -8,5 +8,5 @@ public interface ReportDataService {
     int shouldFileNum(String fileType,Long startTime,Long endTime,String stationCode);
 
 
-    List<String> shouldFileName(String fileType,Long startTime,Long endTime,String stationCode);
+    List<String> shouldFileName(String fileType,Long startTime,Long endTime,String stationCode,String key);
 }

+ 21 - 10
cpp-admin/src/main/java/com/cpp/web/service/reprtdata/impl/ReportDataServiceImpl.java

@@ -1,5 +1,6 @@
 package com.cpp.web.service.reprtdata.impl;
 
+import com.cpp.system.service.ISysConfigService;
 import com.cpp.web.service.reprtdata.ReportDataService;
 import com.cpp.web.utils.DateTimeUtil;
 import lombok.RequiredArgsConstructor;
@@ -20,8 +21,6 @@ import java.util.List;
 @RequiredArgsConstructor
 @Slf4j
 public class ReportDataServiceImpl implements ReportDataService {
-
-
     // 当前文件类型应上报文件个数
     @Override
     public int shouldFileNum(String fileType, Long startTime, Long endTime, String stationCode) {
@@ -37,18 +36,30 @@ public class ReportDataServiceImpl implements ReportDataService {
     }
 
     @Override
-    public List<String> shouldFileName(String fileType, Long startTime, Long endTime, String stationCode) {
+    public List<String> shouldFileName(String fileType, Long startTime, Long endTime, String stationCode,String key) {
+
         List<String> list = new ArrayList<>();
         if ("rdq".equals(fileType) || "dq".equals(fileType) || "nwp".equals(fileType)) {
             list = getDatesInRange(startTime + 24 * 60 * 60 * 1000L, endTime + 24 * 60 * 60 * 1000L);
         }
-        if ("rcdq".equals(fileType) || "cdq".equals(fileType) || "status".equals(fileType) || "nbq".equals(fileType) || "qxz".equals(fileType) || "rp".equals(fileType) || "fj".equals(fileType) || "cft".equals(fileType)) {
-            if (new Date(endTime).after(new Date())) {
-                list = getMin(startTime, new Date().getTime(), fileType);
-            } else {
-                list = getMin(startTime, endTime, fileType);
+        if (!key.equals("true")){
+            if ("rcdq".equals(fileType) || "cdq".equals(fileType) || "status".equals(fileType) || "nbq".equals(fileType) || "qxz".equals(fileType) || "rp".equals(fileType) || "fj".equals(fileType) || "cft".equals(fileType)) {
+                if (new Date(endTime).after(new Date())) {
+                    list = getMin(startTime, new Date().getTime(), fileType);
+                } else {
+                    list = getMin(startTime, endTime, fileType);
+                }
+            }
+        }else {
+            if ("cdq".equals(fileType) || "status".equals(fileType) || "nbq".equals(fileType) || "qxz".equals(fileType) || "rp".equals(fileType) || "fj".equals(fileType) || "cft".equals(fileType)) {
+                if (new Date(endTime).after(new Date())) {
+                    list = getMin(startTime, new Date().getTime(), fileType);
+                } else {
+                    list = getMin(startTime, endTime, fileType);
+                }
             }
         }
+
         return list;
     }
 
@@ -87,7 +98,7 @@ public class ReportDataServiceImpl implements ReportDataService {
      */
     public List<String> getMin(Long startTime, Long endTime, String fileType) {
         List<String> list = new ArrayList<>();
-        if ("cdq".equals(fileType)){
+        if ("cdq".equals(fileType)|| "rcdq".equals(fileType)){
             startTime = startTime + 15 * 60 * 1000L;
         }
         LocalDateTime start = LocalDateTime.ofInstant(Instant.ofEpochMilli(startTime), ZoneId.systemDefault());
@@ -96,7 +107,7 @@ public class ReportDataServiceImpl implements ReportDataService {
         LocalDateTime currentTime = start;
         while (!currentTime.isAfter(end)) {
             String formattedTime = currentTime.format(formatter);
-            if ("cdq".equals(fileType) || "rcdq".equals(fileType)) {
+            if ("cdq".equals(fileType) || "rcdq".equals(fileType)|| "status".equals(fileType)) {
                 currentTime = currentTime.plusMinutes(15);
             } else {
                 currentTime = currentTime.plusMinutes(5);

+ 58 - 299
cpp-ui/src/views/maintenancerelated/overhaulplan/index.vue

@@ -33,19 +33,6 @@
         </el-button>
       </el-form-item>
     </el-form>
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-        >新增
-        </el-button>
-      </el-col>
-    </el-row>
-
     <div style="padding-top: 10px">
       <vxe-table
         ref="xTable"
@@ -65,10 +52,7 @@
         <vxe-table-column field="startTime" :formatter="formatDateTime" title="开始时间"></vxe-table-column>
         <vxe-table-column field="endTime" :formatter="formatDateTime" title="结束时间"></vxe-table-column>
         <vxe-table-column field="overhaulCapacity" title="检修容量(MW)"></vxe-table-column>
-        <vxe-table-column field="maintenanceQuantity" title="检修台数"></vxe-table-column>
         <vxe-table-column field="status" title="状态" :formatter="statusFormatter"></vxe-table-column>
-        <vxe-table-column field="isUse" title="是否使用" :formatter="useFormatter"></vxe-table-column>
-        <vxe-table-column field="mcTime" title="手动停止时间" :formatter="formatDateTime"></vxe-table-column>
         <vxe-table-column field="" title="使用详情">
           <template v-slot="{ row }">
             <el-button
@@ -80,19 +64,6 @@
             </el-button>
           </template>
         </vxe-table-column>
-        <vxe-table-column field="" title="操作">
-          <template v-slot="{ row }">
-            <el-button
-              v-if="row.status === 1"
-              style="padding: 3px 4px 3px 4px;margin: 2px; color: red"
-              size="mini"
-              icon="el-icon-error"
-              title="手动停止"
-              type="text"
-              @click="stopOverhaulPlan(row)">废弃
-            </el-button>
-          </template>
-        </vxe-table-column>
       </vxe-table>
       <vxe-pager
         background
@@ -104,113 +75,26 @@
         :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']">
       </vxe-pager>
     </div>
-
-    <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="850px" height="600px" :append-to-body="true">
-      <div class="dark-el-dialog">
-      <el-form ref="form" :model="form" :rules="rules" width="830px" label-width="150px">
-          <el-row class="mb4">
-            <el-col :span="12">
-              <el-form-item label="场站名称">
-                <el-select v-model="form.stationCode" placeholder="请选择" style="width: 255px"
-                           popper-class="cpp-popper">
-                  <el-option
-                    v-for="item in stationList"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="检修名称" prop="name">
-                <el-input style="width: 100%" v-model="form.name" maxlength="50"/>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row class="dark-el-input dark-el-button ">
-            <el-col :span="12">
-              <el-form-item label="开始时间" prop="startTime">
-                <el-date-picker
-                  popper-class="cpp-popper"
-                  v-model="form.startTime"
-                  :clearable="false"
-                  type="datetime"
-                  value-format="timestamp"
-                  placeholder="选择开始日期"
-                  style="width: 255px">
-                </el-date-picker>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="结束时间" prop="startTime">
-                <el-date-picker
-                  popper-class="cpp-popper"
-                  v-model="form.endTime"
-                  :clearable="false"
-                  type="datetime"
-                  value-format="timestamp"
-                  placeholder="选择结束日期"
-                  style="width: 255px">
-                </el-date-picker>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row class="mb4">
-            <el-col :span="12">
-              <el-form-item label="描述" prop="name">
-                <el-input style="width: 100%" v-model="form.description" maxlength="50"/>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="检修容量(MW)" prop="overhaulCapacity">
-                <el-input style="width: 100%" v-model="form.overhaulCapacity" maxlength="50"/>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row class="mb4">
-            <el-col :span="12">
-              <el-form-item label="检修台数" prop="maintenanceQuantity">
-                <el-input style="width: 100%" v-model="form.maintenanceQuantity" maxlength="50"/>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="commitChannel">确 定</el-button>
-          <el-button @click="cancelChannel">取 消</el-button>
-        </div>
-      </div>
-    </el-dialog>
-
     <el-dialog :title="title" :visible.sync="showDetails" :close-on-click-modal="false" width="1000px" height="600px" :append-to-body="true">
       <div class="dark-el-dialog">
-      <vxe-table
-          ref="xTable"
-          align="center"
-          class="mytable-style"
-          auto-resize
+      <el-table
+          element-loading-background="rgba(8, 61, 92,1)"
           border
-          resizable
-          export-config
-          highlight-current-row
-          show-overflow
-          max-height="700"
+          max-height="300px"
+          v-loading="loading"
           :data="tableDataDetails.slice((currentPage-1)*pageSize,currentPage*pageSize)">
-          <vxe-table-column field="stationCode" title="场站名称" :formatter="codeChangeName"></vxe-table-column>
-          <vxe-table-column field="forecastModel" title="预测模型"></vxe-table-column>
-          <vxe-table-column field="forecastType" title="预测类型"></vxe-table-column>
-          <vxe-table-column field="details" title="详情"></vxe-table-column>
-        </vxe-table>
-        <vxe-pager
-          background
-          :loading="loading"
-          :current-page.sync="currentPage"
-          :page-size.sync="pageSize"
-          :total="totalDetails"
-          @page-change="handlePageChangeDetails"
-          :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']">
-        </vxe-pager>
+          <el-table-column prop="stationCode" align="center" label="场站名称" :formatter="codeChangeName"></el-table-column>
+          <el-table-column prop="name" align="center" label="检修名称" ></el-table-column>
+          <el-table-column prop="forecastModel" align="center" label="预测模型"></el-table-column>
+          <el-table-column prop="forecastType" align="center" label="使用数据类型"></el-table-column>
+          <el-table-column prop="createTime" align="center" label="使用时间">
+            <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.createTime) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="details" align="center" label="使用详情"  :show-overflow-tooltip="true" ></el-table-column>
+        </el-table>
+        <pagination v-show="totalDetails>0" :total="totalDetails" :page.sync="currentPage" :limit.sync="pageSize" />
       </div>
     </el-dialog>
     <el-dialog :title="title" :visible.sync="showAll" :close-on-click-modal="false" width="1000px" height="600px" :append-to-body="true">
@@ -234,33 +118,36 @@
             </el-button>
           </el-form-item>
         </el-form>
-        <vxe-table
-          ref="xTable"
-          align="center"
-          class="mytable-style"
-          auto-resize
+        <el-table
+          element-loading-background="rgba(8, 61, 92,1)"
           border
-          resizable
-          export-config
-          highlight-current-row
-          show-overflow
-          max-height="700"
+          max-height="500px"
+          v-loading="loading"
           :data="tableDataRecords.slice((currentPage-1)*pageSize,currentPage*pageSize)">
-          <vxe-table-column field="stationCode" title="场站名称" :formatter="codeChangeName"></vxe-table-column>
-          <vxe-table-column field="forecastModel" title="预测模型"></vxe-table-column>
-          <vxe-table-column field="forecastType" title="预测类型"></vxe-table-column>
-          <vxe-table-column field="details" title="详情"></vxe-table-column>
-          <vxe-table-column field="createTime" title="使用时间"></vxe-table-column>
-        </vxe-table>
-        <vxe-pager
-          background
-          :loading="loading"
-          :current-page.sync="currentPage"
-          :page-size.sync="pageSize"
-          :total="totalRecords"
-          @page-change="handlePageChangeDetails"
-          :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']">
-        </vxe-pager>
+          <el-table-column prop="stationCode" align="center" label="场站名称" :formatter="codeChangeName"></el-table-column>
+          <el-table-column prop="name" align="center" label="检修名称" ></el-table-column>
+          <el-table-column prop="overPlanCapacity" align="center" label="检修容量(MW)" ></el-table-column>
+          <el-table-column prop="forecastModel" align="center" label="预测模型"></el-table-column>
+          <el-table-column prop="forecastType"  align="center" label="使用数据类型"></el-table-column>
+          <el-table-column prop="details"  align="center" label="详情"></el-table-column>
+          <el-table-column prop="createTime" align="center" label="使用时间">
+            <template slot-scope="scope">
+              <span>{{ parseTime(scope.row.createTime) }}</span>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div class="block flex" style="justify-content: end">
+          <el-pagination
+            popper-class="cpp-popper"
+            @size-change="handleSizeChangeRecords"
+            @current-change="handleCurrentChangeRecords"
+            :current-page="currentRecords"
+            :page-size="pageSize"
+            :page-sizes="[10, 15, 30, 50]"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="totalRecords">
+          </el-pagination>
+        </div>
       </div>
     </el-dialog>
 
@@ -269,8 +156,6 @@
 
 
 <script>
-import form from "vxe-table/packages/form";
-
 export default {
   name: 'overhaulPlan',
   data() {
@@ -304,6 +189,7 @@ export default {
       totalRecords: 0,
       pageSize: 10,
       currentPage: 1,
+      currentRecords: 1,
       stationList: [],
       stationCode: '',
       stationName: undefined,
@@ -312,27 +198,7 @@ export default {
       tableDataRecords: [],
       loading: false,
       capacity: null,
-      // 表单校验
-      rules: {
-        name: [
-          {required: true, message: "检修计划名称不能为空!", trigger: "blur"}
-        ],
-        description: [
-          {required: true, message: "描述不能为空!", trigger: "blur"}
-        ],
-        maintenanceQuantity: [
-          {required: true, message: "检修台数不能为空!", trigger: "blur"},
-          {pattern: /^[0-9]*[1-9][0-9]*$/, message: '只能输入正整数数字'}
-        ],
-        overhaulCapacity: [
-          {required: true, message: "检修容量不能为空!", trigger: "blur"},
-          {pattern: /^\d+(\.\d{2})?$/, message: '只能输入正数数字或带两位小数的数字'}
-        ],
-        startTime: [
-          {required: true, message: '开始时间不能为空!'}
-        ],
-      },
-      showAll: false
+      showAll: false,
     }
   },
   created() {
@@ -343,89 +209,19 @@ export default {
   },
   computed: {},
   methods: {
-    // 表单重置
-    reset() {
-      this.form = {
-        stationCode: '',
-        name: '',
-        startTime: '',
-        endTime: '',
-        overhaulCapacity: '',
-        maintenanceQuantity: '',
-        status: 1,
-        isUse: false,
-        mcTime: '',
-      },
-        this.resetForm("form");
-    },
-    // 取消按钮
-    cancelChannel() {
-      this.open = false;
-      this.reset();
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "新增检修计划";
-    },
-    // 提交按钮
-    async commitChannel() {
-      var checkData = []
-      const param = {
-        "stationCode": this.form.stationCode
-      }
-      await this.$axios.get('/electricfield/findCapacityByStationCode', {params: param}).then(response => {
-        this.capacity = response.data.capacity
-      })
-      await this.$axios.get('overhaulplan/stationCode/noPage', {params: param}).then(response => {
-        checkData = response.data
-      })
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.startTime > this.form.endTime) {
-            this.$message.warning('开始时间不能大于结束时间!')
-            return
-          }
-          if (this.form.startTime == null || this.form.endTime == null) {
-            this.$message.warning('开始时间或者结束时间不能为空!')
-            return
-          }
-          if (Number(this.form.overhaulCapacity) > this.capacity) {
-            this.$message.warning('检修容量不能超过装机容量!')
-            return
-          }
-          var timeStartEnd = [this.form.startTime, this.form.endTime]
-          if (this.checkDate(timeStartEnd, checkData, this.form)) {
-            this.$message.warning('该时间段内已有检修计划!')
-            return
-          }
-          // 新增操作
-          this.$axios.post('/overhaulplan/save', this.form).then((res) => {
-            if (res == undefined) {
-              this.$message.success('新增失败')
-            } else {
-              this.$message.success('新增成功')
-              this.overhualStatus = null
-              this.queryByStationCode()
-              this.open = false;
-            }
-          }).catch((error) => {
-          })
-        }
-      });
-    },
     handlePageChange({currentPage, pageSize}) {
       this.currentPage = currentPage
       this.pageSize = pageSize
       this.queryByStationCode();
     },
-    handlePageChangeDetails({currentPage, pageSize}) {
-      this.currentPage = currentPage
-      if (this.pageSize != pageSize) {
-        this.changePageSize(pageSize)
-      }
-      this.pageSize = pageSize
+    handleSizeChangeRecords(val) {
+      this.pageSize = val
+      this.queryRecords()
+    },
+    handleCurrentChangeRecords(val) {
+     this.currentPage = val
+      this.queryRecords()
+
     },
     //日期转换器
     formatDateTime(cellValue) {
@@ -473,52 +269,15 @@ export default {
         this.loading = false
       })
     },
-    checkDate(v1, v2, v4) {
-      let result = false
-      const item = ''
-      // 修改时所需便利集合
-      const v5 = []
-      // 在修改时,把当前在所有信息集合里要修改的信息去掉(如果不去掉会影响校验)
-      for (let i = 0; i < v2.length; i++) {
-        if (v2[i].id == v4.id || v2[i].status == 2) {
-          continue
-        }
-        v5.push(v2[i])
-      }
-
-      for (let i = 0; i < v2.length; i++) {
-        if (v1[0] >= new Date(v2[i].startTime).getTime() && v1[0] <= new Date(v2[i].endTime).getTime()) {
-          result = true
-          break
-        }
-        if (v1[1] >= new Date(v2[i].startTime).getTime() && v1[1] <= new Date(v2[i].endTime).getTime()) {
-          result = true
-          break
-        }
-        if (v1[0] <= new Date(v2[i].startTime).getTime() && v1[1] >= new Date(v2[i].endTime).getTime()) {
-          result = true
-          break
-        }
-        if (v1[0] >= new Date(v2[i].startTime).getTime() && v1[1] <= new Date(v2[i].endTime).getTime()) {
-          result = true
-          break
-        }
-      }
-
-      return result
-    },
-    stopOverhaulPlan(row) {
-      this.$axios.post("/overhaulplan/updateStatus", row).then(response => {
-        this.$message.success('检修计划停用成功!')
-        this.queryByStationCode();
-      })
-    },
     codeChangeName(row) {
       var codeList = this.stationList
       for (let i = 0; i < codeList.length; i++) {
         if (row.cellValue == codeList[i].value) {
           return codeList[i].label
         }
+        if (row.stationCode == codeList[i].value) {
+          return codeList[i].label
+        }
       }
     },
     showRecords(row) {
@@ -545,7 +304,7 @@ export default {
       const param = {
         "stationCode": this.stationCode,
         "startTime": startTime,
-        "endTime": endTime
+        "endTime": endTime,
       }
       this.$axios.get('overhaulPlanRecords/findByStationCodeAndCreatTimeBetween',{params: param}).then(response =>{
         this.tableDataRecords = response.data

+ 8 - 5
cpp-ui/src/views/statistics/predictedPowerGeneration/index.vue

@@ -45,8 +45,8 @@
             :loading="loading"
             :data="tableData">
             <vxe-table-column field="time" title="预测日期"></vxe-table-column>
-            <vxe-table-column field="forecastPowerGenerationZd" title="站端预测"></vxe-table-column>
-            <vxe-table-column field="forecastPowerGenerationYd" title="云端预测"></vxe-table-column>
+            <vxe-table-column field="forecastPowerGenerationZd" title="站端上传"></vxe-table-column>
+            <vxe-table-column field="forecastPowerGenerationYd" title="云端下发"></vxe-table-column>
           </vxe-table>
         </el-col>
         <el-col :span="18">
@@ -141,6 +141,8 @@ export default {
       })
     },
     contrastDraw(times, zd, yd) {
+      this.loading = true
+
       this.contrastChart = echarts.init(document.getElementById('contrastCharts'), "dark", {renderer: 'svg'})
 
       var option = {
@@ -167,7 +169,7 @@ export default {
           itemWidth: 14,
           itemHeight: 5,
           itemGap: 13,
-          data: ['站端预测', '云端预测'],
+          data: ['站端上传', '云端下发'],
           right: '4%',
           textStyle: {
             fontSize: 12,
@@ -207,7 +209,7 @@ export default {
         }],
         series: [
           {
-            name: '站端预测',
+            name: '站端上传',
             type: 'line',
             data: zd,
             lineStyle: {
@@ -224,7 +226,7 @@ export default {
             }
           },
           {
-            name: '云端预测',
+            name: '云端下发',
             type: 'line',
             data: yd,
             lineStyle: {
@@ -245,6 +247,7 @@ export default {
       }
 
       this.contrastChart.setOption(option, true)
+      this.loading = false
       var _this = this
       window.addEventListener("resize", function () {
         _this.contrastChart.resize();

+ 2 - 2
cpp-ui/src/views/statistics/reportData/index.vue

@@ -58,8 +58,8 @@
         <vxe-table-column field="dataSources" title="上报数据源" :formatter="changeDataSource"></vxe-table-column>
         <vxe-table-column field="fileType" title="文件类型" :formatter="changeFileName"></vxe-table-column>
         <vxe-table-column field="fileName" title="文件名称"></vxe-table-column>
-        <vxe-table-column field="parsingTime" title="数据生成时间" :formatter="formatDateTime"></vxe-table-column>
-        <vxe-table-column field="startTime" title="预测时间" :formatter="formatDateTime"></vxe-table-column>
+        <vxe-table-column field="parsingTime" title="上报时间" :formatter="formatDateTime"></vxe-table-column>
+<!--        <vxe-table-column field="startTime" title="预测时间" :formatter="formatDateTime"></vxe-table-column>-->
         <vxe-table-column field="parsingFileStatus" title="文件上报状态"></vxe-table-column>
       </vxe-table>
       <vxe-pager