Browse Source

业务管理增加重放

xusl 1 year ago
parent
commit
f4d244333d

+ 3 - 0
backend/src/main/java/com/jiayue/ssi/controller/ElectricFieldController.java

@@ -2,6 +2,7 @@ package com.jiayue.ssi.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.jiayue.ssi.annotation.OperateLog;
+import com.jiayue.ssi.annotation.PreventReplay;
 import com.jiayue.ssi.backenum.AuditType;
 import com.jiayue.ssi.backenum.BusinessType;
 import com.jiayue.ssi.constant.CustomException;
@@ -36,6 +37,7 @@ public class ElectricFieldController {
      */
     @GetMapping(value = "/getAll")
     @PreAuthorize("@ss.hasPermi('biz:electric:getAll')")
+    @PreventReplay
     public ResponseVO getAll() throws CustomException {
         try {
             ElectricField electricField = electricFieldService.getOne(new QueryWrapper<>());
@@ -51,6 +53,7 @@ public class ElectricFieldController {
     @PostMapping
     @OperateLog(title = "场站信息", businessType = BusinessType.UPDATE, auditType = AuditType.BIZ)
     @PreAuthorize("@ss.hasPermi('biz:electric:update')")
+    @PreventReplay
     public ResponseVO update(@RequestBody ElectricField electricField) throws CustomException {
         try {
             if (StringUtils.isEmpty(electricField.getStationCode())) {

+ 6 - 0
backend/src/main/java/com/jiayue/ssi/controller/ForecastPowerShortTermController.java

@@ -3,6 +3,7 @@ package com.jiayue.ssi.controller;
 import cn.hutool.core.util.NumberUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jiayue.ssi.annotation.PreventReplay;
 import com.jiayue.ssi.constant.CustomException;
 import com.jiayue.ssi.entity.*;
 import com.jiayue.ssi.service.*;
@@ -10,6 +11,7 @@ import com.jiayue.ssi.util.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
@@ -34,6 +36,8 @@ public class ForecastPowerShortTermController {
      * @return 用户信息
      */
     @GetMapping(value = "/getAll")
+    @PreAuthorize("@ss.hasPermi('biz:dq:getAll')")
+    @PreventReplay
     public ResponseVO getAll(String currentPage, String pageSize, String startTime, String endTime) throws CustomException {
         try {
             Integer cp;
@@ -83,6 +87,8 @@ public class ForecastPowerShortTermController {
      * @return 结果集
      */
     @GetMapping(value = "/getDraw")
+    @PreAuthorize("@ss.hasPermi('biz:dq:getAll')")
+    @PreventReplay
     public ResponseVO getDraw(String startTime, String endTime) throws CustomException{
         Map<String,Object> map = new HashMap<>();
         try{

+ 6 - 0
backend/src/main/java/com/jiayue/ssi/controller/NwpController.java

@@ -3,6 +3,7 @@ package com.jiayue.ssi.controller;
 import cn.hutool.core.util.NumberUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jiayue.ssi.annotation.PreventReplay;
 import com.jiayue.ssi.constant.CustomException;
 import com.jiayue.ssi.entity.ForecastPowerShortTerm;
 import com.jiayue.ssi.entity.Nwp;
@@ -12,6 +13,7 @@ import com.jiayue.ssi.util.ResponseVO;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -38,6 +40,8 @@ public class NwpController {
      * @return 用户信息
      */
     @GetMapping(value = "/getAll")
+    @PreAuthorize("@ss.hasPermi('biz:nwp:getAll')")
+    @PreventReplay
     public ResponseVO getAll(String currentPage, String pageSize, String startTime, String endTime) throws CustomException {
         try {
             Integer cp;
@@ -87,6 +91,8 @@ public class NwpController {
      * @return 结果集
      */
     @GetMapping(value = "/getDraw")
+    @PreAuthorize("@ss.hasPermi('biz:nwp:getAll')")
+    @PreventReplay
     public ResponseVO getDraw(String startTime, String endTime) throws CustomException{
         Map<String,Object> map = new HashMap<>();
         try{

+ 26 - 4
ui/src/views/bizManager/electricField/index.vue

@@ -194,8 +194,20 @@ export default {
   mounted() {
   },
   methods: {
-    getData() {
-      this.$axios.get('/electricField/getAll').then((res) => {
+    async getData() {
+      let sysTime
+      let lk
+      await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
+        sysTime = res.data.sysTime
+        lk = res.data.lk
+      }).catch((error) => {
+      })
+
+      var searchParams = {
+        sysTime: sysTime,
+        lk: lk
+      }
+      await this.$axios.get('/electricField/getAll',{params: searchParams}).then((res) => {
         this.form = res.data
         this.loading = false
       }).catch((error) => {
@@ -204,10 +216,20 @@ export default {
       })
     },
     saveElectricField:debounce(function(formName){
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate(async (valid) => {
         if (valid) {
+          let sysTime
+          let lk
+          await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
+            sysTime = res.data.sysTime
+            lk = res.data.lk
+          }).catch((error) => {
+          })
+
+          this.form.sysTime = sysTime
+          this.form.lk = lk
           this.tableLoading = true
-          this.$axios.post('/electricField/', this.form).then(res => {
+          await this.$axios.post('/electricField/', this.form).then(res => {
             if (res.code == 0) {
               this.$message.success('场站信息保存成功')
             }

+ 27 - 7
ui/src/views/bizManager/forecastPowerShortTerm/index.vue

@@ -73,6 +73,7 @@
 import Chart from './charts'
 import resize from '../../../components/Charts/mixins/resize'
 import moment from "moment";
+import {debounce} from "lodash";
 export default {
   name: 'nwp',
   components: { Chart},
@@ -112,11 +113,21 @@ export default {
 
   },
   methods:{
-    getDraw(){
+    async getDraw(){
+      let sysTime
+      let lk
+      await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
+        sysTime = res.data.sysTime
+        lk = res.data.lk
+      }).catch((error) => {
+      })
+
       this.drawLoading = true
       var searchParams = {
         startTime: this.queryStartTime,
-        endTime: this.queryEndTime
+        endTime: this.queryEndTime,
+        sysTime: sysTime,
+        lk: lk
       }
       this.$axios.get('/forecastPowerShortTermController/getDraw',{params: searchParams}).then((res) => {
         this.drawData = res.data
@@ -124,12 +135,22 @@ export default {
         this.$message.error('查询实时预测短期echarts出错' + error)
       })
     },
-    getTable(){
+    async getTable(){
+      let sysTime
+      let lk
+      await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
+        sysTime = res.data.sysTime
+        lk = res.data.lk
+      }).catch((error) => {
+      })
+
       var searchParams = {
         currentPage: this.currentPage,
         pageSize: this.pageSize,
         startTime: this.queryStartTime,
-        endTime: this.queryEndTime
+        endTime: this.queryEndTime,
+        sysTime: sysTime,
+        lk: lk
       }
       this.$axios.get('/forecastPowerShortTermController/getAll',
         {params: searchParams}).then((res) => {
@@ -186,7 +207,7 @@ export default {
       }
       return true
     },
-    dateQuery(){
+    dateQuery:debounce(function(){
       this.loading = true
       if(this.endTime<=this.startTime){
         this.$message.error("开始时间不能大于结束时间")
@@ -206,7 +227,7 @@ export default {
       this.queryEndTime = this.endTime
       this.getDraw(this.queryStartTime,this.queryEndTime)
       this.getTable()
-    },
+    },1000),
     Byresize(tab){
       if(tab.name =='first'){
         this.resizeKey++
@@ -214,7 +235,6 @@ export default {
       }else{
         this.showToolBar = true
       }
-
     },
   }
 }

+ 25 - 7
ui/src/views/bizManager/nwp/index.vue

@@ -84,6 +84,7 @@
 import Chart from './charts'
 import resize from '../../../components/Charts/mixins/resize'
 import moment from "moment";
+import {debounce} from "lodash";
 export default {
   name: 'nwp',
   components: { Chart},
@@ -120,11 +121,20 @@ export default {
 
   },
   methods:{
-    getDraw(){
+    async getDraw(){
+      let sysTime
+      let lk
+      await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
+        sysTime = res.data.sysTime
+        lk = res.data.lk
+      }).catch((error) => {
+      })
       this.drawLoading = true
       var searchParams = {
         startTime: this.queryStartTime,
-        endTime: this.queryEndTime
+        endTime: this.queryEndTime,
+        sysTime: sysTime,
+        lk: lk
       }
       this.$axios.get('/nwpController/getDraw',{params: searchParams}).then((res) => {
         this.drawData = res.data
@@ -132,12 +142,21 @@ export default {
         this.$message.error('查询实时Nwp echarts出错' + error)
       })
     },
-    getTable(){
+    async getTable(){
+      let sysTime
+      let lk
+      await this.$axios.get('/sysPolicyController/getLicenseKey').then((res) => {
+        sysTime = res.data.sysTime
+        lk = res.data.lk
+      }).catch((error) => {
+      })
       var searchParams = {
         currentPage: this.currentPage,
         pageSize: this.pageSize,
         startTime: this.queryStartTime,
-        endTime: this.queryEndTime
+        endTime: this.queryEndTime,
+        sysTime: sysTime,
+        lk: lk
       }
       this.$axios.get('/nwpController/getAll',
         {params: searchParams}).then((res) => {
@@ -194,7 +213,7 @@ export default {
       }
       return true
     },
-    dateQuery(){
+    dateQuery:debounce(function(){
       this.loading = true
       if(this.endTime<=this.startTime){
         this.$message.error("开始时间不能大于结束时间")
@@ -214,7 +233,7 @@ export default {
       this.queryEndTime = this.endTime
       this.getDraw(this.queryStartTime,this.queryEndTime)
       this.getTable()
-    },
+    },1000),
     Byresize(tab){
       if(tab.name =='first'){
         this.resizeKey++
@@ -222,7 +241,6 @@ export default {
       }else{
         this.showToolBar = true
       }
-
     },
   }
 }