Browse Source

增加测风塔数据查询

xusl 3 years ago
parent
commit
d7be13c0f8

+ 1 - 1
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/WindTowerStatusDataRepository.java

@@ -23,5 +23,5 @@ public interface WindTowerStatusDataRepository extends JpaRepository<WindTowerSt
 	 * @param endTime
 	 * @return
 	 */
-	List<WindTowerStatusData> findByEquipmentIdAndTimeBetween(String equipmentNo, Date startTime, Date endTime);
+	List<WindTowerStatusData> findByStationCodeAndEquipmentIdAndTimeBetween(String stationCode,String equipmentNo, Date startTime, Date endTime);
 }

+ 120 - 115
ipfcst-console/src/main/frontend/views/dataquery/inverterStatusData/index.vue

@@ -22,68 +22,70 @@
         </el-option>
       </el-select>
       <span style="font-weight: bold;font-size: 14px">起始时间:</span>
-        <el-date-picker
-          v-model="startTime"
-          :clearable="false"
-          type="datetime"
-          value-format="timestamp"
-          placeholder="选择日期">
-        </el-date-picker>
+      <el-date-picker
+        v-model="startTime"
+        :clearable="false"
+        type="datetime"
+        value-format="timestamp"
+        placeholder="选择日期">
+      </el-date-picker>
       <span style="font-weight: bold;font-size: 14px">截止时间:</span>
-        <el-date-picker
-          v-model="endTime"
-          :clearable="false"
-          type="datetime"
-          value-format="timestamp"
-          placeholder="选择日期">
-        </el-date-picker>
-        <el-button  :loading=loading  size="small"  @click="dateQuery">查询</el-button>
+      <el-date-picker
+        v-model="endTime"
+        :clearable="false"
+        type="datetime"
+        value-format="timestamp"
+        placeholder="选择日期">
+      </el-date-picker>
+      <el-button :loading=loading size="small" @click="dateQuery">查询</el-button>
     </div>
-<!--    <div class="content">-->
-<!--      &lt;!&ndash;<el-tabs type="card" v-model="activeName" >&ndash;&gt;-->
-<!--      &lt;!&ndash;<el-tab-pane  label="指定逆变器" name="first">&ndash;&gt;-->
-<!--      <div class="tableContent">-->
+    <!--    <div class="content">-->
+    <!--      &lt;!&ndash;<el-tabs type="card" v-model="activeName" >&ndash;&gt;-->
+    <!--      &lt;!&ndash;<el-tab-pane  label="指定逆变器" name="first">&ndash;&gt;-->
+    <!--      <div class="tableContent">-->
     <div style="padding-top: 10px">
-        <vxe-table
-          id="inverterNoTable"
-          ref="inTable"
+      <vxe-table
+        id="inverterNoTable"
+        ref="inTable"
+        :loading="loading"
+        border
+        @sort-change="sortChangeEventNo"
+        :auto-resize="true"
+        highlight-hover-row
+        max-height="90%"
+        :resizable="true"
+        align="center"
+        :data="inverterStatusDataNo">
+        <vxe-table-column field="time" title="接收时间" :formatter="dateFormat" min-width="150" sortable></vxe-table-column>
+        <vxe-table-column field="equipmentId" title="名称" min-width="60" :formatter="nameFormat"></vxe-table-column>
+        <vxe-table-column field="activePower" title="有功(KW)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="reactivePower" title="无功(KW)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="powerFactor" title="功率因数" min-width="60"></vxe-table-column>
+        <vxe-table-column field="voltage" title="电压(V)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="electricalCurrent" title="电流(A)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="dayElectricQuantity" title="当日发电量(kW·h)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="dayGridConnectedHours" title="当日并网小时" min-width="60"></vxe-table-column>
+        <vxe-table-column field="status" title="状态" min-width="60"></vxe-table-column>
+      </vxe-table>
+      <div class="rtPageturning">
+        <div class="toolbar">
+          <vxe-toolbar ref="fstToolBar">
+            <template v-slot:buttons>
+              <vxe-button style="background:transparent;border:none" @click="exportDataEvent"><i
+                class="vxe-icon--download" style="color: white"></i></vxe-button>
+            </template>
+          </vxe-toolbar>
+        </div>
+        <vxe-pager
+          background
           :loading="loading"
-          border
-          @sort-change="sortChangeEventNo"
-          :auto-resize="true"
-          highlight-hover-row
-          max-height="90%"
-          :resizable="true"
-          align="center"
-          :data="inverterStatusDataNo">
-          <vxe-table-column  field="time" title="接收时间" :formatter="dateFormat" min-width="150" sortable ></vxe-table-column>
-          <vxe-table-column field="equipmentId" title="名称" min-width="60" :formatter="nameFormat"></vxe-table-column>
-          <vxe-table-column field="activePower" title="有功(KW)" min-width="60"></vxe-table-column>
-          <vxe-table-column field="reactivePower" title="无功(KW)" min-width="60"></vxe-table-column>
-          <vxe-table-column field="powerFactor" title="功率因数" min-width="60"></vxe-table-column>
-          <vxe-table-column field="voltage" title="电压(V)" min-width="60"></vxe-table-column>
-          <vxe-table-column field="electricalCurrent" title="电流(A)" min-width="60"></vxe-table-column>
-          <vxe-table-column field="dayElectricQuantity" title="当日发电量(kW·h)" min-width="60"></vxe-table-column>
-          <vxe-table-column field="dayGridConnectedHours" title="当日并网小时"min-width="60"></vxe-table-column>
-          <vxe-table-column field="status" title="状态"min-width="60"></vxe-table-column>
-        </vxe-table>
-        <div class="rtPageturning">
-          <div class="toolbar">
-            <vxe-toolbar ref="fstToolBar" >
-              <template v-slot:buttons>
-                <vxe-button style="background:transparent;border:none"  @click="exportDataEvent"><i class="vxe-icon--download" style="color: white"></i></vxe-button>
-              </template>
-            </vxe-toolbar></div>
-          <vxe-pager
-            background
-            :loading="loading"
-            :current-page.sync="currentPageNo"
-            :page-size.sync="pageSizeNo"
-            :total="totalNo"
-            @page-change="handlePageChangeNo"
-            :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']">
-          </vxe-pager>
-<!--        </div>-->
+          :current-page.sync="currentPageNo"
+          :page-size.sync="pageSizeNo"
+          :total="totalNo"
+          @page-change="handlePageChangeNo"
+          :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']">
+        </vxe-pager>
+        <!--        </div>-->
       </div>
     </div>
   </div>
