Quellcode durchsuchen

实时nwp查询页面增加风速风向对比

songhaodong vor 3 Jahren
Ursprung
Commit
fca5078e41

+ 7 - 1
ipfcst/ipfcst-reportquery/src/main/frontend/views/parameterConfiguration/WindSpeedPointInfo/index.vue

@@ -214,6 +214,10 @@ export default {
           {required: true, message: '此处为必填项'},
           {pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: "填写数字", trigger: 'blur'}
         ],
+        belong: [
+          {required: true, message: '此处为必填项'},
+          {pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: "填写数字", trigger: 'blur'}
+        ],
       },
 
       options: [{
@@ -265,8 +269,10 @@ export default {
         return "西南风"
       } else if (row.wind == "7") {
         return "西风"
-      } else {
+      } else if(row.wind == "8"){
         return "西北风"
+      }else {
+        return "没有此风向"
       }
     },
 

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

@@ -531,22 +531,22 @@
               color: this.lineColor
             },
             selected:{
-              '10米风速': false,
-              '30米风速': false,
-              '50米风速': false,
-              '70米风速': false,
+              '10米风速': true,
+              '30米风速': true,
+              '50米风速': true,
+              '70米风速': true,
               '80米风速': true,
-              '90米风速': false,
-              '100米风速': false,
-              '170米风速': false,
-              '实时10米风速': false,
-              '实时30米风速': false,
-              '实时50米风速': false,
-              '实时70米风速': false,
+              '90米风速': true,
+              '100米风速': true,
+              '170米风速': true,
+              '实时10米风速': true,
+              '实时30米风速': true,
+              '实时50米风速': true,
+              '实时70米风速': true,
               '实时80米风速': true,
-              '实时90米风速': false,
-              '实时100米风速': false,
-              '实时170米风速': false,
+              '实时90米风速': true,
+              '实时100米风速': true,
+              '实时170米风速': true,
             }
           },
           dataZoom: [{

+ 266 - 0
ipfcst/ipfcst-reportquery/src/main/frontend/views/realTimeQuery/nwp/chartsWind/index.vue

@@ -0,0 +1,266 @@
+<template>
+  <div style="width: 100%;height: 100%" >
+    <div id="windCharts"></div>
+  </div>
+</template>
+
+<script>
+  import resize from '../../../../components/Charts/mixins/resize'
+  import * as echarts from 'echarts'
+  export default {
+    mixins: [resize],
+    watch: {
+      drawWind:{
+        handler(newValue, oldValue) {
+          this.nwpDatas = newValue.nwpDatas
+          this.windTowerStatusDataDatas = newValue.windTowerStatusDataDatas
+          this.draw(newValue.nwpDatas, newValue.windTowerStatusDataDatas)
+        },
+        deep: true
+      },
+      resizeKey:function(newQuestion, oldQuestion){
+        if(this.chart !=null){
+          this.chart.resize();
+        }
+      }
+    },
+    props: {
+      drawWind:{
+        type:Object,
+      },
+      resizeKey:{
+        type:Number
+      }
+    },
+    data() {
+      return {
+        chart: null,
+        nwpDatas: {},
+        windTowerStatusDataDatas: {},
+      }
+    },
+    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(nwpDatas,windTowerStatusDataDatas) {
+        this.chart = echarts.init(document.getElementById('windCharts'))
+        //风向频率数组,按顺时针方向,上北下南左西右东,16方位
+        let wd10 =nwpDatas.wd10Integers;
+        let wd30 =nwpDatas.wd30Integers;
+        let wd50 = nwpDatas.wd50Integers;
+        let wd70 = nwpDatas.wd70Integers;
+        let wd80 = nwpDatas.wd80Integers;
+        let wd90 = nwpDatas.wd90Integers;
+        let wd100 = nwpDatas.wd100Integers;
+        let wd170 = nwpDatas.wd170Integers;
+        let wdInst10 = windTowerStatusDataDatas.wdInst10Integers;
+        let wdInst30 = windTowerStatusDataDatas.wdInst30Integers;
+        let wdInst50 = windTowerStatusDataDatas.wdInst50Integers;
+        let wdInst70 = windTowerStatusDataDatas.wdInst70Integers;
+        let wdInst80 = windTowerStatusDataDatas.wdInst80Integers;
+        let wdInst90 = windTowerStatusDataDatas.wdInst90Integers;
+        let wdInst100 = windTowerStatusDataDatas.wdInst100Integers;
+        let wdInst170 = windTowerStatusDataDatas.wdInst170Integers;
+        //风向 16方位
+        let nameList = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW'];
+        //数据
+        const wd10s = [];
+        const wd30s = [];
+        const wd50s = [];
+        const wd70s = [];
+        const wd80s = [];
+        const wd90s = [];
+        const wd100s = [];
+        const wd170s = [];
+        const wdInst10s = [];
+        const wdInst30s = [];
+        const wdInst50s = [];
+        const wdInst70s = [];
+        const wdInst80s = [];
+        const wdInst90s = [];
+        const wdInst100s = [];
+        const wdInst170s = [];
+        for (let i = 0; i <= nameList.length; i++) {
+          var jiaodu = (360 / nameList.length) * i;
+          wd10s.push([wd10[i], jiaodu]); //[径向,角度]
+          wd30s.push([wd30[i], jiaodu]); //[径向,角度]
+          wd50s.push([wd50[i], jiaodu]); //[径向,角度]
+          wd70s.push([wd70[i], jiaodu]); //[径向,角度]
+          wd80s.push([wd80[i], jiaodu]); //[径向,角度]
+          wd90s.push([wd90[i], jiaodu]); //[径向,角度]
+          wd100s.push([wd100[i], jiaodu]); //[径向,角度]
+          wd170s.push([wd170[i], jiaodu]); //[径向,角度]
+          wdInst10s.push([wdInst10[i], jiaodu]); //[径向,角度]
+          wdInst30s.push([wdInst30[i], jiaodu]); //[径向,角度]
+          wdInst50s.push([wdInst50[i], jiaodu]); //[径向,角度]
+          wdInst70s.push([wdInst70[i], jiaodu]); //[径向,角度]
+          wdInst80s.push([wdInst80[i], jiaodu]); //[径向,角度]
+          wdInst90s.push([wdInst90[i], jiaodu]); //[径向,角度]
+          wdInst100s.push([wdInst100[i], jiaodu]); //[径向,角度]
+          wdInst170s.push([wdInst170[i], jiaodu]); //[径向,角度]
+        }
+        var option = {
+          title: {
+            text: '风向玫瑰图',
+            subtext: '风向频率玫瑰图',
+            textStyle: {
+              color: '#fff',
+            }
+          },
+          legend: {
+            textStyle: {
+              color: '#ffffff'
+            },
+            // width: '800px',
+            right: '20',
+            left: '120',
+            data: ['10米风向', "30米风向", "50米风向", "70米风向", "80米风向", "90米风向", "100米风向", "170米风向",'实时10米风向', "实时30米风向", "实时50米风向", "实时70米风向", "实时80米风向", "实时90米风向", "实时100米风向", "实时170米风向" ],
+          },
+          polar: {},
+          tooltip: {
+            trigger: 'axis',
+            axisPointer: {
+              type: 'cross',
+            },
+          },
+          angleAxis: {
+            type: 'value',
+            startAngle: 90,
+            min: 0, //最小刻度
+            max: 360, //最大刻度
+            interval: 360 / nameList.length, //间隔刻度 16方位间隔22.5,可改8方位
+            axisLabel: {
+              formatter: function (value, index) {
+                return nameList[index];
+              },
+              color: '#fff',
+            },
+          },
+          radiusAxis: {
+            axisLine: {
+              lineStyle: {
+                color: '#bbb',
+              },
+            }
+          },
+
+          series: [
+            {
+              coordinateSystem: 'polar',
+              name: '10米风向',
+              type: 'line',
+              data: wd10s,
+            },
+            {
+              coordinateSystem: 'polar',
+              name: '30米风向',
+              type: 'line',
+              data: wd30s,
+            },
+            {
+              coordinateSystem: 'polar',
+              name: '50米风向',
+              type: 'line',
+              data: wd50s,
+            },{
+              coordinateSystem: 'polar',
+              name: '70米风向',
+              type: 'line',
+              data: wd70s,
+            },{
+              coordinateSystem: 'polar',
+              name: '80米风向',
+              type: 'line',
+              data: wd80s,
+            },{
+              coordinateSystem: 'polar',
+              name: '90米风向',
+              type: 'line',
+              data: wd90s,
+            },{
+              coordinateSystem: 'polar',
+              name: '100米风向',
+              type: 'line',
+              data: wd100s,
+            },{
+              coordinateSystem: 'polar',
+              name: '50米风向',
+              type: 'line',
+              data: wd50s,
+            },{
+              coordinateSystem: 'polar',
+              name: '170米风向',
+              type: 'line',
+              data: wd170s,
+            },
+            {
+              coordinateSystem: 'polar',
+              name: '实时10米风向',
+              type: 'line',
+              data: wdInst10s,
+            },
+            {
+              coordinateSystem: 'polar',
+              name: '实时30米风向',
+              type: 'line',
+              data: wdInst30s,
+            },
+            {
+              coordinateSystem: 'polar',
+              name: '实时50米风向',
+              type: 'line',
+              data: wdInst50s,
+            },{
+              coordinateSystem: 'polar',
+              name: '实时70米风向',
+              type: 'line',
+              data: wdInst70s,
+            },{
+              coordinateSystem: 'polar',
+              name: '实时80米风向',
+              type: 'line',
+              data: wdInst80s,
+            },{
+              coordinateSystem: 'polar',
+              name: '实时90米风向',
+              type: 'line',
+              data: wdInst90s,
+            },{
+              coordinateSystem: 'polar',
+              name: '实时100米风向',
+              type: 'line',
+              data: wdInst100s,
+            },
+            {
+              coordinateSystem: 'polar',
+              name: '实时170米风向',
+              type: 'line',
+              data: wdInst170s,
+            },
+          ],
+        };
+        this.chart.setOption(option,true)
+      },
+
+    }
+  }
+</script>
+<style scoped>
+  #windCharts{
+    width: 100%;
+    height:calc(80vh - 50px);
+    color: white;
+  }
+</style>

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

