Bläddra i källkod

检修计划按钮修改,上报数据统计查询(初版)

fanxiaoyu 6 månader sedan
förälder
incheckning
9b5c559657

+ 96 - 0
cpp-admin/src/main/java/com/cpp/web/controller/reportData/ReportDataController.java

@@ -0,0 +1,96 @@
+package com.cpp.web.controller.reportData;
+
+import com.cpp.common.core.domain.R;
+import com.cpp.web.domain.datafactory.ParsingLog;
+import com.cpp.web.domain.datafactory.enums.FileTypeEnum;
+import com.cpp.web.domain.enums.DataSourcesEnum;
+import com.cpp.web.domain.station.ElectricField;
+import com.cpp.web.service.datafactory.ParsingLogService;
+import com.cpp.web.service.reprtdata.ReportDataService;
+import com.cpp.web.service.station.ElectricFieldService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("reportData")
+public class ReportDataController {
+
+    private final ElectricFieldService electricFieldService;
+
+    private final ParsingLogService parsingLogService;
+
+    private final ReportDataService reportDataService;
+
+
+    /**
+     * 获取文件类型
+     *
+     * @return
+     */
+    @GetMapping("/getElectricFieldTypeEnum")
+    public R getFileType(String stationCode) {
+        ElectricField electricField = electricFieldService.findByStationCode(stationCode);
+        return R.ok(electricField.getElectricFieldTypeEnum());
+    }
+
+    /**
+     * 上报数据查询
+     *
+     * @param stationCode
+     * @param fileType
+     * @return
+     */
+    @GetMapping("/getData")
+    public R getData(String stationCode, String fileType, Long startTime, Long endTime) {
+        // 获取应上报文件名
+        List<String> shouldFileName = reportDataService.shouldFileName(fileType, startTime, endTime, stationCode);
+        List<ParsingLog> parsingLogList = parsingLogService.findByTimeBetweenAndFileTypeAndStationCode(new Date(startTime), new Date(endTime), fileType, stationCode);
+        List<ParsingLog> resultList = new ArrayList<>();
+        if (parsingLogList.size() > 0) {
+            resultList.addAll(parsingLogList);
+            for (int i = 0; i < shouldFileName.size(); i++) {
+                int finalI = i;
+                List<ParsingLog> collectList = parsingLogList.stream().filter(f -> f.getFileName().contains(shouldFileName.get(finalI))).collect(Collectors.toList());
+                if (collectList.size() > 0) {
+                    continue;
+                } else {
+                    ParsingLog parsingLogs = new ParsingLog();
+                    parsingLogs.setDataSources(DataSourcesEnum.E1);
+                    if ("dq".equals(fileType) || "nwp".equals(fileType)) {
+                        parsingLogs.setFileName("sign_" + shouldFileName.get(i) + "_0000_" + fileType.toUpperCase() + ".WPD");
+                    }
+                    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_" + shouldFileName.get(i) + "_" + fileType.toUpperCase() + ".WPD");
+                    }
+                    parsingLogs.setFileType(FileTypeEnum.valueOf(fileType));
+                    parsingLogs.setParsingFileStatus("失败");
+                    parsingLogs.setStationCode(stationCode);
+                    resultList.add(parsingLogs);
+                }
+            }
+        } else {
+            for (int i = 0; i < shouldFileName.size(); i++) {
+                ParsingLog parsingLogs = new ParsingLog();
+                if ("dq".equals(fileType) || "nwp".equals(fileType)) {
+                    parsingLogs.setFileName("sign_" + shouldFileName.get(i) + "_0000_" + fileType.toUpperCase() + ".WPD");
+                }
+                if ("status".equals(fileType) || "nbq".equals(fileType) || "qxz".equals(fileType) || "rp".equals(fileType) || "fj".equals(fileType) || "cft".equals(fileType)) {
+                    parsingLogs.setFileName("sign_" + shouldFileName.get(i) + "_" + fileType.toUpperCase() + ".WPD");
+                }
+                parsingLogs.setParsingFileStatus("失败");
+                parsingLogs.setStationCode(stationCode);
+                parsingLogs.setFileType(FileTypeEnum.valueOf(fileType));
+                parsingLogs.setDataSources(DataSourcesEnum.E1);
+                resultList.add(parsingLogs);
+            }
+        }
+        resultList.stream().sorted(Comparator.comparing(ParsingLog::getFileName).reversed());
+        return R.ok(resultList);
+    }
+}

