Browse Source

3.14大屏表数据修改

username 3 năm trước cách đây
mục cha
commit
db7fe702e1

+ 11 - 0
master/src/main/java/com/ruoyi/project/aspen/controller/TDashboarddayelecController.java

@@ -124,4 +124,15 @@ public class TDashboarddayelecController extends BaseController
         List<TDashboarddayelec> tDashboarddayelecs = tDashboarddayelecService.selectMonth(tDashboarddayelec);
         return AjaxResult.success(tDashboarddayelecs);
     }
+
+    /**
+     * 查询最近一周DASHBOARD每日抓取数据列表
+     */
+    @PreAuthorize("@ss.hasPermi('aspen:dashboardday:list')")
+    @GetMapping("/week")
+    public AjaxResult selectWeek(TDashboarddayelec tDashboarddayelec)
+    {
+        List<TDashboarddayelec> tDashboarddayelecs = tDashboarddayelecService.selectWeek(tDashboarddayelec);
+        return AjaxResult.success(tDashboarddayelecs);
+    }
 }

+ 11 - 0
master/src/main/java/com/ruoyi/project/aspen/controller/TDashboarddayeleceightController.java

@@ -102,4 +102,15 @@ public class TDashboarddayeleceightController extends BaseController
     {
         return toAjax(tDashboarddayeleceightService.deleteTDashboarddayeleceightByIds(ids));
     }
+
+    /**
+     * 查询电厂大屏每日8:00抓取数据
+     */
+    @PreAuthorize("@ss.hasPermi('aspen:dashboarddayeleceight:list')")
+    @GetMapping("/week")
+    public AjaxResult selectWeek(TDashboarddayeleceight tDashboarddayeleceight)
+    {
+        List<TDashboarddayeleceight> tDashboarddayeleceights=tDashboarddayeleceightService.selectWeek(tDashboarddayeleceight);
+        return AjaxResult.success(tDashboarddayeleceights);
+    }
 }

+ 7 - 0
master/src/main/java/com/ruoyi/project/aspen/mapper/TDashboarddayelecMapper.java

@@ -75,4 +75,11 @@ public interface TDashboarddayelecMapper
      */
     public List<TDashboarddayelec> selectMonth(TDashboarddayelec tDashboarddayelec);
 
+    /**
+     * 查询最近一周dashboardelec抓取数据
+     *
+     * @return dashboardelec抓取数据
+     */
+    public List<TDashboarddayelec> selectWeek(TDashboarddayelec tDashboarddayelec);
+
 }

+ 8 - 0
master/src/main/java/com/ruoyi/project/aspen/mapper/TDashboarddayeleceightMapper.java

@@ -61,4 +61,12 @@ public interface TDashboarddayeleceightMapper
      * @return 结果
      */
     public int deleteTDashboarddayeleceightByIds(Long[] ids);
+
+    /**
+     * 查询电厂大屏本周8:00抓取数据列表
+     *
+     * @param tDashboarddayeleceight 电厂大屏本周8:00抓取数据
+     * @return 电厂大屏本周8:00抓取数据集合
+     */
+    public List<TDashboarddayeleceight> selectWeek(TDashboarddayeleceight tDashboarddayeleceight);
 }

+ 7 - 0
master/src/main/java/com/ruoyi/project/aspen/service/ITDashboarddayelecService.java

@@ -74,4 +74,11 @@ public interface ITDashboarddayelecService
      * @return dashboardelec抓取数据
      */
     public List<TDashboarddayelec> selectMonth(TDashboarddayelec tDashboarddayelec);
+
+    /**
+     * 查询最近一周dashboardelec抓取数据
+     *
+     * @return dashboardelec抓取数据
+     */
+    public List<TDashboarddayelec> selectWeek(TDashboarddayelec tDashboarddayelec);
 }

+ 8 - 0
master/src/main/java/com/ruoyi/project/aspen/service/ITDashboarddayeleceightService.java

@@ -60,4 +60,12 @@ public interface ITDashboarddayeleceightService
      * @return 结果
      */
     public int deleteTDashboarddayeleceightById(Long id);
+
+    /**
+     * 查询电厂大屏本周8:00抓取数据列表
+     *
+     * @param tDashboarddayeleceight 电厂大屏本周8:00抓取数据
+     * @return 电厂大屏本周8:00抓取数据集合
+     */
+    public List<TDashboarddayeleceight> selectWeek(TDashboarddayeleceight tDashboarddayeleceight);
 }