@@ -115,6 +115,9 @@
               </vxe-grid>
           </div>
          </el-tab-pane>
+        <el-tab-pane label="风向对比" name="four">
+          <ChartWind :drawWind = this.drawWind :resizeKey=this.resizeKey />
+        </el-tab-pane>
       </el-tabs>
     </div>
   </div>
@@ -122,10 +125,11 @@
 
 <script>
   import Chart from './charts'
+  import ChartWind from './chartsWind'
   import resize from '../../../components/Charts/mixins/resize'
   export default {
     name: 'nwp',
-    components: { Chart},
+    components: { Chart,ChartWind},
     mixins: [resize],
     data(){
       return{
@@ -141,8 +145,10 @@
         drawLoading:true,
         tableLoading:true,
         resizeKey:1,
+        fourResizeKey: 4,
         activeName: 'first',
         drawData:{datas:[],times:[],ndatas:[]},
+        drawWind:{ nwpDatas:[], windTowerStatusDataDatas:[]},
         tableData:[],
         statisticsData:[],
         total:0,
@@ -188,6 +194,7 @@
           this.queryEndTime = this.endTime
           this.loading = true
           this.getDraw(this.queryStartTime,this.queryEndTime)
+          this.getWindDraw(this.queryStartTime,this.queryEndTime)
           this.getTable()
         })
       },
