Commit ad5afc6649a3769b320c829b35074d9e0b9ea56f
1 parent
531604a8aa
Exists in
master
and in
6 other branches
bug
xiufu
Showing 2 changed files with 24 additions and 20 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
ad5afc6
... | ... | @@ -452,7 +452,7 @@ |
452 | 452 | |
453 | 453 | if(org.apache.commons.collections.CollectionUtils.isNotEmpty(couponReport) && |
454 | 454 | org.apache.commons.collections.CollectionUtils.isNotEmpty(usedInfo)) { |
455 | - if(CollectionUtils.putAll(couponReport, usedInfo, "create_hospital_id", "used_hospital_id")) { | |
455 | + if(CollectionUtils.putAll(couponReport, usedInfo, "used_hospital_id", "used_hospital_id")) { | |
456 | 456 | for (Map<String, Object> map : couponReport) { |
457 | 457 | map.put("province_name", findName(map.get("province_id"))); |
458 | 458 | map.put("city_name", findName(map.get("city_id"))); |
... | ... | @@ -462,7 +462,7 @@ |
462 | 462 | xAxis.add(areaName); |
463 | 463 | } |
464 | 464 | } else{ |
465 | - return RespBuilder.buildErro(ResponseCode.DATA_ERROR); | |
465 | +// return RespBuilder.buildErro(ResponseCode.DATA_ERROR); | |
466 | 466 | } |
467 | 467 | } |
468 | 468 | |
469 | 469 | |
470 | 470 | |
... | ... | @@ -491,23 +491,23 @@ |
491 | 491 | |
492 | 492 | |
493 | 493 | private List<Series> createSeries(List<Map<String, Object>> couponReport) { |
494 | - List<Series> seriesList = new ArrayList<>(); | |
495 | - for (Map<String, Object> coupon : couponReport) { | |
496 | - /** 设置发放券数 */ | |
497 | - Series series = new Series(); | |
498 | - series.setName("发放券数"); | |
499 | - series.setType("bar"); | |
500 | - series.setData(Arrays.asList(coupon.get("coupon_send_count"))); | |
501 | - seriesList.add(series); | |
494 | + Series couponSendCount = new Series(); | |
495 | + couponSendCount.setName("发放券数"); | |
496 | + couponSendCount.setType("bar"); | |
497 | + couponSendCount.setData(new ArrayList<>()); | |
502 | 498 | |
503 | - /** 设置使用券数 */ | |
504 | - Series s = new Series(); | |
505 | - s.setName("使用券数"); | |
506 | - s.setType("bar"); | |
507 | - s.setData(Arrays.asList(coupon.get("people_send_count"))); | |
508 | - seriesList.add(s); | |
499 | + Series peopleUsedCount = new Series(); | |
500 | + peopleUsedCount.setName("使用券数"); | |
501 | + peopleUsedCount.setType("bar"); | |
502 | + peopleUsedCount.setData(new ArrayList<>()); | |
503 | + | |
504 | + for (Map<String, Object> coupon : couponReport) { | |
505 | + Object coupon_send_count = coupon.get("coupon_send_count"); | |
506 | + couponSendCount.getData().add(coupon_send_count == null ? 0 : coupon_send_count); | |
507 | + Object coupon_used_count = coupon.get("coupon_used_count"); | |
508 | + peopleUsedCount.getData().add(coupon_used_count == null ? 0: coupon_used_count); | |
509 | 509 | } |
510 | - return seriesList; | |
510 | + return Arrays.asList(couponSendCount, peopleUsedCount); | |
511 | 511 | } |
512 | 512 | |
513 | 513 | @Override |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java
View file @
ad5afc6
... | ... | @@ -52,9 +52,13 @@ |
52 | 52 | boolean modified = false; |
53 | 53 | for (Map<String, Object> mapOne : listOne) { |
54 | 54 | for (Map<String, Object> mapTwo : listTwo) { |
55 | - if(mapOne.get(oneKey).toString().equals(mapTwo.get(twoKey).toString())) { | |
56 | - putCouponInfo(mapOne, mapTwo); | |
57 | - modified = true; | |
55 | + String oneKeyVal = (String) mapOne.get(oneKey); | |
56 | + String twoKeyVal = (String) mapTwo.get(twoKey); | |
57 | + if(StringUtils.isNotEmpty(oneKeyVal) && StringUtils.isNotEmpty(twoKeyVal)) { | |
58 | + if(oneKeyVal.equals(twoKeyVal)) { | |
59 | + putCouponInfo(mapOne, mapTwo); | |
60 | + modified = true; | |
61 | + } | |
58 | 62 | } |
59 | 63 | } |
60 | 64 | } |