Bläddra i källkod

气象预测修正模块开发

songhaodong 2 år sedan
förälder
incheckning
538717c508

+ 105 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/NwpSpeedModified.java

@@ -0,0 +1,105 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import lombok.Data;
+import org.hibernate.annotations.GenericGenerator;
+import org.springframework.core.annotation.Order;
+
+import javax.persistence.*;
+import javax.validation.constraints.Digits;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 数值天气预报实时数据
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2018/10/23 9:16
+ */
+@Entity
+@Data
+public class NwpSpeedModified implements Serializable {
+    public NwpSpeedModified() {
+
+    }
+
+    public NwpSpeedModified(BigDecimal ws10, BigDecimal ws30, BigDecimal ws50, BigDecimal ws70, BigDecimal ws80, BigDecimal ws90, BigDecimal ws100, BigDecimal ws170, Long modifyTime) {
+        this.ws10 = ws10;
+        this.ws30 = ws30;
+        this.ws50 = ws50;
+        this.ws70 = ws70;
+        this.ws80 = ws80;
+        this.ws90 = ws90;
+        this.ws100 = ws100;
+        this.ws170 = ws170;
+    }
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @Order(1)
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
+    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
+    private Integer id;
+
+    /**
+     * 修改时间
+     */
+    @Column
+    private Long modifyTime;
+
+    /**
+     * 10米风速
+     */
+    @Column
+    @Digits(integer = 10, fraction = 2)
+    private BigDecimal ws10 = new BigDecimal(-99);
+    /**
+     * 30米风速
+     */
+    @Column
+    @Digits(integer = 10, fraction = 2)
+    private BigDecimal ws30 = new BigDecimal(-99);
+    /**
+     * 50米风速
+     */
+    @Column
+    @Digits(integer = 10, fraction = 2)
+    private BigDecimal ws50 = new BigDecimal(-99);
+    /**
+     * 70米风速
+     */
+    @Column
+    @Digits(integer = 10, fraction = 2)
+    private BigDecimal ws70 = new BigDecimal(-99);
+    /**
+     * 80米风速
+     */
+    @Column
+    @Digits(integer = 10, fraction = 2)
+    private BigDecimal ws80 = new BigDecimal(-99);
+    /**
+     * 90米风速
+     */
+    @Column
+    @Digits(integer = 10, fraction = 2)
+    private BigDecimal ws90 = new BigDecimal(-99);
+    /**
+     * 100米风速
+     */
+    @Column
+    @Digits(integer = 10, fraction = 2)
+    private BigDecimal ws100 = new BigDecimal(-99);
+    /**
+     * 170米风速
+     */
+    @Column
+    @Digits(integer = 10, fraction = 2)
+    private BigDecimal ws170 = new BigDecimal(-99);
+    /**
+     * 创建时间
+     */
+    @Column
+    private Date createdDate = new Date();
+}

+ 27 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/NwpSpeedModifiedRespository.java

@@ -0,0 +1,27 @@
+package com.jiayue.ipfcst.common.data.repository;
+
+import com.jiayue.ipfcst.common.data.entity.NwpSpeedModified;
+
+import java.util.List;
+
+/**
+ * nwp数据仓储
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/9/26 11:23
+ */
+public interface NwpSpeedModifiedRespository extends BaseRepository<NwpSpeedModified, Integer> {
+
+
+	/**
+	 * 按时间段查询数据
+	 *
+	 * @param startTime
+	 * @param endTime
+	 */
+	List<NwpSpeedModified> findBymodifyTimeBetween(Long startTime, Long endTime);
+
+	void deleteBymodifyTimeBetween(Long startTime, Long endTime);
+
+}

+ 7 - 0
ipfcst/ipfcst-reportquery/src/main/frontend/router/modules/parameterConfiguration.js

@@ -41,6 +41,13 @@ const parameterConfigurationRouter = {
       meta: {title: '风机曲线', noCache: true},
       sign: 'currency'
     },
+    {
+      path: 'windModify',
+      component: () => import('@/views/parameterConfiguration/windModify'),
+      name: 'windModify',
+      meta: {title: '风速修改', noCache: true},
+      sign: 'currency'
+    },
   ]
 }
 

+ 674 - 0
ipfcst/ipfcst-reportquery/src/main/frontend/views/parameterConfiguration/windModify/charts/index.vue