@@ -195,7 +202,6 @@
         this.drawLoading = true
         this.$axios.get('/nwp/'+startTime+'/'+endTime).then((res) => {
           this.drawData = res.data
-          console.log(res.data.ndatas);
           this.drawLoading = false
           if(!this.drawLoading && !this.tableLoading){
             this.loading = false
@@ -207,6 +213,28 @@
           }
           this.$message.error('查询实时预测短期echarts出错' + error)
         })
+
+
+      },
+      getWindDraw(startTime,endTime){
+        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){
+            this.loading = false
+          }
+        }).catch((error) => {
+          this.drawLoading = false
+          if(!this.drawLoading && !this.tableLoading){
+            this.loading = false
+          }
+          this.$message.error('查询风向对比出错' + error)
+        })
+
+
       },
       getTable(){
         this.tableLoading = true
@@ -321,10 +349,11 @@
         this.queryStartTime = this.startTime
         this.queryEndTime = this.endTime
         this.getDraw(this.queryStartTime,this.queryEndTime)
+        this.getWindDraw(this.queryStartTime,this.queryEndTime)
         this.getTable()
       },
       Byresize(tab){
-        if(tab.name =='first'){
+        if(tab.name =='first' || tab.name =='four'){
           this.resizeKey++
           this.showToolBar = false
         }else{

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

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

+ 236 - 13
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/service/NwpService.java

@@ -191,7 +191,6 @@ public class NwpService extends BaseService {
     list.sort(Comparator.comparing(WindTowerStatusData::getTime));
     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);
@@ -208,7 +207,6 @@ public class NwpService extends BaseService {
     }
     this.defaultRealReplace(checkList);
 
-
     ElectricField electricField = this.getElectricField();
     List<BigDecimal> ws10Collect = new ArrayList<>();
     List<BigDecimal> ws30Collect= new ArrayList<>();
@@ -238,8 +236,6 @@ public class NwpService extends BaseService {
       datas.put("wsInst90",ws90Collect);
       datas.put("wsInst100",ws100Collect);
       datas.put("wsInst170",ws170Collect);
-
-
     }
 
     map1.put("wsInst10","实时10米风速");
@@ -257,6 +253,138 @@ public class NwpService extends BaseService {
 
   }
 
+
+  public Map<String, Object> getWindCompare(Long startTime, Long endTime) throws BusinessException {
+    Map<String,Object> map = new HashMap<>();
+
+
+    List<Nwp> nwpList = new ArrayList<>();
+    Map<String,Object> nwpDatas = new LinkedHashMap<>();
+    List<Nwp> nwpCheckList = new ArrayList<>();
+    nwpList = nwpRepository.findByPreTimeBetween(startTime, endTime);
+    nwpList.sort(Comparator.comparing(Nwp::getPreTime));
+
+    List<WindTowerStatusData> windTowerStatusDataList = new ArrayList<>();
+    Map<String,Object> windTowerStatusDataDatas = new LinkedHashMap<>();
+    List<WindTowerStatusData> windTowerStatusDataCheckList = new ArrayList<>();
+    windTowerStatusDataList = windTowerStatusDataRepository.findByTimeBetween(new Date(startTime), new Date(endTime));
+    windTowerStatusDataList.sort(Comparator.comparing(WindTowerStatusData::getTime));
+
+    long startTimeLong  = startTime;
+    long endTimeLong  = endTime;
+    long timeStep = 900000L;
+    if(startTimeLong%timeStep !=0){
+      startTimeLong = startTimeLong -(startTimeLong%timeStep);
+    }
+
+    for(long i = startTimeLong;i<endTimeLong;i=i+timeStep){
+      long finalI = i;
+      List<Nwp> nwp = nwpList.stream().filter(t -> t.getPreTime() == finalI).collect(Collectors.toList());
+      if (nwp != null && nwp.size() > 0) {
+        nwpCheckList.add(nwp.get(0));
+      }else{
+        nwpCheckList.add(new Nwp());
+      }
+
+      List<WindTowerStatusData> wtsd = windTowerStatusDataList.stream().filter(t -> t.getTime().getTime() == finalI).collect(Collectors.toList());
+      if (wtsd != null && wtsd.size() > 0) {
+        windTowerStatusDataCheckList.add(wtsd.get(0));
+      }else{
+        windTowerStatusDataCheckList.add(new WindTowerStatusData());
+      }
+
+    }
+    this.defaultReplace(nwpCheckList);
+    this.defaultRealReplace(windTowerStatusDataCheckList);
+
+    ElectricField electricField = this.getElectricField();
+
+    List<BigDecimal> wd10 = new ArrayList<>();
+    List<BigDecimal> wd30 = new ArrayList<>();
+    List<BigDecimal> wd50 = new ArrayList<>();
+    List<BigDecimal> wd70 = new ArrayList<>();
+    List<BigDecimal> wd80 = new ArrayList<>();
+    List<BigDecimal> wd90 = new ArrayList<>();
+    List<BigDecimal> wd100 = new ArrayList<>();
+    List<BigDecimal> wd170 = new ArrayList<>();
+
+    List<BigDecimal> wdInst10 = new ArrayList<>();
+    List<BigDecimal> wdInst30 = new ArrayList<>();
+    List<BigDecimal> wdInst50 = new ArrayList<>();
+    List<BigDecimal> wdInst70 = new ArrayList<>();
+    List<BigDecimal> wdInst80 = new ArrayList<>();
+    List<BigDecimal> wdInst90 = new ArrayList<>();
+    List<BigDecimal> wdInst100 = new ArrayList<>();
+    List<BigDecimal> wdInst170 = new ArrayList<>();
+
+    if(electricField.getElectricFieldTypeEnum().getCode() == 2){
+      wd10 = nwpCheckList.stream().map(Nwp::getWd10).collect(Collectors.toList());
+      wd30 = nwpCheckList.stream().map(Nwp::getWd30).collect(Collectors.toList());
+      wd50 = nwpCheckList.stream().map(Nwp::getWd50).collect(Collectors.toList());
+      wd70 = nwpCheckList.stream().map(Nwp::getWd70).collect(Collectors.toList());
+      wd80 = nwpCheckList.stream().map(Nwp::getWd80).collect(Collectors.toList());
+      wd90 = nwpCheckList.stream().map(Nwp::getWd90).collect(Collectors.toList());
+      wd100 = nwpCheckList.stream().map(Nwp::getWd100).collect(Collectors.toList());
+      wd170 = nwpCheckList.stream().map(Nwp::getWd170).collect(Collectors.toList());
+
+      Integer[] wd10Integers = windFrequency(wd10);
+      Integer[] wd30Integers = windFrequency(wd30);
+      Integer[] wd50Integers = windFrequency(wd50);
+      Integer[] wd70Integers = windFrequency(wd70);
+      Integer[] wd80Integers = windFrequency(wd80);
+      Integer[] wd90Integers = windFrequency(wd90);
+      Integer[] wd100Integers = windFrequency(wd100);
+      Integer[] wd170Integers = windFrequency(wd170);
+
+      nwpDatas.put("wd10Integers",wd10Integers);
+      nwpDatas.put("wd30Integers",wd30Integers);
+      nwpDatas.put("wd50Integers",wd50Integers);
+      nwpDatas.put("wd70Integers",wd70Integers);
+      nwpDatas.put("wd80Integers",wd80Integers);
+      nwpDatas.put("wd90Integers",wd90Integers);
+      nwpDatas.put("wd100Integers",wd100Integers);
+      nwpDatas.put("wd170Integers",wd170Integers);
+
+      wdInst10 = windTowerStatusDataCheckList.stream().map(WindTowerStatusData::getWdInst10).collect(Collectors.toList());
+      wdInst30 = windTowerStatusDataCheckList.stream().map(WindTowerStatusData::getWdInst30).collect(Collectors.toList());
+      wdInst50 = windTowerStatusDataCheckList.stream().map(WindTowerStatusData::getWdInst50).collect(Collectors.toList());
+      wdInst70 = windTowerStatusDataCheckList.stream().map(WindTowerStatusData::getWdInst70).collect(Collectors.toList());
+      wdInst80 = windTowerStatusDataCheckList.stream().map(WindTowerStatusData::getWdInst80).collect(Collectors.toList());
+      wdInst90 = windTowerStatusDataCheckList.stream().map(WindTowerStatusData::getWdInst90).collect(Collectors.toList());
+      wdInst100 = windTowerStatusDataCheckList.stream().map(WindTowerStatusData::getWdInst100).collect(Collectors.toList());
+      wdInst170 = windTowerStatusDataCheckList.stream().map(WindTowerStatusData::getWdInst110).collect(Collectors.toList());
+
+      Integer[] wdInst10Integers = windFrequency(wdInst10);
+      Integer[] wdInst30Integers = windFrequency(wdInst30);
+      Integer[] wdInst50Integers = windFrequency(wdInst50);
+      Integer[] wdInst70Integers = windFrequency(wdInst70);
+      Integer[] wdInst80Integers = windFrequency(wdInst80);
+      Integer[] wdInst90Integers = windFrequency(wdInst90);
+      Integer[] wdInst100Integers = windFrequency(wdInst100);
+      Integer[] wdInst170Integers = windFrequency(wdInst170);
+
+      windTowerStatusDataDatas.put("wdInst10Integers", wdInst10Integers);
+      windTowerStatusDataDatas.put("wdInst30Integers", wdInst30Integers);
+      windTowerStatusDataDatas.put("wdInst50Integers", wdInst50Integers);
+      windTowerStatusDataDatas.put("wdInst70Integers", wdInst70Integers);
+      windTowerStatusDataDatas.put("wdInst80Integers", wdInst80Integers);
+      windTowerStatusDataDatas.put("wdInst90Integers", wdInst90Integers);
+      windTowerStatusDataDatas.put("wdInst100Integers", wdInst100Integers);
+      windTowerStatusDataDatas.put("wdInst170Integers", wdInst170Integers);
+
+    }
+
+
+    String[] nameList = {"N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"};
+
+    map.put("nwpDatas", nwpDatas);
+    map.put("windTowerStatusDataDatas", windTowerStatusDataDatas);
+    map.put("nameList", nameList);
+
+    return map;
+  }
+
+
   /**
    * 根据时间 分页查询 NWP数据 yh
    *
@@ -478,8 +606,6 @@ public class NwpService extends BaseService {
   public void defaultReplace(List<Nwp> datas){
     BigDecimal nullBig =  new BigDecimal(-99);
     for(Nwp i :datas){
-
-
       if(i.getT().compareTo(nullBig)==0){
         i.setT(null);
       }
@@ -549,9 +675,7 @@ public class NwpService extends BaseService {
       if(i.getWd170().compareTo(nullBig)==0){
         i.setWd170(null);
       }
-
     }
-
   }
 
   /**
@@ -562,9 +686,6 @@ public class NwpService extends BaseService {
   public void defaultRealReplace(List<WindTowerStatusData> datas){
     BigDecimal nullBig =  new BigDecimal(-99);
     for(WindTowerStatusData i :datas){
-
-
-
       if(i.getWsInst10().compareTo(nullBig)==0){
         i.setWsInst10(null);
       }
@@ -589,9 +710,31 @@ public class NwpService extends BaseService {
       if(i.getWsInst110().compareTo(nullBig)==0){
         i.setWsInst110(null);
       }
-
+      if(i.getWdInst10().compareTo(nullBig)==0){
+        i.setWdInst10(null);
+      }
+      if(i.getWdInst30().compareTo(nullBig)==0){
+        i.setWdInst30(null);
+      }
+      if(i.getWdInst50().compareTo(nullBig)==0){
+        i.setWdInst50(null);
+      }
+      if(i.getWdInst70().compareTo(nullBig)==0){
+        i.setWdInst70(null);
+      }
+      if(i.getWdInst80().compareTo(nullBig)==0){
+        i.setWdInst80(null);
+      }
+      if(i.getWdInst90().compareTo(nullBig)==0){
+        i.setWdInst90(null);
+      }
+      if(i.getWdInst100().compareTo(nullBig)==0){
+        i.setWdInst100(null);
+      }
+      if(i.getWdInst110().compareTo(nullBig)==0){
+        i.setWdInst110(null);
+      }
     }
-
   }
 
   /**
@@ -777,4 +920,84 @@ public class NwpService extends BaseService {
     }
     return nwpDays;
   }
+
+  // 风频计算
+  public Integer[] windFrequency(List<BigDecimal> bigDecimals){
+
+    BigDecimal b0 = new BigDecimal(0);
+    BigDecimal b225 = new BigDecimal(22.5);
+    BigDecimal b45 = new BigDecimal(45);
+    BigDecimal b675 = new BigDecimal(67.5);
+    BigDecimal b90 = new BigDecimal(90);
+    BigDecimal b1125 = new BigDecimal(112.5);
+    BigDecimal b135 = new BigDecimal(135);
+    BigDecimal b1575 = new BigDecimal(157.5);
+    BigDecimal b180 = new BigDecimal(180);
+    BigDecimal b2025 = new BigDecimal(202.5);
+    BigDecimal b225b = new BigDecimal(225);
+    BigDecimal b2475 = new BigDecimal(247.5);
+    BigDecimal b270 = new BigDecimal(270);
+    BigDecimal b2925 = new BigDecimal(292.5);
+    BigDecimal b315 = new BigDecimal(315);
+    BigDecimal b3375 = new BigDecimal(337.5);
+    BigDecimal b360 = new BigDecimal(360);
+
+    Integer N = 0;
+    Integer NNE = 0;
+    Integer NE = 0;
+    Integer ENE = 0;
+    Integer E = 0;
+    Integer ESE = 0;
+    Integer SE = 0;
+    Integer SSE = 0;
+    Integer S = 0;
+    Integer SSW = 0;
+    Integer SW = 0;
+    Integer WSW = 0;
+    Integer W = 0;
+    Integer WNW = 0;
+    Integer NW = 0;
+    Integer NNW = 0;
+
+    if(bigDecimals.get(0) != null){
+      for(BigDecimal bg: bigDecimals){
+        if(bg.compareTo(b0) > -1  && bg.compareTo(b225) == -1 ){
+          N++;
+        }else if(bg.compareTo(b225) > -1 && bg.compareTo(b45) == -1){
+          NNE++;
+        }else if(bg.compareTo(b45) > -1 && bg.compareTo(b675) == -1){
+          NE++;
+        }else if(bg.compareTo(b675) > -1 && bg.compareTo(b90) == -1){
+          ENE++;
+        }else if(bg.compareTo(b90) > -1 && bg.compareTo(b1125) == -1){
+          E++;
+        }else if(bg.compareTo(b1125) > -1 && bg.compareTo(b135) == -1){
+          ESE++;
+        }else if(bg.compareTo(b135) > -1 && bg.compareTo(b1575) == -1){
+          SE++;
+        }else if(bg.compareTo(b1575) > -1 && bg.compareTo(b180) == -1){
+          SSE++;
+        }else if(bg.compareTo(b180) > -1 && bg.compareTo(b2025) == -1){
+          S++;
+        }else if(bg.compareTo(b2025) > -1 && bg.compareTo(b225b) == -1){
+          SSW++;
+        }else if(bg.compareTo(b225b) > -1 && bg.compareTo(b2475) == -1){
+          SW++;
+        }else if(bg.compareTo(b2475) > -1 && bg.compareTo(b270) == -1){
+          WSW++;
+        }else if(bg.compareTo(b270) > -1 && bg.compareTo(b2925) == -1){
+          W++;
+        }else if(bg.compareTo(b2925) > -1 && bg.compareTo(b315) == -1){
+          WNW++;
+        }else if(bg.compareTo(b315) > -1 && bg.compareTo(b3375) == -1){
+          NW++;
+        }else if(bg.compareTo(b3375) > -1 && bg.compareTo(b360) == -1){
+          NNW++;
+        }
+      }
+    }
+    // 16
+    Integer[] integers = {N,NNE,NE,ENE,E,ESE,SE,SSE,S,SSW,SW,WSW,W,WNW,NW,NNW};
+    return integers;
+  }
 }