+ 5 - 0
master/src/main/java/com/ruoyi/project/aspen/service/impl/TDashboarddayelecServiceImpl.java

@@ -97,4 +97,9 @@ public class TDashboarddayelecServiceImpl implements ITDashboarddayelecService {
     public List<TDashboarddayelec> selectMonth(TDashboarddayelec tDashboarddayelec) {
         return tDashboarddayelecMapper.selectMonth(tDashboarddayelec);
     }
+
+    @Override
+    public List<TDashboarddayelec> selectWeek(TDashboarddayelec tDashboarddayelec) {
+        return tDashboarddayelecMapper.selectWeek(tDashboarddayelec);
+    }
 }

+ 5 - 0
master/src/main/java/com/ruoyi/project/aspen/service/impl/TDashboarddayeleceightServiceImpl.java

@@ -94,4 +94,9 @@ public class TDashboarddayeleceightServiceImpl implements ITDashboarddayeleceigh
     {
         return tDashboarddayeleceightMapper.deleteTDashboarddayeleceightById(id);
     }
+
+    @Override
+    public List<TDashboarddayeleceight> selectWeek(TDashboarddayeleceight tDashboarddayeleceight) {
+        return tDashboarddayeleceightMapper.selectWeek(tDashboarddayeleceight);
+    }
 }

+ 4 - 0
master/src/main/resources/mybatis/aspen/TDashboarddayelecMapper.xml

@@ -260,5 +260,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectMonth" parameterType="TDashboarddayelec" resultMap="TDashboarddayelecResult">
         select * from ( select * from t_dashboarddayelec where del_flag = 0 order by id asc ) WHERE 32 > ROWNUM
     </select>
+
+    <select id="selectWeek" parameterType="TDashboarddayelec" resultMap="TDashboarddayelecResult">
+        select * from ( select * from t_dashboarddayelec where del_flag = 0 order by id asc ) WHERE 8 > ROWNUM
+    </select>
     
 </mapper>

+ 4 - 0
master/src/main/resources/mybatis/aspen/TDashboarddayeleceightMapper.xml

@@ -112,5 +112,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </update>
+
+    <select id="selectWeek" parameterType="TDashboarddayeleceight" resultMap="TDashboarddayeleceightResult">
+        select * from ( select * from t_dashboarddayeleceight where del_flag = 0 order by id asc ) WHERE 8 > ROWNUM
+    </select>
     
 </mapper>

+ 9 - 0
ui/src/api/aspen/dashboarddayelec.js

@@ -69,3 +69,12 @@ export function selectMonth(query) {
     params: query
   })
 }
+
+// 查询一周dashboarddayelec抓取数据
+export function selectWeek(query) {
+  return request({
+    url: '/aspen/dashboarddayelec/week',
+    method: 'get',
+    params: query
+  })
+}