@@ -0,0 +1,674 @@
+<template>
+  <div style="width: 100%;height: 100%" >
+    <div id="speedCharts"></div>
+  </div>
+</template>
+
+<script>
+  import resize from '../../../../components/Charts/mixins/resize'
+  import echarts from 'echarts'
+  import cc from '../../../curvecolors'
+  export default {
+    mixins: [resize],
+    watch: {
+      drawData:{
+        handler(newValue, oldValue) {
+          this.cName = newValue.cName
+          this.modifyName = newValue.modifyName
+          this.thFormat = [{key:"ws10",value:this.cName.ws10},
+            {key:"ws30",value:this.cName.ws30},
+            {key:"ws50",value:this.cName.ws50},
+            {key:"ws70",value:this.cName.ws70},
+            {key:"ws80",value:this.cName.ws80},
+            {key:"ws90",value:this.cName.ws90},
+            {key:"ws100",value:this.cName.ws100},
+            {key:"ws170",value:this.cName.ws170},
+            ],
+            this.modifyFormat = [{key:"ws10Modify",value:this.modifyName.ws10Modify},
+            {key:"ws30Modify",value:this.modifyName.ws30Modify},
+            {key:"ws50Modify",value:this.modifyName.ws50Modify},
+            {key:"ws70Modify",value:this.modifyName.ws70Modify},
+            {key:"ws80Modify",value:this.modifyName.ws80Modify},
+            {key:"ws90Modify",value:this.modifyName.ws90Modify},
+            {key:"ws100Modify",value:this.modifyName.ws100Modify},
+            {key:"ws170Modify",value:this.modifyName.ws170Modify},
+            ]
+          this.draw(newValue.times, newValue.datas,newValue.modifyDatas)
+        },
+        deep: true
+      },
+    },
+    props: {
+      drawData:{
+        type:Object,
+      },
+    },
+    data() {
+      return {
+        lineColor:'',
+        cName:{},
+        modifyName: {},
+        chart: null,
+        thFormat:[],
+        modifyFormat:[],
+        company:'m/s',
+        lineStyle:[
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(219,50,51,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws10,
+                borderColor: 'rgba(219,50,51,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(219,196,50,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws30,
+                borderColor: 'rgba(219,196,50,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(101,219,50,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws50,
+                borderColor: 'rgba(101,219,50,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(50,219,171,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws70,
+                borderColor: 'rgba(50,219,171,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(50,118,219,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws80,
+                borderColor: 'rgba(50,118,219,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(140,50,219,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws90,
+                borderColor: 'rgba(140,50,219,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(202,50,219,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws100,
+                borderColor: 'rgba(202,50,219,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(50,199,219,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws110,
+                borderColor: 'rgba(50,199,219,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(219,143,50,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws120,
+                borderColor: 'rgba(219,143,50,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(219,50,51,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws10,
+                borderColor: 'rgba(219,50,51,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(219,196,50,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws30,
+                borderColor: 'rgba(219,196,50,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(101,219,50,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws50,
+                borderColor: 'rgba(101,219,50,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(50,219,171,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws70,
+                borderColor: 'rgba(50,219,171,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(50,118,219,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws80,
+                borderColor: 'rgba(50,118,219,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(140,50,219,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws90,
+                borderColor: 'rgba(140,50,219,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(202,50,219,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws100,
+                borderColor: 'rgba(202,50,219,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(50,199,219,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws110,
+                borderColor: 'rgba(50,199,219,0.2)',
+                borderWidth: 12
+              }
+            },
+          },
+          {
+            areaStyle: {
+              normal: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                  offset: 0,
+                  color: 'rgba(219,143,50,0.3)'
+                }, {
+                  offset: 0.8,
+                  color: 'rgba(219, 50, 51, 0)'
+                }], false),
+                shadowColor: 'rgba(0, 0, 0, 0.1)',
+                shadowBlur: 10
+              }
+            },
+            itemStyle: {
+              normal: {
+                color: cc.ws120,
+                borderColor: 'rgba(219,143,50,0.2)',
+                borderWidth: 12
+              }
+            },
+          }
+        ]
+      }
+    },
+    mounted() {
+      if(sessionStorage.getItem('styleSwitch') === 'blue'){
+        this.lineColor = 'white'
+      }else{
+        this.lineColor = '#3b3b3b'
+      }
+    },
+    beforeDestroy() {
+      if (!this.chart) {
+        return
+      }
+      this.chart.dispose()
+      this.chart = null
+    },
+    methods: {
+      draw(timeaxis,datas,modifyDatas) {
+        this.chart = echarts.init(document.getElementById('speedCharts'))
+        var option = {
+          backgroundColor: 'transparent',
+          title: {
+            top: 20,
+            text: '风速曲线',
+            textStyle: {
+              fontWeight: 'normal',
+              fontSize: 16,
+              color: this.lineColor
+            },
+            left: '1%'
+          },
+          tooltip: {
+            trigger: 'axis',
+            axisPointer: {
+              lineStyle: {
+                color: '#57617B'
+              }
+            }
+          },
+          toolbox: {
+            feature: {
+              // dataView: {show: true, readOnly: false},
+              // magicType: {show: true, type: ['line', 'bar']},
+              // restore: {show: true},
+              saveAsImage: {show: true}
+            }
+          },
+          legend: {
+            top: 20,
+            width:'60%',
+            icon: 'rect',
+            itemWidth: 14,
+            itemHeight: 5,
+            itemGap: 13,
+            data: [],
+            right: '4%',
+            textStyle: {
+              fontSize: 12,
+              color: this.lineColor
+            },
+            selected:{
+              '修改后10米风速': false,
+              '修改后30米风速': false,
+              '修改后50米风速': false,
+              '修改后70米风速': false,
+              '修改后80米风速': true,
+              '修改后90米风速': false,
+              '修改后100米风速': false,
+              '修改后170米风速': false,
+              '10米风速': false,
+              '30米风速': false,
+              '50米风速': false,
+              '70米风速': false,
+              '80米风速': true,
+              '90米风速': false,
+              '100米风速': false,
+              '170米风速': false,
+
+            }
+          },
+          dataZoom: [{
+            show: true,
+            realtime: true,
+            start: 0,
+            end: 100,
+            left: "15%",
+            right: "15%",
+            textStyle: {
+              color: this.lineColor
+            }
+          }, {
+            type: 'inside'
+          }],
+          grid: {
+            top: 100,
+            left: '2%',
+            right: '2%',
+            bottom: '10%',
+            containLabel: true
+          },
+          xAxis: [{
+            type: 'category',
+            boundaryGap: false,
+            axisLine: {
+              lineStyle: {
+                color: this.lineColor
+              }
+            },
+            data:[]
+          }],
+          yAxis: [{
+            type: 'value',
+            name: this.company,
+            axisTick: {
+              show: false
+            },
+            axisLine: {
+              lineStyle: {
+                color: this.lineColor
+              }
+            },
+
+            axisLabel: {
+              margin: 10,
+              textStyle: {
+                fontSize: 14,
+                color: this.lineColor
+              },
+              formatter: '{value}',
+            },
+            splitLine: {
+              lineStyle: {
+                color: '#57617B'
+              }
+            }
+          }],
+          series: []
+        }
+        option.xAxis[0].data = timeaxis
+        var index = 0;
+
+        for(var key in modifyDatas){
+          var keyName='';
+          for(var i = 0 ;i<this.modifyFormat.length;i++){
+            if(key ==this.modifyFormat[i].key ){
+              keyName =this.modifyFormat[i].value;
+            }
+          }
+          option.legend.data.push(keyName)
+          // if(index != 4){
+          //   option.legend.selected[keyName] = false
+          // }else {
+          //   option.legend.selected[keyName] = true
+          // }
+          var nsValue = {
+            name: '',
+            type: 'line',
+            smooth: false,
+            symbol: 'circle',
+            symbolSize: 5,
+            showSymbol: false,
+            lineStyle: {
+              normal: {
+                width: 2
+              }
+            },
+            // areaStyle: {},
+            itemStyle: {},
+            data: []
+          }
+          nsValue.name = keyName
+          nsValue.data = modifyDatas[key]
+          nsValue.itemStyle = this.lineStyle[index].itemStyle
+          option.series.push(nsValue)
+          index++;
+        }
+
+
+        for(var key in datas){
+          var keyName='';
+          for(var i = 0 ;i<this.thFormat.length;i++){
+            if(key ==this.thFormat[i].key ){
+              keyName =this.thFormat[i].value;
+            }
+          }
+          option.legend.data.push(keyName)
+          var sValue = {
+            name: '',
+            type: 'line',
+            smooth: false,
+            symbol: 'circle',
+            symbolSize: 5,
+            showSymbol: false,
+            lineStyle: {
+              normal: {
+                width: 2
+              }
+            },
+            itemStyle: {},
+            data: []
+          }
+          sValue.name = keyName
+          sValue.data = datas[key]
+          sValue.itemStyle = this.lineStyle[index].itemStyle
+          option.series.push(sValue)
+          index++;
+        }
+
+
+
+        this.chart.setOption(option,true)
+      },
+
+    }
+  }
+</script>
+<style scoped>
+  #speedCharts{
+    width: 100%;
+    height:calc(80vh - 50px);
+  }
+</style>

