Commit e18635ffa3d555b625eb23c3e91dde33c6da7815

Authored by litao
1 parent fcc1199f49

bug修复 null转换为0

Showing 2 changed files with 20 additions and 5 deletions

platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml View file @ e18635f
... ... @@ -246,10 +246,10 @@
246 246 and f.id = #{tempId}
247 247 </if>
248 248 <if test="startDate != null">
249   - and b.create_date >= #{startDate}
  249 + and b.use_date >= #{startDate}
250 250 </if>
251 251 <if test="endDate != null">
252   - and b.create_date <![CDATA[ < ]]> #{endDate}
  252 + and b.use_date <![CDATA[ < ]]> #{endDate}
253 253 </if>
254 254 </select>
255 255  
256 256  
... ... @@ -266,10 +266,10 @@
266 266 and f.id = #{tempId}
267 267 </if>
268 268 <if test="startDate != null">
269   - and b.used_hospital_id >= #{startDate}
  269 + and b.create_date >= #{startDate}
270 270 </if>
271 271 <if test="endDate != null">
272   - and b.used_hospital_id <![CDATA[ < ]]> #{endDate}
  272 + and b.create_date <![CDATA[ < ]]> #{endDate}
273 273 </if>
274 274 </select>
275 275  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ e18635f
... ... @@ -486,6 +486,7 @@
486 486 reportModel.doMerge();
487 487  
488 488 Map<String, Object> titleMap = parseTitle(couponReport);
  489 + transNullToZero(couponReport, titleMap);
489 490  
490 491 return RespBuilder.buildSuccess("couponReport", couponReport, "couponReportMap", titleMap, "reportModel", reportModel);
491 492 // return RespBuilder.buildSuccess(couponReport);
... ... @@ -589,7 +590,7 @@
589 590 tempMap.put("area_name", areaName);
590 591  
591 592 /** 没传区县 报表数据就为区域的 */
592   - if(param.get("area_id") == null) {
  593 + if(param.get("areaId") == null) {
593 594 xAxis.add(areaName);
594 595 } else { /** 传了区县 报表数据就为医院 */
595 596 xAxis.add((String) hNameMap.get(hid));
... ... @@ -607,6 +608,20 @@
607 608 List<String> hospitalIds = couponMapper.doHospitalFilter(param);
608 609 param.put("hospitalId", hospitalIds);
609 610 }
  611 +
  612 + private void transNullToZero(List<Map<String, Object>> couponReport, Map<String, Object> titleMap) {
  613 + if(org.apache.commons.collections.CollectionUtils.isNotEmpty(couponReport)
  614 + && org.apache.commons.collections.MapUtils.isNotEmpty(titleMap))
  615 + for (Map<String, Object> coupon : couponReport) {
  616 + Set<String> set = titleMap.keySet();
  617 + for (String s : set) {
  618 + if(coupon.get(s) == null) {
  619 + coupon.put(s, 0);
  620 + }
  621 + }
  622 + }
  623 + }
  624 +
610 625  
611 626 private Map<String,Object> parseTitle(List<Map<String, Object>> couponReport) {
612 627 Map<String, Object> titleMap = new HashMap<>();