瀏覽代碼

检修计划相关(初版)

fanxiaoyu 6 月之前
父節點
當前提交
f325409931

+ 7 - 0
cpp-admin/src/main/java/com/cpp/web/controller/configManager/ElectricFieldController.java

@@ -3,6 +3,7 @@ package com.cpp.web.controller.configManager;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.cpp.common.core.domain.R;
 import com.cpp.web.domain.datafactory.SftpChannel;
+import com.cpp.web.domain.overhaulplan.OverhaulPlan;
 import com.cpp.web.domain.station.ElectricField;
 import com.cpp.web.domain.station.enums.ProvinceEnum;
 import com.cpp.web.service.datafactory.SftpChannelService;
@@ -228,4 +229,10 @@ public class ElectricFieldController {
         List<ElectricField> electricFieldList = electricFieldService.list();
         return R.ok(electricFieldList);
     }
+
+    @ApiOperation(value = "通过条件查询装机容量", notes = "通过条件查询装机容量")
+    @GetMapping("/findCapacityByStationCode")
+    public R findCapacityByStationCode(String stationCode) {
+        return R.ok(electricFieldService.findByStationCode(stationCode));
+    }
 }

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

@@ -0,0 +1,83 @@
+package com.cpp.web.controller.overhaulPlan;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.cpp.common.core.domain.R;
+import com.cpp.web.domain.overhaulplan.OverhaulPlan;
+import com.cpp.web.service.overhaulplan.OverhaulPlanService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/overhaulplan")
+@Api(value = "overhaulplan", tags = "cpp_overhaul_plan管理")
+public class OverhaulPlanController {
+
+    private final OverhaulPlanService overhaulPlanService;
+
+    @ApiOperation(value = "分页查询所有", notes = "分页查询")
+    @GetMapping("/getList")
+    public R getList(Long currentPage,Long pageSize) {
+        Page page = new Page(currentPage, pageSize);
+        page.setMaxLimit((long) -1);
+        System.out.println(overhaulPlanService.page(page, overhaulPlanService.getList()));
+        return R.ok(overhaulPlanService.page(page, overhaulPlanService.getList()));
+    }
+
+
+    @ApiOperation(value = "新增检修计划信息", notes = "新增检修计划信息")
+    @PostMapping("/save")
+    public R save(@RequestBody OverhaulPlan overhaulPlan) {
+        return R.ok(overhaulPlanService.save(overhaulPlan));
+    }
+
+
+    @ApiOperation(value = "修改检修计划信息", notes = "修改检修计划信息")
+    @PostMapping("/updateById")
+    public R updateById(@RequestBody OverhaulPlan overhaulPlan) {
+        return R.ok(overhaulPlanService.updateById(overhaulPlan));
+    }
+
+
+    @ApiOperation(value = "删除检修计划", notes = "删除检修计划")
+    @PostMapping("/remove")
+    public R removeById(@RequestBody OverhaulPlan overhaulPlan) {
+        return R.ok(overhaulPlanService.removeById(overhaulPlan.getId()));
+    }
+
+
+    /**
+     * @param stationCode
+     * @param currentPage
+     * @param pageSize
+     * @return
+     */
+    @ApiOperation(value = "通过场站编号查询检修计划(分页查询)", notes = "通过场站编号查询检修计划(分页查询)")
+    @GetMapping("/stationCode")
+    public R getByStationCode( String stationCode,Long currentPage,Long pageSize,Integer status) {
+        Page page = new Page(currentPage,pageSize);
+        page.setMaxLimit((long)-1);
+        return R.ok(overhaulPlanService.page(page,overhaulPlanService.getByStationCode(stationCode,status)));
+    }
+
+    @ApiOperation(value = "通过场站编号查询检修计划", notes = "通过场站编号查询检修计划")
+    @GetMapping("/stationCode/noPage")
+    public R findByStationCode( String stationCode) {
+        return R.ok(overhaulPlanService.findByStationCode(stationCode));
+    }
+
+    @ApiOperation(value = "修改检修计划信息", notes = "修改检修计划信息")
+    @PostMapping("/updateStatus")
+    public R updateStatus(@RequestBody OverhaulPlan overhaulPlan) {
+        overhaulPlan.setStatus(2);
+        overhaulPlan.setMcTime(new Date());
+        return R.ok(overhaulPlanService.updateById(overhaulPlan));
+    }
+}