+ 4 - 0
cpp-admin/src/main/java/com/cpp/web/service/datafactory/ParsingLogService.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.cpp.web.domain.datafactory.ParsingLog;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * 解析记录业务层接口
@@ -17,4 +18,7 @@ public interface ParsingLogService extends IService<ParsingLog> {
 
     QueryWrapper<ParsingLog> getByStationCodeAndCreateTimeAndFileStatusAndFileType(String stationCode, Date startTime, Date endTime, String fileStatus, String fileType);
 
+    QueryWrapper<ParsingLog> getByStationCodeAndCreateTimeAndFileType(String stationCode, Date startTime, Date endTime,String fileType);
+
+    List<ParsingLog> findByTimeBetweenAndFileTypeAndStationCode(Date startTime,Date endTime,String fileType,String stationCode);
 }

+ 41 - 0
cpp-admin/src/main/java/com/cpp/web/service/datafactory/impl/ParsingLogServiceImpl.java

@@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.cpp.web.domain.datafactory.ParsingLog;
 import com.cpp.web.mapper.datafactory.ParsingLogMapper;
 import com.cpp.web.service.datafactory.ParsingLogService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * 解析记录业务层实现类
@@ -17,6 +19,13 @@ import java.util.Date;
  */
 @Service
 public class ParsingLogServiceImpl extends ServiceImpl<ParsingLogMapper, ParsingLog> implements ParsingLogService {
+
+    private final ParsingLogMapper parsingLogMapper;
+
+    public ParsingLogServiceImpl(ParsingLogMapper parsingLogMapper) {
+        this.parsingLogMapper = parsingLogMapper;
+    }
+
     @Override
     public QueryWrapper<ParsingLog> getByStationCodeAndCreateTimeAndFileStatusAndFileType(String stationCode, Date startTime, Date endTime, String fileStatus, String fileType) {
         QueryWrapper<ParsingLog> wrapper = new QueryWrapper<>();
@@ -34,4 +43,36 @@ public class ParsingLogServiceImpl extends ServiceImpl<ParsingLogMapper, Parsing
         }
         return wrapper;
     }
+
+    @Override
+    public QueryWrapper<ParsingLog> getByStationCodeAndCreateTimeAndFileType(String stationCode, Date startTime, Date endTime, String fileType) {
+        QueryWrapper<ParsingLog> wrapper = new QueryWrapper<>();
+        if (stationCode != null && !"".equals(stationCode)){
+            wrapper.eq("station_code", stationCode);
+        }
+        if (null != startTime && !"".equals(startTime) && null != endTime && !"".equals(endTime)){
+            wrapper.between("parsing_time", startTime, endTime);
+        }
+        if (null != fileType && !"".equals(fileType)){
+            wrapper.eq("file_type", fileType);
+        }
+        wrapper.orderByDesc("file_name");
+        return wrapper;
+    }
+
+    @Override
+    public List<ParsingLog> findByTimeBetweenAndFileTypeAndStationCode(Date startTime, Date endTime, String fileType, String stationCode) {
+        QueryWrapper<ParsingLog> wrapper = new QueryWrapper<>();
+        if (stationCode != null && !"".equals(stationCode)){
+            wrapper.eq("station_code",stationCode);
+        }
+        if (null != startTime && !"".equals(startTime) && null != endTime && !"".equals(endTime)){
+            wrapper.between("parsing_time",startTime,endTime);
+        }
+        if (null != fileType && !"".equals(fileType)){
+            wrapper.eq("file_type",fileType);
+        }
+        List<ParsingLog> parsingLogs = parsingLogMapper.selectList(wrapper);
+        return parsingLogs;
+    }
 }

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

