diff --git a/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml b/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml index d84bb74..88261ae 100644 --- a/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml +++ b/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml @@ -246,10 +246,10 @@ and f.id = #{tempId} - and b.create_date >= #{startDate} + and b.use_date >= #{startDate} - and b.create_date #{endDate} + and b.use_date #{endDate} @@ -266,10 +266,10 @@ and f.id = #{tempId} - and b.used_hospital_id >= #{startDate} + and b.create_date >= #{startDate} - and b.used_hospital_id #{endDate} + and b.create_date #{endDate} diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java index d32cdbd..7643a25 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java @@ -486,6 +486,7 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService reportModel.doMerge(); Map titleMap = parseTitle(couponReport); + transNullToZero(couponReport, titleMap); return RespBuilder.buildSuccess("couponReport", couponReport, "couponReportMap", titleMap, "reportModel", reportModel); // return RespBuilder.buildSuccess(couponReport); @@ -589,7 +590,7 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService tempMap.put("area_name", areaName); /** 没传区县 报表数据就为区域的 */ - if(param.get("area_id") == null) { + if(param.get("areaId") == null) { xAxis.add(areaName); } else { /** 传了区县 报表数据就为医院 */ xAxis.add((String) hNameMap.get(hid)); @@ -608,6 +609,20 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService param.put("hospitalId", hospitalIds); } + private void transNullToZero(List> couponReport, Map titleMap) { + if(org.apache.commons.collections.CollectionUtils.isNotEmpty(couponReport) + && org.apache.commons.collections.MapUtils.isNotEmpty(titleMap)) + for (Map coupon : couponReport) { + Set set = titleMap.keySet(); + for (String s : set) { + if(coupon.get(s) == null) { + coupon.put(s, 0); + } + } + } + } + + private Map parseTitle(List> couponReport) { Map titleMap = new HashMap<>(); for (Map map : couponReport) {