Commit 604aee3604af68b488329d5f4b63cf7a405df1bc

Authored by wtt
1 parent 48d76ab055

update

Showing 1 changed file with 7 additions and 5 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java View file @ 604aee3
... ... @@ -447,16 +447,11 @@
447 447  
448 448 List<BabyStatisticsManagerWeekAgeGroupQueryModel> babyStatisticsManagerWeekAgeGroupQueryModelList = new ArrayList<>();
449 449  
450   - Integer counts = 0;
451 450 if (CollectionUtils.isNotEmpty(temp)) {
452 451 for (HashMap hashMap : temp) {
453 452 BabyStatisticsManagerWeekAgeGroupQueryModel babyStatisticsManagerWeekAgeGroupQueryModel = new BabyStatisticsManagerWeekAgeGroupQueryModel();
454 453 babyStatisticsManagerWeekAgeGroupQueryModel.setWeekAge(hashMap.get("_id") == null ? null : hashMap.get("_id").toString());
455 454 babyStatisticsManagerWeekAgeGroupQueryModel.setCount(hashMap.get("count").toString());
456   - if(hashMap.get("count") !=null && !"0".equals(hashMap.get("count").toString())){
457   - counts += Integer.parseInt(hashMap.get("count").toString());
458   - }
459   -
460 455 babyStatisticsManagerWeekAgeGroupQueryModelList.add(babyStatisticsManagerWeekAgeGroupQueryModel);
461 456 }
462 457 }
463 458  
... ... @@ -514,8 +509,15 @@
514 509 }
515 510 }
516 511 Map map = new HashMap();
  512 + Integer counts = 0;
  513 +
517 514 // babyStatisticsManagerWeekAgeGroupResult.setData(babyStatisticsManagerWeekAgeGroupQueryModelListResult);
518 515 map.put("babyStatisticsManagerWeekAgeGroupQueryModelListResult", babyStatisticsManagerWeekAgeGroupQueryModelListResult);
  516 + for (BabyStatisticsManagerWeekAgeGroupQueryModel b:babyStatisticsManagerWeekAgeGroupQueryModelListResult) {
  517 + if(StringUtils.isNotEmpty(b.getCount()) && !"0".equals(b.getCount())){
  518 + counts += Integer.parseInt(b.getCount());
  519 + }
  520 + }
519 521 map.put("counts", counts);
520 522 babyStatisticsManagerWeekAgeGroupResult.setObject(map);
521 523 babyStatisticsManagerWeekAgeGroupResult.setErrorcode(ErrorCodeConstants.SUCCESS);