Selaa lähdekoodia

修改湍流平均值 以及统计计算逻辑 湍流平均值取风速段14.5-15.5之间

hxf 2 vuotta sitten
vanhempi
commit
6a6a7e32fc

+ 14 - 7
neim-biz/src/main/java/com/jiayue/biz/controller/HomePageController.java

@@ -11,8 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 
-
-
 /**
  * 首页Controller
  *
@@ -69,9 +67,18 @@ public class HomePageController extends BaseController {
      * 首页空气密度、温度、压强平均值
      */
     @GetMapping("/selectTForAir")
-    public AjaxResult selectTForAir(String equipmentId, String month) {
+    public AjaxResult selectTForAir(String projectId, String equipmentId, String month) {
+
+        return AjaxResult.success(homePageService.getAirAndPaAndT(projectId, equipmentId, month));
+    }
+
+    /**
+     * 首页空气密度、温度、压强平均值
+     */
+    @GetMapping("/selectStationTForAir")
+    public AjaxResult selectStationTForAir(String stationId, String equipmentId, String month) {
 
-        return AjaxResult.success(homePageService.getAirAndPaAndT(equipmentId, month));
+        return AjaxResult.success(homePageService.selectStationTForAir(stationId, equipmentId, month));
     }
 
     /**
@@ -182,21 +189,21 @@ public class HomePageController extends BaseController {
 
     //地图点位坐标 (风机、测风塔、拐点)
     @GetMapping("/getPointMap")
-    public AjaxResult getPointMap(){
+    public AjaxResult getPointMap() {
         return AjaxResult.success(homePageService.getPointMap());
     }
 
 
     //查询所有的场站坐标
     @GetMapping("/getStationSeat")
-    public AjaxResult getStationSeat(){
+    public AjaxResult getStationSeat() {
         return AjaxResult.success(homePageService.getStationSeat());
     }
 
 
     //查询所有的项目坐标
     @GetMapping("/getProjectSeat")
-    public AjaxResult getProjectSeat(){
+    public AjaxResult getProjectSeat() {
         return AjaxResult.success(homePageService.getProjectSeat());
     }
 

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
neim-biz/src/main/java/com/jiayue/biz/job/AirDensityJob.java


+ 4 - 1
neim-biz/src/main/java/com/jiayue/biz/service/HomePageService.java

@@ -44,7 +44,10 @@ public interface HomePageService extends IService<WindTowerDataParentTable> {
 
 
     //首页空气密度、温度、压强平均值
-    Map<String, Object> getAirAndPaAndT(String equipmentId, String month);
+    Map<String, Object> getAirAndPaAndT(String projectId,String equipmentId, String month);
+
+    //首页场站空气密度、温度、压强平均值
+    Map<String, Object> selectStationTForAir(String stationId,String equipmentId, String month);
 
 
     //首页全省资源概述

+ 101 - 14
neim-biz/src/main/java/com/jiayue/biz/service/impl/HomePageServiceImpl.java

@@ -504,10 +504,10 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
      * @param equipmentId 场站编号
      * @return Map<String, BigDecimal>
      */
-    public Map<String, Object> getAirAndPaAndT(String equipmentId, String month) {
+    public Map<String, Object> getAirAndPaAndT(String projectId,String equipmentId, String month) {
         List<WindTowerInfo> windTowerInfoList = windTowerInfoService.lambdaQuery().eq(WindTowerInfo::getEquipmentNo, equipmentId).list();
         String[] wdHeight = windTowerInfoList.get(0).getWdHeights().split(",");
-
+        ProjectInfo oneProjectInfoById = projectInfoService.getOneProjectInfoById(projectId);
         ArrayList<String> arrayList = new ArrayList(Arrays.asList(windTowerInfoList.get(0).getHeights().split(",")));
         //层高排序
         List<Integer> heightList = arrayList.stream().map(s -> Integer.parseInt(CalculationUtil.getNumberFromString(s))).sorted().collect(Collectors.toList());
@@ -526,7 +526,7 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
                 .or().eq(EquipmentAttribute::getFieldName, wdHeight[0] + "monthWdRose").list();
 
         List<WindTowerCalculationData> windTowerCalculationDataList = windTowerCalculationDataService.getByBetweenTimeAndEquipmentIdAndEbId(yearDay, endTime, equipmentId, equipmentAttributeList);
-        windTowerCalculationDataList = windTowerCalculationDataList.stream().filter(w ->  w.getTime().getTime() >= yearDay.getTime() && w.getTime().getTime() <= endTime.getTime()).collect(Collectors.toList());
+        windTowerCalculationDataList = windTowerCalculationDataList.stream().filter(w -> w.getTime().getTime() >= yearDay.getTime() && w.getTime().getTime() <= endTime.getTime()).collect(Collectors.toList());
         HashMap<String, Object> dataMap = new HashMap<>();
         //温度
         dataMap.put("t", this.getDataForCalculationByEb(equipmentAttributeList, windTowerCalculationDataList, "tAVE"));
@@ -540,14 +540,18 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
         dataMap.put("windShear", this.getDataForCalculationByEb(equipmentAttributeList, windTowerCalculationDataList, "windShearMonth"));
         //层高
         dataMap.put("height", maxHeight);
-        List<EquipmentAttribute> batteryDay1 = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals("batteryDay")).collect(Collectors.toList());
-        List<WindTowerCalculationData> calculationDataList = windTowerCalculationDataList.stream().filter(w -> w.getEbId().equals(batteryDay1.get(0).getId())).collect(Collectors.toList());
-        BigDecimal batteryDay = calculationDataList.stream().map(WindTowerCalculationData::getValue).reduce(BigDecimal.ZERO, BigDecimal::add);
-        BigDecimal hourMax = batteryDay.divide(BigDecimal.valueOf(6.25), 2, RoundingMode.HALF_UP);
         //发电量
-        dataMap.put("battery", batteryDay);
+        if(StrUtil.isNotBlank(oneProjectInfoById.getProjectBasicInfo().getTPowerGeneration())){
+            dataMap.put("battery", oneProjectInfoById.getProjectBasicInfo().getTPowerGeneration());
+        }
         //满发小时数
-        dataMap.put("hour", hourMax);
+        if (StrUtil.isNotBlank(oneProjectInfoById.getProjectBasicInfo().getTAvailableHours())){
+            dataMap.put("hour", oneProjectInfoById.getProjectBasicInfo().getTAvailableHours());
+        }
+        if(StrUtil.isNotBlank(oneProjectInfoById.getProjectBasicInfo().getWd())){
+            //主风向
+            dataMap.put("wdSum", oneProjectInfoById.getProjectBasicInfo().getWd());
+        }
 
         List<EquipmentAttribute> equipmentAttributes = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(wdHeight[0] + "monthWdRose")).collect(Collectors.toList());
         List<WindDirectionStatisticsData> windDirectionStatisticsDataList = windDirectionStatisticsDataService.lambdaQuery().eq(WindDirectionStatisticsData::getEbId, equipmentAttributes.get(0).getId()).between(WindDirectionStatisticsData::getTime, yearDay, endTime)
@@ -560,8 +564,91 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
             hashMap.put(k.getKey(), reduce);
         }
         Map.Entry<String, BigDecimal> stringBigDecimalEntry = hashMap.entrySet().stream().max(Comparator.comparing(Map.Entry::getValue)).get();
-        //主风向
-        dataMap.put("wdSum", stringBigDecimalEntry.getKey());
+        //起止时间
+        Map<String, Long> dataTimeStartAndEnd = prophaseWeatherDataService.getDataTimeStartAndEnd(equipmentId);
+        String startTime = DateUtil.format(new Date(dataTimeStartAndEnd.get("startTime")), "yyyy-MM-dd");
+        String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd");
+        dataMap.put("dataTime", startTime + "-" + endTimeStr);
+        dataMap.put("longitude", windTowerInfoList.get(0).getLongitude());
+        dataMap.put("latitude", windTowerInfoList.get(0).getLatitude());
+
+        return dataMap;
+    }
+
+    /**
+     * 首页空气密度、温度、压强平均值 湍流 风切变 满发小时数 日发电量 经纬度 数据起止时间
+     *
+     * @param equipmentId 场站编号
+     * @return Map<String, BigDecimal>
+     */
+    public Map<String, Object> selectStationTForAir(String stationId, String equipmentId, String month) {
+        List<WindTowerInfo> windTowerInfoList = windTowerInfoService.lambdaQuery().eq(WindTowerInfo::getEquipmentNo, equipmentId).list();
+        List<FanModelData> fanModelDataList = fanModelDataService.getFanModelDataList().stream().filter(f -> f.getStationId().equals(stationId)).collect(Collectors.toList());
+
+        StationInfo stationInfo = stationInfoService.getOneStationInfo(stationId);
+
+
+        String[] wdHeight = windTowerInfoList.get(0).getWdHeights().split(",");
+
+        ArrayList<String> arrayList = new ArrayList(Arrays.asList(windTowerInfoList.get(0).getHeights().split(",")));
+        //层高排序
+        List<Integer> heightList = arrayList.stream().map(s -> Integer.parseInt(CalculationUtil.getNumberFromString(s))).sorted().collect(Collectors.toList());
+        Integer maxHeight = heightList.get(heightList.size() - 1);
+        //获取最后一条记录
+        WindTowerCalculationData lastDataCalculation = windTowerCalculationDataService.getLastDataCalculation(equipmentId);
+
+        Date yearDay = DateTimeUtil.getYearDay(lastDataCalculation.getTime().getTime());
+        //获取去年月份开始时间
+//        Date beginTime = DateUtil.offsetMonth(DateUtil.beginOfMonth(yearDay), 1);
+        Date endTime = lastDataCalculation.getTime();
+
+        List<EquipmentAttribute> equipmentAttributeList = equipmentAttributeService.lambdaQuery().eq(EquipmentAttribute::getFieldName, "airDensityMonth").or().eq(EquipmentAttribute::getFieldName, "tAVE").or().
+                eq(EquipmentAttribute::getFieldName, "paAVE").or().eq(EquipmentAttribute::getFieldName, maxHeight + "turbulenceMonth").or().
+                eq(EquipmentAttribute::getFieldName, "windShearMonth").or().eq(EquipmentAttribute::getFieldName, "batteryDay")
+                .or().eq(EquipmentAttribute::getFieldName, wdHeight[0] + "monthWdRose").list();
+
+        List<WindTowerCalculationData> windTowerCalculationDataList = windTowerCalculationDataService.getByBetweenTimeAndEquipmentIdAndEbId(yearDay, endTime, equipmentId, equipmentAttributeList);
+        windTowerCalculationDataList = windTowerCalculationDataList.stream().filter(w -> w.getTime().getTime() >= yearDay.getTime() && w.getTime().getTime() <= endTime.getTime()).collect(Collectors.toList());
+        HashMap<String, Object> dataMap = new HashMap<>();
+        //温度
+        dataMap.put("t", this.getDataForCalculationByEb(equipmentAttributeList, windTowerCalculationDataList, "tAVE"));
+        //空气密度
+        dataMap.put("air", this.getDataForCalculationByEb(equipmentAttributeList, windTowerCalculationDataList, "airDensityMonth"));
+        //压强
+        dataMap.put("pa", this.getDataForCalculationByEb(equipmentAttributeList, windTowerCalculationDataList, "paAVE"));
+        //湍流
+        dataMap.put("turbulence", this.getDataForCalculationByEb(equipmentAttributeList, windTowerCalculationDataList, maxHeight + "turbulenceMonth"));
+        //风切变
+        dataMap.put("windShear", this.getDataForCalculationByEb(equipmentAttributeList, windTowerCalculationDataList, "windShearMonth"));
+        //层高
+        dataMap.put("height", maxHeight);
+
+
+        if (fanModelDataList.size() > 0) {
+            BigDecimal hourMax = BigDecimal.ZERO;
+            //年发电量
+            String generatingCapacity = fanModelDataList.get(0).getGeneratingCapacity();
+            if (StrUtil.isNotBlank(stationInfo.getStationBasicInfo().getCapacity())) {
+                hourMax = new BigDecimal(generatingCapacity).divide(new BigDecimal(stationInfo.getStationBasicInfo().getCapacity()), 2, RoundingMode.HALF_UP);
+            }
+            //发电量
+            dataMap.put("battery", generatingCapacity);
+            //满发小时数
+            dataMap.put("hour", hourMax);
+            //主风向
+            dataMap.put("wdSum", fanModelDataList.get(0).getWdSum());
+        }
+        List<EquipmentAttribute> equipmentAttributes = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(wdHeight[0] + "monthWdRose")).collect(Collectors.toList());
+        List<WindDirectionStatisticsData> windDirectionStatisticsDataList = windDirectionStatisticsDataService.lambdaQuery().eq(WindDirectionStatisticsData::getEbId, equipmentAttributes.get(0).getId()).between(WindDirectionStatisticsData::getTime, yearDay, endTime)
+                .eq(WindDirectionStatisticsData::getEquipmentId, equipmentId).list();
+
+        Map<String, List<WindDirectionStatisticsData>> collect = windDirectionStatisticsDataList.stream().collect(Collectors.groupingBy(w -> w.getDirection()));
+        HashMap<String, BigDecimal> hashMap = new HashMap<>();
+        for (Map.Entry<String, List<WindDirectionStatisticsData>> k : collect.entrySet()) {
+            BigDecimal reduce = k.getValue().stream().map(WindDirectionStatisticsData::getValue).reduce(BigDecimal.ZERO, BigDecimal::add);
+            hashMap.put(k.getKey(), reduce);
+        }
+
         //起止时间
         Map<String, Long> dataTimeStartAndEnd = prophaseWeatherDataService.getDataTimeStartAndEnd(equipmentId);
         String startTime = DateUtil.format(new Date(dataTimeStartAndEnd.get("startTime")), "yyyy-MM-dd");
