Browse Source

去掉检修记录页面,检修记录实体修改,检修计划修改校验逻辑

fanxiaoyu 6 tháng trước cách đây
mục cha
commit
29a40d81f0

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

@@ -67,7 +67,7 @@ public class OverhaulPlanController {
         return R.ok(overhaulPlanService.page(page,overhaulPlanService.getByStationCode(stationCode,status)));
     }
 
-    @ApiOperation(value = "通过场站编号查询检修计划", notes = "通过场站编号查询检修计划")
+    @ApiOperation(value = "通过场站编号查询检修计划(使用中)", notes = "通过场站编号查询检修计划(使用中)")
     @GetMapping("/stationCode/noPage")
     public R findByStationCode( String stationCode) {
         return R.ok(overhaulPlanService.findByStationCode(stationCode));

+ 11 - 4
cpp-admin/src/main/java/com/cpp/web/controller/overhaulPlan/OverhaulPlanRecordsController.java

@@ -26,10 +26,17 @@ public class OverhaulPlanRecordsController {
         return R.ok(overhaulPlanRecordsService.page(page,overhaulPlanRecordsService.getByStationCode(stationCode)));
     }
 
-    @ApiOperation(value = "通过场站编号查询记录(分页查询)", notes = "通过场站编号查询记录(分页查询)")
-    @GetMapping("/findByStationCodeAndTimeBetween")
-    public R findByStationCodeAndTimeBetween(String stationCode, Long startTime,Long endTime){
-        return R.ok(overhaulPlanRecordsService.findByStationCodeAndTimeBetween(stationCode,new Date(startTime),new Date(endTime)));
+    @ApiOperation(value = "根据检修计划id查询检修记录", notes = "根据检修计划id查询检修记录")
+    @GetMapping("/findByOpId")
+    public R findByStationCodeAndTimeBetween(Long opId){
+        return R.ok(overhaulPlanRecordsService.findByOpId(opId));
+    }
+
+
+    @ApiOperation(value = "根据场站编号和时间段查询所有检修记录", notes = "根据场站编号和时间段查询所有检修记录")
+    @GetMapping("/findByStationCodeAndCreatTimeBetween")
+    public R findByStationCodeAndCreatTimeBetween(String stationCode,Long startTime,Long endTime){
+        return R.ok(overhaulPlanRecordsService.findByStationCodeAndCreatTimeBetween(stationCode,new Date(startTime),new Date(endTime)));
     }
 
 }

+ 32 - 0
cpp-admin/src/main/java/com/cpp/web/domain/datafactory/enums/FileTypeEnum.java

@@ -3,6 +3,9 @@ package com.cpp.web.domain.datafactory.enums;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 
+import java.util.ArrayList;
+import java.util.List;
+
 @Getter
 @AllArgsConstructor
 public enum FileTypeEnum {
@@ -21,4 +24,33 @@ public enum FileTypeEnum {
     private Integer code;
     private String message;
 
+    // 风电上报类型
+    public List<FileTypeEnum> getWindFileType(){
+        List<FileTypeEnum> fileTypeEnumList = new ArrayList<>();
+        fileTypeEnumList.add(FileTypeEnum.dq);
+        fileTypeEnumList.add(FileTypeEnum.cdq);
+        fileTypeEnumList.add(FileTypeEnum.rp);
+        fileTypeEnumList.add(FileTypeEnum.nwp);
+        fileTypeEnumList.add(FileTypeEnum.status);
+        fileTypeEnumList.add(FileTypeEnum.cft);
+        fileTypeEnumList.add(FileTypeEnum.fj);
+        fileTypeEnumList.add(FileTypeEnum.rdq);
+        fileTypeEnumList.add(FileTypeEnum.rcdq);
+        return fileTypeEnumList;
+    }
+
+    // 光伏上报文件
+    public List<FileTypeEnum> getPhotovoltaicFileType(){
+        List<FileTypeEnum> fileTypeEnumList = new ArrayList<>();
+        fileTypeEnumList.add(FileTypeEnum.dq);
+        fileTypeEnumList.add(FileTypeEnum.cdq);
+        fileTypeEnumList.add(FileTypeEnum.rp);
+        fileTypeEnumList.add(FileTypeEnum.nwp);
+        fileTypeEnumList.add(FileTypeEnum.status);
+        fileTypeEnumList.add(FileTypeEnum.qxz);
+        fileTypeEnumList.add(FileTypeEnum.nbq);
+        fileTypeEnumList.add(FileTypeEnum.rdq);
+        fileTypeEnumList.add(FileTypeEnum.rcdq);
+        return fileTypeEnumList;
+    }
 }

+ 12 - 28
cpp-admin/src/main/java/com/cpp/web/domain/overhaulplan/OverhaulPlanRecords.java

@@ -2,6 +2,7 @@ package com.cpp.web.domain.overhaulplan;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.cpp.web.domain.BaseCppEntity;
+import com.cpp.web.domain.datafactory.enums.FileTypeEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -22,30 +23,11 @@ import java.util.Date;
 @EqualsAndHashCode(callSuper = true)
 @ApiModel(value = "cpp_overhaul_plan_records")
 public class OverhaulPlanRecords extends BaseCppEntity {
-
-    /**
-     * 使用时间
-     */
-    @ApiModelProperty(value = "使用时间")
-    private Date useTime;
-
-    /**
-     * 检修开始时间
-     */
-    @ApiModelProperty(value = "检修开始时间")
-    private Date startTime;
-
-    /**
-     * 检修结束时间
-     */
-    @ApiModelProperty(value = "检修结束时间")
-    private Date endTime;
-
     /**
-     * 检修容量
+     * 检修计划id
      */
-    @ApiModelProperty(value = "检修容量")
-    private BigDecimal overhaulCapacity;
+    @ApiModelProperty(value = "检修计划id")
+    private Long opId;
 
     /**
      * 预测模型
@@ -55,14 +37,16 @@ public class OverhaulPlanRecords extends BaseCppEntity {
 
 
     /**
-     * 使用次数
+     * 类型
      */
-    @ApiModelProperty(value = "使用次数")
-    private Integer useNum = 0;
+    @ApiModelProperty(value = "预测类型")
+    private FileTypeEnum forecastType;
+
 
     /**
-     * 更新时间
+     * 详情 文件名 + 检修的时间
      */
-    @ApiModelProperty(value = "更新时间")
-    private Date updateTime;
+    @ApiModelProperty(value = "详情")
+    private String details;
+
 }

+ 0 - 2
cpp-admin/src/main/java/com/cpp/web/mapper/overhaulplan/OverhaulPlanMapper.java

@@ -18,6 +18,4 @@ import java.util.List;
 @Mapper
 public interface OverhaulPlanMapper extends BaseMapper<OverhaulPlan> {
 
-    @Select("select * from cpp_overhaul_plan where station_code = #{stationCode}")
-    List<OverhaulPlan> findBysStationCode(@Param("stationCode") String stationCode);
 }

+ 1 - 1
cpp-admin/src/main/java/com/cpp/web/service/cloud/CloudFileParsing.java

@@ -420,7 +420,7 @@ public class CloudFileParsing {
             }
         }
 
-        return overhaulPlanService.getCorrectionData(forecastPowerShortTerm);
+        return overhaulPlanService.getCorrectionData(forecastPowerShortTerm,"","");
     }
 
 