+ 27 - 0
cpp-admin/src/main/java/com/cpp/web/controller/overhaulPlan/OverhaulPlanRecordsController.java

@@ -0,0 +1,27 @@
+package com.cpp.web.controller.overhaulPlan;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.cpp.common.core.domain.R;
+import com.cpp.web.service.overhaulplan.OverhaulPlanRecordsService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/overhaulPlanRecords")
+@Api(value = "overhaulplanrecords", tags = "cpp_overhaul_plan_records管理")
+public class OverhaulPlanRecordsController {
+
+    private final OverhaulPlanRecordsService overhaulPlanRecordsService;
+    @ApiOperation(value = "通过场站编号查询记录(分页查询)", notes = "通过场站编号查询记录(分页查询)")
+    @GetMapping("/findByStationCode")
+    public R findByStationCode(String stationCode,Long pageSize,Long currentPage){
+        Page page = new Page(currentPage,pageSize);
+        page.setMaxLimit((long)-1);
+        return R.ok(overhaulPlanRecordsService.page(page,overhaulPlanRecordsService.getByStationCode(stationCode)));
+    }
+
+}

+ 87 - 0
cpp-admin/src/main/java/com/cpp/web/domain/overhaulplan/OverhaulPlan.java

@@ -0,0 +1,87 @@
+package com.cpp.web.domain.overhaulplan;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.cpp.web.domain.BaseCppEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.validation.constraints.Digits;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * cpp_overhaul_plan
+ *
+ * @author fxy
+ * @date 2024-10-08 9:47:33
+ */
+@Data
+@TableName("cpp_overhaul_plan")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "cpp_overhaul_plan")
+public class OverhaulPlan extends BaseCppEntity {
+
+    /**
+     * 描述
+     */
+    @ApiModelProperty(value = "描述")
+    private String description;
+
+    /**
+     * 描述
+     */
+    @ApiModelProperty(value = "检修名称")
+    private String name;
+
+
+    /**
+     * 开始时间
+     */
+    @ApiModelProperty(value = "开始时间")
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    @ApiModelProperty(value = "结束时间")
+    private Date endTime;
+
+    /**
+     * 检修容量(MW)
+     */
+    @ApiModelProperty(value = "检修容量(MW)")
+    @Digits(integer = 10, fraction = 2)
+    private BigDecimal overhaulCapacity = new BigDecimal(-99);
+
+    /**
+     * 检修个数
+     */
+    @ApiModelProperty(value = "检修台数")
+    private Integer maintenanceQuantity;
+
+    /**
+     * 状态:0 待执行 1 执行中 2 已完成
+     */
+    @ApiModelProperty(value = "状态")
+    private Integer status;
+
+    /**
+     * 生效时间
+     */
+    @ApiModelProperty(value = "生效时间")
+    private Date finalEntryTime;
+
+    /**
+     * 手动完成时间
+     */
+    @ApiModelProperty(value = "手动完成时间")
+    private Date mcTime;
+
+    /**
+     * 是否使用
+     */
+    @ApiModelProperty(value = "是否使用")
+    private boolean isUse;
+}

+ 57 - 0
cpp-admin/src/main/java/com/cpp/web/domain/overhaulplan/OverhaulPlanRecords.java

@@ -0,0 +1,57 @@
+package com.cpp.web.domain.overhaulplan;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.cpp.web.domain.BaseCppEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.validation.constraints.Digits;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * cpp_overhaul_plan_records
+ *
+ * @author fxy
+ * @date 2024-10-10 9:47:33
+ */
+@Data
+@TableName("cpp_overhaul_plan_records")
+@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;
+
+    /**
+     * 检修容量
+     */
+    @ApiModelProperty(value = "检修容量")
+    private BigDecimal overhaulCapacity;
+
+    /**
+     * 使用数据类型
+     */
+    @ApiModelProperty(value = "使用数据类型")
+    private String dataType;
+
+
+}

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

@@ -0,0 +1,23 @@
+package com.cpp.web.mapper.overhaulplan;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cpp.web.domain.overhaulplan.OverhaulPlan;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * cpp_overhaul_plan
+ *
+ * @author fxy
+ * @date 2024-10-08 9:47:33
+ */
+@Mapper
+public interface OverhaulPlanMapper extends BaseMapper<OverhaulPlan> {
+
+    @Select("select * from cpp_overhaul_plan where station_code = #{stationCode}")
+    List<OverhaulPlan> findBysStationCode(@Param("stationCode") String stationCode);
+}