@@ -962,14 +1049,14 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
                 map.put("modelType", key);
                 //风机数量
                 map.put("modelTotal", size);
-                //满发小时数
+                //平均风速
                 map.put("wsAve", fanModelData.getWsAve());
                 //主风向
                 map.put("wdSum", fanModelData.getWdSum());
                 //发电量
                 map.put("generatingCapacity", fanModelData.getGeneratingCapacity());
-                //满发小时数
-                map.put("realTimeTotal", fanModelData.getRealTimeTotal());
+                //等效小时数
+                map.put("realTimeTotal", size == 0 ? 0 : new BigDecimal(fanModelData.getGeneratingCapacity()).divide(BigDecimal.valueOf(size), 2, RoundingMode.HALF_UP));
                 arrayList.add(map);
 
             }

+ 7 - 0
neim-ui/src/api/biz/dataQuery/homePage.js

@@ -54,6 +54,13 @@ export function selectTForAir(query) {
     method: 'get',
     params: query
   })
+}// 首页空气密度与温度
+export function selectStationTForAir(query) {
+  return request({
+    url: '/dataQuery/homePage/selectStationTForAir',
+    method: 'get',
+    params: query
+  })
 }
 // 首页风速占比
 export function getHeightForAveWs(query) {

+ 1 - 1
neim-ui/src/views/largeScreenPage/Subpage/emailResourcesInfo.vue

@@ -295,7 +295,7 @@ export default {
       })
     },
     getTowerInfo() {
-      selectTForAir({equipmentId: this.cftNo, month: ''}).then(res => {
+      selectTForAir({projectId:this.projectId,equipmentId: this.cftNo, month: ''}).then(res => {
         // console.log(res.data)
         let data = res.data
         this.height = res.data.height

+ 2 - 2
neim-ui/src/views/largeScreenPage/Subpage/realResourcesInfo.vue

@@ -200,7 +200,7 @@
 </template>
 
 <script>
-import {selectTForAir} from "@/api/biz/dataQuery/homePage";
+import {selectStationTForAir} from "@/api/biz/dataQuery/homePage";
 import {stationSelect} from "@/api/biz/dataQuery/largeScreenPage";
 import wdCharts from '../components/wdCharts'
 import wdPowerCharts from '../components/wdPowerCharts'
@@ -277,7 +277,7 @@ export default {
       })
     },
     getTowerInfo() {
-      selectTForAir({equipmentId: this.cftNo, month: ''}).then(res => {
+      selectStationTForAir({stationId:this.stationId,equipmentId: this.cftNo, month: ''}).then(res => {
         // console.log(res.data)
         let data = res.data
         this.stationInfo = {

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä