Commit b8ae9ba9d089abb1e9b2fea82f373fa7de35ad27
1 parent
d7893b2245
Exists in
master
and in
6 other branches
统计
Showing 2 changed files with 37 additions and 37 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
View file @
b8ae9ba
... | ... | @@ -282,24 +282,18 @@ |
282 | 282 | String permission = permissionsModelList.get(0).getAreaPermission(); |
283 | 283 | System.out.println("permission======" + permission); |
284 | 284 | |
285 | - String parentId = ""; | |
286 | 285 | if (StringUtils.isNotEmpty(countRequest.getProvinceId())) |
287 | 286 | { |
288 | 287 | basicQuery.setParentId(countRequest.getProvinceId()); |
289 | 288 | countRequest.setExportType(1); |
290 | - parentId = countRequest.getProvinceId(); | |
291 | 289 | } |
292 | 290 | |
293 | 291 | if (StringUtils.isNotEmpty(countRequest.getCityId())) |
294 | 292 | { |
295 | 293 | basicQuery.setParentId(countRequest.getCityId()); |
296 | 294 | countRequest.setExportType(2); |
297 | - parentId = countRequest.getCityId(); | |
298 | 295 | } |
299 | 296 | |
300 | - //获取地址列表 | |
301 | - List<Map<String, Object>> list = mongoUtil.getChilds(parentId,null); | |
302 | - | |
303 | 297 | if (StringUtils.isNotEmpty(countRequest.getAreaId())) |
304 | 298 | { |
305 | 299 | basicQuery.setParentId(countRequest.getAreaId()); |
306 | 300 | |
307 | 301 | |
308 | 302 | |
... | ... | @@ -315,29 +309,35 @@ |
315 | 309 | //用于存在没有机构的区域Id |
316 | 310 | List<String> addrId = new ArrayList<>(); |
317 | 311 | |
318 | -// | |
319 | -// List<String> childsId = new ArrayList<>(); | |
320 | -// | |
321 | -// if (addrType == 1) | |
322 | -// { | |
323 | -// if (StringUtils.isNotEmpty(permission)) | |
324 | -// { | |
325 | -// List<Map> permissions = JsonUtil.toList(permission,Map.class); | |
326 | -// } | |
327 | -// } | |
328 | -// else if(addrType == 2) | |
329 | -// { | |
330 | -// } | |
331 | -// else | |
332 | -// { | |
333 | -// } | |
334 | -// | |
335 | -// if (addrType < 3) | |
336 | -// { | |
337 | -// } | |
338 | 312 | |
313 | + //权限的id | |
314 | + List<String> childsId = new ArrayList<>(); | |
339 | 315 | |
316 | + if (StringUtils.isNotEmpty(permission)) { | |
317 | + List<Map> permissions = JsonUtil.toList(permission, Map.class); | |
318 | + if (CollectionUtils.isNotEmpty(permissions)) | |
319 | + { | |
320 | + for (Map map : permissions) | |
321 | + { | |
322 | + if (addrType == 1) | |
323 | + { | |
324 | + String c = String.valueOf(map.get("c")); | |
325 | + childsId.add(c); | |
326 | + } | |
327 | + else if (addrType == 2) | |
328 | + { | |
329 | + String a = String.valueOf(map.get("a")); | |
330 | + childsId.add(a); | |
331 | + } | |
340 | 332 | |
333 | + } | |
334 | + } | |
335 | + } | |
336 | + basicQuery.setIds(childsId); | |
337 | + | |
338 | + //获取地址列表 | |
339 | + List<BasicConfig> configList = basicConfigService.queryBasicConfig(basicQuery); | |
340 | + | |
341 | 341 | //序列号 |
342 | 342 | int seq = 0; |
343 | 343 | |
... | ... | @@ -347,7 +347,7 @@ |
347 | 347 | //统计城市和区县表格数据 |
348 | 348 | if (addrType < 3) |
349 | 349 | { |
350 | - List<BasicConfig> configList = basicConfigService.queryBasicConfig(basicQuery); | |
350 | + | |
351 | 351 | OrganizationQuery query = new OrganizationQuery(); |
352 | 352 | query.setYn(YnEnums.YES.getId()); |
353 | 353 | if (CollectionUtils.isNotEmpty(configList)) |
354 | 354 | |
355 | 355 | |
356 | 356 | |
... | ... | @@ -567,15 +567,15 @@ |
567 | 567 | |
568 | 568 | if (addrType < 3) |
569 | 569 | { |
570 | - if (CollectionUtils.isNotEmpty(list)) | |
570 | + if (CollectionUtils.isNotEmpty(configList)) | |
571 | 571 | { |
572 | - for (Map<String, Object> addr : list) | |
572 | + for (BasicConfig addr : configList) | |
573 | 573 | { |
574 | - if (addrId.contains(String.valueOf(addr.get("id")) + String.valueOf(addr.get("name")))) | |
574 | + if (addrId.contains(addr.getId() + addr.getName())) | |
575 | 575 | { |
576 | 576 | continue; |
577 | 577 | } |
578 | - xAxis.add(String.valueOf(addr.get("name"))); | |
578 | + xAxis.add(addr.getName()); | |
579 | 579 | } |
580 | 580 | for (BasicConfig config : riskLevelConfig) |
581 | 581 | { |
582 | 582 | |
583 | 583 | |
... | ... | @@ -588,14 +588,14 @@ |
588 | 588 | |
589 | 589 | List<String> items = new ArrayList<>(); |
590 | 590 | |
591 | - for (Map<String, Object> addr : list) | |
591 | + for (BasicConfig addr : configList) | |
592 | 592 | { |
593 | - if (addrId.contains(String.valueOf(addr.get("id")) + String.valueOf(addr.get("name")))) | |
593 | + if (addrId.contains(addr.getId() + addr.getName())) | |
594 | 594 | { |
595 | 595 | continue; |
596 | 596 | } |
597 | 597 | |
598 | - String id = String.valueOf(addr.get("id")); | |
598 | + String id = addr.getId(); | |
599 | 599 | if (addrType == 1) |
600 | 600 | { |
601 | 601 | idQuery.setCityId(id); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java
View file @
b8ae9ba
... | ... | @@ -66,13 +66,13 @@ |
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | - public List<Map<String, Object>> getChilds(String parentId,String childId) { | |
69 | + public List<Map<String, Object>> getChilds(String parentId,List<String> childIds) { | |
70 | 70 | List<Map<String, Object>> childList = new ArrayList<>(); |
71 | 71 | |
72 | 72 | Criteria c = Criteria.where("parentId").is(parentId); |
73 | - if (StringUtils.isNotEmpty(childId)) | |
73 | + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(childIds)) | |
74 | 74 | { |
75 | - c.and("id").is(childId); | |
75 | + c.and("id").in(childIds); | |
76 | 76 | } |
77 | 77 | c.and("typeId").is("b7ea005c-dfac-4c2a-bdae-25239b3f44fd"); |
78 | 78 |