+ 16 - 7
ui/src/api/aspen/dashboarddayeleceight.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 查询电厂大屏每日8:00抓取数据列表
 export function listDashboarddayeleceight(query) {
   return request({
-    url: '/his/dashboarddayeleceight/list',
+    url: '/aspen/dashboarddayeleceight/list',
     method: 'get',
     params: query
   })
@@ -12,7 +12,7 @@ export function listDashboarddayeleceight(query) {
 // 查询电厂大屏每日8:00抓取数据详细
 export function getDashboarddayeleceight(id) {
   return request({
-    url: '/his/dashboarddayeleceight/' + id,
+    url: '/aspen/dashboarddayeleceight/' + id,
     method: 'get'
   })
 }
@@ -20,7 +20,7 @@ export function getDashboarddayeleceight(id) {
 // 新增电厂大屏每日8:00抓取数据
 export function addDashboarddayeleceight(data) {
   return request({
-    url: '/his/dashboarddayeleceight',
+    url: '/aspen/dashboarddayeleceight',
     method: 'post',
     data: data
   })
@@ -29,7 +29,7 @@ export function addDashboarddayeleceight(data) {
 // 修改电厂大屏每日8:00抓取数据
 export function updateDashboarddayeleceight(data) {
   return request({
-    url: '/his/dashboarddayeleceight',
+    url: '/aspen/dashboarddayeleceight',
     method: 'put',
     data: data
   })
@@ -38,7 +38,7 @@ export function updateDashboarddayeleceight(data) {
 // 删除电厂大屏每日8:00抓取数据
 export function delDashboarddayeleceight(id) {
   return request({
-    url: '/his/dashboarddayeleceight/' + id,
+    url: '/aspen/dashboarddayeleceight/' + id,
     method: 'delete'
   })
 }
@@ -46,8 +46,17 @@ export function delDashboarddayeleceight(id) {
 // 导出电厂大屏每日8:00抓取数据
 export function exportDashboarddayeleceight(query) {
   return request({
-    url: '/his/dashboarddayeleceight/export',
+    url: '/aspen/dashboarddayeleceight/export',
     method: 'get',
     params: query
   })
-}
+}
+
+//电厂大屏本周8:00抓取数据
+export function selectWeek(query) {
+  return request({
+    url: '/aspen/dashboarddayeleceight/week',
+    method: 'get',
+    params: query
+  })
+}

+ 5 - 2
ui/src/views/monitor/elec/bottomRight.vue

@@ -15,7 +15,7 @@
       </div>
       <div style="display:flex;flex-direction:row">
         <div style="flex: 3">
-          <bottomRightChart />
+          <bottomRightChart :weekData="weekData"/>
         </div>
       <div class="naturalGasData" style="flex: 1">
         <div style="">
@@ -52,13 +52,16 @@
 <script>
 import bottomRightChart from "./echart/bottom/bottomRightChart";
 export default {
+  props:['weekData'],
   data() {
     return {};
   },
   components: {
     bottomRightChart
   },
-  mounted() {},
+  mounted() {
+    console.log('我是周数据',this.weekData);
+  },
   methods: {}
 };
 </script>

+ 17 - 8
ui/src/views/monitor/elec/centerRight2.vue

@@ -11,14 +11,14 @@
         <div id="peakToValley" style="width:100%;height:2.5rem;"></div>
       </div>
       <div class="d-flex jc-center body-box" style=" margin-top: 0;height: 60px">
-        <div class="fontElec"><p class="title-p">发电量</p><p class="title-p2">2264.0</p></div>
+        <div class="fontElec"><p class="title-p">发电量</p><p class="title-p2">{{this.dashboarddayelec.ypg}}</p></div>
       </div>
       <div class="d-flex jc-center body-box" style=" margin-top: 0;height: 60px">
-        <div class="fontElec"><p class="title-p">倒电量</p> <p class="title-p2">853.0</p></div>
+        <div class="fontElec"><p class="title-p">倒电量</p> <p class="title-p2">{{this.dashboarddayelec.daodianliang}}</p></div>
 
       </div>
       <div class="d-flex jc-center body-box" style=" margin-top: 0;height: 60px">
-        <div class="fontElec"><p class="title-p">用电量</p><p class="title-p2">1872.0</p></div>
+        <div class="fontElec"><p class="title-p">用电量</p><p class="title-p2">{{this.dashboarddayelec.eveLec}}</p></div>
 
       </div>
     </div>
@@ -27,9 +27,8 @@
 
 <script>
   import centreRight2Chart1 from "@/components/echart/centreRight2/centreRight2Chart1";
-  props:[]
-
   export default {
+    props:['dashboardelecdata'],
     data() {
       return {
         config: {
@@ -52,7 +51,9 @@
             },
           ],
           showValue: true
-        }
+        },
+        dashboarddayelec:this.dashboardelecdata[0],
+        dashboarddayelecmonth:this.dashboardelecdata[1]
       };
     },
     components: { centreRight2Chart1 },
@@ -63,6 +64,12 @@
       initChart() {
         // 基于准备好的dom,初始化echarts实例
         this.chart = this.echarts.init(document.getElementById('peakToValley'))
+        const dateDay = [];
+        const dateNum = [];
+        for (let i = 0; i < this.dashboarddayelecmonth.length; i++) {
+          dateDay[i] = this.dashboarddayelecmonth[i].dateDay;
+          dateNum[i] = this.dashboarddayelecmonth[i].fenggucha;
+        }
 
         this.chart.setOption({
           /* 周围边距 */
@@ -82,7 +89,8 @@
           xAxis: [
             {
               type: 'category',
-              data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'],
+              // data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'],
+              data:dateDay,
               axisTick: {
                 alignWithLabel: true
               }
@@ -104,7 +112,8 @@
                   { type: 'min', name: 'Min' }
                 ]
               },
-              data: [10, 52, 20, 33, 30, 30, -34, 10, 33, 20, 33, 30, 30, -13, 10, 12, 20, 33, 30, 30, -20, 10, 43, 20, 33, 30, 30, -20, 12, 45, -11]
+              // data: [10, 52, 20, 33, 30, 30, -34, 10, 33, 20, 33, 30, 30, -13, 10, 12, 20, 33, 30, 30, -20, 10, 43, 20, 33, 30, 30, -20, 12, 45, -11]
+              data:dateNum,
             }
           ]
         })

+ 8 - 2
ui/src/views/monitor/elec/echart/bottom/bottomRightChart.vue

@@ -8,6 +8,7 @@
 import echartMixins from "@/utils/resizeMixins";
 
 export default {
+  props:['weekData'],
   data() {
     return {
       chart: null
@@ -16,6 +17,7 @@ export default {
   mounted() {
     this.draw();
     this.charTimg();
+    console.log('weekData:',this.weekData)
   },
   mixins: [echartMixins],
   methods: {
@@ -48,7 +50,10 @@ export default {
         weekMaxData.push(maxData);
         var distance = Math.round(Math.random() * 11000 + 500);
         weekLineData.push(distance);
-
+      };
+      const dateNum = [];
+      for (let i = 0; i < this.weekData.length; i++) {
+        dateNum[i] = this.weekData[i].evconsume;
       }
 
       // // 颜色设置
@@ -266,7 +271,8 @@ export default {
         },
         series: [
           {
-            data: [820, 932, 901, 934, 1290, 1330, 1320],
+            // data: [820, 932, 901, 934, 1290, 1330, 1320],
+            data:dateNum,
             type: 'line',
             smooth: true,
             symbolSize: 10,

+ 33 - 2
ui/src/views/monitor/elec/elecindex.vue

@@ -74,7 +74,7 @@
           </div>
           <!-- 中间 -->
           <div>
-            <centerRight2 :dashboardelecdata="dashboardelecdata,monthData"/>
+            <centerRight2 :dashboardelecdata="[dashboardelecdata,monthData]"/>
           </div>
           <div>
             <dv-border-box-13>
@@ -90,7 +90,7 @@
           </dv-border-box-13>
           <div class="bototm-box1">
             <dv-border-box-12>
-              <bottom-right :dashboardelecdata="dashboardelecdata"/>
+              <bottom-right :weekData="weekData"/>
             </dv-border-box-12>
             <div class="bototm-box2">
               <dv-border-box-12>
@@ -158,6 +158,7 @@ import '@/assets/styles/index.scss' // global css
 import '@/common/flexible.js';
 import dayjs from "dayjs";
 import {selectLast,selectMonth} from "@/api/aspen/dashboarddayelec";
+import {selectWeek} from "@/api/aspen/dashboarddayeleceight";
 export default {
   data() {
     return {
@@ -257,6 +258,20 @@ export default {
         bocElec: null,
         dataDate: null,
         dateDay: null
+      },
+      weekData:{
+        pageNum: 1,
+        pageSize: 20,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        evconsume: null,
+        elecp: null,
+        hechengqi: null,
+        u2: null,
+        dataDate: null,
+        dateDay: null
       }
     };
   },
@@ -291,6 +306,7 @@ export default {
   created() {
     this.getList1();
     this.getMonthList1();
+    this.getWeekList();
     // 每隔30秒请求一次数据
     window.setInterval(() => {
       setTimeout(() => {
@@ -306,6 +322,14 @@ export default {
         this.getMonthList1();
       }, 0)
     }, 1000 * 10 * 6 * 60 * 6)
+
+    // 一天请求一次数据
+    window.setInterval(() => {
+      setTimeout(() => {
+        ///调取接口获取数据
+        this.getWeekList();
+      }, 0)
+    }, 1000 * 10 * 6 * 60 * 6)
   },
   methods: {
     /** 查询dashboarddayelec抓取数据列表 */
@@ -322,6 +346,13 @@ export default {
         this.monthData = response.data;
       });
     },
+    /** 查询dashboarddayelec近一周抓取数据列表 */
+    getWeekList()
+    {
+      selectWeek(this.queryParams).then(response => {
+        this.weekData = response.data;
+      });
+    },
     cancelLoading() {
       setTimeout(() => {
         this.loading = false;