Bladeren bron

整合 mongodb

hxf 2 jaren geleden
bovenliggende
commit
0d89b295d9

+ 6 - 9
neim-biz/src/main/java/com/jiayue/biz/controller/HomePageController.java

@@ -112,14 +112,6 @@ public class HomePageController extends BaseController {
     @ApiImplicitParams({})
     @GetMapping("/provincialEnergyInfo")
     public AjaxResult provincialEnergy() {
-        //        resourcesOverview: '黑龙江处于高纬度地区,日照强度较大,太阳能转换率较高,为开发太阳能源提供了有理条件。特别是大兴安岭一带常年受到东亚西风带影响,具有风速大,气候干燥特点,与同维度地图相比,风资源更丰富,利于风能资源的开发与利用。'
-        //全省场站坐标、信息
-//        provinceInfo:{//全省信息
-//            fNum:'100',
-//            fHours:'2496h',
-//            gNum:'41',
-//            gHours:'1620h'
-//        }
 
         return AjaxResult.success(homePageService.getResourcesOverview());
     }
@@ -140,7 +132,6 @@ public class HomePageController extends BaseController {
 
     }
 
-    //TODO 参数不一定
     @ApiOperation(value = "前期项目塔坐标以及周边风机坐标", notes = "前期项目塔坐标以及周边风机坐标查询")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id", value = "id", paramType = "query", dataType = "String"),
@@ -204,5 +195,11 @@ public class HomePageController extends BaseController {
         return AjaxResult.success();
     }
 
+    //地图点位坐标 (风机、测风塔、拐点)
+    @GetMapping("/getPointMap")
+    public AjaxResult getPointMap(){
+        return AjaxResult.success(homePageService.getPointMap());
+    }
+
 
 }

+ 3 - 0
neim-biz/src/main/java/com/jiayue/biz/service/HomePageService.java

@@ -96,4 +96,7 @@ public interface HomePageService extends IService<WindTowerDataParentTable> {
 
     //项目进展
     List<ProjectEvolveDto> getProjectEvolve(String projectId);
+
+    //地图点位坐标 (风机、测风塔、拐点)
+    HashMap<String, Object> getPointMap();
 }

+ 100 - 47
neim-biz/src/main/java/com/jiayue/biz/service/impl/HomePageServiceImpl.java

@@ -739,34 +739,83 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
     //查询项目概况
     public HashMap<String, Object> projectMapInfo(String projectId) {
         HashMap<String, Object> dataMap = new HashMap<>();
+        //获取项目信息
         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.isEmpty()) {
+            for (ProjectInfo projectInfo : collect) {
+                dataMap.put("projectOverview", projectInfo.getProjectBasicInfo().getProjectOverview());
+                dataMap.put("resourcesOverview", projectInfo.getProjectBasicInfo().getResourcesOverview());
+                if (projectInfo.getEquipment() != null && projectInfo.getEquipment().size() > 0) {
+                    dataMap.put("longitude", projectInfo.getEquipment().get(0).getLongitude());
+                    dataMap.put("latitude", projectInfo.getEquipment().get(0).getLatitude());
+                }
+            }
+        }
+        return dataMap;
+    }
 
-        if (collect.size() > 0) {
-            ProjectInfo projectInfo = collect.get(0);
-            dataMap.put("projectOverview", projectInfo.getProjectBasicInfo().getProjectOverview());
-            dataMap.put("resourcesOverview", projectInfo.getProjectBasicInfo().getResourcesOverview());
+    //地图点位坐标 (风机、测风塔、拐点)
+    public HashMap<String, Object> getPointMap() {
+        HashMap<String, Object> dataMap = new HashMap<>();
+        //获取项目信息
+        List<ProjectInfo> projectInfoList = projectInfoService.getProjectInfoList();
+        //获取场站数据
+        List<StationInfo> stationInfoList = stationInfoService.selectStationInfo();
+        //循环所有项目于信息
+        //测风塔List
+        ArrayList<Map<String, Object>> towerList = new ArrayList<>();
+        //拐点坐标List
+        ArrayList<List<Coordinates>> coordinateList = new ArrayList<>();
+        //风机List
+        ArrayList<List<FanTower>> fanList = new ArrayList<>();
+        for (ProjectInfo projectInfo : projectInfoList) {
             //拐点坐标
-            dataMap.put("coordinates", projectInfo.getCoordinates());
-            if (projectInfo.getEquipment().size() > 0) {
-                HashMap<String, String> map = new HashMap<>();
+            coordinateList.add(projectInfo.getCoordinates());
+
+            if (projectInfo.getEquipment() != null && projectInfo.getEquipment().size() > 0) {
+                //循环测风塔信息
                 for (Equipment equipment : projectInfo.getEquipment()) {
-                    //经度
+                    HashMap<String, Object> map = new HashMap<>();
                     map.put("longitude", equipment.getLongitude());
                     map.put("latitude", equipment.getLatitude());
                     map.put("towerName", equipment.getName());
-                    arrayList.add(map);
+                    map.put("projectName", projectInfo.getProjectBasicInfo().getProjectNameEasy());
+                    towerList.add(map);
                 }
 
             }
-            //测风塔坐标
-            dataMap.put("towerInfo", arrayList);
         }
+
+        dataMap.put("towerList", towerList);
+        dataMap.put("coordinatesList", coordinateList);
+
+
+        for (StationInfo stationInfo : stationInfoList) {
+
+            if (stationInfo.getEquipment() != null && stationInfo.getEquipment().size() > 0) {
+                //循环测风塔信息
+                ArrayList<Map<String, Object>> arrayList = new ArrayList<>();
+                for (Equipment equipment : stationInfo.getEquipment()) {
+                    HashMap<String, Object> map = new HashMap<>();
+                    map.put("longitude", equipment.getLongitude());
+                    map.put("latitude", equipment.getLatitude());
+                    map.put("towerName", equipment.getName());
+                    map.put("stationName", stationInfo.getStationBasicInfo().getStationName());
+                    arrayList.add(map);
+                }
+                towerList.addAll(arrayList);
+            }
+            fanList.add(stationInfo.getFanTowerList());
+        }
+        dataMap.put("fan", fanList);
+
         return dataMap;
     }
 
+
     /**
      * 项目测风塔下拉框
      *
@@ -869,24 +918,16 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
 
             }
             //过滤塔信息
-            List<Equipment> equipmentList = stationInfoList.get(0).getEquipment();
-            ArrayList<HashMap<String, String>> towerList = new ArrayList<>();
-            if (equipmentList.size() > 0) {
-                for (Equipment equipment : equipmentList) {
-                    HashMap<String, String> towerMap = new HashMap<>();
-                    towerMap.put("name", equipment.getName());
-                    towerMap.put("towerId", equipment.getId());
-                    towerMap.put("equipmentNo", equipment.getEquipmentNo());
-                    towerMap.put("longitude", equipment.getLongitude());
-                    towerMap.put("latitude", equipment.getLatitude());
-                    towerList.add(towerMap);
-                }
-
+            StationInfo stationInfo = stationInfoList.get(0);
+            if (stationInfo.getEquipment() != null && stationInfo.getEquipment().size() > 0) {
+                dataMap.put("longitude", stationInfo.getEquipment().get(0).getLongitude());
+                dataMap.put("latitude", stationInfo.getEquipment().get(0).getLatitude());
+            } else {
+                dataMap.put("longitude", stationInfo.getFanTowerList().get(0).getLongitudeFan());
+                dataMap.put("latitude", stationInfo.getFanTowerList().get(0).getLatitudeFan());
             }
+
             dataMap.put("modelT", arrayList);
-            //风机点位
-            dataMap.put("modelFan", stationInfoList.get(0).getFanTowerList());
-            dataMap.put("tower", towerList);
         }
         return dataMap;
     }
@@ -942,33 +983,45 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
                         projectEvolveDtoOne.setIndex(menusOne.getIndex());
                         projectEvolveDtoOne.setTaskContent(menusOne.getWorkContent());
                         projectEvolveDtoOne.setPlanTime(menusOne.getPlanTime());
-                        projectEvolveDtoOne.setStatus(menusOne.getStatus());
-                        projectEvolveList.add(projectEvolveDtoOne);
-
-                        if (menusOne.getProjectMenusTows() != null && menusOne.getProjectMenusTows().size() > 0) {
-                            //循环二级菜单
-                            for (ProjectMenusTow menusTow : menusOne.getProjectMenusTows()) {
-                                if (menusTow.getProjectMenusThreeList() != null && menusTow.getProjectMenusThreeList().size() > 0) {
-                                    //循环三级菜单
-                                    for (ProjectMenusThree menusThree : menusTow.getProjectMenusThreeList()) {
+                        if (menusOne.getProjectMenusTows().size() > 0 && menusOne.getProjectMenusTows().get(0).getIndex().equals("")) {
+                            if (menusOne.getProjectMenusTows().get(0).getProjectMenusThreeList().size() > 0) {
+                                projectEvolveDtoOne.setStatus(menusOne.getProjectMenusTows().get(0).getProjectMenusThreeList().get(0).getRealTime());
+                                projectEvolveList.add(projectEvolveDtoOne);
+                            }
+                        } else {
+                            projectEvolveList.add(projectEvolveDtoOne);
+                            if (menusOne.getProjectMenusTows() != null && menusOne.getProjectMenusTows().size() > 0) {
+                                //循环二级菜单
+                                for (ProjectMenusTow menusTow : menusOne.getProjectMenusTows()) {
+                                    if (menusTow.getProjectMenusThreeList() != null && menusTow.getProjectMenusThreeList().size() > 0) {
+                                        //循环三级菜单
+                                        for (ProjectMenusThree menusThree : menusTow.getProjectMenusThreeList()) {
+                                            ProjectEvolveDto projectEvolveDto = new ProjectEvolveDto();
+                                            //放入二级序号
+                                            projectEvolveDto.setIndex(menusTow.getIndex());
+                                            //放入二级计划时间
+                                            projectEvolveDto.setPlanTime(menusTow.getPlanTime());
+                                            //放入二级工作内容
+                                            projectEvolveDto.setTaskContent(menusTow.getWorkContent());
+                                            //详细工作信息 三级工作内容
+                                            projectEvolveDto.setDetailedTaskContent(menusThree.getWorkContent());
+                                            //实际完成时间 三级时间
+                                            projectEvolveDto.setRealTime(menusThree.getRealTime());
+                                            //放入状态 三级备注
+                                            projectEvolveDto.setStatus(menusThree.getRemark());
+                                            projectEvolveList.add(projectEvolveDto);
+                                        }
+                                    } else {
                                         ProjectEvolveDto projectEvolveDto = new ProjectEvolveDto();
-                                        //放入二级序号
                                         projectEvolveDto.setIndex(menusTow.getIndex());
-                                        //放入二级计划时间
-                                        projectEvolveDto.setPlanTime(menusOne.getPlanTime());
-                                        //放入二级工作内容
                                         projectEvolveDto.setTaskContent(menusTow.getWorkContent());
-                                        //详细工作信息 三级工作内容
-                                        projectEvolveDto.setDetailedTaskContent(menusThree.getWorkContent());
-                                        //实际完成时间 三级时间
-                                        projectEvolveDto.setRealTime(menusThree.getRealTime());
-                                        //放入状态 三级备注
-                                        projectEvolveDto.setStatus(menusThree.getRemark());
+                                        projectEvolveDto.setPlanTime(menusTow.getPlanTime());
                                         projectEvolveList.add(projectEvolveDto);
                                     }
                                 }
                             }
                         }
+
                     }
                 }