+ 3 - 1
cpp-admin/src/main/java/com/cpp/web/service/overhaulplan/OverhaulPlanRecordsService.java

@@ -20,6 +20,8 @@ public interface OverhaulPlanRecordsService extends IService<OverhaulPlanRecords
 
     OverhaulPlanRecords findByStationCodeAndForecastModel(String stationCode, String forecastModel, Date startTime,Date endTime);
 
-    List<OverhaulPlanRecords> findByStationCodeAndTimeBetween(String stationCode,Date startTime,Date endTime);
+    List<OverhaulPlanRecords> findByOpId(Long opId);
+
+    List<OverhaulPlanRecords> findByStationCodeAndCreatTimeBetween(String stationCode,Date startTime,Date endTime);
 
 }

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

@@ -25,6 +25,6 @@ public interface OverhaulPlanService extends IService<OverhaulPlan> {
 
     List<OverhaulPlan> findByStationCodeAndTimeBetween(Date date,String stationCode);
 
-    <T> List<T>  getCorrectionData(List<T> list);
+    <T> List<T>  getCorrectionData(List<T> list,String fileType,String fileName);
 
 }

+ 13 - 7
cpp-admin/src/main/java/com/cpp/web/service/overhaulplan/impl/OverhaulPlanRecordsServiceImpl.java