+ 23 - 0
cpp-admin/src/main/java/com/cpp/web/mapper/overhaulplan/OverhaulPlanRecordsMapper.java

@@ -0,0 +1,23 @@
+package com.cpp.web.mapper.overhaulplan;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cpp.web.domain.overhaulplan.OverhaulPlan;
+import com.cpp.web.domain.overhaulplan.OverhaulPlanRecords;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * cpp_overhaul_plan_records
+ *
+ * @author fxy
+ * @date 2024-10-08 9:47:33
+ */
+@Mapper
+public interface OverhaulPlanRecordsMapper extends BaseMapper<OverhaulPlanRecords> {
+
+//    @Select("select * from cpp_overhaul_plan_records where station_code = #{stationCode}")
+//    List<OverhaulPlan> findBysStationCode(@Param("stationCode") String stationCode);
+}

+ 20 - 0
cpp-admin/src/main/java/com/cpp/web/service/overhaulplan/OverhaulPlanRecordsService.java

@@ -0,0 +1,20 @@
+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.List;
+
+/**
+ * cpp_overhaul_plan_records
+ *
+ * @author fxy
+ * @date 2024-10-08 9:47:33
+ */
+public interface OverhaulPlanRecordsService extends IService<OverhaulPlanRecords> {
+
+    QueryWrapper<OverhaulPlanRecords> getByStationCode(String stationCode);
+
+}

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

@@ -0,0 +1,23 @@
+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 java.util.List;
+
+/**
+ * cpp_overhaul_plan
+ *
+ * @author fxy
+ * @date 2024-10-08 9:47:33
+ */
+public interface OverhaulPlanService extends IService<OverhaulPlan> {
+
+    QueryWrapper<OverhaulPlan> getList();
+
+    QueryWrapper<OverhaulPlan> getByStationCode(String stationCode,Integer status);
+
+    List<OverhaulPlan> findByStationCode(String stationCode);
+
+}

+ 29 - 0
cpp-admin/src/main/java/com/cpp/web/service/overhaulplan/impl/OverhaulPlanRecordsServiceImpl.java

@@ -0,0 +1,29 @@
+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.overhaulplan.OverhaulPlanRecords;
+import com.cpp.web.mapper.overhaulplan.OverhaulPlanRecordsMapper;
+import com.cpp.web.service.overhaulplan.OverhaulPlanRecordsService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+ * cpp_overhaul_plan_records
+ *
+ * @author fxy
+ * @date 2024-10-08 9:47:33
+ */
+@Service
+@RequiredArgsConstructor
+public class OverhaulPlanRecordsServiceImpl extends ServiceImpl<OverhaulPlanRecordsMapper, OverhaulPlanRecords> implements OverhaulPlanRecordsService {
+
+    @Override
+    public QueryWrapper<OverhaulPlanRecords> getByStationCode(String stationCode) {
+        QueryWrapper<OverhaulPlanRecords> wrapper = new QueryWrapper<>();
+        if (!"".equals(stationCode)) {
+            wrapper.eq("station_code", stationCode);
+        }
+        return wrapper;
+    }
+}

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

@@ -0,0 +1,62 @@
+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.overhaulplan.OverhaulPlan;
+import com.cpp.web.domain.station.ElectricField;
+import com.cpp.web.mapper.overhaulplan.OverhaulPlanMapper;
+import com.cpp.web.service.overhaulplan.OverhaulPlanService;
+import io.swagger.models.auth.In;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * cpp_overhaul_plan
+ *
+ * @author fxy
+ * @date 2024-10-08 9:47:33
+ */
+@Service
+@RequiredArgsConstructor
+public class OverhaulPlanServiceImpl extends ServiceImpl<OverhaulPlanMapper, OverhaulPlan> implements OverhaulPlanService {
+
+    private final OverhaulPlanMapper overhaulPlanMapper;
+    /**
+     *  查询所有检修计划
+     * @return
+     */
+    @Override
+    public QueryWrapper<OverhaulPlan> getList() {
+        QueryWrapper<OverhaulPlan> wrapper = new QueryWrapper<>();
+        return wrapper;
+    }
+
+    /**
+     *  根据场站编号查询检修计划信息
+     * @param stationCode
+     * @return
+     */
+    @Override
+    public QueryWrapper<OverhaulPlan> getByStationCode(String stationCode, Integer status) {
+        QueryWrapper<OverhaulPlan> wrapper = new QueryWrapper<>();
+        if (null != status){
+            if (!"".equals(stationCode)){
+                wrapper.eq("station_code",stationCode);
+                wrapper.eq("status",status);
+            }
+        }else {
+            if (!"".equals(stationCode)){
+                wrapper.eq("station_code",stationCode);
+            }
+        }
+        return wrapper;
+    }
+
+    @Override
+    public List<OverhaulPlan> findByStationCode(String stationCode) {
+        List<OverhaulPlan> overhaulPlanList = overhaulPlanMapper.findBysStationCode(stationCode);
+        return overhaulPlanList;
+    }
+}

+ 537 - 0
cpp-ui/src/views/maintenancerelated/overhaulplan/index.vue

@@ -0,0 +1,537 @@
+<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 label="使用状态">
+        <el-select v-model="overhualStatus" placeholder="请选择" style="width: 255px" popper-class="cpp-popper" clearable>
+          <el-option
+            v-for="item in options"
+            :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>
+    <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-col :span="1.5">-->
+      <!--        <el-button-->
+      <!--          type="success"-->
+      <!--          plain-->
+      <!--          icon="el-icon-edit"-->
+      <!--          size="mini"-->
+      <!--          @click="handleUpdate"-->
+      <!--        >修改-->
+      <!--        </el-button>-->
+      <!--      </el-col>-->
+    </el-row>
+
+    <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="name" title="检修名称"></vxe-table-column>
+        <vxe-table-column field="description" title="描述"></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="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
+              v-if="row.status === 1"
+              style="padding: 3px 4px 3px 4px;margin: 2px; color: red; background-color: whitesmoke;"
+              size="mini"
+              icon="el-icon-error"
+              title="手动停止"
+              @click="stopOverhaulPlan(row)">废弃
+            </el-button>
+          </template>
+        </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>
+
+    <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>
+    </el-dialog>
+  </div>
+</template>
+
+
+<script>
+import form from "vxe-table/packages/form";
+
+export default {
+  name: 'overhaulPlan',
+  data() {
+    return {
+      options: [{
+        value: 1,
+        label: '使用中'
+      }, {
+        value: 2,
+        label: '已废弃'
+      }],
+      overhualStatus: null,
+      form: {
+        stationCode: '',
+        name: '',
+        startTime: '',
+        endTime: '',
+        overhaulCapacity: '',
+        maintenanceQuantity: '',
+        status: 1,
+        isUse: false,
+        mcTime: '',
+      },
+      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,
+      // 表单校验
+      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: '开始时间不能为空!'}
+        ],
+      },
+    }
+  },
+  created() {
+    this.getStationCode()
+  },
+  mounted() {
+
+  },
+  computed: {},
+  methods: {
+    // 表单重置
+    reset() {
+      this.edit = false;
+      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 = "新增检修计划";
+      this.edit = false;
+    },
+    /** 修改按钮操作 */
+    handleUpdate() {
+      this.title = "修改检修计划";
+      this.reset();
+      const _selectData = this.$refs.xTable.getRadioRecord(true)
+      if (_selectData == null) {
+        this.$message({
+          type: 'warning',
+          message: '请选择记录!'
+        });
+        return
+      }
+      this.open = true;
+      this.edit = true;
+      this.form = JSON.parse(JSON.stringify(_selectData))
+    },
+    // 提交按钮
+    async commitChannel() {
+      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 => {
+        this.tableData = 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, this.tableData, 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 {
+            // 新增操作
+            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) => {
+            })
+          }
+        }
+      });
+    },
+    // /** 删除按钮操作 */
+    // handleDelete() {
+    //   const _selectData = this.$refs.xTable.getRadioRecord(true)
+    //   if (_selectData == null) {
+    //     this.$message({
+    //       type: 'warning',
+    //       message: '请选择记录!'
+    //     });
+    //     return
+    //   }
+    //
+    //   this.$confirm('是否确认删除?', '提示', {
+    //     confirmButtonText: '确定',
+    //     cancelButtonText: '取消',
+    //     type: 'warning'
+    //   }).then(() => {
+    //     this.doDelete(_selectData)
+    //   }).catch(() => {
+    //   });
+    // },
+    /**
+     * 删除提交
+     */
+    // doDelete(row) {
+    //   this.$axios.post('/overhaulplan/remove', row).then((res) => {
+    //     this.$message.success('删除成功!')
+    //     this.dataQuery()
+    //   }).catch((error) => {
+    //   })
+    //   this.loading = false
+    // },
+    handlePageChange({currentPage, pageSize}) {
+      this.currentPage = currentPage
+      this.pageSize = pageSize
+      this.queryByStationCode();
+    },
+    // dataQuery() {
+    //   this.loading = true
+    //   const param = {
+    //     "currentPage": this.currentPage,
+    //     "pageSize": this.pageSize,
+    //   }
+    //   this.$axios.get('/overhaulplan/getList', {params: param}).then(response => {
+    //     this.tableData = response.data.records
+    //     this.total = response.data.total
+    //     this.loading = false
+    //   }).catch(() => {
+    //     this.loading = false
+    //   })
+    // },
+
+    //日期转换器
+    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
+    },
+    // 状态转换
+    statusFormatter(cellValue) {
+      return cellValue.cellValue === 1 ? '使用中' : '已废弃'
+    },
+    useFormatter(cellValue) {
+      return cellValue.cellValue === 0 ? '否' : '是'
+    },
+    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,
+        "status": this.overhualStatus
+      }
+      this.$axios.get('/overhaulplan/stationCode', {params: param}).then(response => {
+        this.tableData = response.data.records
+        this.total = response.data.total
+        this.loading = false
+      })
+    },
+    checkDate(v1, v2, v3, 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])
+      }
+      // 编辑修改
+      if (v3) {
+        for (let i = 0; i < v5.length; i++) {
+          if (v1[0] >= v5[i].startTime && v1[0] <= v5[i].endTime) {
+            result = true
+            break
+          }
+          if (v1[1] >= v5[i].startTime && v1[1] <= v5[i].endTime) {
+            result = true
+            break
+          }
+          if (v1[0] <= v5[i].startTime && v1[1] >= v5[i].endTime) {
+            result = true
+            break
+          }
+          if (v1[0] >= v5[i].startTime && v1[1] <= v5[i].endTime) {
+            result = true
+            break
+          }
+        }
+      } else {
+        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++) {
+        console.log("a"+ row.cellValue)
+        console.log("b" + codeList[i].value)
+        if (row.cellValue == codeList[i].value){
+          return codeList[i].label
+        }
+      }
+    }
+  }
+}
+</script>

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

@@ -0,0 +1,175 @@
+<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 label="使用状态">-->
+<!--        <el-select v-model="overhualStatus" placeholder="请选择" style="width: 255px" popper-class="cpp-popper" clearable>-->
+<!--          <el-option-->
+<!--            v-for="item in options"-->
+<!--            :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>
+<!--    <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>-->
+<!--      &lt;!&ndash;      <el-col :span="1.5">&ndash;&gt;-->
+<!--      &lt;!&ndash;        <el-button&ndash;&gt;-->
+<!--      &lt;!&ndash;          type="success"&ndash;&gt;-->
+<!--      &lt;!&ndash;          plain&ndash;&gt;-->
+<!--      &lt;!&ndash;          icon="el-icon-edit"&ndash;&gt;-->
+<!--      &lt;!&ndash;          size="mini"&ndash;&gt;-->
+<!--      &lt;!&ndash;          @click="handleUpdate"&ndash;&gt;-->
+<!--      &lt;!&ndash;        >修改&ndash;&gt;-->
+<!--      &lt;!&ndash;        </el-button>&ndash;&gt;-->
+<!--      &lt;!&ndash;      </el-col>&ndash;&gt;-->
+<!--    </el-row>-->
+
+    <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="dataType" 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>
+import form from "vxe-table/packages/form";
+
+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++) {
+        console.log("a"+ row.cellValue)
+        console.log("b" + codeList[i].value)
+        if (row.cellValue == codeList[i].value){
+          return codeList[i].label
+        }
+      }
+    }
+  }
+}
+</script>