+ 146 - 0
ipfcst/ipfcst-reportquery/src/main/frontend/views/parameterConfiguration/windModify/index.vue

@@ -0,0 +1,146 @@
+<template>
+  <div class="chart-container">
+    <div class="filter">
+      <div class="startTime">
+        <span class="timeText">起始时间</span>
+        <el-date-picker
+          v-model="startTime"
+          :clearable="false"
+          type="datetime"
+          value-format="timestamp"
+          placeholder="选择日期">
+        </el-date-picker>
+      </div>
+      <div class="endTime">
+        <span class="timeText">截止时间</span>
+        <el-date-picker
+          v-model="endTime"
+          :clearable="false"
+          type="datetime"
+          value-format="timestamp"
+          placeholder="选择日期">
+        </el-date-picker>
+      </div>
+      <div class="timeQuery">
+        <el-button  size="small" :loading="loading"  @click="dateQuery">查询</el-button>
+      </div>
+      <div class="modulus" style="font-size: 14px;">
+        &nbsp; 风速调整系数:
+        <el-input-number v-model="num" size="small" controls-position="right" :precision="2" :step="0.1" :max="20" :min="1"></el-input-number>
+        <el-button  size="small" :loading="loading"  @click="modifyDateQuery">预览修改</el-button>
+        <el-button  size="small" :loading="loading"  @click="confirmModifyDateQuery">确认修改</el-button>
+      </div>
+    </div>
+    <div class="content">
+          <chart :drawData = this.drawData />
+    </div>
+  </div>
+</template>
+
+<script>
+import Chart from './charts'
+import resize from '../../../components/Charts/mixins/resize'
+export default {
+  name: 'windModify',
+  components: { Chart },
+  mixins: [resize],
+  data(){
+    return{
+      chart: null,
+      queryStartTime:'',
+      queryEndTime:'',
+      startTime:new Date(new Date().toLocaleDateString()).getTime(),
+      endTime:new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 1000*4-1,
+      loading:true,
+      drawLoading:true,
+      drawData:{datas:[],times:[],modifyDatas:[]},
+      total:0,
+      pageSize: 10,
+      currentPage: 1,
+      dialogVisible: false,
+      num: 1,
+      modify: 0,
+    }
+  },
+  mounted() {
+    this.init()
+  },
+  methods:{
+    init(){
+      this.$axios.get("nwp/getNwpDay").then(res=>{
+        var days = res.data + 1
+        this.endTime = new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 1000*days-1
+        this.queryStartTime = this.startTime
+        this.queryEndTime = this.endTime
+        this.loading = true
+        this.getDraw(this.queryStartTime,this.queryEndTime)
+      })
+    },
+    getDraw(startTime,endTime){
+      this.drawLoading = true
+      this.$axios.get('/nwp/modifySpeedPreview/'+startTime+'/'+endTime+'/'+this.num + '/' + this.modify).then((res) => {
+        this.drawData = res.data
+        this.drawLoading = false
+        if(!this.drawLoading ){
+          this.loading = false
+        }
+      }).catch((error) => {
+        this.drawLoading = false
+        if(!this.drawLoading ){
+          this.loading = false
+        }
+        this.$message.error('查询实时预测短期echarts出错' + error)
+      })
+    },
+    dateQuery(){
+      this.loading = true
+      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*31){
+        this.startTime = this.queryStartTime
+        this.endTime = this.queryEndTime
+        this.$message.error("只能最多查询31天的数据哦")
+        this.loading = false
+        return
+      }
+      this.queryStartTime = this.startTime
+      this.queryEndTime = this.endTime
+      this.num = 1
+      this.getDraw(this.queryStartTime,this.queryEndTime)
+    },
+    modifyDateQuery(){
+        this.loading = true
+        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*31){
+          this.startTime = this.queryStartTime
+          this.endTime = this.queryEndTime
+          this.$message.error("只能最多查询31天的数据哦")
+          this.loading = false
+          return
+        }
+        this.queryStartTime = this.startTime
+        this.queryEndTime = this.endTime
+        this.getDraw(this.queryStartTime,this.queryEndTime)
+    },
+    confirmModifyDateQuery(){
+      this.modify = 1
+      this.modifyDateQuery()
+    }
+  }
+}
+</script>
+
+<style scoped>
+</style>
+

+ 18 - 18
ipfcst/ipfcst-reportquery/src/main/frontend/views/realTimeQuery/nwp/charts/index.vue

@@ -44,7 +44,7 @@
             ]
           }
 
-          this.draw(newValue.times, newValue.datas, newValue.ndatas)
+          this.draw(newValue.times, newValue.datas, newValue.nDatas)
 
         },
         deep: true
@@ -487,7 +487,7 @@
       this.chart = null
     },
     methods: {
-      draw(timeaxis,datas,ndatas) {
+      draw(timeaxis,datas,nDatas) {
         this.chart = echarts.init(document.getElementById('nwpcharts'))
         var option = {
           backgroundColor: 'transparent',
@@ -531,22 +531,22 @@
               color: this.lineColor
             },
             selected:{
-              '10米风速': true,
-              '30米风速': true,
-              '50米风速': true,
-              '70米风速': true,
+              '10米风速': false,
+              '30米风速': false,
+              '50米风速': false,
+              '70米风速': false,
               '80米风速': true,
-              '90米风速': true,
-              '100米风速': true,
-              '170米风速': true,
-              '实时10米风速': true,
-              '实时30米风速': true,
-              '实时50米风速': true,
-              '实时70米风速': true,
+              '90米风速': false,
+              '100米风速': false,
+              '170米风速': false,
+              '实时10米风速': false,
+              '实时30米风速': false,
+              '实时50米风速': false,
+              '实时70米风速': false,
               '实时80米风速': true,
-              '实时90米风速': true,
-              '实时100米风速': true,
-              '实时170米风速': true,
+              '实时90米风速': false,
+              '实时100米风速': false,
+              '实时170米风速': false,
             }
           },
           dataZoom: [{
@@ -648,7 +648,7 @@
 
 
 
-        for(var key in ndatas){
+        for(var key in nDatas){
           var keyName='';
           for(var i = 0 ;i<this.nthFormat.length;i++){
             if(key ==this.nthFormat[i].key ){
@@ -678,7 +678,7 @@
             data: []
           }
           nsValue.name = keyName
-          nsValue.data = ndatas[key]
+          nsValue.data = nDatas[key]
           // sValue.areaStyle = this.lineStyle[index].areaStyle
           nsValue.itemStyle = this.lineStyle[index].itemStyle
           option.series.push(nsValue)

+ 5 - 1
ipfcst/ipfcst-reportquery/src/main/frontend/views/realTimeQuery/nwp/chartsWind/index.vue

@@ -123,7 +123,11 @@
             textStyle: {
               color: '#ffffff'
             },
-            // width: '800px',
+            icon: 'rect',
+            itemWidth: 14,
+            itemHeight: 5,
+            itemGap: 13,
+            inactiveColor: '#9C9C9C',
             right: '20',
             left: '120',
             data: ['10米风向', "30米风向", "50米风向", "70米风向", "80米风向", "90米风向", "100米风向", "170米风向",'实时10米风向', "实时30米风向", "实时50米风向", "实时70米风向", "实时80米风向", "实时90米风向", "实时100米风向", "实时170米风向" ],

+ 3 - 3
ipfcst/ipfcst-reportquery/src/main/frontend/views/realTimeQuery/nwp/index.vue

@@ -147,7 +147,7 @@
         resizeKey:1,
         fourResizeKey: 4,
         activeName: 'first',
-        drawData:{datas:[],times:[],ndatas:[]},
+        drawData:{datas:[],times:[],nDatas:[]},
         drawWind:{ nwpDatas:[], windTowerStatusDataDatas:[]},
         tableData:[],
         statisticsData:[],
@@ -155,7 +155,8 @@
         sortOrder:'asc',
         pageSize: 10,
         currentPage: 1,
-        showToolBar:false
+        showToolBar:false,
+        dialogVisible: false,
         /*menuKey:1,
         isRenderingTime : new Date().getTime()*/
 
@@ -220,7 +221,6 @@
         this.drawLoading = true
         this.$axios.get('/nwp/WindCompareToWtsdWind/'+startTime+'/'+endTime).then((res) => {
           // console.log(res.data);
-          console.log("这是nwpindx的res数据" + res.data.nwpDatas.wd10Integers);
           this.drawWind = res.data
           this.drawLoading = false
           if(!this.drawLoading && !this.tableLoading){

+ 17 - 0
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/controller/NwpController.java

@@ -160,4 +160,21 @@ public class NwpController {
       return ResponseVO.fail(e.toString());
     }
   }
+
+  @GetMapping(value="/nwp/modifySpeedPreview/{startTime}/{endTime}/{num}/{modify}")
+  public ResponseVO modifySpeedPreview(@PathVariable("startTime") Long startTime,
+                                   @PathVariable("endTime") Long endTime,
+                                   @PathVariable("num") String num,
+                                   @PathVariable("modify") Integer modify
+                                   ){
+    Map<String,Object> map = new HashMap<>();
+    try{
+      map = nwpService.modifySpeedPreview(startTime,endTime,num,modify);
+      return ResponseVO.success(map);
+    }catch(Exception e){
+      e.printStackTrace();
+      log.error("风向对比数据查询错误");
+      return ResponseVO.fail(e.toString());
+    }
+  }
 }

+ 293 - 29
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/service/NwpService.java

@@ -3,11 +3,9 @@ package com.jiayue.ipfcst.service;
 import com.jiayue.ipfcst.common.core.exception.BusinessException;
 import com.jiayue.ipfcst.common.core.util.CommonUtil;
 import com.jiayue.ipfcst.common.core.util.DateMomentUtil;
-import com.jiayue.ipfcst.common.data.entity.ElectricField;
-import com.jiayue.ipfcst.common.data.entity.Nwp;
-import com.jiayue.ipfcst.common.data.entity.SysParameter;
-import com.jiayue.ipfcst.common.data.entity.WindTowerStatusData;
+import com.jiayue.ipfcst.common.data.entity.*;
 import com.jiayue.ipfcst.common.data.repository.NwpRepository;
+import com.jiayue.ipfcst.common.data.repository.NwpSpeedModifiedRespository;
 import com.jiayue.ipfcst.common.data.repository.SysParameterRepository;
 import com.jiayue.ipfcst.common.data.repository.WindTowerStatusDataRepository;
 import com.jiayue.ipfcst.common.data.service.BaseService;
@@ -46,11 +44,18 @@ public class NwpService extends BaseService {
 
   private final WindTowerStatusDataRepository windTowerStatusDataRepository;
 
+  private final NwpSpeedModifiedRespository nwpSpeedModifiedRespository;
+
+  private final NwpSpeedModifiedService nwpSpeedModifiedService;
+
   @Autowired
-  public NwpService(NwpRepository nwpRepository, SysParameterRepository sysParameterRepository, WindTowerStatusDataRepository windTowerStatusDataRepository){
+  public NwpService(NwpRepository nwpRepository, SysParameterRepository sysParameterRepository, WindTowerStatusDataRepository windTowerStatusDataRepository,
+                    NwpSpeedModifiedRespository nwpSpeedModifiedRespository,NwpSpeedModifiedService nwpSpeedModifiedService){
     this.nwpRepository = nwpRepository;
     this.sysParameterRepository = sysParameterRepository;
     this.windTowerStatusDataRepository = windTowerStatusDataRepository;
+    this.nwpSpeedModifiedRespository = nwpSpeedModifiedRespository;
+    this.nwpSpeedModifiedService = nwpSpeedModifiedService;
   }
   /**
    * 按时间查询实时NWP yh
@@ -61,9 +66,6 @@ public class NwpService extends BaseService {
   @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
   public Map<String,Object> findByForecastTimeBetween(Long startTime, Long endTime) throws BusinessException {
 
-
-
-
     Map<String,Object> map = new HashMap<>();
     List<Nwp> list = new ArrayList<>();
     List<Nwp> checkList = new ArrayList<>();
@@ -169,7 +171,7 @@ public class NwpService extends BaseService {
     map.put("times",times);
     map.put("datas",datas);
     Map<String,Object> nMap = findRealNwpByTimeBetween(startTime, endTime);
-    map.put("ndatas",nMap.get("ndatas"));
+    map.put("nDatas",nMap.get("nDatas"));
     map.put("ncName",nMap.get("ncName"));
     return map;
   }
@@ -217,26 +219,23 @@ public class NwpService extends BaseService {
     List<BigDecimal> ws100Collect= new ArrayList<>();
     List<BigDecimal> ws170Collect= new ArrayList<>();
     Map<String,String> map1 = new HashMap<>();
-    if(electricField.getElectricFieldTypeEnum().getCode() == 1){
 
-    }else{
-      ws10Collect = checkList.stream().map(WindTowerStatusData::getWsInst10).collect(Collectors.toList());
-      ws30Collect = checkList.stream().map(WindTowerStatusData::getWsInst30).collect(Collectors.toList());
-      ws50Collect = checkList.stream().map(WindTowerStatusData::getWsInst50).collect(Collectors.toList());
-      ws70Collect = checkList.stream().map(WindTowerStatusData::getWsInst70).collect(Collectors.toList());
-      ws80Collect = checkList.stream().map(WindTowerStatusData::getWsInst80).collect(Collectors.toList());
-      ws90Collect = checkList.stream().map(WindTowerStatusData::getWsInst90).collect(Collectors.toList());
-      ws100Collect = checkList.stream().map(WindTowerStatusData::getWsInst100).collect(Collectors.toList());
-      ws170Collect = checkList.stream().map(WindTowerStatusData::getWsInst110).collect(Collectors.toList());
-      datas.put("wsInst10",ws10Collect);
-      datas.put("wsInst30",ws30Collect);
-      datas.put("wsInst50",ws50Collect);
-      datas.put("wsInst70",ws70Collect);
-      datas.put("wsInst80",ws80Collect);
-      datas.put("wsInst90",ws90Collect);
-      datas.put("wsInst100",ws100Collect);
-      datas.put("wsInst170",ws170Collect);
-    }
+    ws10Collect = checkList.stream().map(WindTowerStatusData::getWsInst10).collect(Collectors.toList());
+    ws30Collect = checkList.stream().map(WindTowerStatusData::getWsInst30).collect(Collectors.toList());
+    ws50Collect = checkList.stream().map(WindTowerStatusData::getWsInst50).collect(Collectors.toList());
+    ws70Collect = checkList.stream().map(WindTowerStatusData::getWsInst70).collect(Collectors.toList());
+    ws80Collect = checkList.stream().map(WindTowerStatusData::getWsInst80).collect(Collectors.toList());
+    ws90Collect = checkList.stream().map(WindTowerStatusData::getWsInst90).collect(Collectors.toList());
+    ws100Collect = checkList.stream().map(WindTowerStatusData::getWsInst100).collect(Collectors.toList());
+    ws170Collect = checkList.stream().map(WindTowerStatusData::getWsInst110).collect(Collectors.toList());
+    datas.put("wsInst10",ws10Collect);
+    datas.put("wsInst30",ws30Collect);
+    datas.put("wsInst50",ws50Collect);
+    datas.put("wsInst70",ws70Collect);
+    datas.put("wsInst80",ws80Collect);
+    datas.put("wsInst90",ws90Collect);
+    datas.put("wsInst100",ws100Collect);
+    datas.put("wsInst170",ws170Collect);
 
     map1.put("wsInst10","实时10米风速");
     map1.put("wsInst30","实时30米风速");
@@ -247,7 +246,7 @@ public class NwpService extends BaseService {
     map1.put("wsInst100","实时100米风速");
     map1.put("wsInst170","实时170米风速");
 
-    map.put("ndatas", datas);
+    map.put("nDatas", datas);
     map.put("ncName", map1);
   return map;
 
@@ -386,6 +385,235 @@ public class NwpService extends BaseService {
 
 
   /**
+   * 修改风速 预览
+   *
+   * @param startTime
+   * @param endTime
+   * @return
+   * @throws BusinessException
+   */
+  @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
+  public Map<String,Object> modifySpeedPreview(Long startTime, Long endTime, String num, Integer modify) throws BusinessException {
+
+    // 返回值 map
+    Map<String,Object> map = new HashMap<>();
+    // nwp数据
+    List<Nwp> list = new ArrayList<>();
+    // 修改后 nwp数据
+    List<NwpSpeedModified> modifiedList = new ArrayList<>();
+    // 间隔15分钟的nwp数据
+    List<Nwp> checkList = new ArrayList<>();
+    // 返回值 预测nwp
+    Map<String,Object> datas = new LinkedHashMap<>();
+    // 返回值 修改后nwp
+    Map<String,Object> modifyDatas = new LinkedHashMap<>();
+    // nwp时间区间数据并排序
+    list = nwpRepository.findByPreTimeBetween(startTime, endTime);
+    list.sort(Comparator.comparing(Nwp::getPreTime));
+    // 修改后nwp时间区间数据并排序
+    modifiedList = nwpSpeedModifiedRespository.findBymodifyTimeBetween(startTime,endTime);
+    modifiedList.sort(Comparator.comparing(NwpSpeedModified::getModifyTime));
+    // 时间区间
+    long startTimeLong  = startTime;
+    long endTimeLong  = endTime;
+    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    // 间隔时间
+    long timeStep = 900000L;
+    if(startTimeLong%timeStep !=0){
+      startTimeLong = startTimeLong -(startTimeLong%timeStep);
+    }
+    // x坐标数据
+    List<String> times = new ArrayList<>();
+    // 修改后nwp数据
+    List<NwpSpeedModified> nwpSpeedModifieds = new ArrayList<>();
+
+    for(long i = startTimeLong;i<endTimeLong;i=i+timeStep){
+      long finalI = i;
+      List<Nwp> p = list.stream().filter(t -> t.getPreTime() == finalI).collect(Collectors.toList());
+      if (p != null && p.size() > 0) {
+        Nwp nwp = p.get(0);
+        // 间隔15分钟的nwp数据
+        checkList.add(nwp);
+        // NwpSpeedModified对象(原nwp * 系数)
+        NwpSpeedModified nwpSpeedModified = caculateSpeed(nwp, num);
+        nwpSpeedModifieds.add(nwpSpeedModified);
+      }else{
+        checkList.add(new Nwp());
+        nwpSpeedModifieds.add(new NwpSpeedModified());
+      }
+      String timeFormat = sdf.format(new Date(i));
+      times.add(timeFormat);
+    }
+
+    // 把-99 替换成 null
+    this.defaultReplace(checkList);
+    this.nwpSpeedDefaultReplace(nwpSpeedModifieds);
+
+    // 如果当前时间区间有修改后的值 ,展示修改后的值
+    if(modifiedList.size() < 1  && num.equals(1) || !(num.equals("1"))){
+      modifiedList = nwpSpeedModifieds;
+    }
+
+    //  保存修改后的值
+    if(modify == 1){
+      nwpSpeedModifiedRespository.saveAll(modifiedList);
+    }
+
+    ElectricField electricField = this.getElectricField();
+    List<BigDecimal> ws10Collect = new ArrayList<>();
+    List<BigDecimal> ws30Collect= new ArrayList<>();
+    List<BigDecimal> ws50Collect= new ArrayList<>();
+    List<BigDecimal> ws70Collect= new ArrayList<>();
+    List<BigDecimal> ws80Collect= new ArrayList<>();
+    List<BigDecimal> ws90Collect= new ArrayList<>();
+    List<BigDecimal> ws100Collect= new ArrayList<>();
+    List<BigDecimal> ws170Collect= new ArrayList<>();
+    // 曲线名
+    Map<String,String> map1 = new HashMap<>();
+    Map<String,String> modifyMap = new HashMap<>();
+
+    if(electricField.getElectricFieldTypeEnum().getCode() == 2){
+      ws10Collect = checkList.stream().map(Nwp::getWs10).collect(Collectors.toList());
+      ws30Collect = checkList.stream().map(Nwp::getWs30).collect(Collectors.toList());
+      ws50Collect = checkList.stream().map(Nwp::getWs50).collect(Collectors.toList());
+      ws70Collect = checkList.stream().map(Nwp::getWs70).collect(Collectors.toList());
+      ws80Collect = checkList.stream().map(Nwp::getWs80).collect(Collectors.toList());
+      ws90Collect = checkList.stream().map(Nwp::getWs90).collect(Collectors.toList());
+      ws100Collect = checkList.stream().map(Nwp::getWs100).collect(Collectors.toList());
+      ws170Collect = checkList.stream().map(Nwp::getWs170).collect(Collectors.toList());
+      datas.put("ws10",ws10Collect);
+      datas.put("ws30",ws30Collect);
+      datas.put("ws50",ws50Collect);
+      datas.put("ws70",ws70Collect);
+      datas.put("ws80",ws80Collect);
+      datas.put("ws90",ws90Collect);
+      datas.put("ws100",ws100Collect);
+      datas.put("ws170",ws170Collect);
+
+      List<BigDecimal> ws10ModifyList = modifiedList.stream().map(NwpSpeedModified::getWs10).collect(Collectors.toList());
+      List<BigDecimal> ws30ModifyList = modifiedList.stream().map(NwpSpeedModified::getWs30).collect(Collectors.toList());
+      List<BigDecimal> ws50ModifyList = modifiedList.stream().map(NwpSpeedModified::getWs50).collect(Collectors.toList());
+      List<BigDecimal> ws70ModifyList = modifiedList.stream().map(NwpSpeedModified::getWs70).collect(Collectors.toList());
+      List<BigDecimal> ws80ModifyList = modifiedList.stream().map(NwpSpeedModified::getWs80).collect(Collectors.toList());
+      List<BigDecimal> ws90ModifyList = modifiedList.stream().map(NwpSpeedModified::getWs90).collect(Collectors.toList());
+      List<BigDecimal> ws100ModifyList = modifiedList.stream().map(NwpSpeedModified::getWs100).collect(Collectors.toList());
+      List<BigDecimal> ws170ModifyList = modifiedList.stream().map(NwpSpeedModified::getWs170).collect(Collectors.toList());
+
+      modifyDatas.put("ws10Modify", ws10ModifyList);
+      modifyDatas.put("ws30Modify", ws30ModifyList);
+      modifyDatas.put("ws50Modify", ws50ModifyList);
+      modifyDatas.put("ws70Modify", ws70ModifyList);
+      modifyDatas.put("ws80Modify", ws80ModifyList);
+      modifyDatas.put("ws90Modify", ws90ModifyList);
+      modifyDatas.put("ws100Modify", ws100ModifyList);
+      modifyDatas.put("ws170Modify", ws170ModifyList);
+
+      try {
+        SysParameter sysParameter = sysParameterRepository.findBySysKeyEquals("NWP_CHANGE_WIND");
+        if (sysParameter != null) {
+          String nwpChangeWind = sysParameter.getSysValue();
+          String[] windChangeName = nwpChangeWind.split(",");
+          if (windChangeName.length == 16) {
+            map1.put("ws10",windChangeName[0]+"米风速");
+            map1.put("ws30",windChangeName[1]+"米风速");
+            map1.put("ws50",windChangeName[2]+"米风速");
+            map1.put("ws70",windChangeName[3]+"米风速");
+            map1.put("ws80",windChangeName[4]+"米风速");
+            map1.put("ws90",windChangeName[5]+"米风速");
+            map1.put("ws100",windChangeName[6]+"米风速");
+            map1.put("ws170",windChangeName[7]+"米风速");
+          }
+        }
+
+      } catch (RuntimeException e) {
+        String errorInfo = "NWP风速风向别名参数获取失败" + CommonUtil.printStackTraceToString(e);
+        log.error(errorInfo, e);
+      }
+      if (map1.isEmpty()){
+        map1.put("ws10","10米风速");
+        map1.put("ws30","30米风速");
+        map1.put("ws50","50米风速");
+        map1.put("ws70","70米风速");
+        map1.put("ws80","80米风速");
+        map1.put("ws90","90米风速");
+        map1.put("ws100","100米风速");
+        map1.put("ws170","170米风速");
+      }
+      modifyMap.put("ws10Modify","修改后10米风速");
+      modifyMap.put("ws30Modify","修改后30米风速");
+      modifyMap.put("ws50Modify","修改后50米风速");
+      modifyMap.put("ws70Modify","修改后70米风速");
+      modifyMap.put("ws80Modify","修改后80米风速");
+      modifyMap.put("ws90Modify","修改后90米风速");
+      modifyMap.put("ws100Modify","修改后100米风速");
+      modifyMap.put("ws170Modify","修改后170米风速");
+    }
+
+    map.put("cName",map1);
+    map.put("modifyName", modifyMap);
+    map.put("times",times);
+    map.put("datas",datas);
+    map.put("modifyDatas",modifyDatas);
+    return map;
+  }
+
+  /**
+   * 修改风速
+   * @param nwp
+   * @param num
+   * @return
+   */
+  public NwpSpeedModified caculateSpeed(Nwp nwp, String num){
+    NwpSpeedModified nwpSpeedModified = new NwpSpeedModified();
+    if(nwp.getWs10().compareTo(BigDecimal.ZERO) == 1){
+      nwpSpeedModified.setWs10(nwp.getWs10().multiply(new BigDecimal(num)));
+    }
+    if(nwp.getWs30().compareTo(BigDecimal.ZERO) == 1){
+      nwpSpeedModified.setWs30(nwp.getWs30().multiply(new BigDecimal(num)));
+    }
+    if(nwp.getWs50().compareTo(BigDecimal.ZERO) == 1){
+      nwpSpeedModified.setWs50(nwp.getWs50().multiply(new BigDecimal(num)));
+    }
+    if(nwp.getWs70().compareTo(BigDecimal.ZERO) == 1){
+      nwpSpeedModified.setWs70(nwp.getWs70().multiply(new BigDecimal(num)));
+    }
+    if(nwp.getWs80().compareTo(BigDecimal.ZERO) == 1){
+      nwpSpeedModified.setWs80(nwp.getWs80().multiply(new BigDecimal(num)));
+    }
+    if(nwp.getWs90().compareTo(BigDecimal.ZERO) == 1){
+      nwpSpeedModified.setWs90(nwp.getWs90().multiply(new BigDecimal(num)));
+    }
+    if(nwp.getWs100().compareTo(BigDecimal.ZERO) == 1){
+      nwpSpeedModified.setWs100(nwp.getWs100().multiply(new BigDecimal(num)));
+    }
+    if(nwp.getWs170().compareTo(BigDecimal.ZERO) == 1){
+      nwpSpeedModified.setWs170(nwp.getWs170().multiply(new BigDecimal(num)));
+    }
+    nwpSpeedModified.setModifyTime(nwp.getPreTime());
+    return nwpSpeedModified;
+  }
+
+  /**
+   * 计算修改风速
+   *
+   * @param nwpList
+   * @param num
+   * @return
+   */
+  public List<BigDecimal> getModifyDatas(List<BigDecimal> nwpList, String num){
+    List<BigDecimal> tempList = new ArrayList<>();
+    for (BigDecimal collect : nwpList) {
+
+      if(collect != null){
+        BigDecimal multiply = collect.multiply(new BigDecimal(num));
+        tempList.add(multiply);
+      }
+
+    }
+    return tempList;
+  }
+
+  /**
    * 根据时间 分页查询 NWP数据 yh
    *
    * @param startTime 开始时间
@@ -738,6 +966,42 @@ public class NwpService extends BaseService {
   }
 
   /**
+   *  对集合进行 -99替换null操作,主要用于图标展示空值
+   *
+   * @param datas  需要替换集合
+   */
+  public void nwpSpeedDefaultReplace(List<NwpSpeedModified> datas){
+    BigDecimal nullBig =  new BigDecimal(-99);
+    for(NwpSpeedModified i :datas){
+
+      if(i.getWs10().compareTo(nullBig)==0){
+        i.setWs10(null);
+      }
+      if(i.getWs30().compareTo(nullBig)==0){
+        i.setWs30(null);
+      }
+      if(i.getWs50().compareTo(nullBig)==0){
+        i.setWs50(null);
+      }
+      if(i.getWs70().compareTo(nullBig)==0){
+        i.setWs70(null);
+      }
+      if(i.getWs80().compareTo(nullBig)==0){
+        i.setWs80(null);
+      }
+      if(i.getWs90().compareTo(nullBig)==0){
+        i.setWs90(null);
+      }
+      if(i.getWs100().compareTo(nullBig)==0){
+        i.setWs100(null);
+      }
+      if(i.getWs170().compareTo(nullBig)==0){
+        i.setWs170(null);
+      }
+    }
+  }
+
+  /**
    * (统计查询:nwp风速统计(吉林22))
    * @param startTime     开始时间
    * @param endTime       结束时间

+ 27 - 0
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/service/NwpSpeedModifiedService.java

@@ -0,0 +1,27 @@
+package com.jiayue.ipfcst.service;
+
+import com.jiayue.ipfcst.common.data.repository.NwpSpeedModifiedRespository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * @author shd
+ * @since 2022-06-27
+ */
+@Service
+@Slf4j
+public class NwpSpeedModifiedService {
+
+  private final NwpSpeedModifiedRespository nwpSpeedModifiedRespository;
+
+  public NwpSpeedModifiedService(NwpSpeedModifiedRespository nwpSpeedModifiedRespository){
+    this.nwpSpeedModifiedRespository = nwpSpeedModifiedRespository;
+  }
+
+  @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
+  public void delete(Long startTime, Long endTime){
+    this.nwpSpeedModifiedRespository.deleteBymodifyTimeBetween(startTime,endTime);
+  }
+}