@@ -51,17 +51,23 @@ public class OverhaulPlanRecordsServiceImpl extends ServiceImpl<OverhaulPlanReco
     }
 
     @Override
-    public List<OverhaulPlanRecords> findByStationCodeAndTimeBetween(String stationCode, Date startTime, Date endTime) {
+    public List<OverhaulPlanRecords> findByOpId(Long opId) {
+        QueryWrapper<OverhaulPlanRecords> wrapper = new QueryWrapper<>();
+        if (null != opId){
+            wrapper.eq("op_id",opId);
+        }
+        return overhaulPlanRecordsMapper.selectList(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){
-            wrapper.eq("start_time",startTime);
-        }
-        if (null != endTime){
-            wrapper.eq("end_time",endTime);
+        if (null != startTime && !"".equals(startTime) && null != endTime && !"".equals(endTime)){
+            wrapper.between("create_time",startTime,endTime);
         }
-        return overhaulPlanRecordsMapper.selectList(wrapper);
+        return list(wrapper);
     }
 }

+ 40 - 33
cpp-admin/src/main/java/com/cpp/web/service/overhaulplan/impl/OverhaulPlanServiceImpl.java

@@ -2,6 +2,7 @@ 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.web.domain.datafactory.enums.FileTypeEnum;
 import com.cpp.web.domain.overhaulplan.OverhaulPlan;
 import com.cpp.web.domain.overhaulplan.OverhaulPlanRecords;
 import com.cpp.web.domain.station.ElectricField;
@@ -10,8 +11,6 @@ import com.cpp.web.service.overhaulplan.OverhaulPlanRecordsService;
 import com.cpp.web.service.overhaulplan.OverhaulPlanService;
 import com.cpp.web.service.station.ElectricFieldService;
 import lombok.RequiredArgsConstructor;
-import org.apache.poi.ss.formula.functions.T;
-import org.springframework.security.core.parameters.P;
 import org.springframework.stereotype.Service;
 
 import java.lang.reflect.Field;
@@ -72,8 +71,12 @@ public class OverhaulPlanServiceImpl extends ServiceImpl<OverhaulPlanMapper, Ove
 
     @Override
     public List<OverhaulPlan> findByStationCode(String stationCode) {
-        List<OverhaulPlan> overhaulPlanList = overhaulPlanMapper.findBysStationCode(stationCode);
-        return overhaulPlanList;
+        QueryWrapper<OverhaulPlan> wrapper = new QueryWrapper<>();
+        if (null != stationCode && !"".equals(stationCode)){
+            wrapper.eq("station_code",stationCode);
+        }
+        wrapper.eq("status",1);
+        return list(wrapper);
     }
 
     @Override
@@ -91,15 +94,22 @@ public class OverhaulPlanServiceImpl extends ServiceImpl<OverhaulPlanMapper, Ove
     }
 
     /**
-     *  返回修正后数据
+     * 返回修正后数据
+     *
      * @param list
-     * @return
      * @param <T>
+     * @return
      */
     @Override
-    public <T> List<T> getCorrectionData(List<T> list) {
+    public <T> List<T> getCorrectionData(List<T> list, String fileType, String fileName) {
+
         List<T> resultList = new ArrayList<>();
         BigDecimal electricFieldCapacity = BigDecimal.ZERO;
+        String forecastModel = "";
+        String stationCode = "";
+        Long id = null;
+        Date useStartTime = null;
+        Date useEndTime = null;
         for (T tList : list) {
             try {
                 Class<?> childClass = tList.getClass();
@@ -111,7 +121,7 @@ public class OverhaulPlanServiceImpl extends ServiceImpl<OverhaulPlanMapper, Ove
                 // 场站编号
                 Field stationCodeField = superClass.getDeclaredField("stationCode");
                 stationCodeField.setAccessible(true);
-                String stationCode = (String) stationCodeField.get(tList);
+                stationCode = (String) stationCodeField.get(tList);
                 // 获取场站装机
                 ElectricField electricField = electricFieldService.findByStationCode(stationCode);
                 if (null != electricField) {
@@ -127,47 +137,44 @@ public class OverhaulPlanServiceImpl extends ServiceImpl<OverhaulPlanMapper, Ove
                 // 预测模型
                 Field forecastModelField = childClass.getDeclaredField("forecastModel");
                 forecastModelField.setAccessible(true);
-                String forecastModel = (String)forecastModelField.get(tList);
-                // 根据时间查询检修计划
-                List<OverhaulPlan> overhaulPlanList = this.findByStationCodeAndTimeBetween(startTime, stationCode);
+                forecastModel = (String) forecastModelField.get(tList);
+                // 根据时间查询使用中的检修计划
+                List<OverhaulPlan> overhaulPlanList = findByStationCodeAndTimeBetween(startTime, stationCode);
                 if (overhaulPlanList.size() > 0) {
+                    int flag = 0;
+                    if (flag == 0) {
+                        useStartTime = startTime;
+                    }
+                    useEndTime = startTime;
+                    id = overhaulPlanList.get(0).getId();
                     BigDecimal overCapacity = overhaulPlanList.get(0).getOverhaulCapacity();
                     openCapcityField.set(tList, electricFieldCapacity.subtract(overCapacity));
-                    // 预测数据
+                    // 预测数据(短期or超短期)
                     Field fpValueFiled = childClass.getDeclaredField("fpValue");
                     fpValueFiled.setAccessible(true);
                     BigDecimal fpValue = (BigDecimal) fpValueFiled.get(tList);
                     // 开机/装机
                     BigDecimal ratio = (electricFieldCapacity.subtract(overCapacity)).divide(electricFieldCapacity, 2, RoundingMode.HALF_UP);
                     fpValueFiled.set(tList, fpValue.multiply(ratio));
-                    // 查询检修记录
-                    OverhaulPlanRecords overhaulPlanRecord = overhaulPlanRecordsService.findByStationCodeAndForecastModel(stationCode,forecastModel,overhaulPlanList.get(0).getStartTime(),overhaulPlanList.get(0).getEndTime());
-                    if (null != overhaulPlanRecord) {
-                        overhaulPlanRecord.setUseNum(overhaulPlanRecord.getUseNum() + 1);
-                        overhaulPlanRecord.setUpdateTime(new Date());
-                        overhaulPlanRecordsService.saveOrUpdate(overhaulPlanRecord);
-                        // 使用次数 +1
-                    }else {
-                        OverhaulPlanRecords overhaulPlanRecords = new OverhaulPlanRecords();
-                        overhaulPlanRecords.setOverhaulCapacity(overhaulPlanList.get(0).getOverhaulCapacity());
-                        overhaulPlanRecords.setStartTime(overhaulPlanList.get(0).getStartTime());
-                        overhaulPlanRecords.setEndTime(overhaulPlanList.get(0).getEndTime());
-                        overhaulPlanRecords.setUseNum(overhaulPlanRecords.getUseNum() + 1);
-                        overhaulPlanRecords.setStationCode(stationCode);
-                        overhaulPlanRecords.setForecastModel(forecastModel);
-                        overhaulPlanRecords.setCreateTime(new Date());
-                        overhaulPlanRecordsService.saveOrUpdate(overhaulPlanRecords);
-                    }
-
-                }else {
+                } else {
                     // 设置开机为装机
-                    openCapcityField.set(tList,electricFieldCapacity);
+                    openCapcityField.set(tList, electricFieldCapacity);
                 }
                 resultList.add(tList);
+
             } catch (NoSuchFieldException | IllegalAccessException e) {
                 throw new RuntimeException(e);
             }
         }
+        if (null != id) {
+            OverhaulPlanRecords overhaulPlanRecords = new OverhaulPlanRecords();
+            overhaulPlanRecords.setForecastModel(forecastModel);
+            overhaulPlanRecords.setStationCode(stationCode);
+            overhaulPlanRecords.setOpId(id);
+            overhaulPlanRecords.setDetails(fileType + ":开始时间:" + useStartTime + "~结束时间:" + useEndTime);
+            overhaulPlanRecords.setForecastType(FileTypeEnum.valueOf(fileType));
+            overhaulPlanRecordsService.save(overhaulPlanRecords);
+        }
         return resultList;
     }
 }

+ 90 - 35
cpp-ui/src/views/maintenancerelated/overhaulplan/index.vue

@@ -27,6 +27,11 @@
                    @click="queryByStationCode">查询
         </el-button>
       </el-form-item>
+      <el-form-item>
+        <el-button type="primary" size="mini" style="margin-left: 5px" icon="el-icon-search"
+                   @click="showAllRecords">检修记录
+        </el-button>
+      </el-form-item>
     </el-form>
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
@@ -100,9 +105,9 @@
       </vxe-pager>
     </div>
 
-    <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="850px" height="600px">
-      <div class="dark-el-input dark-el-button">
-        <el-form ref="form" :model="form" :rules="rules" width="830px" label-width="150px">
+    <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="场站名称">
@@ -169,26 +174,7 @@
                 <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>
@@ -197,9 +183,9 @@
       </div>
     </el-dialog>
 
-    <el-dialog :title="title" :visible.sync="showDetails" :close-on-click-modal="false" width="1000px" height="600px">
-      <div class="dark-el-input dark-el-button">
-        <vxe-table
+    <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"
@@ -212,12 +198,9 @@
           max-height="700"
           :data="tableDataDetails.slice((currentPage-1)*pageSize,currentPage*pageSize)">
           <vxe-table-column field="stationCode" title="场站名称" :formatter="codeChangeName"></vxe-table-column>
-          <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="forecastModel" title="预测模型"></vxe-table-column>
-          <vxe-table-column field="useNum" title="使用次数"></vxe-table-column>
-          <vxe-table-column field="updateTime" :formatter="formatDateTime" 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
@@ -230,6 +213,56 @@
         </vxe-pager>
       </div>
     </el-dialog>
+    <el-dialog :title="title" :visible.sync="showAll" :close-on-click-modal="false" width="1000px" height="600px" :append-to-body="true">
+      <div class="dark-el-dialog">
+        <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>
+            <el-button type="primary" size="mini" style="margin-left: 5px" icon="el-icon-search"
+                       @click="queryRecords">查询
+            </el-button>
+          </el-form-item>
+        </el-form>
+        <vxe-table
+          ref="xTable"
+          align="center"
+          class="mytable-style"
+          auto-resize
+          border
+          resizable
+          export-config
+          highlight-current-row
+          show-overflow
+          max-height="700"
+          :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>
+      </div>
+    </el-dialog>
 
   </div>
 </template>
@@ -242,6 +275,7 @@ export default {
   name: 'overhaulPlan',
   data() {
     return {
+      dateTime: [new Date(new Date().toLocaleDateString()).getTime(), new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1],
       options: [{
         value: 1,
         label: '使用中'
@@ -267,6 +301,7 @@ export default {
       showDetails: false,
       total: 0,
       totalDetails: 0,
+      totalRecords: 0,
       pageSize: 10,
       currentPage: 1,
       stationList: [],
@@ -274,6 +309,7 @@ export default {
       stationName: undefined,
       tableData: [],
       tableDataDetails: [],
+      tableDataRecords: [],
       loading: false,
       capacity: null,
       // 表单校验
@@ -296,6 +332,7 @@ export default {
           {required: true, message: '开始时间不能为空!'}
         ],
       },
+      showAll: false
     }
   },
   created() {
@@ -489,15 +526,33 @@ export default {
       this.title = '使用记录详情'
       this.loading = true
       const param = {
-        "stationCode": this.stationCode,
-        "startTime": Date.parse(row.startTime),
-        "endTime": Date.parse(row.endTime)
+        "opId":row.id
       }
-      this.$axios.get('/overhaulPlanRecords/findByStationCodeAndTimeBetween', {params: param}).then(response => {
+      this.$axios.get('/overhaulPlanRecords/findByOpId', {params: param}).then(response => {
         this.tableDataDetails = response.data
-        this.totalDetails  = response.data.length()
+        this.totalDetails  = this.tableDataDetails.length
         this.loading = false
       })
+    },
+    showAllRecords(){
+      this.showAll = true
+      this.title = '使用记录'
+    },
+    queryRecords(){
+      this.loading = true
+      let startTime = Math.round(this.dateTime[0])
+      let endTime = Math.round(this.dateTime[1])
+      const param = {
+        "stationCode": this.stationCode,
+        "startTime": startTime,
+        "endTime": endTime
+      }
+      this.$axios.get('overhaulPlanRecords/findByStationCodeAndCreatTimeBetween',{params: param}).then(response =>{
+        this.tableDataRecords = response.data
+        this.totalRecords = this.tableDataRecords.length
+      })
+      this.loading = false
+
     }
   }
 }

+ 0 - 141
cpp-ui/src/views/maintenancerelated/overhaulplanrecords/index.vue

@@ -1,141 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-form :inline="true" size="small" class="dark-el-input dark-el-button">
-      <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>
-        <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">
-        <vxe-table-column field="stationCode" title="场站名称" :formatter="codeChangeName"></vxe-table-column>
-        <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="forecastModel" title="预测模型"></vxe-table-column>
-        <vxe-table-column field="useNum" title="使用次数"></vxe-table-column>
-        <vxe-table-column field="updateTime" :formatter="formatDateTime" 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: 'overhaulPlanRecords',
-  data() {
-    return {
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      edit: false,
-      total: 0,
-      sortOrder: 'asc',
-      pageSize: 10,
-      currentPage: 1,
-      stationList: [],
-      stationCode: '',
-      stationName: undefined,
-      searchForm: {},
-      tableData: [],
-      loading: false,
-      modId: '',
-      checkSign: '',
-      capacity: null,
-    }
-  },
-  created() {
-    this.getStationCode()
-  },
-  mounted() {
-
-  },
-  computed: {},
-  methods: {
-    handlePageChange({currentPage, pageSize}) {
-      this.currentPage = currentPage
-      this.pageSize = pageSize
-      this.queryByStationCode();
-    },
-    //日期转换器
-    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.queryByStationCode()
-        } else {
-          this.queryByStationCode()
-        }
-      })
-    },
-    queryByStationCode() {
-      this.loading = true
-      const param = {
-        "currentPage": this.currentPage,
-        "pageSize": this.pageSize,
-        "stationCode": this.stationCode,
-      }
-      this.$axios.get('/overhaulPlanRecords/findByStationCode', {params: param}).then(response => {
-        this.tableData = response.data.records
-        this.total = response.data.total
-        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
-        }
-      }
-    }
-  }
-}
-</script>