@@ -92,54 +94,51 @@
 <script>
 
   export default {
-    data(){
-      return{
+    data() {
+      return {
         stationCode: '',
         stationList: [],
-        loading:false,
-        queryStartTime:"",
-        queryEndTime:"",
-        startTime:new Date(new Date().toLocaleDateString()).getTime(),
-        endTime:new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 1000-1,
-        inverterInfoId:[],
-        inverterInfos:[],
-        inverterStatusDataNo:[],
-        inverterStatusDataAll:[],
+        loading: false,
+        queryStartTime: "",
+        queryEndTime: "",
+        startTime: new Date(new Date().toLocaleDateString()).getTime(),
+        endTime: new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 1000 - 1,
+        inverterInfoId: [],
+        inverterInfos: [],
+        inverterStatusDataNo: [],
+        inverterStatusDataAll: [],
         activeName: 'first',
-        totalNo:0,
+        totalNo: 0,
         pageSizeNo: 10,
         currentPageNo: 1,
-        sortOrderNo:'asc',
-        totalAll:0,
+        sortOrderNo: 'asc',
+        totalAll: 0,
         pageSizeAll: 10,
         currentPageAll: 1,
-        sortOrderTime:'asc',
-        sortOrderNumber:'asc',
+        sortOrderTime: 'asc',
+        sortOrderNumber: 'asc',
       }
     },
-    created () {
+    created() {
       this.$nextTick(() => {
         // 手动将表格和工具栏进行关联
         this.$refs.inTable.connect(this.$refs.inverterToolbar)
         // this.$refs.iaTable.connect(this.$refs.inverterAllToolbar)
       })
     },
-    mounted(){
+    mounted() {
       this.getStationList()
     },
-    methods:{
+    methods: {
       stationCodeChange() {
         // 获取逆变器设备
         let queryParam = this.stationCode;
-        if (queryParam==''){
-          // 清除设备下拉框
-          this.inverterInfos = ''
-        }
-        else{
-          this.$axios.get('/findInverterInfoByStation/' + queryParam).then((res) => {
-            this.inverterInfos = res.data
-          })
-        }
+        this.inverterInfos = ''
+        this.inverterInfoId = ''
+        this.$axios.get('/findInverterInfoByStation/' + queryParam).then((res) => {
+          this.inverterInfos = res.data
+        })
+
       },
       getStationList() {
         this.$axios.get('/electricField/getElectricField').then((res) => {
@@ -148,37 +147,42 @@
           this.$message.error('获取场站下拉框出错' + error)
         })
       },
-      queryInverterDataNo(){
-        this.loading=true
+      queryInverterDataNo() {
+        this.loading = true
         let inverterId = this.inverterInfoId;
-        if (inverterId==''){
-          inverterId="ALL"
+        if (inverterId == '') {
+          inverterId = "ALL"
         }
-        this.$axios.get('/inverterStatusData/'+this.stationCode+'/'+this.queryStartTime+'/'+this.queryEndTime+'/'+this.currentPageNo+'/'+this.pageSizeNo+'/'+inverterId).then((res) => {
+        this.$axios.get('/inverterStatusData/' + this.stationCode + '/' + this.queryStartTime + '/' + this.queryEndTime + '/' + this.currentPageNo + '/' + this.pageSizeNo + '/' + inverterId).then((res) => {
           this.inverterStatusDataNo = res.data.content
           // 表分页格数据总条数
           this.totalNo = res.data.count
-          this.loading=false
+          this.loading = false
         }).catch((error) => {
-          this.loading=false
+          this.loading = false
           this.$message.error('查询逆变器根据number出错' + error)
         })
       },
-      dateQuery(){
+      dateQuery() {
         let queryParam = this.stationCode;
-        if (queryParam==''){
+        if (queryParam == '') {
           this.$message.error("请选择场站")
           return;
         }
-        this.loading=true
-        if(this.endTime<=this.startTime){
+        let infoId = this.inverterInfoId;
+        if (infoId == '') {
+          this.$message.error("请选择设备")
+          return;
+        }
+        this.loading = true
+        if (this.endTime <= this.startTime) {
           this.$message.error("开始时间不能小于结束时间")
           this.startTime = this.queryStartTime
           this.endTime = this.queryEndTime
-          this.loading=false
+          this.loading = false
           return
         }
-        if(this.endTime-this.startTime> 60 * 60 * 24 * 1000*3){
+        if (this.endTime - this.startTime > 60 * 60 * 24 * 1000 * 3) {
           this.startTime = this.queryStartTime
           this.endTime = this.queryEndTime
           this.$message.error("只能最多查询3天的数据")
@@ -192,8 +196,8 @@
         this.queryInverterDataNo()
         this.currentPageAll = 1
       },
-      sortChangeEventNo ({ column, property, order }) {
-        if(order == null){
+      sortChangeEventNo({column, property, order}) {
+        if (order == null) {
           order = 'asc'
         }
         this.currentPageNo = 1
@@ -202,16 +206,16 @@
         this.startTime = this.queryStartTime
         this.endTime = this.queryEndTime
       },
-      sortChangeEventAll ({ column, property, order }) {
-        if(order == null){
+      sortChangeEventAll({column, property, order}) {
+        if (order == null) {
           order = 'asc'
         }
 
-        if(property == 'time'){
+        if (property == 'time') {
           this.sortOrderTime = order
         }
 
-        if(property == 'equipmentNo'){
+        if (property == 'equipmentNo') {
           this.sortOrderNumber = order
         }
         this.currentPageAll = 1
@@ -219,13 +223,13 @@
         this.startTime = this.queryStartTime
         this.endTime = this.queryEndTime
       },
-      checkColumnMethod ({ column }) {
+      checkColumnMethod({column}) {
         if (column.property === 'time') {
           return false
         }
         return true
       },
-      dateFormat({ cellValue, row, column }) {
+      dateFormat({cellValue, row, column}) {
         const date = new Date(cellValue) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
         const Y = date.getFullYear() + '-'
         const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
@@ -235,23 +239,24 @@
         const s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds())
         return Y + M + D + H + m + s
       },
-      nameFormat({ cellValue, row, column }) {
-        var name ='未知设备'
-        for(let index in this.inverterInfos) {
-          if(cellValue == this.inverterInfos[index].id){
+      nameFormat({cellValue, row, column}) {
+        var name = '未知设备'
+        for (let index in this.inverterInfos) {
+          if (cellValue == this.inverterInfos[index].id) {
             name = this.inverterInfos[index].name
           }
-        };
+        }
+        ;
         return name
       },
-      handlePageChangeNo ({ currentPage, pageSize }) {
+      handlePageChangeNo({currentPage, pageSize}) {
         this.currentPageNo = currentPage
         this.pageSizeNo = pageSize
         this.startTime = this.queryStartTime
         this.endTime = this.queryEndTime
         this.queryInverterDataNo();
       },
-      handlePageChangeAll({ currentPage, pageSize }){
+      handlePageChangeAll({currentPage, pageSize}) {
         this.currentPageAll = currentPage
         this.pageSizeAll = pageSize
         this.startTime = this.queryStartTime
@@ -260,7 +265,7 @@
       },
       exportDataEvent() {
         this.loading = true
-        this.$axios.get('/export/inverterStatusData/'+this.queryStartTime+'/'+this.queryEndTime+'/'+this.inverterInfoId, {
+        this.$axios.get('/export/inverterStatusData/' + this.queryStartTime + '/' + this.queryEndTime + '/' + this.inverterInfoId, {
           responseType: 'blob'// 用于解决中文乱码
         }).then((response) => {
           this.loading = false

+ 38 - 41
ipfcst-console/src/main/frontend/views/dataquery/weatherStationStatusData/index.vue

@@ -37,7 +37,7 @@
         value-format="timestamp"
         placeholder="选择日期">
       </el-date-picker>
-      <el-button  :loading=loading  size="small"  @click="queryData">查询</el-button>
+      <el-button :loading=loading size="small" @click="queryData">查询</el-button>
     </div>
     <vxe-table
       id="weatherStationStatusDataTable"
@@ -51,14 +51,14 @@
       :resizable="true"
       align="center"
       :data="tableData">
-      <vxe-table-column  field="time" title="接收时间" :formatter="dateFormat" min-width="150" sortable ></vxe-table-column>
+      <vxe-table-column field="time" title="接收时间" :formatter="dateFormat" min-width="150" sortable></vxe-table-column>
       <vxe-table-column field="globalR" title="总辐射" min-width="60"></vxe-table-column>
       <vxe-table-column field="directR" title="直接辐射" min-width="60"></vxe-table-column>
       <vxe-table-column field="diffuseR" title="散射辐射" min-width="60"></vxe-table-column>
       <vxe-table-column field="obliqueR" title="斜面辐射" min-width="60"></vxe-table-column>
       <vxe-table-column field="airT" title="环境温度" min-width="60"></vxe-table-column>
       <vxe-table-column field="p" title="气压" min-width="60"></vxe-table-column>
-      <vxe-table-column field="rh" title="湿度"min-width="60"></vxe-table-column>
+      <vxe-table-column field="rh" title="湿度" min-width="60"></vxe-table-column>
       <vxe-table-column field="cellT" title="背板温度" min-width="60"></vxe-table-column>
       <vxe-table-column field="ws" title="风速" min-width="60"></vxe-table-column>
       <vxe-table-column field="wd" title="风向" min-width="60"></vxe-table-column>
@@ -88,49 +88,49 @@
       return {
         stationCode: '',
         stationList: [],
-        startTime:new Date(new Date().toLocaleDateString()).getTime(),
-        endTime:new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 1000-1,
-        tableData:[],
-        total:0,
-        sortOrder:'asc',
+        startTime: new Date(new Date().toLocaleDateString()).getTime(),
+        endTime: new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 1000 - 1,
+        tableData: [],
+        total: 0,
+        sortOrder: 'asc',
         pageSize: 10,
         currentPage: 1,
         weatherStationInfos: [],
         weatherStationInfoId: '',
-        columns:[],
-        loading:false,
-        displayConfigPageSize:{
-          id:"",
-          displayCode:"pageSize",
-          showCode:"",
-          hiddenCode:""
-        },
+        columns: [],
+        loading: false,
+        displayConfigPageSize: {
+          id: "",
+          displayCode: "pageSize",
+          showCode: "",
+          hiddenCode: ""
+        }
       }
     },
     mounted() {
       this.getStationList()
     },
     methods: {
-      queryData(){
+      queryData() {
         let queryParam = this.stationCode;
-        if (queryParam==''){
+        if (queryParam == '') {
           this.$message.error("请选择场站")
           return;
         }
         let infoId = this.weatherStationInfoId;
-        if (infoId==''){
+        if (infoId == '') {
           this.$message.error("请选择气象站")
           return;
         }
         this.loading = true
-        if(this.endTime<=this.startTime){
+        if (this.endTime <= this.startTime) {
           this.$message.error("开始时间不能小于结束时间")
           this.startTime = this.queryStartTime
           this.endTime = this.queryEndTime
           this.loading = false
           return
         }
-        if(this.endTime-this.startTime> 60 * 60 * 24 * 1000*3){
+        if (this.endTime - this.startTime > 60 * 60 * 24 * 1000 * 3) {
           this.startTime = this.queryStartTime
           this.endTime = this.queryEndTime
           this.$message.error("只能最多查询3天的数据")
@@ -144,15 +144,12 @@
       stationCodeChange() {
         // 获取逆变器设备
         let queryParam = this.stationCode;
-        if (queryParam==''){
-          // 清除设备下拉框
-          this.weatherStationInfos = ''
-        }
-        else{
-          this.$axios.get('/weatherStationInfo/' + queryParam).then((res) => {
-            this.weatherStationInfos = res.data
-          })
-        }
+        this.weatherStationInfos = ''
+        this.weatherStationInfoId = ''
+        this.$axios.get('/weatherStationInfo/' + queryParam).then((res) => {
+          this.weatherStationInfos = res.data
+        })
+
       },
       getStationList() {
         this.$axios.get('/electricField/getElectricField').then((res) => {
@@ -161,14 +158,14 @@
           this.$message.error('获取场站下拉框出错' + error)
         })
       },
-      getTable(){
+      getTable() {
         this.loading = true
         this.$emit('sendLoading', this.loading)
         let weatherStationId = this.weatherStationInfoId;
-        if (weatherStationId==''){
-          weatherStationId="ALL"
+        if (weatherStationId == '') {
+          weatherStationId = "ALL"
         }
-        this.$axios.get('/weatherStationStatusData/'+this.stationCode+'/'+this.startTime+'/'+this.endTime+'/'+this.currentPage+'/'+this.pageSize+'/'+weatherStationId).then((res) => {
+        this.$axios.get('/weatherStationStatusData/' + this.stationCode + '/' + this.startTime + '/' + this.endTime + '/' + this.currentPage + '/' + this.pageSize + '/' + weatherStationId).then((res) => {
           this.tableData = res.data.content
           // 表分页格数据总条数
           this.total = res.data.count
@@ -181,23 +178,23 @@
         })
 
       },
-      changePageSize(pageSize){
+      changePageSize(pageSize) {
         this.displayConfigPageSize.showCode = pageSize
-        this.$axios.post('displayConfig/',this.displayConfigPageSize).then((res) => {
+        this.$axios.post('displayConfig/', this.displayConfigPageSize).then((res) => {
           this.displayConfigPageSize = res.data
           // this.$message.success('PageSize设置成功' )
         }).catch((error) => {
           this.$message.error('PageSize设置出错' + error)
         })
       },
-      handlePageChange ({ currentPage, pageSize }) {
+      handlePageChange({currentPage, pageSize}) {
         this.currentPage = currentPage
         this.pageSize = pageSize
         this.startTime = this.queryStartTime
         this.endTime = this.queryEndTime
         this.getTable();
       },
-      dateFormat({ cellValue, row, column }) {
+      dateFormat({cellValue, row, column}) {
         const date = new Date(cellValue) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
         const Y = date.getFullYear() + '-'
         const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
@@ -207,15 +204,15 @@
         const s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds())
         return Y + M + D + H + m + s
       },
-      sortChangeEvent ({ column, property, order }) {
-        if(order == null){
+      sortChangeEvent({column, property, order}) {
+        if (order == null) {
           order = 'asc'
         }
         this.currentPage = 1
         this.sortOrder = order
         this.getTable()
       },
-      checkColumnMethod ({ column }) {
+      checkColumnMethod({column}) {
         if (column.property === 'time') {
           return false
         }

+ 162 - 223
ipfcst-console/src/main/frontend/views/dataquery/windTowerStatusData/index.vue

@@ -1,48 +1,80 @@
 <template>
-  <div style="width: 100%;height: 100%" >
-    <div style="width: 100%;background-color: transparent;height: 1%;display:inline-block">
-      <div class="filter">
-        <div class="startTime">
-          <span class="timeText">间隔时间</span>
-          <el-select v-model="jgTime"  placeholder="请选择" @change="changeJgTime">
-            <el-option
-              v-for="item in jgTimes"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value">
-            </el-option>
-          </el-select>
-
-              <vxe-button style="background:transparent;border:none"  @click="exportDataEvent"><i class="vxe-icon--download" style="color: white"></i></vxe-button>
-
-        </div>
-      </div>
-    </div>
-    <div class="tableContent">
-      <vxe-grid
-        id="windTowerStatusDataTable"
-        border
-        show-header-overflow
-        show-overflow
-        export-config
-        highlight-hover-row
-        @sort-change="sortChangeEvent"
-        :toolbar="tableToolbar"
-        :custom-config="{storage: true, checkMethod: checkColumnMethod}"
-        :auto-resize="true"
-        :header-cell-style="{background:'black',color:'white'}"
-        max-height="91%"
-        :cell-style="{background:'black',color:'white'}"
-         align="center"
-        :sort-config="{remote:'true'}"
-        :loading="loading"
-        :columns="tableColumn"
-        :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)"></vxe-grid>
+  <div class="chart-container">
+    <div class="filter">
+      <span style="font-weight: bold;font-size: 14px">场站名称:</span>
+      <el-select style="width:250px" clearable v-model="stationCode" size="small" @change="stationCodeChange">
+        <el-option
+          v-for="item in stationList"
+          :key="item.stationCode"
+          :label="item.name"
+          :value="item.stationCode">
+          <span style="float: left">{{ item.name }}</span>
+          <span style="float: right; color: #8492a6;font-size: 13px">{{ item.stationCode }}</span>
+        </el-option>
+      </el-select>
+      <span style="font-weight: bold;font-size: 14px">测风塔:</span>
+      <el-select v-model="windTowerInfoId" clearable placeholder="请选择">
+        <el-option
+          v-for="item in windTowerInfos"
+          :key="item.id"
+          :label="item.name"
+          :value="item.id">
+        </el-option>
+      </el-select>
+      <span style="font-weight: bold;font-size: 14px">起始时间:</span>
+      <el-date-picker
+        v-model="startTime"
+        :clearable="false"
+        type="datetime"
+        value-format="timestamp"
+        placeholder="选择日期">
+      </el-date-picker>
+      <span style="font-weight: bold;font-size: 14px">截止时间:</span>
+      <el-date-picker
+        v-model="endTime"
+        :clearable="false"
+        type="datetime"
+        value-format="timestamp"
+        placeholder="选择日期">
+      </el-date-picker>
+      <el-button :loading=loading size="small" @click="queryData">查询</el-button>
     </div>
+    <vxe-table
+      id="windTowerStatusDataTable"
+      :loading="loading"
+      border
+      @sort-change="sortChangeEvent"
+      :auto-resize="true"
+      highlight-hover-row
+      max-height="90%"
+      :resizable="true"
+      align="center"
+      :data="tableData">
+      <vxe-table-column field="time" title="接收时间" :formatter="dateFormat" min-width="150" sortable></vxe-table-column>
+      <vxe-table-column field="wsInstHubHeight" title="轮毂风速m/s" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wdInstHubHeight" title="轮毂风向°" min-width="60"></vxe-table-column>
+      <vxe-table-column field="tInst" title="温度℃" min-width="60"></vxe-table-column>
+      <vxe-table-column field="rhInst" title="湿度%" min-width="60"></vxe-table-column>
+      <vxe-table-column field="paInst" title="气压KPa" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wsInst10" title="10米风速m/s" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wdInst10" title="10米风向°" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wsInst30" title="30米风速m/s" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wdInst30" title="30米风向°" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wsInst50" title="50米风速m/s" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wdInst50" title="50米风向°" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wsInst70" title="70米风速m/s" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wdInst70" title="70米风向°" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wsInst80" title="80米风速m/s" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wdInst80" title="80米风向°" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wsInst90" title="90米风速m/s" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wdInst90" title="90米风向°" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wsInst100" title="100米风速m/s" min-width="60"></vxe-table-column>
+      <vxe-table-column field="wdInst100" title="100米风向°" min-width="60"></vxe-table-column>
+    </vxe-table>
     <div class="rtPageturning">
       <vxe-pager
-        background
         :loading="loading"
+        background
         :current-page="currentPage"
         :page-size="pageSize"
         :total="total"
@@ -55,192 +87,141 @@
 
 <script>
   export default {
-    watch: {
-      // 如果 `question` 发生改变,这个函数就会运行
-      queryTime: function(newQuestion, oldQuestion) {
-        var queryTimeList = newQuestion.split(",")
-        this.currentPage = 1
-        this.startTime=Number(queryTimeList[0])
-        this.endTime=Number(queryTimeList[1])
-        this.windTowerInfoId = Number(queryTimeList[2])
-        this.windTowerInfoName = queryTimeList[3]
-        this.eqTimeInterval()
-      }
-    },
-    props: {
-      queryTime:{
-        type:String,
-      },
-      thFormat:{
-        type:Array
-      }
-    },
     data() {
       return {
+        stationCode: '',
+        stationList: [],
         startTime: new Date(new Date().toLocaleDateString()).getTime(),
         endTime: new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 1000 - 1,
-        thLoadSign:true,
-        loading:false,
-        tableData:[],
-        total:0,
-        sortOrder:'asc',
+        thLoadSign: true,
+        loading: false,
+        tableData: [],
+        total: 0,
+        sortOrder: 'asc',
         pageSize: 10,
         currentPage: 1,
-        windTowerInfoId:'',
-        windTowerInfoName:'',
-        tableHead:[],
-        tablePage: {
-          total: 0,
-          currentPage: 1,
-          pageSize: 10,
-          align: 'right',
-          pageSizes: [10, 20, 50, 100, 200, 500],
-          layouts: ['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total'],
-          perfect: true
-        },
-        tableToolbar: {
-          custom: true
-        },
-        tableColumn: [
-          { field: 'time', title: '接入时间',formatter:this.dateFormat,sortable:true,width:"180" },
-          { field: 'equipmentNo', title: '设备编号',minWidth:"130",formatter:this.nameFormat  },
-        ],
-        jgTime:3600000,
-        jgTimes:[
-          {label: "1分钟",value:60000},
-          {label: "15分钟",value:900000},
-          {label: "1小时",value:3600000}
-        ],
-        displayConfigJgTime:{
-          id:"",
-          displayCode:"timeInterval",
-          showCode:"",
-          hiddenCode:""
-        },
-        displayConfigPageSize:{
-          id:"",
-          displayCode:"pageSize",
-          showCode:"",
-          hiddenCode:""
-        },
+        windTowerInfos: [],
+        windTowerInfoId: '',
+        windTowerInfoName: '',
+        displayConfigPageSize: {
+          id: "",
+          displayCode: "pageSize",
+          showCode: "",
+          hiddenCode: ""
+        }
       }
     },
     mounted() {
+      this.getStationList()
     },
     methods: {
-      exportDataEvent() {
+      queryData() {
+        let queryParam = this.stationCode;
+        if (queryParam == '') {
+          this.$message.error("请选择场站")
+          return;
+        }
+        let infoId = this.windTowerInfoId;
+        if (infoId == '') {
+          this.$message.error("请选择测风塔")
+          return;
+        }
         this.loading = true
-        this.$axios.get('export/windTowerStatusData/'+this.startTime+'/'+this.endTime+'/'+this.windTowerInfoId+'/'+this.jgTime+'?sortOrder='+this.sortOrder, {
-          responseType: 'blob'// 用于解决中文乱码
-        }).then((response) => {
+        if (this.endTime <= this.startTime) {
+          this.$message.error("开始时间不能小于结束时间")
+          this.startTime = this.queryStartTime
+          this.endTime = this.queryEndTime
           this.loading = false
-        }).catch((error) => {
+          return
+        }
+        if (this.endTime - this.startTime > 60 * 60 * 24 * 1000 * 3) {
+          this.startTime = this.queryStartTime
+          this.endTime = this.queryEndTime
+          this.$message.error("只能最多查询3天的数据")
           this.loading = false
-          this.$message.error('导出失败' + error)
-        })
+          return
+        }
+        this.queryStartTime = this.startTime
+        this.queryEndTime = this.endTime
+        this.getTable()
       },
-      eqTimeInterval(){
-        this.$axios.get('displayConfig/eqTimeInterval').then((res) => {
-          this.displayConfigJgTime = res.data
-          this.jgTime = parseInt(this.displayConfigJgTime.showCode)
-          this.getTable()
-          // this.$message.success('间隔时间获取成功' )
-          this.dialogVisible = false
-        }).catch((error) => {
-          this.$message.error('间隔时间获取出错' + error)
-        })
-        this.$axios.get('displayConfig/pageSize').then((res) => {
-          this.displayConfigPageSize = res.data
-          this.pageSize = parseInt(this.displayConfigPageSize.showCode)
-          // this.$message.success('PageSize获取成功' )
-          this.dialogVisible = false
-        }).catch((error) => {
-          this.$message.error('PageSize获取出错' + error)
+      stationCodeChange() {
+        // 获取逆变器设备
+        let queryParam = this.stationCode;
+        this.windTowerInfos = ''
+        this.windTowerInfoId = ''
+        this.$axios.get('/windTowerInfo/' + queryParam).then((res) => {
+          this.windTowerInfos = res.data
         })
       },
-      changeJgTime(){
-        this.displayConfigJgTime.showCode = this.jgTime
-        this.$axios.post('displayConfig/',this.displayConfigJgTime).then((res) => {
-          this.displayConfigJgTime = res.data
-          // this.$message.success('间隔时间设置成功' )
-          this.dialogVisible = false
-          this.getTable(this.startTime,this.endTime)
+      getStationList() {
+        this.$axios.get('/electricField/getElectricField').then((res) => {
+          this.stationList = res.data
         }).catch((error) => {
-          this.$message.error('间隔时间设置出错' + error)
+          this.$message.error('获取场站下拉框出错' + error)
         })
       },
-      getTable(){
+      getTable() {
+        let windTowerId = this.windTowerInfoId;
+        if (windTowerId == '') {
+          windTowerId = "ALL"
+        }
         this.loading = true
-        this.$emit('sendLoading', this.loading)
-        this.$axios.get('/windTowerStatusData/'+this.startTime+'/'+this.endTime+'/'+this.windTowerInfoId+'/'+this.jgTime+'?sortOrder='+this.sortOrder).then((res) => {
+        this.$axios.get('/windTowerStatusData/' + this.stationCode + '/' + this.startTime + '/' + this.endTime + '/' + this.currentPage + '/' + this.pageSize + '/' + windTowerId).then((res) => {
           this.tableData = res.data.content
           // 表分页格数据总条数
           this.total = res.data.count
-          //表头
-          this.tableHead = res.data.tableHead
-
-          this.tableColumn = [
-            { field: 'time', title: '接入时间',formatter:this.dateFormat,sortable:true,width:"180" },
-            { field: 'equipmentNo', title: '设备编号',minWidth:"130",formatter:this.nameFormat  },
-          ]
-
-            //只加载一次
-            for(var i = 0 ;i<this.tableHead.length;i++){
-              var th = new Object();
-              th.field = this.tableHead[i]
-              for(var j = 0;j<this.thFormat.length;j++){
-                if(this.tableHead[i] == this.thFormat[j].key ){
-                  th.title = this.thFormat[j].value
-                }
-              }
-              th.minWidth = "130"
-              this.tableColumn.push(th)
-            }
-
-            this.thLoadSign = false
-
-
           this.loading = false
-          this.$emit('sendLoading', this.loading)
-
         }).catch((error) => {
           this.loading = false
-          this.$emit('sendLoading', this.loading)
           this.$message.error('查询table出错' + error)
         })
       },
-      changePageSize(pageSize){
+      changePageSize(pageSize) {
         this.displayConfigPageSize.showCode = pageSize
-        this.$axios.post('displayConfig/',this.displayConfigPageSize).then((res) => {
+        this.$axios.post('displayConfig/', this.displayConfigPageSize).then((res) => {
           this.displayConfigPageSize = res.data
           // this.$message.success('PageSize设置成功' )
         }).catch((error) => {
           this.$message.error('PageSize设置出错' + error)
         })
       },
-      handlePageChange ({ currentPage, pageSize }) {
+      handlePageChange({currentPage, pageSize}) {
         this.currentPage = currentPage
-        if(this.pageSize!=pageSize){
-          this.changePageSize(pageSize)
-        }
         this.pageSize = pageSize
-        // this.getTable();
+        this.startTime = this.queryStartTime
+        this.endTime = this.queryEndTime
+        this.getTable();
       },
-      dateFormat({ cellValue, row, column }) {
-        return this.$XEUtils.toDateString(cellValue, 'yyyy-MM-dd HH:mm:ss')
+      dateFormat({cellValue, row, column}) {
+        const date = new Date(cellValue) // 时间戳为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()) : date.getHours()) + ':'
+        const m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'
+        const s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds())
+        return Y + M + D + H + m + s
       },
-      nameFormat({ cellValue, row, column }) {
-        return this.windTowerInfoName
+      nameFormat({cellValue, row, column}) {
+        var name = '未知设备'
+        for (let index in this.inverterInfos) {
+          if (cellValue == this.inverterInfos[index].id) {
+            name = this.inverterInfos[index].name
+          }
+        }
+        ;
+        return name
       },
-      sortChangeEvent ({ column, property, order }) {
-        if(order == null){
+      sortChangeEvent({column, property, order}) {
+        if (order == null) {
           order = 'asc'
         }
         this.currentPage = 1
         this.sortOrder = order
         this.getTable()
       },
-      checkColumnMethod ({ column }) {
+      checkColumnMethod({column}) {
         if (column.property === 'time') {
           return false
         }
@@ -250,50 +231,8 @@
   }
 </script>
 <style scoped>
-  .tableContent{
-    width: 100%;
-    height:90%;
-  }
-  .tableContent >>> td{
-    border:1px solid #ffffff;
-  }
-  .rtPageturning{
-    width: 100%;
-    height: 10%;
-  }
-  .rtPageturning >>> button,
-  .rtPageturning >>> span,
-  .rtPageturning >>> input,
-  .rtPageturning >>> .vxe-pager--btn-wrapper li{
-    background-color: transparent !important;
-    color: #ffffff !important;
-    border: 1px solid #ffffff;
-  }
-  .rtPageturning >>> span{
-    border:none
-  }
-  .rtPageturning >>> .vxe-pager--wrapper .vxe-pager--btn-wrapper li:not(.disabled).is--active {
-    background-color: #9f9fa0 !important;
-  }
-  .tableContent >>> .vxe-button.type--button.is--circle {
-    padding: 0 .5em;
-    min-width: 34px;
-    border-radius: 10%;
-    border: none;
-    background: transparent;
-    color: white;
-  }
-  .filter{
-    position:relative;
-    display:flex;
-    padding:0px 0px 10px 10px;
-    font-size:12px;
-    line-height:11px;
-    color:white;
-  }
-  .filter >>> input{
-    background:transparent;
-    border:none;
-    color:white;
+
+  .my_table_insert .vxe-body--row.is--new {
+    background-color: #f1fdf1;
   }
 </style>

+ 114 - 109
ipfcst-console/src/main/frontend/views/dataquery/windTurbineStatusData/index.vue

@@ -37,59 +37,61 @@
         value-format="timestamp"
         placeholder="选择日期">
       </el-date-picker>
-      <el-button  :loading=loading  size="small"  @click="dateQuery">查询</el-button>
+      <el-button :loading=loading size="small" @click="dateQuery">查询</el-button>
     </div>
-<!--    <div class="content">-->
-      <!--<el-tabs type="card" v-model="activeName" >-->
-        <!--<el-tab-pane  label="指定风机" name="first">-->
-<!--          <div class="tableContent">-->
+    <!--    <div class="content">-->
+    <!--<el-tabs type="card" v-model="activeName" >-->
+    <!--<el-tab-pane  label="指定风机" name="first">-->
+    <!--          <div class="tableContent">-->
     <div style="padding-top: 10px">
-            <vxe-table
-              id="wtNoTable"
-              ref="wtNoTable"
-              :loading="loading"
-              border
-              export-config
-              @sort-change="sortChangeEventNo"
-              :auto-resize="true"
-              highlight-hover-row
-              max-height="90%"
-              :resizable="true"
-              align="center"
-              :data="wtDataNo">
-              <vxe-table-column  field="time" title="接收时间" :formatter="dateFormat" min-width="150" sortable ></vxe-table-column>
-              <vxe-table-column field="equipmentId" title="名称" min-width="60" :formatter="nameFormat"></vxe-table-column>
-              <vxe-table-column field="activePower" title="有功(KW)" min-width="60"></vxe-table-column>
-              <vxe-table-column field="reactivePower" title="无功(KW)" min-width="60"></vxe-table-column>
-              <vxe-table-column field="powerFactor" title="功率因数" min-width="60"></vxe-table-column>
-              <vxe-table-column field="voltage" title="电压(V)" min-width="60"></vxe-table-column>
-              <vxe-table-column field="electricalCurrent" title="电流(A)" min-width="60"></vxe-table-column>
-              <vxe-table-column field="dayElectricQuantity" title="当日发电量(kW·h)" min-width="60"></vxe-table-column>
-              <vxe-table-column field="dayGridConnectedHours" title="当日并网小时"min-width="60"></vxe-table-column>
-              <vxe-table-column field="windWheelRatedSpeed" title="转速(rpm)"min-width="60"></vxe-table-column>
-              <vxe-table-column field="ws" title="风速(m/s)"min-width="60"></vxe-table-column>
-              <vxe-table-column field="wd" title="风向(°)"min-width="60"></vxe-table-column>
-              <vxe-table-column field="t" title="温度(℃)"min-width="60"></vxe-table-column>
-              <vxe-table-column field="pitchAngle" title="桨距角(°)"min-width="60"></vxe-table-column>
-              <vxe-table-column field="status" title="状态"min-width="60"></vxe-table-column>
-            </vxe-table>
-            <div class="rtPageturning">
-              <div class="toolbar">
-                <vxe-toolbar ref="fstToolBar" >
-                  <template v-slot:buttons>
-                    <vxe-button style="background:transparent;border:none"  @click="exportDataEvent"><i class="vxe-icon--download" style="color: white"></i></vxe-button>
-                  </template>
-                </vxe-toolbar></div>
-              <vxe-pager
-                background
-                :loading="loading"
-                :current-page.sync="currentPageNo"
-                :page-size.sync="pageSizeNo"
-                :total="totalNo"
-                @page-change="handlePageChangeNo"
-                :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']">
-              </vxe-pager>
-          </div>
+      <vxe-table
+        id="wtNoTable"
+        ref="wtNoTable"
+        :loading="loading"
+        border
+        export-config
+        @sort-change="sortChangeEventNo"
+        :auto-resize="true"
+        highlight-hover-row
+        max-height="90%"
+        :resizable="true"
+        align="center"
+        :data="wtDataNo">
+        <vxe-table-column field="time" title="接收时间" :formatter="dateFormat" min-width="150" sortable></vxe-table-column>
+        <vxe-table-column field="equipmentId" title="名称" min-width="60" :formatter="nameFormat"></vxe-table-column>
+        <vxe-table-column field="activePower" title="有功(KW)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="reactivePower" title="无功(KW)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="powerFactor" title="功率因数" min-width="60"></vxe-table-column>
+        <vxe-table-column field="voltage" title="电压(V)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="electricalCurrent" title="电流(A)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="dayElectricQuantity" title="当日发电量(kW·h)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="dayGridConnectedHours" title="当日并网小时" min-width="60"></vxe-table-column>
+        <vxe-table-column field="windWheelRatedSpeed" title="转速(rpm)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="ws" title="风速(m/s)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="wd" title="风向(°)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="t" title="温度(℃)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="pitchAngle" title="桨距角(°)" min-width="60"></vxe-table-column>
+        <vxe-table-column field="status" title="状态" min-width="60"></vxe-table-column>
+      </vxe-table>
+      <div class="rtPageturning">
+        <div class="toolbar">
+          <vxe-toolbar ref="fstToolBar">
+            <template v-slot:buttons>
+              <vxe-button style="background:transparent;border:none" @click="exportDataEvent"><i
+                class="vxe-icon--download" style="color: white"></i></vxe-button>
+            </template>
+          </vxe-toolbar>
+        </div>
+        <vxe-pager
+          background
+          :loading="loading"
+          :current-page.sync="currentPageNo"
+          :page-size.sync="pageSizeNo"
+          :total="totalNo"
+          @page-change="handlePageChangeNo"
+          :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']">
+        </vxe-pager>
+      </div>
     </div>
   </div>
 </template>
@@ -98,54 +100,51 @@
 
   export default {
     name: 'inverterTable',
-    data(){
-      return{
+    data() {
+      return {
         stationCode: '',
         stationList: [],
-        loading:false,
-        queryStartTime:"",
-        queryEndTime:"",
-        startTime:new Date(new Date().toLocaleDateString()).getTime(),
-        endTime:new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 1000-1,
-        windTurbineInfoId:[],
-        windTurbineInfos:[],
-        wtDataNo:[],
-        wtDataAll:[],
+        loading: false,
+        queryStartTime: "",
+        queryEndTime: "",
+        startTime: new Date(new Date().toLocaleDateString()).getTime(),
+        endTime: new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 1000 - 1,
+        windTurbineInfoId: [],
+        windTurbineInfos: [],
+        wtDataNo: [],
+        wtDataAll: [],
         activeName: 'first',
-        totalNo:0,
+        totalNo: 0,
         pageSizeNo: 10,
         currentPageNo: 1,
-        sortOrderNo:'asc',
-        totalAll:0,
+        sortOrderNo: 'asc',
+        totalAll: 0,
         pageSizeAll: 10,
         currentPageAll: 1,
-        sortOrderTime:'asc',
-        sortOrderNumber:'asc'
+        sortOrderTime: 'asc',
+        sortOrderNumber: 'asc'
       }
     },
-    created () {
+    created() {
       this.$nextTick(() => {
         // 手动将表格和工具栏进行关联
         // this.$refs.wtAllTable.connect(this.$refs.wtAllToolbar)
         this.$refs.wtNoTable.connect(this.$refs.wtNoToolbar)
       })
     },
-    mounted(){
+    mounted() {
       this.getStationList()
     },
-    methods:{
+    methods: {
       stationCodeChange() {
         // 获取逆变器设备
         let queryParam = this.stationCode;
-        if (queryParam==''){
-          // 清除设备下拉框
-          this.windTurbineInfos = ''
-        }
-        else{
-          this.$axios.get('/windTurbineInfo/findWindTurbineInfoByStation/' + queryParam).then((res) => {
-            this.windTurbineInfos = res.data
-          })
-        }
+        this.windTurbineInfos = ''
+        this.windTurbineInfoId = ''
+        this.$axios.get('/windTurbineInfo/findWindTurbineInfoByStation/' + queryParam).then((res) => {
+          this.windTurbineInfos = res.data
+        })
+
       },
       getStationList() {
         this.$axios.get('/electricField/getElectricField').then((res) => {
@@ -154,37 +153,42 @@
           this.$message.error('获取场站下拉框出错' + error)
         })
       },
-      querywtDataNo(){
-        this.loading=true
+      querywtDataNo() {
+        this.loading = true
         let windTurbineId = this.windTurbineInfoId;
-        if (windTurbineId==''){
-          windTurbineId="ALL"
+        if (windTurbineId == '') {
+          windTurbineId = "ALL"
         }
-        this.$axios.get('/windTurbineStatusData/'+this.stationCode+'/'+this.queryStartTime+'/'+this.queryEndTime+'/'+this.currentPageNo+'/'+this.pageSizeNo+'/'+windTurbineId).then((res) => {
+        this.$axios.get('/windTurbineStatusData/' + this.stationCode + '/' + this.queryStartTime + '/' + this.queryEndTime + '/' + this.currentPageNo + '/' + this.pageSizeNo + '/' + windTurbineId).then((res) => {
           this.wtDataNo = res.data.content
           // 表分页格数据总条数
           this.totalNo = res.data.count
-          this.loading=false
+          this.loading = false
         }).catch((error) => {
-          this.loading=false
+          this.loading = false
           this.$message.error('查询风机根据number出错' + error)
         })
       },
-      dateQuery(){
+      dateQuery() {
         let queryParam = this.stationCode;
-        if (queryParam==''){
+        if (queryParam == '') {
           this.$message.error("请选择场站")
           return;
         }
-        this.loading=true
-        if(this.endTime<=this.startTime){
+        let infoId = this.windTurbineInfoId;
+        if (infoId == '') {
+          this.$message.error("请选择设备")
+          return;
+        }
+        this.loading = true
+        if (this.endTime <= this.startTime) {
           this.$message.error("开始时间不能小于结束时间")
           this.startTime = this.queryStartTime
           this.endTime = this.queryEndTime
-          this.loading=false
+          this.loading = false
           return
         }
-        if(this.endTime-this.startTime> 60 * 60 * 24 * 1000*3){
+        if (this.endTime - this.startTime > 60 * 60 * 24 * 1000 * 3) {
           this.startTime = this.queryStartTime
           this.endTime = this.queryEndTime
           this.$message.error("只能最多查询3天的数据")
@@ -199,8 +203,8 @@
         this.currentPageAll = 1
         // this.querywtDataAll()
       },
-      sortChangeEventNo ({ column, property, order }) {
-        if(order == null){
+      sortChangeEventNo({column, property, order}) {
+        if (order == null) {
           order = 'asc'
         }
         this.currentPageNo = 1
@@ -209,14 +213,14 @@
         this.startTime = this.queryStartTime
         this.endTime = this.queryEndTime
       },
-      sortChangeEventAll ({ column, property, order }) {
-        if(order == null){
+      sortChangeEventAll({column, property, order}) {
+        if (order == null) {
           order = 'asc'
         }
-        if(property == 'time'){
+        if (property == 'time') {
           this.sortOrderTime = order
         }
-        if(property == 'equipmentNo'){
+        if (property == 'equipmentNo') {
           this.sortOrderNumber = order
         }
         this.currentPageAll = 1
@@ -224,13 +228,13 @@
         this.startTime = this.queryStartTime
         this.endTime = this.queryEndTime
       },
-      checkColumnMethod ({ column }) {
+      checkColumnMethod({column}) {
         if (column.property === 'time') {
           return false
         }
         return true
       },
-      dateFormat({ cellValue, row, column }) {
+      dateFormat({cellValue, row, column}) {
         // return this.$XEUtils.toDateString(cellValue, 'yyyy-MM-dd HH:mm:ss')
         const date = new Date(cellValue) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
         const Y = date.getFullYear() + '-'
@@ -241,31 +245,32 @@
         const s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds())
         return Y + M + D + H + m + s
       },
-      nameFormat({ cellValue, row, column }) {
-        var name ='未知设备'
-        for(let index in this.windTurbineInfos) {
-          if(cellValue == this.windTurbineInfos[index].id){
+      nameFormat({cellValue, row, column}) {
+        var name = '未知设备'
+        for (let index in this.windTurbineInfos) {
+          if (cellValue == this.windTurbineInfos[index].id) {
             name = this.windTurbineInfos[index].name
           }
-        };
+        }
+        ;
         return name
       },
-      handlePageChangeNo ({ currentPage, pageSize }) {
+      handlePageChangeNo({currentPage, pageSize}) {
         this.currentPageNo = currentPage
         this.pageSizeNo = pageSize
         this.querywtDataNo();
         this.startTime = this.queryStartTime
         this.endTime = this.queryEndTime
       },
-      handlePageChangeAll({ currentPage, pageSize }){
+      handlePageChangeAll({currentPage, pageSize}) {
         this.currentPageAll = currentPage
         this.pageSizeAll = pageSize
         // this.querywtDataAll();
         this.startTime = this.queryStartTime
         this.endTime = this.queryEndTime
-      },exportDataEvent() {
+      }, exportDataEvent() {
         this.loading = true
-        this.$axios.get('/export/windTurbineStatusData/'+this.queryStartTime+'/'+this.queryEndTime+'/'+this.windTurbineInfoId, {
+        this.$axios.get('/export/windTurbineStatusData/' + this.queryStartTime + '/' + this.queryEndTime + '/' + this.windTurbineInfoId, {
           responseType: 'blob'// 用于解决中文乱码
         }).then((response) => {
           this.loading = false

+ 0 - 8
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/WeatherStationStatusDataController.java

@@ -1,22 +1,14 @@
 package com.jiayue.ipfcst.console.controller;
 
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
-import com.jiayue.ipfcst.common.data.entity.WeatherStationStatusData;
 import com.jiayue.ipfcst.console.service.WeatherStationStatusDataService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RestController;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.BufferedOutputStream;
-import java.io.IOException;
-import java.net.URLEncoder;
-import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 /**

+ 82 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/WindTowerStatusDataController.java

@@ -0,0 +1,82 @@
+package com.jiayue.ipfcst.console.controller;
+
+import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
+import com.jiayue.ipfcst.console.service.WindTowerStatusDataService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedOutputStream;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 测风塔数据restful接口
+ *
+ * @author yh
+ * @version 1.0
+ * @since 2019/8/7 10:12
+ */
+@RestController
+@Slf4j
+public class WindTowerStatusDataController {
+
+  private final WindTowerStatusDataService windTowerStatusDataService;
+
+  @Autowired
+  public WindTowerStatusDataController(WindTowerStatusDataService windTowerStatusDataService){
+    this.windTowerStatusDataService=windTowerStatusDataService;
+  }
+
+//  /**
+//   * 分页查询 测风塔数据
+//   * @param startTime 开始时间
+//   * @param endTime 结束时间
+//   * @param page 页码
+//   * @param size 条数
+//   * @param sortOrder 排序
+//   * @return
+//   */
+//  @GetMapping(value = "/windTowerStatusData/{startTime}/{endTime}/{page}/{size}/{no}")
+//  public ResponseVO findByTimeBetweenForPaging(@PathVariable("startTime") Long startTime,
+//                                               @PathVariable("endTime") Long endTime,
+//                                               @PathVariable("page") Integer page,
+//                                               @PathVariable("size") Integer size,
+//                                               @PathVariable("no") Integer no,
+//                                               String sortOrder){
+//    Map<String,Object> map = new HashMap<>();
+//    try{
+//      map =  windTowerStatusDataService.findByTimeBetweenForPaging(new Date(startTime),new Date(endTime),page,size,no,sortOrder);
+//      return ResponseVO.success(map);
+//    }catch(Exception e){
+//      e.printStackTrace();
+//      log.error("测风塔数据分页查询错误");
+//      return ResponseVO.fail(e.toString());
+//    }
+//  }
+
+  @GetMapping(value = "/windTowerStatusData/{stationCode}/{startTime}/{endTime}/{page}/{size}/{no}")
+  public ResponseVO findByTimeBetweenAndNoAndTimeStep(@PathVariable("stationCode") String stationCode,@PathVariable("startTime") Long startTime,
+                                                      @PathVariable("endTime") Long endTime,
+                                                      @PathVariable("page") Integer page,
+                                                      @PathVariable("size") Integer size,
+                                                      @PathVariable("no") String no){
+    Map<String,Object> map = new HashMap<>();
+    try{
+      map =  windTowerStatusDataService.findByTimeBetweenAndNoAndTimeStep(stationCode,new Date(startTime),new Date(endTime),page,size,no);
+      return ResponseVO.success(map);
+    }catch(Exception e){
+      e.printStackTrace();
+      log.error("测风数据分页查询错误");
+      return ResponseVO.fail(e.toString());
+    }
+  }
+}

+ 131 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/WindTowerStatusDataService.java

@@ -0,0 +1,131 @@
+package com.jiayue.ipfcst.console.service;
+
+import com.jiayue.ipfcst.common.data.entity.WindTowerStatusData;
+import com.jiayue.ipfcst.common.data.repository.PowerStationStatusDataRepository;
+import com.jiayue.ipfcst.common.data.repository.WindTowerStatusDataRepository;
+import com.jiayue.ipfcst.common.data.service.BaseService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+import javax.persistence.criteria.Predicate;
+import java.lang.reflect.Field;
+import java.util.*;
+
+/**
+ * 测风塔数据业务层
+ *
+ * @author yh
+ * @version 1.0
+ * @since 2019/8/5 16:02
+ */
+@Service
+public class WindTowerStatusDataService extends BaseService {
+
+  private final WindTowerStatusDataRepository windTowerStatusDataRepository;
+
+  @Autowired
+  public WindTowerStatusDataService(WindTowerStatusDataRepository windTowerStatusDataRepository,
+                                    PowerStationStatusDataRepository powerStationStatusDataRepository) {
+    this.windTowerStatusDataRepository = windTowerStatusDataRepository;
+  }
+
+  /**
+   * 分页查询 环境监测仪数据 tl
+   *
+   * @param startTime 开始时间
+   * @param endTime   结束时间
+   * @param no        设备编号
+   * @return
+   */
+  @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
+  public Map<String, Object> findByTimeBetweenAndNoAndTimeStep(String stationCode,Date startTime, Date endTime,
+                                                               Integer page,Integer size,String no) {
+
+    Map<String, Object> map = new HashMap<>();
+    Sort sort = Sort.by(Sort.Direction.DESC, "time");
+    Specification<WindTowerStatusData> specification = this.specificationFindByTime(stationCode,startTime, endTime,no);
+    Pageable pageable = PageRequest.of(page - 1, size, sort); //页码:前端从1开始,jpa从0开始,做个转换
+    Page windTowerStatusDatas = windTowerStatusDataRepository.findAll(specification, pageable);
+    List<WindTowerStatusData> datas = new ArrayList<>();
+    datas = windTowerStatusDatas.getContent();
+    map.put("content", datas);// 结果集
+    map.put("count", windTowerStatusDatas.getTotalElements());// 总记录数
+    return map;
+  }
+  /**
+   * 根据时间 分页查询条件 yh
+   *
+   * @param startTime 开始时间
+   * @param endTime   结束时间
+   * @return 过滤条件
+   */
+  Specification<WindTowerStatusData> specificationFindByTime(final String stationCode, final Date startTime, final Date endTime,final String no) {
+    return (Specification<WindTowerStatusData>) (root, criteriaQuery, cb) -> {
+      List<Predicate> predicates = new ArrayList<>();
+      predicates.add(cb.equal(root.get("stationCode").as(String.class), stationCode));
+      if (!"ALL".equals(no)){
+        predicates.add(cb.equal(root.get("equipmentId").as(String.class), no));
+      }
+      if (startTime != null) {
+        //大于或等于传入时间
+        predicates.add(cb.greaterThanOrEqualTo(root.get("time").as(Date.class), startTime));
+      }
+      if (endTime != null) {
+        //小于传入时间
+        predicates.add(cb.lessThan(root.get("time").as(Date.class), endTime));
+      }
+      //添加排序的功能
+      return cb.and(predicates.toArray(new Predicate[predicates.size()]));
+    };
+  }
+
+  /**
+   * 查询条件 yh
+   *
+   * @param startTime 开始时间
+   * @param endTime   结束时间
+   * @param no        设备编号
+   * @return 过滤条件
+   */
+  Specification<WindTowerStatusData> Specification(final Date startTime, final Date endTime, final Integer no) {
+    return (Specification<WindTowerStatusData>) (root, criteriaQuery, cb) -> {
+      List<Predicate> predicates = new ArrayList<>();
+      if (startTime != null) {
+        //大于或等于传入时间
+        predicates.add(cb.greaterThanOrEqualTo(root.get("time").as(Date.class), startTime));
+      }
+      if (endTime != null) {
+        //小于传入时间
+        predicates.add(cb.lessThan(root.get("time").as(Date.class), endTime));
+      }
+      if (no != null) {
+        predicates.add(cb.equal(root.get("equipmentNo").as(Integer.class), no));
+      }
+      //添加排序的功能
+      return cb.and(predicates.toArray(new Predicate[predicates.size()]));
+
+    };
+  }
+
+  /**
+   * 获取测风塔数据实体所有私有属性名称集合
+   *
+   * @return 属性名称集合
+   */
+  public List<String> getWindTowerStatusDataAttributeName() {
+    List<String> attributeName = new ArrayList<>();
+    WindTowerStatusData windTowerStatusData = new WindTowerStatusData();
+    Class c = windTowerStatusData.getClass();
+    Field[] fs = c.getDeclaredFields();
+    for (Field f : fs) {
+      attributeName.add(f.getName());
+    }
+    return attributeName;
+  }
+}

+ 1 - 1
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/E63UploadFileService.java

@@ -628,7 +628,7 @@ public class E63UploadFileService extends BaseUploadFileService {
         }
       }
       if (!isUseRedis) {
-        List<WindTowerStatusData> windTowerStatusDataList = windTowerStatusDataRepository.findByEquipmentIdAndTimeBetween(cftId, new Date(startTime), new Date(endTime));
+        List<WindTowerStatusData> windTowerStatusDataList = windTowerStatusDataRepository.findByStationCodeAndEquipmentIdAndTimeBetween(electricFieldInfo.getStationCode(),cftId, new Date(startTime), new Date(endTime));
         if (windTowerStatusDataList.isEmpty()){
           // 没有测风塔数据用nwp数据补
           Long nwpTime;