@@ -0,0 +1,12 @@
+package com.cpp.web.service.reprtdata;
+
+import java.util.List;
+
+public interface ReportDataService {
+
+    // 获取应上报文件个数
+    int shouldFileNum(String fileType,Long startTime,Long endTime,String stationCode);
+
+
+    List<String> shouldFileName(String fileType,Long startTime,Long endTime,String stationCode);
+}

+ 105 - 0
cpp-admin/src/main/java/com/cpp/web/service/reprtdata/impl/ReportDataServiceImpl.java

@@ -0,0 +1,105 @@
+package com.cpp.web.service.reprtdata.impl;
+
+import com.cpp.web.service.reprtdata.ReportDataService;
+import com.cpp.web.utils.DateTimeUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+@Service
+@RequiredArgsConstructor
+@Slf4j
+public class ReportDataServiceImpl implements ReportDataService {
+
+
+    // 当前文件类型应上报文件个数
+    @Override
+    public int shouldFileNum(String fileType, Long startTime, Long endTime, String stationCode) {
+        int num = 0;
+        if (fileType.equals("dq") || fileType.equals("nwp")) {
+            num = DateTimeUtil.getDaysBetweenTwoDate(startTime, endTime);
+        } else if (fileType.equals("cdq")) {
+            num = DateTimeUtil.getMomentsBetweenTwoDate(startTime, endTime);
+        } else if (fileType.equals("status") || fileType.equals("nbq") || fileType.equals("qxz") || fileType.equals("rp") || fileType.equals("fj") || fileType.equals("cft")) {
+            num = DateTimeUtil.getMin5BetweenTwoDate(startTime, endTime);
+        }
+        return num;
+    }
+
+    @Override
+    public List<String> shouldFileName(String fileType, Long startTime, Long endTime, String stationCode) {
+        List<String> list = new ArrayList<>();
+        if ("dq".equals(fileType) || "nwp".equals(fileType)) {
+            list = getDatesInRange(startTime + 24 * 60 * 60 * 1000L, endTime + 24 * 60 * 60 * 1000L);
+        }
+        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;
+    }
+
+    /**
+     * 获取每一天 判断dq和nwp
+     *
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    public List<String> getDatesInRange(Long startTime, Long endTime) {
+        List<String> list = new ArrayList<>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTimeInMillis(startTime);
+
+        Date currentDate = calendar.getTime();
+        while (currentDate.getTime() <= endTime) {
+            String formattedDate = sdf.format(currentDate);
+            list.add(formattedDate);
+            // 移动到下一天
+            calendar.add(Calendar.DAY_OF_MONTH, 1);
+            currentDate = calendar.getTime();
+        }
+        return list;
+    }
+
+    /**
+     * 5分钟节点/15分钟节点
+     *
+     * @param startTime
+     * @param endTime
+     * @param fileType
+     * @return
+     */
+    public List<String> getMin(Long startTime, Long endTime, String fileType) {
+        List<String> list = new ArrayList<>();
+        LocalDateTime start = LocalDateTime.ofInstant(Instant.ofEpochMilli(startTime), ZoneId.systemDefault());
+        LocalDateTime end = LocalDateTime.ofInstant(Instant.ofEpochMilli(endTime), ZoneId.systemDefault());
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd_HHmm");
+        LocalDateTime currentTime = start;
+        while (!currentTime.isAfter(end)) {
+            String formattedTime = currentTime.format(formatter);
+            if ("cdq".equals(fileType)) {
+                currentTime = currentTime.plusMinutes(15);
+            } else {
+                currentTime = currentTime.plusMinutes(5);
+            }
+            list.add(formattedTime);
+        }
+        return list;
+    }
+}

+ 11 - 0
cpp-admin/src/main/java/com/cpp/web/utils/DateTimeUtil.java

@@ -178,6 +178,17 @@ public class DateTimeUtil {
         return (int) ((dateTo - dateFrom) / (15 * 60 * 1000));
     }
 
