Commit f41d4d75 authored by chenhao's avatar chenhao

提交对于建筑树的帅选

parent 2c4512be
......@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
......@@ -225,7 +226,8 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
if(buildingMapList==null || buildingMapList.size()<1) {
return null;
}
return parseTree((List<Map<String, Object>>)buildingMapList.get(0).get("children"),FireStationCountMap);
List<Map<String, Object>> childrens = ((List<Map<String, Object>>) buildingMapList.get(0).get("children")).stream().filter(i->i.get("bizOrgCode").toString().contains(bizOrgCode)).collect(Collectors.toList());
return parseTree(childrens,FireStationCountMap);
}
@SuppressWarnings("unchecked")
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
......@@ -416,12 +417,13 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
if (buildingMapList == null || buildingMapList.size() < 1) {
return null;
}
Map<String, Object> reMap = parseTree((List<Map<String, Object>>) buildingMapList.get(0).get("children"),
List<Map<String, Object>> childrens = ((List<Map<String, Object>>) buildingMapList.get(0).get("children")).stream().filter(i->i.get("bizOrgCode").toString().contains(bizOrgCode)).collect(Collectors.toList());
Map<String, Object> reMap = parseTree(childrens,
keySiteCountMap, allCount);
Map<String, Object> fristMap = buildingMapList.get(0);
fristMap.put("id", 0);
fristMap.put("name", fristMap.get("instanceName") + " (" + reMap.get("allCount") + ")");
fristMap.put("children", fristMap.get("children"));
fristMap.put("children", reMap.get("children"));
buildingMapList.clear();
buildingMapList.add(fristMap);
return buildingMapList;
......@@ -437,12 +439,12 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
if (keySiteCountMap.containsKey(child.get("id").toString())) {
allCount = allCount + keySiteCountMap.get(child.get("id").toString()).intValue();
child.put("name",
child.get("name") + " (" + keySiteCountMap.get(child.get("id").toString()) + ")");
child.get("name") + "(" + keySiteCountMap.get(child.get("id").toString()) + ")");
} else {
child.put("name", child.get("name") + " (" + 0 + ")");
child.put("name", child.get("name") + "(" + 0 + ")");
}
} else {
child.put("name", child.get("name") + " (" + 0 + ")");
child.put("name", child.get("name") + "(" + 0 + ")");
}
if (!ValidationUtil.isEmpty(child.get("children"))) {
parseTree((List<Map<String, Object>>) child.get("children"), keySiteCountMap, allCount);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment