hxf 2 gadi atpakaļ
vecāks
revīzija
3e146464d1

+ 3 - 15
neim-biz/src/main/java/com/jiayue/biz/controller/HomePageController.java

@@ -208,29 +208,17 @@ public class HomePageController extends BaseController {
         return AjaxResult.success(homePageService.getStationTotalityInfo());
     }
 
-    @ApiOperation(value = "场站信息", notes = "查询场站信息")
+    @ApiOperation(value = "场站信息(杨总数据)", notes = "计算风机台数、风机机型、风机点位坐标、塔坐标")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "场站编号", value = "stationId", paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "场站id", value = "stationId", paramType = "query", dataType = "String"),
     })
     @GetMapping("/stationInfo")
     public AjaxResult stationInfo(String stationId) {
 
-
 //        ----{杨总数据},计算风机台数、风机机型、风机点位坐标、塔坐标
 
-        HashMap<String, Object> hashMap = new HashMap<>();
-        HashMap<String, Object> fInfo = new HashMap<>();
-        HashMap<String, Object> gInfo = new HashMap<>();
-        fInfo.put("num", "10");
-        fInfo.put("capacity", "724.6");
-        fInfo.put("fjNum", "407");
-        gInfo.put("num", "4");
-        gInfo.put("capacity", "110");
-        gInfo.put("nbqNum", "204");
-        hashMap.put("fInfo", fInfo);
-        hashMap.put("gInfo", gInfo);
 
-        return AjaxResult.success(hashMap);
+        return AjaxResult.success(homePageService.getStationInfo(stationId));
     }
 
 

+ 3 - 1
neim-biz/src/main/java/com/jiayue/biz/domain/FanModelData.java

@@ -16,6 +16,8 @@ public class FanModelData {
     private String stationId;
     //场站名称
     private String stationName;
+    //机型名称
+    private String modelName;
     //场站简称
     private String stationNameEasy;
     //平均风速
@@ -25,5 +27,5 @@ public class FanModelData {
     //发电量年
     private String generatingCapacity;
     //满发小时数
-    private String realTime;
+    private String realTimeTotal;
 }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 23 - 4
neim-biz/src/main/java/com/jiayue/biz/job/AirDensityJob.java


+ 10 - 0
neim-biz/src/main/java/com/jiayue/biz/service/FanModelDataService.java

@@ -0,0 +1,10 @@
+package com.jiayue.biz.service;
+
+import com.jiayue.biz.domain.FanModelData;
+
+import java.util.List;
+
+public interface FanModelDataService {
+    //查询杨总数据(风机计算数据)
+    List<FanModelData> getFanModelDataList();
+}

+ 26 - 0
neim-biz/src/main/java/com/jiayue/biz/service/impl/FanModelDataServiceImpl.java

@@ -0,0 +1,26 @@
+package com.jiayue.biz.service.impl;
+
+import com.jiayue.biz.domain.FanModelData;
+import com.jiayue.biz.service.FanModelDataService;
+import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.mongodb.core.MongoTemplate;
+import org.springframework.data.mongodb.core.query.Query;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@AllArgsConstructor
+public class FanModelDataServiceImpl implements FanModelDataService {
+
+    private final MongoTemplate mongoTemplate;
+
+
+    //查询杨总数据(风机计算数据)
+    public List<FanModelData> getFanModelDataList() {
+        return mongoTemplate.find(new Query(), FanModelData.class, "fan_model_data");
+    }
+
+
+}

+ 44 - 6
neim-biz/src/main/java/com/jiayue/biz/service/impl/HomePageServiceImpl.java

@@ -50,6 +50,8 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
 
     private final ProjectProgressService proProjectInfoService;
     private final TotalityInfoService totalityInfoService;
+    private final FanModelDataService fanModelDataService;
+
 
     private final BigDecimal threeParameterOne = new BigDecimal("1.146");
     private final BigDecimal threeParameterTow = new BigDecimal("77.42");
@@ -739,12 +741,27 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
         List<ProjectInfo> projectInfoList = projectInfoService.getProjectInfoList();
         //根据项目ID过滤指定数据
         List<ProjectInfo> collect = projectInfoList.stream().filter(p -> p.getId().equals(projectId)).collect(Collectors.toList());
+        ArrayList<HashMap<String, String>> arrayList = new ArrayList<>();
+
         if (collect.size() > 0) {
             ProjectInfo projectInfo = collect.get(0);
             dataMap.put("projectOverview", projectInfo.getProjectBasicInfo().getProjectOverview());
             dataMap.put("resourcesOverview", projectInfo.getProjectBasicInfo().getResourcesOverview());
             //拐点坐标
             dataMap.put("coordinates", projectInfo.getCoordinates());
+            if (projectInfo.getEquipment().size() > 0) {
+                HashMap<String, String> map = new HashMap<>();
+                for (Equipment equipment : projectInfo.getEquipment()) {
+                    //经度
+                    map.put("longitude", equipment.getLongitude());
+                    map.put("latitude", equipment.getLatitude());
+                    map.put("towerName", equipment.getName());
+                    arrayList.add(map);
+                }
+
+            }
+            //测风塔坐标
+            dataMap.put("towerInfo", arrayList);
         }
         //项目中所有的塔、拐点坐标、 TODO 地图四个角信息
         return dataMap;
@@ -818,20 +835,41 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
         //场站信息
         List<StationInfo> stationInfos = stationInfoService.selectStationInfo();
         List<StationInfo> stationInfoList = stationInfos.stream().filter(s -> s.getId().equals(stationId)).collect(Collectors.toList());
+        List<FanModelData> fanModelDataList = fanModelDataService.getFanModelDataList();
+        //过滤
+        List<FanModelData> collect = fanModelDataList.stream().filter(f -> f.getStationId().equals(stationId)).collect(Collectors.toList());
+
         HashMap<String, Object> dataMap = new HashMap<>();
         if (stationInfoList.size() > 0) {
-            ArrayList<HashMap<String,Object>> arrayList = new ArrayList<>();
+            ArrayList<HashMap<String, Object>> arrayList = new ArrayList<>();
             //根据风机类型分组
             Map<String, List<FanTower>> modelMap = stationInfoList.get(0).getFanTowerList().stream()
                     .collect(Collectors.groupingBy(FanTower::getFanModel));
             //遍历map指定key
             for (Map.Entry<String, List<FanTower>> entry : modelMap.entrySet()) {
-                HashMap<String, Object> map = new HashMap<>();
-                map.put("modelType", entry.getKey());
-                map.put("modelTotal", entry.getValue().size());
-                arrayList.add(map);
+                for (FanModelData fanModelData : collect) {
+                    if (fanModelData.getModelName().equals(entry.getKey())) {
+                        HashMap<String, Object> map = new HashMap<>();
+                        //风机名称
+                        map.put("modelType", entry.getKey());
+                        //风机数量
+                        map.put("modelTotal", entry.getValue().size());
+                        //满发小时数
+                        map.put("wsAve", fanModelData.getWsAve());
+                        //主风向
+                        map.put("wdSum", fanModelData.getWdSum());
+                        //发电量
+                        map.put("generatingCapacity", fanModelData.getGeneratingCapacity());
+                        //满发小时数
+                        map.put("realTimeTotal", fanModelData.getRealTimeTotal());
+                        arrayList.add(map);
+
+                    }
+                }
+
             }
-            dataMap.put("modelT",arrayList);
+            dataMap.put("modelT", arrayList);
+            //风机点位
             dataMap.put("modelTower", stationInfoList.get(0).getFanTowerList());
         }
         return dataMap;

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels