zy преди 2 години
родител
ревизия
12b94e05d6
променени са 1 файла, в които са добавени 15 реда и са изтрити 5 реда
  1. 15 5
      neim-biz/src/main/java/com/jiayue/biz/service/impl/HomePageServiceImpl.java

+ 15 - 5
neim-biz/src/main/java/com/jiayue/biz/service/impl/HomePageServiceImpl.java

@@ -718,13 +718,15 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
         //测风塔List
         HashSet<Map<String, Object>> towerList = new HashSet<>();
         //拐点坐标List
-        ArrayList<List<List<Coordinates>>> coordinateList = new ArrayList<>();
+        ArrayList<Map<String,List<List<Coordinates>>>> coordinateList = new ArrayList<>();
         //风机List
-        ArrayList<FanTower> fanList = new ArrayList<>();
+        List<HashMap<String, Object>> fanList = new ArrayList<>();
         HashSet<String> eqNoList = new HashSet<>();
         for (ProjectInfo projectInfo : projectInfoList) {
+            Map<String,List<List<Coordinates>>> cmap = new HashMap<>();
+            cmap.put(projectInfo.getProjectBasicInfo().getProjectNameEasy(),projectInfo.getCoordinates());
             //拐点坐标
-            coordinateList.add(projectInfo.getCoordinates());
+            coordinateList.add(cmap);
 
             if (projectInfo.getEquipment() != null && projectInfo.getEquipment().size() > 0) {
                 //循环测风塔信息
@@ -746,7 +748,6 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
         dataMap.put("coordinatesList", coordinateList);
 
         for (StationInfo stationInfo : stationInfoList) {
-
             if (stationInfo.getEquipment() != null && stationInfo.getEquipment().size() > 0) {
                 //循环测风塔信息
                 ArrayList<Map<String, Object>> arrayList = new ArrayList<>();
@@ -763,7 +764,15 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
                 }
                 towerList.addAll(arrayList);
             }
-            fanList.addAll(stationInfo.getFanTowerList());
+            Map<String, List<FanTower>> collect = stationInfo.getFanTowerList().stream().collect(Collectors.groupingBy(FanTower::getFanModel));
+            for (Map.Entry<String, List<FanTower>> entry : collect.entrySet()) {
+                HashMap<String, Object> map = new HashMap<>();
+                List<FanTower> collect1 = stationInfo.getFanTowerList().stream().filter(w -> w.getFanModel().equals(entry.getKey())).collect(Collectors.toList());
+                map.put("type","station");
+                map.put("name",stationInfo.getStationBasicInfo().getStationName());
+                map.put("data",collect1);
+                fanList.add(map);
+            }
         }
 
         List<Map<String, Object>> listMap = new ArrayList<>();
@@ -846,6 +855,7 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
                     hashMap.put("longitude", stationInfo.getStationBasicInfo().getLongitude());
                     //纬度
                     hashMap.put("latitude", stationInfo.getStationBasicInfo().getLatitude());
+                    hashMap.put("type", stationInfo.getStationBasicInfo().getStationType());
                     arrayList.add(hashMap);
                 }
                 stationMap.put("station", arrayList);