Commit e73c1624 authored by chenzhao's avatar chenzhao

修改bug

parent 4270fc15
...@@ -391,11 +391,16 @@ public class DataSourcesImpl implements DataSources { ...@@ -391,11 +391,16 @@ public class DataSourcesImpl implements DataSources {
} }
private String[] getBuildingList() { private String[] getBuildingList() {
List<MenuFrom> buildingList = equipmentService.getBuildingList(); // 导出模板增加权限
List<String> buildingNames = buildingList.stream().map(item -> { ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
return item.getName() + "@" + item.getKey(); String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
ResponseModel<Object> response = equipFeignClient.getBuildingTree();
List<Map<String, Object>> buildingMapList = (List<Map<String, Object>>) response.getResult();
List<Map<String, Object>> children = (List<Map<String, Object>>) buildingMapList.get(0).get("children");
List<String> collect = children.stream().filter(result -> result.get("bizOrgCode").toString().startsWith(bizOrgCode)).map(itme -> {
return itme.get("name") + "@" + itme.get("id");
}).collect(Collectors.toList()); }).collect(Collectors.toList());
String[] str = buildingNames.toArray(new String[buildingNames.size()]); String[] str = collect.toArray(new String[collect.size()]);
return str; return str;
} }
......
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