浏览代码

增加多个实际功率

xusl 1 年之前
父节点
当前提交
db80a6ad26
共有 16 个文件被更改,包括 1177 次插入82 次删除
  1. 2 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/EquipmentTypeEnum.java
  2. 91 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/OverhaulPlanOne.java
  3. 32 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/OverhaulPlanOneRepository.java
  4. 8 1
      ipfcst/ipfcst-console/src/main/frontend/router/modules/console.js
  5. 3 3
      ipfcst/ipfcst-console/src/main/frontend/views/console/overHaulPlan/index.vue
  6. 545 0
      ipfcst/ipfcst-console/src/main/frontend/views/console/overHaulPlanOne/index.vue
  7. 15 3
      ipfcst/ipfcst-console/src/main/frontend/views/dataexchange/gatherdatapoint/index.vue
  8. 1 0
      ipfcst/ipfcst-console/src/main/frontend/views/dataexchange/tunnelinfo/index.vue
  9. 2 1
      ipfcst/ipfcst-console/src/main/frontend/views/enumeration.js
  10. 109 0
      ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/OverHaulOlanOneController.java
  11. 229 0
      ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/OverHaulPlanOneService.java
  12. 7 5
      ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/dataexchange/dataprocesser/datapacker/iml/PowerStationDataPacker.java
  13. 11 9
      ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/dataexchange/dataprocesser/datapacker/iml/PowerStationDataPackerOne.java
  14. 9 0
      ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/dataexchange/service/GetRealTimeDate4GenerateUploadFileService.java
  15. 86 60
      ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/dataexchange/service/SaveEquipmentStatusData.java
  16. 27 0
      ipfcst/ipfcst-console/src/main/resources/sql/t_equipment_attribute.sql

+ 2 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/EquipmentTypeEnum.java

@@ -76,6 +76,8 @@ public enum EquipmentTypeEnum {
         switch (code) {
             case 0:
                 return POWERSTATION;
+            case 21:
+                return POWERSTATION2;
             case 1:
                 return WEATHERSTATION;
             case 2:

+ 91 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/OverhaulPlanOne.java

@@ -0,0 +1,91 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import com.jiayue.ipfcst.common.data.abst.AbstractBaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.hibernate.annotations.GenericGenerator;
+
+import javax.persistence.*;
+import javax.validation.constraints.Digits;
+import java.math.BigDecimal;
+
+/**
+ * 风电检修计划
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/7/22 11:24
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+public class OverhaulPlanOne extends AbstractBaseEntity {
+
+
+    /**
+     * 编号
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
+    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
+    @Column
+    private Integer id;
+
+
+    /**
+     * 名称
+     */
+    @Column
+    private String name;
+
+    /**
+     * 描述
+     */
+    @Column
+    private String describe;
+
+    /**
+     * 开始时间
+     */
+    @Column
+    private Long startTime;
+
+    /**
+     * 结束时间
+     */
+    @Column
+    private Long endTime;
+
+    /**
+     * 检修容量,单位MW
+     */
+    @Column
+    @Digits(integer = 10, fraction = 2)
+    private BigDecimal overhaulCapactity;
+
+    /**
+     * 状态:改为执行中和关闭中
+     */
+    @Column
+    private Integer status;
+
+    /**
+     * 生效时间
+     */
+    @Column
+    private Long finalEntryTime;
+
+    /**
+     * 手动完成时间
+     * Manual completion time
+     */
+    private Long mcTime;
+
+    @Column
+    private String stationCode;
+
+    /*
+    backUpA 捆绑id
+     */
+
+}

+ 32 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/OverhaulPlanOneRepository.java

@@ -0,0 +1,32 @@
+package com.jiayue.ipfcst.common.data.repository;
+
+import com.jiayue.ipfcst.common.data.entity.OverhaulPlan;
+import com.jiayue.ipfcst.common.data.entity.OverhaulPlanOne;
+
+import java.util.List;
+
+/**
+ * 风电检修计划
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/9/26 11:44
+ */
+public interface OverhaulPlanOneRepository extends BaseRepository<OverhaulPlanOne, Integer> {
+	/**
+	 * 查询检修记录
+	 *
+	 * @param stTime 开始时间
+	 * @param eTime  结束时间
+	 * @return 检修记录
+	 */
+	List<OverhaulPlanOne> findByEndTimeGreaterThanEqualAndStartTimeLessThanEqual(Long stTime, Long eTime);
+	List<OverhaulPlanOne> findByEndTimeGreaterThanEqualAndStartTimeLessThanEqualAndStatus(Long stTime, Long eTime,Integer status);
+	List<OverhaulPlanOne> findByStartTimeLessThanAndEndTimeGreaterThanAndStatus(Long startTime,Long endTime,Integer status);
+
+	List<OverhaulPlanOne> findByEndTimeAfterAndStatus(Long time,Integer status);
+
+	List<OverhaulPlanOne> findByBackupAIsNull();
+
+	List<OverhaulPlanOne> findByBackupAIsNotNull();
+}

+ 8 - 1
ipfcst/ipfcst-console/src/main/frontend/router/modules/console.js

@@ -86,7 +86,14 @@ const consoleRouter = {
       path: 'overHaulPlan',
       component: () => import('@/views/console/overHaulPlan/index'),
       name: 'OverHaulPlan',
-      meta: { title: '检修计划', noCache: true },
+      meta: { title: '光伏检修计划', noCache: true },
+      sign: 'currency'
+    },
+    {
+      path: 'overHaulPlanOne',
+      component: () => import('@/views/console/overHaulPlanOne/index'),
+      name: 'OverHaulPlanOne',
+      meta: { title: '风电检修计划', noCache: true },
       sign: 'currency'
     },
     // {

+ 3 - 3
ipfcst/ipfcst-console/src/main/frontend/views/console/overHaulPlan/index.vue

@@ -3,8 +3,8 @@
     <el-card class="box-card">
       <div slot="header" class="clearfix">
         <span>检修计划</span>
-        <el-button style="float: right;padding:3px 10px 3px 3px;" type="text" @click="qrShow">二维码扫描上传
-        </el-button>
+<!--        <el-button style="float: right;padding:3px 10px 3px 3px;" type="text" @click="qrShow">二维码扫描上传-->
+<!--        </el-button>-->
         <el-button style="float: right;padding:3px 10px 3px 3px;" type="text" @click="exportDataEvent">导出数据
         </el-button>
       </div>
@@ -230,7 +230,7 @@ export default {
   methods: {
     getEl() {
       this.$axios.get("/electricField/").then(response => {
-        this.elCapacity = response.data.capacity
+        this.elCapacity = response.data.backupE
         this.getAll()
       })
     },

+ 545 - 0
ipfcst/ipfcst-console/src/main/frontend/views/console/overHaulPlanOne/index.vue

@@ -0,0 +1,545 @@
+<template>
+  <div class="app-container">
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>检修计划</span>
+<!--        <el-button style="float: right;padding:3px 10px 3px 3px;" type="text" @click="qrShow">二维码扫描上传-->
+<!--        </el-button>-->
+        <el-button style="float: right;padding:3px 10px 3px 3px;" type="text" @click="exportDataEvent">导出数据
+        </el-button>
+      </div>
+      <el-button type="primary" size="small" @click="insertEvent" style="round-clip: 10px"
+                 :loading="btnLonding">新增
+      </el-button>
+      <div>
+        <el-dialog
+          :close-on-click-modal="false"
+          :visible.sync="dialogVisible"
+          title="请扫描以下二维码"
+          style="padding: 0px;"
+          label-width="1px"
+          width="500px">
+          <!--            <el-image-->
+          <!--              src="http://www.baidu.com"-->
+          <!--              fit="fill"-->
+          <!--            />-->
+          <div id="qrCode" ref="qrCodeDiv" name="qrCodeDiv" align="center"></div>
+
+          <span
+            slot="footer"
+            class="dialog-footer">
+            <el-button
+              size="mini"
+              @click="cancel">关 闭</el-button>
+          </span>
+        </el-dialog>
+      </div>
+      <div style="padding-top: 10px">
+        <vxe-table
+          highlight-hover-row
+          :keep-source="true"
+          align="center"
+          :loading="loading"
+          v-loading="false"
+          ref="xTable"
+          auto-resize
+          highlight-current-row
+          border
+          resizable
+          show-overflow
+          :edit-rules="rules"
+          :data="tableData"
+          v-show="showTable"
+          :edit-config="{trigger: 'manual', mode: 'row',autoClear: false,icon:'none'}"
+        >
+          <vxe-table-column title="检修计划信息">
+            <vxe-table-column field="name" title="检修名称"
+                              :edit-render="{name:'$input',attrs:{type:'text'}}"></vxe-table-column>
+            <vxe-table-column field="describe" title="描述"
+                              :edit-render="{name:'$input',attrs:{type:'text'}}"></vxe-table-column>
+            <vxe-table-column width="14%" field="startTime" title="开始时间"
+                              :edit-render="{name:'$input',attrs:{type:'text'}}">
+              <template v-slot:edit="{ row }">
+                <el-date-picker
+                  style="width: 100%"
+                  v-model="row.startTime"
+                  type="datetime"
+                  value-format="timestamp"
+                  placeholder="选择开始时间"
+                  :readonly=startTimeShow
+                  :picker-options="pickerOptions1"/>
+              </template>
+              <template v-slot="{ row }">{{ timestampToTime(row.startTime) }}
+              </template>
+            </vxe-table-column>
+            <vxe-table-column width="14%" field="endTime" title="结束时间"
+                              :edit-render="{name:'$input',attrs:{type:'text'}}">
+              <template v-slot:edit="{ row }">
+                <el-date-picker
+                  style="width: 100%"
+                  v-model="row.endTime"
+                  type="datetime"
+                  value-format="timestamp"
+                  placeholder="选择结束时间"
+                  :picker-options="pickerOptions1"/>
+              </template>
+              <template v-slot="{ row }">{{
+                  timestampToTime(row.endTime)
+                }}
+              </template>
+            </vxe-table-column>
+            <!--            <vxe-table-column width="15%" field="finalEntryTime" title="生效时间"-->
+            <!--                              :edit-render="{}">-->
+            <!--              <template v-slot="{ row }">{{ timestampToTime(row.finalEntryTime) }}</template>-->
+            <!--            </vxe-table-column>-->
+            <vxe-table-column field="overhaulCapactity" title="检修容量(Mw)"
+                              :edit-render="{name:'$input',attrs:{type:'text'}}"></vxe-table-column>
+            <vxe-table-column field="status" title="计划状态">
+              <template v-slot="{ row }">{{ row.status == 2 ? '已停止' : '执行中' }}</template>
+            </vxe-table-column>
+            <vxe-table-column width="10%" field="createTime" title="创建时间">
+              <template v-slot="{ row }">{{ timestampToTime1(row.createTime) }}</template>
+            </vxe-table-column>
+            <vxe-table-column width="10%" field="lastModifyTime" title="最后修改时间">
+              <template v-slot="{ row }">{{ timestampToTime1(row.lastModifyTime) }}</template>
+            </vxe-table-column>
+            <vxe-table-column width="10%" field="mcTime" title="手动停止时间">
+              <template v-slot="{ row }">{{ timestampToTime1(row.mcTime) }}</template>
+            </vxe-table-column>
+            <vxe-table-column fixed="right" width="150" title="操作">
+              <template v-slot="{ row }">
+                <template v-if="$refs.xTable.isActiveByRow(row)">
+                  <el-button
+                    style="padding: 3px 4px 3px 4px;margin: 2px"
+                    size="mini"
+                    icon="el-icon-edit"
+                    :loading="saveLoding"
+                    @click="saveCheck(row)">保存
+                  </el-button>
+                  <el-button
+                    style="padding: 3px 4px 3px 4px;margin: 2px"
+                    size="mini"
+                    icon="el-icon-edit"
+                    @click="cancelRowEvent(row)">取消
+                  </el-button>
+                </template>
+                <template v-else>
+                  <el-button
+                    v-show="row.status==1"
+                    style="padding: 3px 4px 3px 4px;margin: 2px"
+                    size="mini"
+                    icon="el-icon-edit"
+                    @click="editRowEvent(row)"
+                    :loading="btnLonding">编辑
+                  </el-button>
+                  <el-button
+                    v-show="row.status==1&&row.finalEntryTime>now"
+                    type="danger"
+                    style="padding: 3px 4px 3px 4px;margin: 2px"
+                    size="mini"
+                    icon="el-icon-delete"
+                    @click="removeEvent(row)"
+                    :loading=btnLonding>删除
+                  </el-button>
+                  <el-button
+                    v-show="row.finalEntryTime<now&&row.id!=undefined&&row.status==1"
+                    type="success"
+                    style="padding: 3px 4px 3px 4px;margin: 2px"
+                    size="mini"
+                    icon="el-icon-check"
+                    :loading="saveLoding"
+                    title="手动停止"
+                    @click="fulSaveRowEvent(row)">停止
+                  </el-button>
+                </template>
+              </template>
+            </vxe-table-column>
+          </vxe-table-column>
+        </vxe-table>
+        <vxe-pager
+          perfect
+          :current-page.sync="currentPage"
+          :page-size.sync="pageSize"
+          :total="total"
+          :page-sizes=[10,50,100]
+          :layouts="['PrevJump', 'PrevPage','JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']"
+          @page-change="handlePageChange"
+          v-show="showTable"
+        ><!--v-show="!btnLonding"-->
+        </vxe-pager>
+      </div>
+
+
+    </el-card>
+  </div>
+</template>
+<script>
+import request from '@/utils/request'
+import QRCode from 'qrcodejs2';
+export default {
+  data() {
+    return {
+      now: new Date().getTime(),
+      checkSign: '',
+      checkTableDate: [],
+      holidayType: '',
+      loading: false,
+      dialogVisible: false,
+      generateOverHaulPlanCodeContentData:'',
+      saveLoding: false,
+      showTable: true,
+      btnLonding: false,
+      tableData: [],
+      currentPage: 1,
+      pageSize: 10,
+      total: 0,
+      elCapacity: 0,
+      startTimeShow:false,
+      //表单验证规则
+      rules: {
+        name: [
+          {required: true, message: ' 检修名称不能为空'},
+          {min: 1, max: 9, message: '称长度在 1 到 9 个字符'}
+        ],
+        describe: [
+          {required: true, message: '请填写检修计划描述,原因等'},
+          {min: 1, max: 9, message: '名称长度在 1 到 9 个字符'}
+        ],
+        startTime: [
+          {required: true, message: '开始时间不能为空'}
+        ],
+        overhaulCapactity: [
+          { required: true, message: '不能为空' },
+          { pattern: /^\d+(\.\d{2})?$/, message: '只能输入正数数字或带两位小数的数字' }
+          // {message: '输入过长', max: 50}
+
+        ]
+      },
+      //当前日期之前日期不可选
+      pickerOptions1: {
+        disabledDate(time) {
+          return time.getTime() < Date.now() - 8.64e7;
+          // return time.getTime() <= Date.now();
+        }
+      }
+    }
+  },
+  created() {
+    this.getEl()
+  },
+  methods: {
+    getEl() {
+      this.$axios.get("/electricField/").then(response => {
+        this.elCapacity = response.data.backupF
+        this.getAll()
+      })
+    },
+    getAll() {
+      this.now = (new Date()).getTime()
+      this.loading = true
+      this.saveLoding = false
+      this.$axios.get("/overHaulPlanOne/" + this.currentPage + '/' + this.pageSize).then(response => {
+        if (response.data.content == "") {
+          this.showTable = false
+
+        } else {
+          this.showTable = true
+        }
+        this.tableData = response.data.content
+        this.total = response.data.count
+
+        if (response.data.totalElements != 0) {
+
+          this.total = response.data.totalElements
+        }
+        this.loading = false
+
+      })
+      this.generateOverHaulPlanCodeContent()
+    },
+    //编辑框改变
+    editRowEvent(row) {
+      this.startTimeShow = false
+      if(row.startTime < new Date().getTime()){
+        this.startTimeShow = true
+      }
+      this.checkSign = true
+      this.btnLonding = true
+      this.$refs.xTable.setActiveRow(row)
+    },
+    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] >= v2[i].startTime && v1[0] <= v2[i].endTime) {
+            result = true
+            break
+          }
+          if (v1[1] >= v2[i].startTime && v1[1] <= v2[i].endTime) {
+            result = true
+            break
+          }
+          if (v1[0] <= v2[i].startTime && v1[1] >= v2[i].endTime) {
+            result = true
+            break
+          }
+          if (v1[0] >= v2[i].startTime && v1[1] <= v2[i].endTime) {
+            result = true
+            break
+          }
+        }
+      }
+      return result
+    },
+    //数据校验
+    saveCheck(row) {
+
+      this.$refs.xTable.validate(row, callback => {
+        if(row.startTime<new Date().getTime()&&!this.startTimeShow){
+          this.$XModal.message({status: 'error', message: '开始时间不能小于当前时间!'})
+        }else if(row.overhaulCapactity>this.elCapacity){
+          this.$XModal.message({status: 'error', message: '检修容量不能大于装机容量!'})
+        } else if (row.startTime == null || row.endTime == null) {
+          // callback(new Error('开始结束日期不能为空'))
+          this.$XModal.message({status: 'error', message: '开始结束日期不能为空!'})
+        } else {
+          var timeStartEnd = [row.startTime,row.endTime]
+          if (this.checkDate(timeStartEnd, this.tableData, this.checkSign, row)) {
+            this.$XModal.message({status: 'error', message: '该时间段已有检修计划!'})
+          } else {
+            callback:this.saveRowEvent(row)
+          }
+        }
+      })
+    },
+    //保存数据操作
+    saveRowEvent(row) {
+      this.saveLoding = true
+      this.$refs.xTable.validate(valid => {
+        if (valid) {
+          if (row.id == undefined) {
+            row.status = '1'
+            this.$axios.post("/overHaulPlanOne/", row).then(response => {
+              this.getAll()
+              this.$XModal.message({status: 'warning', message: response.message})
+              this.saveLoding = false
+            })
+          } else {
+            this.$axios.put("/overHaulPlanOne/", row).then(response => {
+              this.getAll()
+              this.$XModal.message({status: 'warning', message: response.message})
+              this.saveLoding = false
+
+            })
+          }
+          this.btnLonding = false
+        } else {
+          this.$XModal.message({status: 'error', message: '校验不通过!'})
+          this.saveLoding = false
+        }
+
+      })
+    },
+    //停止数据操作
+    fulSaveRowEvent(row) {
+      this.$XModal.confirm('您点击了手动停止,是否确认停止?').then(type => {
+        this.saveLoding = true
+        this.$refs.xTable.validate(valid => {
+          if (valid) {
+            row.status = '2'
+            this.$axios.put("/overHaulPlanOne/", row).then(response => {
+              this.getAll()
+              this.$XModal.message({status: 'warning', message: response.message})
+              this.saveLoding = false
+            })
+          } else {
+            this.$XModal.message({status: 'error', message: '校验不通过!'})
+            this.saveLoding = false
+          }
+          this.btnLonding = false
+        })
+      })
+    },
+    //取消编辑或添加操作
+    cancelRowEvent(row) {
+      this.saveLoding = false
+      this.btnLonding = false
+      const xTable = this.$refs.xTable
+      if (row.id == undefined) {
+        this.$refs.xTable.remove(row)
+      } else {
+        xTable.clearActived().then(() => {
+          // 还原行数据
+          xTable.revertData(row)
+        })
+      }
+    },
+    //删除数据
+    removeEvent(row) {
+      this.$XModal.confirm('您确定要删除该数据?').then(type => {
+        if (type === 'confirm') {
+          this.$axios.delete("/overHaulPlanOne/", {data: row}).then(response => {
+            this.$XModal.message({status: 'warning', message: response.message})
+            this.getAll()
+          })
+        }
+      })
+    },
+    //时间戳日期转换器
+    timestampToTime(time) {
+      const date = new Date(time) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
+      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
+    },
+    timestampToTime1(time) {
+      if (time == undefined) {
+        return '空'
+      }
+      const date = new Date(time) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
+      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
+    },
+    //新增编辑框
+    insertEvent() {
+      this.startTimeShow = false
+      this.showTable = true
+      this.btnLonding = true
+      this.checkSign = false
+      this.timeStartEnd = []
+      this.$refs.xTable.insert()
+        .then(({row}) => this.$refs.xTable.setActiveRow(row))
+    },
+    //分页出发事件
+    handlePageChange({currentPage, pageSize}) {
+      this.currentPage = currentPage
+      this.pageSize = pageSize
+      this.getAll()
+    },
+    /*handleSizeChange(size) {
+        this.pageSize = size
+        this.getAll()
+    },
+    handleCurrentChange(currentPage) {
+        this.currentPage = currentPage
+        this.getAll()
+    },*/
+    //导出
+    qrShow(){
+      this.dialogVisible = true
+      this.$nextTick(() => {
+        var divs = document.getElementsByName('qrCodeDiv')
+        for(var j = 0;j<divs.length;j++){
+          divs[j].innerHTML = ""
+        }
+        new QRCode(this.$refs.qrCodeDiv, {
+          text: this.generateOverHaulPlanCodeContentData[0],
+          width: 300,
+          height: 300,
+          colorDark: "#333333", //二维码颜色
+          colorLight: "#ffffff", //二维码背景色
+          correctLevel: QRCode.CorrectLevel.L//容错率,L/M/H
+        })
+      })
+
+    },
+    generateOverHaulPlanCodeContent(){
+      this.$axios.get("/overHaulPlanOne/generateOverHaulPlanCodeContent").then(response => {
+        console.log(response.data)
+        this.generateOverHaulPlanCodeContentData =  response.data
+      })
+
+    },
+    cancel(){
+
+      this.dialogVisible = false
+    },
+    exportDataEvent() {
+      this.loading = true
+      this.$axios.get('/overHaulPlanOne/').then(res => {
+        const data = res.data
+
+        for(let i = 0;i<data.length;i++){
+          data[i].startTime = this.timestampToTime1(data[i].startTime)
+          data[i].endTime = this.timestampToTime1(data[i].endTime)
+          data[i].finalEntryTime = this.timestampToTime1(data[i].finalEntryTime)
+          data[i].createTime = this.timestampToTime1(data[i].createTime)
+          data[i].mcTime = this.timestampToTime1(data[i].mcTime)
+        }
+
+        this.$refs.xTable.exportData({
+          filename: '检修计划信息',
+          type: 'csv',
+          isHeader: true,
+          isFooter: true,
+          data
+        })
+        this.loading = false
+      }).catch(e => {
+      })
+    },
+    //导入
+    importDataEvent() {
+      this.$refs.xTable.importData({types: ['csv']})
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.app-container {
+  /*left: 0;*/
+  /*width: 100%;*/
+  /*min-height: 100%;*/
+  /*height: auto;*/
+  /*background-image: linear-gradient(25deg, #05362d, #145d44, #24875d, #35b477)*/
+
+}
+
+.pagination {
+  margin: 20px 0;
+  text-align: right;
+}
+</style>

+ 15 - 3
ipfcst/ipfcst-console/src/main/frontend/views/dataexchange/gatherdatapoint/index.vue

@@ -586,7 +586,7 @@ export default {
     changeEqA() {
       if (this.formateEqType(this.formData.eqType)) {
         this.code = this.tempId
-        if (this.tempId === 0) {
+        if (this.tempId === 0 || this.tempId === 21) {
           this.$axios.get('/electricField/').then(res => {
             // console.log(res.data)
             this.eqData = []
@@ -618,6 +618,9 @@ export default {
       if (this.formData.eqType === 'POWERSTATION') {
         this.formData.equipmentId = 0
       }
+      if (this.formData.eqType === 'POWERSTATION2') {
+        this.formData.equipmentId = 21
+      }
       this.$delete(this.formData, 'eqType')
       if(this.formData.dataSource ==='GENERATE' && this.formData.generationRegulation === '系统自动计算'){
         this.formData.generationRegulation = '1'
@@ -669,7 +672,7 @@ export default {
       this.saveFlag = 2
       this.resetShow = false
       this.modelId = row.id
-      if(row.equipmentAttribute.id === 100 && row.equipmentAttribute.equipmentType.code === 0){
+      if((row.equipmentAttribute.id === 100 && row.equipmentAttribute.equipmentType.code === 0) || (row.equipmentAttribute.id === 7003 && row.equipmentAttribute.equipmentType.code === 0)){
         this.needShow = false
       }
       this.formData = {
@@ -838,6 +841,13 @@ export default {
               this.needShow = false
             }
           }
+          if (this.formData.eqType === 'POWERSTATION2') {
+            equipmentId = 21
+            //设备属性为实际功率不展示考核的四项
+            if(this.formData.equipmentAttribute.id === 7003){
+              this.needShow = false
+            }
+          }
           this.$axios.get('/dataExchange/protocolDataPoint/getProtocolGatherDataPoint/' + equipmentId + '/' + this.formData.equipmentAttribute.id).then((res) => {
             if (res.data.length === 0) {
               this.buttonShow = false
@@ -933,6 +943,7 @@ export default {
     formateEq(code) {
       let returnValue = ''
       if (code === 0) returnValue = 'POWERSTATION'
+      if (code === 21) returnValue = 'POWERSTATION2'
       if (code === 1) returnValue = 'WEATHERSTATION'
       if (code === 2) returnValue = 'INVERTER'
       if (code === 3) returnValue = 'WINDTOWER'
@@ -960,6 +971,7 @@ export default {
       this.tempId = ''
       let returnValue = ''
       if (eqType === 'POWERSTATION') returnValue = 0
+      if (eqType === 'POWERSTATION2') returnValue = 21
       if (eqType === 'WEATHERSTATION') returnValue = 1
       if (eqType === 'INVERTER') returnValue = 2
       if (eqType === 'WINDTOWER') returnValue = 3
@@ -1040,7 +1052,7 @@ export default {
     // 设备id转名称
     formateEqId(row, column) {
       let belongTo = '未知设备名称'
-      if (row.row.equipmentAttribute.equipmentType.code === 0) {
+      if (row.row.equipmentAttribute.equipmentType.code === 0 || row.row.equipmentAttribute.equipmentType.code === 21) {
         belongTo = this.elTableData[0].name
       } else {
         for (let i = 0; i < this.eqTableData.length; i++) {

+ 1 - 0
ipfcst/ipfcst-console/src/main/frontend/views/dataexchange/tunnelinfo/index.vue

@@ -1345,6 +1345,7 @@ export default {
     },
     getEl() {
       this.$axios.get('/electricField/').then(res => {
+        this.elTableData.length=0
         this.elTableData.push(res.data)
         this.form.efiId = this.elTableData[0].stationCode
         this.ef = this.elTableData[0].stationCode

+ 2 - 1
ipfcst/ipfcst-console/src/main/frontend/views/enumeration.js

@@ -29,7 +29,8 @@ export default {
     {value: 'WINDTURBINE', label: '风机'}
   ],
   equipmentTypeEnum: [
-    {value: 'POWERSTATION', label: '发电站', key: 0},
+    {value: 'POWERSTATION', label: '光伏发电站', key: 0},
+    {value: 'POWERSTATION2', label: '风电发电站', key: 21},
     {value: 'WEATHERSTATION', label: '气象站', key: 1},
     {value: 'INVERTER', label: '逆变器', key: 2},
     {value: 'WINDTOWER', label: '测风塔', key: 3},

+ 109 - 0
ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/OverHaulOlanOneController.java

@@ -0,0 +1,109 @@
+package com.jiayue.ipfcst.console.controller;
+
+import com.jiayue.ipfcst.common.core.exception.BusinessException;
+import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
+import com.jiayue.ipfcst.common.data.entity.OverhaulPlanOne;
+import com.jiayue.ipfcst.console.service.OverHaulPlanOneService;
+import lombok.SneakyThrows;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * 检修计划信息restful接口
+ *
+ * @author tl
+ * @version 3.0
+ * @since 2020/03/27 10:12
+ */
+@RestController
+@RequestMapping("overHaulPlanOne")
+public class OverHaulOlanOneController {
+  final private OverHaulPlanOneService overHaulPlanOneService;
+  @Autowired
+  public OverHaulOlanOneController(OverHaulPlanOneService overHaulPlanOneService){
+    this.overHaulPlanOneService = overHaulPlanOneService;
+  }
+  /**
+   * 新增 检修计划接口
+   *
+   * @param overhaulPlan
+   * @return 操作结果
+   */
+
+  @PostMapping
+  public ResponseVO insert(@RequestBody OverhaulPlanOne overhaulPlan){
+    this.overHaulPlanOneService.add(overhaulPlan);
+    return ResponseVO.success(1);
+  }
+
+  /**
+   * 修改 检修计划接口
+   */
+  @PutMapping
+  public ResponseVO update(@RequestBody OverhaulPlanOne overhaulPlan) throws BusinessException {
+    this.overHaulPlanOneService.save(overhaulPlan);
+    return ResponseVO.success(1);
+  }
+
+  /**
+   * 删除 检修计划接口
+   * @param overhaulPlan
+   * @return 操作结果
+   */
+  @DeleteMapping
+  public ResponseVO delete(@RequestBody OverhaulPlanOne overhaulPlan){
+    this.overHaulPlanOneService.delete(overhaulPlan.getId());
+    return ResponseVO.success(1);
+  }
+
+  /**
+   * 获取 检修计划接口
+   * @param page 页码
+   * @param size 条数
+   * @return 操作结果
+   */
+  @SneakyThrows
+  @GetMapping(value = "/{page}/{size}")
+  public ResponseVO get(@PathVariable("page") Integer page, @PathVariable("size") Integer size) {
+    OverhaulPlanOne overhaulPlan = new OverhaulPlanOne();
+    Page<OverhaulPlanOne> overhaulPlanCalendarPage = this.overHaulPlanOneService.get(overhaulPlan, page, size);
+    return ResponseVO.success(overhaulPlanCalendarPage);
+  }
+
+  /**
+   * 获取全部 检修计划接口
+   * @return 操作结果
+   */
+  @SneakyThrows
+  @GetMapping()
+  public ResponseVO getAll() {
+    List<OverhaulPlanOne> list = this.overHaulPlanOneService.getAll();
+    return ResponseVO.success(list);
+  }
+
+  @GetMapping("/generateOverHaulPlanCodeContent")
+  public ResponseVO generateOverHaulPlanCodeContent() throws IOException, BusinessException {
+    List<String> list = this.overHaulPlanOneService.generateOverHaulPlanCodeContent();
+    return ResponseVO.success(list);
+  }
+
+//
+//  @GetMapping("/getAllOpGroup")
+//  public ResponseVO get(){
+//    List<OpGroup> allOpGroup = overHaulPlanService.getAllOpGroup();
+//
+//    return ResponseVO.success(allOpGroup);
+//  }
+//
+//
+//  @GetMapping("/getMaintenanceInformation")
+//  public ResponseVO getMaintenanceInformation(){
+//    return ResponseVO.success(overHaulPlanService.getMaintenanceInformation());
+//  }
+
+
+}

+ 229 - 0
ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/OverHaulPlanOneService.java

@@ -0,0 +1,229 @@
+package com.jiayue.ipfcst.console.service;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.json.JSONObject;
+import com.jiayue.ipfcst.common.core.exception.BusinessException;
+import com.jiayue.ipfcst.common.core.util.JsonBeanUtil;
+import com.jiayue.ipfcst.common.data.entity.ElectricField;
+import com.jiayue.ipfcst.common.data.entity.OverhaulPlan;
+import com.jiayue.ipfcst.common.data.entity.OverhaulPlanOne;
+import com.jiayue.ipfcst.common.data.repository.ElectricFieldRepository;
+import com.jiayue.ipfcst.common.data.repository.OverhaulPlanOneRepository;
+import com.jiayue.ipfcst.console.util.GzipUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.*;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.*;
+
+/**
+ * 检修计划业务层
+ *
+ * @author Tangle
+ * @version 1.0
+ * @since 2020/03/27 10:02
+ */
+@Service
+@Slf4j
+public class OverHaulPlanOneService {
+  private final OverhaulPlanOneRepository overhaulPlanOneRepository;
+
+  private final ElectricFieldRepository electricFieldRepository;
+
+  @Autowired
+  public OverHaulPlanOneService(OverhaulPlanOneRepository overhaulPlanOneRepository, ElectricFieldRepository electricFieldRepository) {
+    this.overhaulPlanOneRepository = overhaulPlanOneRepository;
+    this.electricFieldRepository = electricFieldRepository;
+  }
+
+  /**
+   * 新增检修计划
+   *
+   * @param overhaulPlan 检修计划实体
+   */
+  public void add(OverhaulPlanOne overhaulPlan) {
+    overhaulPlan.setFinalEntryTime(overhaulPlan.getStartTime());
+    this.overhaulPlanOneRepository.save(overhaulPlan);
+  }
+
+  /**
+   * 修改检修计划信息
+   *
+   * @param overhaulPlan
+   * @throws BusinessException
+   */
+  public void save(OverhaulPlanOne overhaulPlan) throws BusinessException {
+    if (overhaulPlan.getId() == null) {
+      throw new BusinessException("修改时主键不能为空");
+    } else {
+      Calendar calendar = Calendar.getInstance();
+      if (overhaulPlan.getStatus() == 2) {
+        calendar.setTime(new Date());
+        overhaulPlan.setMcTime(calendar.getTimeInMillis());
+      }
+      overhaulPlan.setFinalEntryTime(overhaulPlan.getStartTime());
+      this.overhaulPlanOneRepository.save(overhaulPlan);
+    }
+  }
+
+  /**
+   * 删除检修计划信息
+   *
+   * @param id 主键
+   */
+  public void delete(final Integer id) {
+    this.overhaulPlanOneRepository.deleteById(id);
+  }
+
+  /**
+   * 查询检修计划信息(分页)
+   */
+  public Page<OverhaulPlanOne> get(final OverhaulPlanOne overhaulPlan, final Integer page, final Integer size) {
+    getAll();
+    ExampleMatcher matcher =
+      ExampleMatcher.matching().withMatcher("id", ExampleMatcher.GenericPropertyMatchers.contains());
+    Example<OverhaulPlanOne> example = Example.of(overhaulPlan, matcher);
+    Pageable pageable = PageRequest.of(page - 1, size);
+    return overhaulPlanOneRepository.findAll(example, pageable);
+
+  }
+
+  /**
+   * 查询检修计划信息
+   */
+  @Transactional
+  public List<OverhaulPlanOne> getAll() {
+    List<OverhaulPlanOne> overhaulPlans = overhaulPlanOneRepository.findAll();
+    List<OverhaulPlanOne> overhaulPlansResult = new ArrayList<>();
+    overhaulPlans.forEach(s->{
+      long a = s.getEndTime();
+      long b = System.currentTimeMillis();
+      if(a< b){
+        s.setStatus(2);
+        overhaulPlanOneRepository.save(s);
+      }
+      overhaulPlansResult.add(s);
+    });
+
+
+    return overhaulPlansResult;
+
+  }
+
+  /**
+   * 计算出距离当前最近且在当前时间之后的时间
+   *
+   * @return
+   */
+  public OverhaulPlanOne findByNextTime() {
+
+    List<OverhaulPlanOne> overhaulPlanList = overhaulPlanOneRepository.findAll();
+    OverhaulPlanOne overhaulPlan1 = new OverhaulPlanOne();
+    overhaulPlan1.setStartTime(0L);
+    if (overhaulPlanList.size() > 0) {
+
+      Long time = System.currentTimeMillis();
+      for (OverhaulPlanOne overhaulPlan : overhaulPlanList) {
+        if (overhaulPlan.getStartTime() > time) {
+          Long difference = overhaulPlan.getStartTime() - time;
+          if (overhaulPlan1.getStartTime() == 0) {
+            overhaulPlan1 = overhaulPlan;
+          }
+          if (difference > 0L && difference < overhaulPlan1.getStartTime()) {
+            overhaulPlan1 = overhaulPlan;
+          }
+        }
+      }
+    }
+
+    return overhaulPlan1;
+  }
+
+  /**
+   * 单条数据更新操作
+   * @param bean
+   */
+  @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+  public void saveCloud(OverhaulPlanOne bean) {
+    Optional<OverhaulPlanOne> optional = overhaulPlanOneRepository.findById(bean.getId());
+    if (optional.isPresent()) {
+      bean.setId(optional.get().getId());
+    }
+    overhaulPlanOneRepository.save(bean);
+  }
+
+  /**
+   * 先清空本地数据,再保存新数据
+   * @param overhaulPlans
+   */
+  @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+  public void saveCloud(List<OverhaulPlanOne> overhaulPlans) {
+    if (null != overhaulPlans && overhaulPlans.size() > 0) {
+      overhaulPlanOneRepository.deleteAll();
+      overhaulPlanOneRepository.saveAll(overhaulPlans);
+    }
+  }
+
+  /**
+   * 获取当前时间检修容量
+   */
+  public BigDecimal getOverhaulCapacity(){
+    BigDecimal overhaulCapacity = new BigDecimal(0);
+    long time = System.currentTimeMillis();
+    List<OverhaulPlanOne> overhaulPlans = overhaulPlanOneRepository.findByStartTimeLessThanAndEndTimeGreaterThanAndStatus(time, time, 1);
+    if(overhaulPlans.size()>0){
+      overhaulCapacity = overhaulPlans.get(0).getOverhaulCapactity();
+    }
+    return overhaulCapacity;
+  }
+
+  /**
+   * 检修计划二维码内容生成
+   *
+   * @return 二维码生成内容集
+   * @throws IOException       io异常
+   * @throws BusinessException 业务异常
+   */
+  public List<String> generateOverHaulPlanCodeContent() throws IOException, BusinessException {
+
+    ElectricField electricField = electricFieldRepository.findAll().get(0);
+
+    String content = electricField.getStationCode() + "|";
+
+    List<OverhaulPlanOne> overhaulPlanList = overhaulPlanOneRepository.findAll();
+
+    content = JsonBeanUtil.beanToJson(overhaulPlanList);
+
+    List<String> qrCodeContents = GzipUtil.zipList(content);
+    List<String> result = new ArrayList<>();
+    String taskNo = getTaskNo(electricField);
+    for (int i = 0; i < qrCodeContents.size(); i++) {
+      JSONObject jsonObject = new JSONObject();
+      jsonObject.putOnce("taskNo", taskNo);
+      jsonObject.putOnce("taskType", "stationData-jx");
+      jsonObject.putOnce("partNo", i + 1);
+      jsonObject.putOnce("partTotal", qrCodeContents.size());
+      jsonObject.putOnce("data", qrCodeContents.get(i));
+      result.add(i, jsonObject.toString());
+    }
+
+    return result;
+  }
+
+  /**
+   * 获取taskNo编号
+   *
+   * @param electricField 场站对象
+   * @return 编号
+   */
+
+  private String getTaskNo(ElectricField electricField) {
+    Date date = DateUtil.date();
+    return electricField.getStationCode() + DateUtil.format(date, "yyMMddHHmmss");
+  }
+}

+ 7 - 5
ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/dataexchange/dataprocesser/datapacker/iml/PowerStationDataPacker.java

@@ -400,7 +400,7 @@ public class PowerStationDataPacker extends AbstractDataPacker<PowerStationStatu
    */
   private void initPowerFilter(Integer point) {
     ProtocolDataContainer.getInstance().getDataFiltering().addFilter(point, (val) -> {
-      if (val.compareTo(getElectricField().getCapacity().multiply(BigDecimal.valueOf(1.5D))) > 0) {
+      if (val.compareTo(new BigDecimal(getElectricField().getBackupE()).multiply(BigDecimal.valueOf(1.5D))) > 0) {
         log.info("实际功率超装机容量的1.5倍,值为:" + val + ",抛出异常");
         throw new RuntimeException("实际功率超装机容量的1.5倍");
       }
@@ -483,6 +483,7 @@ public class PowerStationDataPacker extends AbstractDataPacker<PowerStationStatu
       if (electricField != null) {
         this.electricField = electricField;
       }
+      electricField.setCapacity(new BigDecimal(electricField.getBackupE()));
       electricField.setElectricFieldTypeEnum(ElectricFieldTypeEnum.E1);
       return this.electricField;
     }
@@ -556,14 +557,15 @@ public class PowerStationDataPacker extends AbstractDataPacker<PowerStationStatu
     public PowerStationStatusData packageData () throws DataExchangeException {
       PowerStationStatusData powerStationStatusData = new PowerStationStatusData();
       try {
+        BigDecimal cap = new BigDecimal(getElectricField().getBackupE());
         //设定时间
         powerStationStatusData.setTime(DateTime.now().withMillisOfSecond(0).withSecondOfMinute(0).toDate());
         //设定容量
-        powerStationStatusData.setCapacity(new BigDecimal(this.getElectricField().getBackupE()));
+        powerStationStatusData.setCapacity(cap);
         //设定并网设备数
 //        powerStationStatusData.setOnGridNum(this.getElectricField().getGridCE());
         //设定开机容量为装机容量
-        powerStationStatusData.setOpenCapacity(new BigDecimal(this.getElectricField().getBackupE()).subtract(overHaulPlanService.getOverhaulCapacity()));
+        powerStationStatusData.setOpenCapacity(cap.subtract(overHaulPlanService.getOverhaulCapacity()));
         //设定场站状态
 //        powerStationStatusData.setStatus(this.getElectricField().getElectricFieldTypeEnum().getCode());
         //设定实际功率
@@ -573,7 +575,7 @@ public class PowerStationDataPacker extends AbstractDataPacker<PowerStationStatu
         if (powerStationStatusData.getReferencePowerBySample() == null || powerStationStatusData.getReferencePowerBySample().compareTo(powerStationStatusData.getRealValue()) == -1) {
           log.warn("样板机法计算值小于实际功率异常,值为:" + powerStationStatusData.getReferencePowerBySample());
           powerStationStatusData.setAbnormalOfSample(powerStationStatusData.getReferencePowerBySample());
-          powerStationStatusData.setReferencePowerBySample(((getElectricField().getCapacity().subtract(powerStationStatusData.getRealValue())).multiply(BigDecimal.valueOf(random.nextFloat())).multiply(BigDecimal.valueOf(0.001))).add(powerStationStatusData.getRealValue()).setScale(2, BigDecimal.ROUND_HALF_UP));
+          powerStationStatusData.setReferencePowerBySample(((powerStationStatusData.getCapacity().subtract(powerStationStatusData.getRealValue())).multiply(BigDecimal.valueOf(random.nextFloat())).multiply(BigDecimal.valueOf(0.001))).add(powerStationStatusData.getRealValue()).setScale(2, BigDecimal.ROUND_HALF_UP));
         } else if (powerStationStatusData.getReferencePowerBySample().compareTo(powerStationStatusData.getCapacity()) == 1) {
           log.warn("样板机法计算值超装机容量异常,值为:" + powerStationStatusData.getReferencePowerBySample());
           powerStationStatusData.setAbnormalOfSample(powerStationStatusData.getReferencePowerBySample());
@@ -775,7 +777,7 @@ public class PowerStationDataPacker extends AbstractDataPacker<PowerStationStatu
      * 获取当前时间开机容量比 即开机容量和装机容量的比值
      */
     public BigDecimal getOpenRatio () {
-      return BigDecimal.ONE.subtract(overHaulPlanService.getOverhaulCapacity().divide(electricField.getCapacity(), 2, RoundingMode.HALF_DOWN));
+      return BigDecimal.ONE.subtract(overHaulPlanService.getOverhaulCapacity().divide(new BigDecimal(electricField.getBackupE()), 2, RoundingMode.HALF_DOWN));
     }
 
     /**

+ 11 - 9
ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/dataexchange/dataprocesser/datapacker/iml/PowerStationDataPackerOne.java

@@ -138,7 +138,7 @@ public class PowerStationDataPackerOne extends AbstractDataPacker<PowerStationSt
    * 查询检修信息
    */
   @Autowired
-  OverHaulPlanService overHaulPlanService;
+  OverHaulPlanOneService overHaulPlanOneService;
   /**
    * 查询场站的具体信息
    */
@@ -197,7 +197,7 @@ public class PowerStationDataPackerOne extends AbstractDataPacker<PowerStationSt
   List<Field> fields = new ArrayList<>();
   @Setter
   @Getter
-  private PowerStationStatusData t = new PowerStationStatusData();
+  private PowerStationStatusDataOne t = new PowerStationStatusDataOne();
   /**
    * 场站信息
    */
@@ -440,7 +440,7 @@ public class PowerStationDataPackerOne extends AbstractDataPacker<PowerStationSt
       //清除默认值
       point.setMagnification(null);
       EquipmentAttribute equipmentAttribute = new EquipmentAttribute();
-      equipmentAttribute.setEquipmentType(EquipmentTypeEnum.POWERSTATION);
+      equipmentAttribute.setEquipmentType(EquipmentTypeEnum.POWERSTATION2);
       point.setEquipmentAttribute(equipmentAttribute);
       List<ProtocolGatherDataPoint> points = protocolGatherDataPointService.get(point);
       for (ProtocolGatherDataPoint p : points) {
@@ -472,7 +472,7 @@ public class PowerStationDataPackerOne extends AbstractDataPacker<PowerStationSt
     /**
      * 获取场站的情况
      * 场站的容量
-     * 场站的类型 风电or 光伏
+     * 场站的类型 风电
      *
      * @return ElectricField 场站信息
      */
@@ -481,6 +481,7 @@ public class PowerStationDataPackerOne extends AbstractDataPacker<PowerStationSt
       if (electricField != null) {
         this.electricField = electricField;
       }
+      electricField.setCapacity(new BigDecimal(electricField.getBackupF()));
       electricField.setElectricFieldTypeEnum(ElectricFieldTypeEnum.E2);
       return this.electricField;
     }
@@ -519,7 +520,7 @@ public class PowerStationDataPackerOne extends AbstractDataPacker<PowerStationSt
      */
     private void initCalculatorOfMeasuring () {
       this.calculatorOfMeasuring = null;
-      ProtocolGatherDataPoint dataPoint = protocolGatherDataPointService.get(null, EquipmentTypeEnum.POWERSTATION, "referencePowerByMeasuring");
+      ProtocolGatherDataPoint dataPoint = protocolGatherDataPointService.get(null, EquipmentTypeEnum.POWERSTATION2, "referencePowerByMeasuring");
       if (dataPoint != null && DataSourceEnum.GENERATE.equals(dataPoint.getDataSource())) {
         this.calculatorOfMeasuring = new PointDataCalculator<>(NumOrBool.NUM, dataPoint.getGenerationRegulation(), dataPoint.getMagnification());
       }
@@ -554,14 +555,15 @@ public class PowerStationDataPackerOne extends AbstractDataPacker<PowerStationSt
     public PowerStationStatusDataOne packageData () throws DataExchangeException {
       PowerStationStatusDataOne powerStationStatusData = new PowerStationStatusDataOne();
       try {
+        BigDecimal cap = new BigDecimal(getElectricField().getBackupF());
         //设定时间
         powerStationStatusData.setTime(DateTime.now().withMillisOfSecond(0).withSecondOfMinute(0).toDate());
         //设定容量
-        powerStationStatusData.setCapacity(new BigDecimal(this.getElectricField().getBackupF()));
+        powerStationStatusData.setCapacity(cap);
         //设定并网设备数
 //        powerStationStatusData.setOnGridNum(this.getElectricField().getGridCE());
         //设定开机容量为装机容量
-        powerStationStatusData.setOpenCapacity(new BigDecimal(this.getElectricField().getBackupF()).subtract(overHaulPlanService.getOverhaulCapacity()));
+        powerStationStatusData.setOpenCapacity(cap.subtract(overHaulPlanOneService.getOverhaulCapacity()));
         //设定场站状态
 //        powerStationStatusData.setStatus(this.getElectricField().getElectricFieldTypeEnum().getCode());
         //设定实际功率
@@ -650,7 +652,7 @@ public class PowerStationDataPackerOne extends AbstractDataPacker<PowerStationSt
 
         if (powerStationStatusData.getOpenCapacity().compareTo(new BigDecimal(0)) != 0) {
           //设置理论功率
-          powerStationStatusData.setTheoryValue(powerStationStatusData.getAbleValue().multiply(BigDecimal.ONE.add(getMagnificationK())).add(overHaulPlanService.getOverhaulCapacity().multiply(powerStationStatusData.getRealValue().divide(powerStationStatusData.getOpenCapacity(), 2))).setScale(2, RoundingMode.HALF_DOWN));
+          powerStationStatusData.setTheoryValue(powerStationStatusData.getAbleValue().multiply(BigDecimal.ONE.add(getMagnificationK())).add(overHaulPlanOneService.getOverhaulCapacity().multiply(powerStationStatusData.getRealValue().divide(powerStationStatusData.getOpenCapacity(), 2))).setScale(2, RoundingMode.HALF_DOWN));
         } else {
           powerStationStatusData.setTheoryValue(new BigDecimal(0));
         }
@@ -773,7 +775,7 @@ public class PowerStationDataPackerOne extends AbstractDataPacker<PowerStationSt
      * 获取当前时间开机容量比 即开机容量和装机容量的比值
      */
     public BigDecimal getOpenRatio () {
-      return BigDecimal.ONE.subtract(overHaulPlanService.getOverhaulCapacity().divide(electricField.getCapacity(), 2, RoundingMode.HALF_DOWN));
+      return BigDecimal.ONE.subtract(overHaulPlanOneService.getOverhaulCapacity().divide(new BigDecimal(electricField.getBackupF()), 2, RoundingMode.HALF_DOWN));
     }
 
     /**

+ 9 - 0
ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/dataexchange/service/GetRealTimeDate4GenerateUploadFileService.java

@@ -106,6 +106,15 @@ public class GetRealTimeDate4GenerateUploadFileService {
         pointMap.put(powerStation, points);
         this.equipmentPoints.put(equipmentType, pointMap);
         return pointMap;
+      }
+      else if (equipmentType == EquipmentTypeEnum.POWERSTATION2) {
+        points = protocolGatherDataPointService.getByEquipmentId(null, EquipmentTypeEnum.POWERSTATION2);
+        AbstractEquipmentInfo powerStation = new AbstractEquipmentInfo();
+        powerStation.setEquipmentType(EquipmentTypeEnum.POWERSTATION2);
+        powerStation.setId(21);
+        pointMap.put(powerStation, points);
+        this.equipmentPoints.put(equipmentType, pointMap);
+        return pointMap;
       } else {
         List<AbstractEquipmentInfo> list = equipmentInfoService.findByEqType(equipmentType);
         if (list.size() > 0) {

+ 86 - 60
ipfcst/ipfcst-console/src/main/java/com/jiayue/ipfcst/dataexchange/service/SaveEquipmentStatusData.java

@@ -5,6 +5,7 @@ import com.jiayue.ipfcst.common.data.entity.InverterStatusData;
 import com.jiayue.ipfcst.common.data.entity.WeatherStationStatusData;
 import com.jiayue.ipfcst.common.data.entity.WindTowerStatusData;
 import com.jiayue.ipfcst.common.data.entity.WindTurbineStatusData;
+import com.jiayue.ipfcst.console.service.SysParameterService;
 import com.jiayue.ipfcst.dataexchange.dataprocesser.datapacker.AbstractDataPacker;
 import com.jiayue.ipfcst.dataexchange.dataprocesser.datapacker.TheoreticalPowerByHubSpeedCalculateFactory;
 import com.jiayue.ipfcst.dataexchange.dataprocesser.datapacker.iml.PowerStationDataPacker;
@@ -66,6 +67,9 @@ public class SaveEquipmentStatusData {
   PowerStationStatusDataService powerStationStatusDataService;
 
   @Autowired
+  PowerStationStatusDataOneService powerStationStatusDataOneService;
+
+  @Autowired
   WindTurbineStatusDataService windTurbineStatusDataService;
 
   @Autowired
@@ -77,6 +81,9 @@ public class SaveEquipmentStatusData {
   @Autowired
   WindTowerStatusDataService windTowerStatusDataService;
 
+  @Autowired
+  SysParameterService sysParameterService;
+
   public void addWindTowerPacker(AbstractDataPacker<WindTowerStatusData> windTowerPacker) {
     if (windTowerPacker != null) {
       this.windTowerPackers.add(windTowerPacker);
@@ -183,14 +190,23 @@ public class SaveEquipmentStatusData {
   /**
    * 保存场站数据  1分钟间隔
    */
-//  @Scheduled(fixedRate = 60000)
+  @Scheduled(fixedRate = 60000)
   public void saveStationData() {
-
-    if (powerStationDataPacker != null) {
-      try {
-        powerStationStatusDataService.save(powerStationDataPacker.packageData());
-      } catch (DataExchangeException e) {
-        log.error("包装场站数据时出错:", e);
+    int demo = sysParameterService.getTranSysParameter("demo","1");
+    if (demo==0){
+      if (powerStationDataPacker != null) {
+        try {
+          powerStationStatusDataService.save(powerStationDataPacker.packageData());
+        } catch (DataExchangeException e) {
+          log.error("包装光伏场站数据时出错:", e);
+        }
+      }
+      if (powerStationDataPackerOne != null) {
+        try {
+          powerStationStatusDataOneService.save(powerStationDataPackerOne.packageData());
+        } catch (DataExchangeException e) {
+          log.error("包装风电场站数据时出错:", e);
+        }
       }
     }
   }
@@ -199,18 +215,21 @@ public class SaveEquipmentStatusData {
   /**
    * 保存气象站数据  1分钟间隔
    */
-//  @Scheduled(fixedRate = 60000)
+  @Scheduled(fixedRate = 60000)
   public void saveWeatherStationData() {
-    if (weatherStationPackers != null && weatherStationPackers.size() > 0) {
-      for (AbstractDataPacker<WeatherStationStatusData> p : weatherStationPackers) {
-        try {
-          weatherStationStatusDataService.save(p.packageData());
-        } catch (DataExchangeException e) {
-          log.error("包装气象站数据时出错", e);
-        } catch (IllegalAccessException e) {
-          log.error("包装气象站数据时出错", e);
-        } catch (Exception e) {
-          log.error("包装气象站数据,并存储时出错", e);
+    int demo = sysParameterService.getTranSysParameter("demo","1");
+    if (demo==0){
+      if (weatherStationPackers != null && weatherStationPackers.size() > 0) {
+        for (AbstractDataPacker<WeatherStationStatusData> p : weatherStationPackers) {
+          try {
+            weatherStationStatusDataService.save(p.packageData());
+          } catch (DataExchangeException e) {
+            log.error("包装气象站数据时出错", e);
+          } catch (IllegalAccessException e) {
+            log.error("包装气象站数据时出错", e);
+          } catch (Exception e) {
+            log.error("包装气象站数据,并存储时出错", e);
+          }
         }
       }
     }
@@ -220,18 +239,21 @@ public class SaveEquipmentStatusData {
   /**
    * 保存测风塔数据  1分钟间隔
    */
-//  @Scheduled(fixedRate = 60000)
+  @Scheduled(fixedRate = 60000)
   public void saveWindTowerData() {
-    if (windTowerPackers != null && windTowerPackers.size() > 0) {
-      for (AbstractDataPacker<WindTowerStatusData> p : windTowerPackers) {
-        try {
-          windTowerStatusDataService.save(p.packageData());
-        } catch (DataExchangeException e) {
-          log.error("包装测风塔数据时出错", e);
-        } catch (IllegalAccessException e) {
-          log.error("包装测风塔数据时出错", e);
-        } catch (Exception e) {
-          log.error("包装测风塔数据,并存储时出错", e);
+    int demo = sysParameterService.getTranSysParameter("demo","1");
+    if (demo==0){
+      if (windTowerPackers != null && windTowerPackers.size() > 0) {
+        for (AbstractDataPacker<WindTowerStatusData> p : windTowerPackers) {
+          try {
+            windTowerStatusDataService.save(p.packageData());
+          } catch (DataExchangeException e) {
+            log.error("包装测风塔数据时出错", e);
+          } catch (IllegalAccessException e) {
+            log.error("包装测风塔数据时出错", e);
+          } catch (Exception e) {
+            log.error("包装测风塔数据,并存储时出错", e);
+          }
         }
       }
     }
@@ -265,27 +287,30 @@ public class SaveEquipmentStatusData {
   /**
    * 保存风机数据  5分钟间隔 每五分钟执行
    */
-//  @Scheduled(cron = "0 0/5 * * * *")
+  @Scheduled(cron = "0 0/5 * * * *")
   public void saveWindTurbineData() {
-    if (windTurbinePackers != null && windTurbinePackers.size() > 0) {
-      DateTime d = DateTime.now();
-      List<WindTurbineStatusData> l = new ArrayList<>();
-      WindTurbineStatusData windTurbineStatusData = null;
-      for (AbstractDataPacker<WindTurbineStatusData> p : windTurbinePackers) {
-        try {
-          windTurbineStatusData = p.packageData();
-        } catch (Exception e) {
-          log.error("包装风机数据时出错", e);
+    int demo = sysParameterService.getTranSysParameter("demo","1");
+    if (demo==0){
+      if (windTurbinePackers != null && windTurbinePackers.size() > 0) {
+        DateTime d = DateTime.now();
+        List<WindTurbineStatusData> l = new ArrayList<>();
+        WindTurbineStatusData windTurbineStatusData = null;
+        for (AbstractDataPacker<WindTurbineStatusData> p : windTurbinePackers) {
+          try {
+            windTurbineStatusData = p.packageData();
+          } catch (Exception e) {
+            log.error("包装风机数据时出错", e);
+          }
+          try {
+            windTurbineStatusData = TheoreticalPowerByHubSpeedCalculateFactory.getInstance().calculate(windTurbineStatusData);
+          } catch (Exception e) {
+            log.error("计算风机机头风速法理论功率出错", e);
+          }
+          l.add(windTurbineStatusData);
         }
-        try {
-          windTurbineStatusData = TheoreticalPowerByHubSpeedCalculateFactory.getInstance().calculate(windTurbineStatusData);
-        } catch (Exception e) {
-          log.error("计算风机机头风速法理论功率出错", e);
-        }
-        l.add(windTurbineStatusData);
+        windTurbineStatusDataService.save(l);
+        log.info("存储风机数据总耗时:" + (DateTime.now().getMillis() - d.getMillis()) + "ms");
       }
-      windTurbineStatusDataService.save(l);
-      log.info("存储风机数据总耗时:" + (DateTime.now().getMillis() - d.getMillis()) + "ms");
     }
   }
 
@@ -293,22 +318,23 @@ public class SaveEquipmentStatusData {
   /**
    * 保存逆变器数据  5分钟间隔 每五分钟执行
    */
-//  @Scheduled(cron = "0 0/5 * * * *")
+  @Scheduled(cron = "0 0/5 * * * *")
   public void saveInverterData() {
-    if (inverterPackers != null && inverterPackers.size() > 0) {
-      DateTime d = DateTime.now();
-      List<InverterStatusData> l = new ArrayList<>();
-      for (AbstractDataPacker<InverterStatusData> p : inverterPackers) {
-        try {
-          l.add(p.packageData());
-        } catch (Exception e) {
-          log.error("包装逆变器数据,并存储时出错", e);
+    int demo = sysParameterService.getTranSysParameter("demo","1");
+    if (demo==0){
+      if (inverterPackers != null && inverterPackers.size() > 0) {
+        DateTime d = DateTime.now();
+        List<InverterStatusData> l = new ArrayList<>();
+        for (AbstractDataPacker<InverterStatusData> p : inverterPackers) {
+          try {
+            l.add(p.packageData());
+          } catch (Exception e) {
+            log.error("包装逆变器数据,并存储时出错", e);
+          }
         }
+        inverterStatusDataService.save(l);
+        log.info("存储逆变器数据总耗时:" + (DateTime.now().getMillis() - d.getMillis()) + "ms");
       }
-      inverterStatusDataService.save(l);
-      log.info("存储逆变器数据总耗时:" + (DateTime.now().getMillis() - d.getMillis()) + "ms");
     }
   }
-
-
 }

+ 27 - 0
ipfcst/ipfcst-console/src/main/resources/sql/t_equipment_attribute.sql

@@ -283,3 +283,30 @@ INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_
 INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 6998, '备用字段9', 'data9', '', 'AGC_AVC',  NULL, 'SPARE' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 6998) ;
 INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 6999, '备用字段10', 'data10', '', 'AGC_AVC',  NULL, 'SPARE' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 6999) ;
 
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7000, '系统自动判断是否限电', 'isRationingByAutoControl', '', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7000) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7001, '人工判断是否限电', 'isRationingByManualControl', '', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7001) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7002, '场站状态', 'status', '', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7002) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7003, '实际功率', 'realValue', 'MW', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7003) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7004, '可用功率', 'ableValue', 'MW', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7004) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7005, '理论功率', 'theoryValue', 'MW', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7005) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7006, '开机容量', 'openCapacity', 'MW', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7006) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7007, '装机容量', 'capacity', 'MW', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7007) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7008, '站内受阻功率', 'onSiteObstructed', 'MW', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7008) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7009, '站外受阻功率', 'offSiteObstructed', 'MW', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7009) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7010, '并网设备数', 'onGridNum', '', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7010) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7011, '样板机理论功率', 'referencePowerBySample', 'MW', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7011) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7012, '测风/光法理论功率', 'referencePowerByMeasuring', 'MW', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7012) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7013, '样板机可用功率', 'ablePowerBySample', 'MW', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7013) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7014, '测风/光法可用功率', 'ablePowerByMeasuring', 'MW', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7014) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7015, '日发电量', 'dailyOutPut', 'MW', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7015) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7016, '日上网电量', 'dailyGridOutPut', 'MW', 'POWERSTATION2',  NULL, 'INVARIANT' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7016) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7017, '备用字段1', 'data1', '', 'POWERSTATION2',  NULL, 'SPARE' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7017) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7018, '备用字段2', 'data2', '', 'POWERSTATION2',  NULL, 'SPARE' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7018) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7019, '备用字段3', 'data3', '', 'POWERSTATION2',  NULL, 'SPARE' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7019) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7020, '备用字段4', 'data4', '', 'POWERSTATION2',  NULL, 'SPARE' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7020) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7021, '备用字段5', 'data5', '', 'POWERSTATION2',  NULL, 'SPARE' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7021) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7022, '备用字段6', 'data6', '', 'POWERSTATION2',  NULL, 'SPARE' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7022) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7023, '备用字段7', 'data7', '', 'POWERSTATION2',  NULL, 'SPARE' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7023) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7024, '备用字段8', 'data8', '', 'POWERSTATION2',  NULL, 'SPARE' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7024) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7025, '备用字段9', 'data9', '', 'POWERSTATION2',  NULL, 'SPARE' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7025) ;
+INSERT INTO t_equipment_attribute(C_ID,C_EXPLANATION,C_FIELD_NAME,C_MEASUREMENT_UNITS,C_EQUIPMENT_TYPE,C_STATION_CODE, C_EQUIPMENT_ATTRIBUTE_TYPE_ENUM)  select 7026, '备用字段10', 'data10', '', 'POWERSTATION2',  NULL, 'SPARE' from dual where not exists (select C_ID from t_equipment_attribute where C_ID = 7026) ;