+    /**
+     * 获取两个时间间的间隔间隔时刻数(5分钟一个时刻)
+     *
+     * @param dateFrom 开始时间
+     * @param dateTo   结束时间
+     * @return 间隔时刻数
+     */
+    public static int getMin5BetweenTwoDate(Long dateFrom, Long dateTo) {
+        return (int) ((dateTo - dateFrom) / (5 * 60 * 1000));
+    }
+
 
     /**
      * 获取现在时间

+ 112 - 105
cpp-ui/src/views/maintenancerelated/overhaulplan/index.vue

@@ -12,7 +12,8 @@
         </el-select>
       </el-form-item>
       <el-form-item label="使用状态">
-        <el-select v-model="overhualStatus" placeholder="请选择" style="width: 255px" popper-class="cpp-popper" clearable>
+        <el-select v-model="overhualStatus" placeholder="请选择" style="width: 255px" popper-class="cpp-popper"
+                   clearable>
           <el-option
             v-for="item in options"
             :key="item.value"
@@ -98,94 +99,99 @@
     </div>
 
     <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="850px" height="600px">
-      <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="mb4">
-          <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-col :span="12">
-            <el-form-item label="状态" prop="status">
-              <el-input style="width: 100%" v-model="form.status === 1 ? '使用中' : '已废弃'" maxlength="50" :disabled="true"/>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row class="mb4">
-          <el-col :span="12">
-            <el-form-item label="是否使用" prop="isUse">
-              <el-input style="width: 100%" v-model="form.isUse === false ? '否' : '是'" maxlength="50" :disabled="true"/>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="手动停止时间">
-              <el-input style="width: 100%" v-model="form.mcTime" maxlength="50" :disabled="true"/>
-            </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 class="dark-el-input dark-el-button">
+        <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-col :span="12">-->
+            <!--              <el-form-item label="状态" prop="status">-->
+            <!--                <el-input style="width: 100%" v-model="form.status === 1 ? '使用中' : '已废弃'" maxlength="50"-->
+            <!--                          :disabled="true"/>-->
+            <!--              </el-form-item>-->
+            <!--            </el-col>-->
+          </el-row>
+          <!--          <el-row class="mb4">-->
+          <!--            <el-col :span="12">-->
+          <!--              <el-form-item label="是否使用" prop="isUse">-->
+          <!--                <el-input style="width: 100%" v-model="form.isUse === false ? '否' : '是'" maxlength="50"-->
+          <!--                          :disabled="true"/>-->
+          <!--              </el-form-item>-->
+          <!--            </el-col>-->
+          <!--            <el-col :span="12">-->
+          <!--              <el-form-item label="手动停止时间">-->
+          <!--                <el-input style="width: 100%" v-model="form.mcTime" maxlength="50" :disabled="true"/>-->
+          <!--              </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>
   </div>
@@ -311,6 +317,7 @@ export default {
     },
     // 提交按钮
     async commitChannel() {
+      var checkData=[]
       const param = {
         "stationCode": this.form.stationCode
       }
@@ -318,7 +325,7 @@ export default {
         this.capacity = response.data.capacity
       })
       await this.$axios.get('overhaulplan/stationCode/noPage', {params: param}).then(response => {
-        this.tableData = response.data
+        checkData = response.data
       })
       this.$refs["form"].validate(valid => {
         if (valid) {
@@ -335,20 +342,20 @@ export default {
             return
           }
           var timeStartEnd = [this.form.startTime, this.form.endTime]
-          if (this.checkDate(timeStartEnd, this.tableData, this.edit, this.form)) {
+          if (this.checkDate(timeStartEnd, checkData, this.edit, this.form)) {
             this.$message.warning('该时间段内已有检修计划!')
             return
           }
-          if (this.form.id != undefined) {
-            // 更新操作
-            this.$axios.post('/overhaulplan/updateById', this.form).then((res) => {
-              this.$message.success('修改成功')
-              this.open = false;
-              this.overhualStatus = null
-              this.queryByStationCode()
-            }).catch((error) => {
-            })
-          } else {
+          // if (this.form.id != undefined) {
+          //   // 更新操作
+          //   this.$axios.post('/overhaulplan/updateById', this.form).then((res) => {
+          //     this.$message.success('修改成功')
+          //     this.open = false;
+          //     this.overhualStatus = null
+          //     this.queryByStationCode()
+          //   }).catch((error) => {
+          //   })
+          // } else {
             // 新增操作
             this.$axios.post('/overhaulplan/save', this.form).then((res) => {
               if (res == undefined) {
@@ -362,7 +369,7 @@ export default {
             }).catch((error) => {
             })
           }
-        }
+        // }
       });
     },
     // /** 删除按钮操作 */
@@ -522,12 +529,12 @@ export default {
         this.queryByStationCode();
       })
     },
-    codeChangeName(row){
+    codeChangeName(row) {
       var codeList = this.stationList
       for (let i = 0; i < codeList.length; i++) {
-        console.log("a"+ row.cellValue)
+        console.log("a" + row.cellValue)
         console.log("b" + codeList[i].value)
-        if (row.cellValue == codeList[i].value){
+        if (row.cellValue == codeList[i].value) {
           return codeList[i].label
         }
       }

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

@@ -0,0 +1,267 @@
+<template>
+  <div class="app-container">
+    <el-form :inline="true" size="small" class="dark-el-input dark-el-button">
+      <el-form-item label="时间">
+        <el-date-picker
+          :clearable="false"
+          v-model="dateTime"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :default-time="['00:00:00', '23:59:59']"
+          popper-class="cpp-popper"
+        />
+      </el-form-item>
+      <el-form-item label="场站名称">
+        <el-select v-model="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-form-item label="文件类型">
+        <el-select v-model="fileTypeName" placeholder="请选择" style="width: 255px" popper-class="cpp-popper" clearable>
+          <el-option
+            v-for="item in fileType"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" size="mini" style="margin-left: 5px" icon="el-icon-search"
+                   @click="queryByStationCode">查询
+        </el-button>
+      </el-form-item>
+    </el-form>
+    <div style="padding-top: 10px">
+      <vxe-table
+        ref="xTable"
+        align="center"
+        class="mytable-style"
+        auto-resize
+        border
+        resizable
+        export-config
+        highlight-current-row
+        show-overflow
+        max-height="700"
+        :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)"
+        :row-style="rowStyle">
+        <vxe-table-column field="stationCode" title="场站名称" :formatter="codeChangeName"></vxe-table-column>
+        <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="parsingFileStatus" title="文件上报状态"></vxe-table-column>
+      </vxe-table>
+      <vxe-pager
+        background
+        :loading="loading"
+        :current-page.sync="currentPage"
+        :page-size.sync="pageSize"
+        :total="total"
+        @page-change="handlePageChange"
+        :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']">
+      </vxe-pager>
+    </div>
+  </div>
+</template>
+
+
+<script>
+export default {
+  name: 'reportData',
+  data() {
+    return {
+      dateTime: [new Date(new Date().toLocaleDateString()).getTime(), new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1],
+      fileType: [],
+      fileTypeName: '',
+      title: "",
+      total: 0,
+      pageSize: 10,
+      currentPage: 1,
+      stationList: [],
+      stationCode: '',
+      stationName: undefined,
+      tableData: [],
+      loading: false,
+      electricFieldTypeEnum: '',
+    }
+  },
+  created() {
+    this.getStationCode()
+  },
+  mounted() {
+  },
+  computed: {},
+  methods: {
+    handlePageChange({currentPage, pageSize}) {
+      this.currentPage = currentPage
+      if (this.pageSize != pageSize) {
+        this.changePageSize(pageSize)
+      }
+      this.pageSize = pageSize
+    },
+    //日期转换器
+    formatDateTime(cellValue) {
+      if (cellValue.cellValue == null) {
+        return ''
+      }
+      const date = new Date(cellValue.cellValue)
+      const Y = date.getFullYear() + '-'
+      const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
+      const D = date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()
+      const h = " " + (date.getHours() < 10 ? '0' : '') + date.getHours() + ':'
+      const m = (date.getMinutes() < 10 ? '0' : '') + date.getMinutes() + ':'
+      const s = (date.getSeconds() < 10 ? '0' : '') + date.getSeconds()
+      return Y + M + D + h + m + s
+    },
+    getStationCode() {
+      this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
+        this.stationList = response.data
+        if (this.stationList.length > 0) {
+          this.stationCode = this.stationList[0].value
+          this.getElectricFieldTypeEnum()
+        }
+      })
+    },
+    getElectricFieldTypeEnum() {
+      this.loading = true
+      const param = {
+        "stationCode": this.stationCode,
+      }
+      this.$axios.get('reportData/getElectricFieldTypeEnum', {params: param}).then(response => {
+        this.electricFieldTypeEnum = response.data
+        if (this.electricFieldTypeEnum === 'E1') {
+          this.fileType = [{
+            value: 'dq',
+            label: '短期'
+          }, {
+            value: 'rdq',
+            label: '调控后短期'
+          }, {
+            value: 'cdq',
+            label: '超短期'
+          }, {
+            value: 'rcdq',
+            label: '调控后超短期'
+          }, {
+            value: 'nwp',
+            label: 'Nwp'
+          }, {
+            value: 'qxz',
+            label: '气象站'
+          }, {
+            value: 'nbq',
+            label: '逆变器'
+          }, {
+            value: 'rp',
+            label: '实发功率'
+          }, {
+            value: 'status',
+            label: '运行信息'
+          }]
+        } else {
+          this.fileType = [{
+            value: 'dq',
+            label: '短期'
+          }, {
+            value: 'rdq',
+            label: '调控后短期'
+          }, {
+            value: 'cdq',
+            label: '超短期'
+          }, {
+            value: 'rcdq',
+            label: '调控后超短期'
+          }, {
+            value: 'nwp',
+            label: 'Nwp'
+          }, {
+            value: 'cft',
+            label: '测风塔'
+          }, {
+            value: 'fj',
+            label: '风机'
+          }, {
+            value: 'rp',
+            label: '实发功率'
+          }, {
+            value: 'status',
+            label: '运行信息'
+          }]
+        }
+        this.fileTypeName = this.fileType[0].value
+        this.queryByStationCode()
+      })
+    },
+    queryByStationCode() {
+      let startTime = Math.round(this.dateTime[0])
+      let endTime = Math.round(this.dateTime[1])
+      if (endTime <= startTime) {
+        this.$message.warning("开始时间不能大于结束时间")
+        return
+      }
+      const param = {
+        "stationCode": this.stationCode,
+        "fileType": this.fileTypeName,
+        "startTime": startTime,
+        "endTime": endTime,
+      }
+      this.$axios.get('/reportData/getData', {params: param}).then(response => {
+        this.tableData = response.data
+        this.total = this.tableData.length
+        this.loading = false
+      })
+    },
+    codeChangeName(row) {
+      var codeList = this.stationList
+      for (let i = 0; i < codeList.length; i++) {
+        if (row.cellValue == codeList[i].value) {
+          return codeList[i].label
+        }
+      }
+    },
+    changeDataSource(row) {
+      if (row.cellValue === "E1") {
+        return "ftp(场站端)"
+      }
+      if (row.cellValue === "E2") {
+        return "云端(中心端)"
+      }
+      if (row.cellValue === "E3") {
+        return "集中预测(控制端)"
+      }
+      if (row.cellValue === "E4") {
+        return "ftp(场站端经集中调控)"
+      }
+    },
+    changeFileName(row) {
+      for (let i = 0; i < this.fileType.length; i++) {
+        if (row.cellValue === this.fileType[i].value) {
+          return this.fileType[i].label
+        }
+      }
+    },
+    // 根据文件样式改变行样式
+    rowStyle({row, rowIndex}) {
+      if (row.parsingFileStatus === '失败') {
+        return {
+          background: 'linear-gradient(to bottom, #fa908f,#f53f3d)',
+          color: '#ffffff'
+        }
+      }
+    },
+  }
+}
+</script>
+
+<style scoped>
+</style>