diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java index fa3822180..4f4546088 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java @@ -1611,6 +1611,7 @@ public class WxChartServiceImpl implements WxChartDataService { result.put("pressSuccHistory",pressSuccHistoryMap); result.put("pressPaymentHistory",pressPaymentHistoryMap); + wxCoupon.setTenantId(tenantId); result.put("pressSuccRate",wxCouponService.pressSuccRate(wxCoupon)); result.put("sumJoin",wxCouponService.sumJoin(wxCoupon)); return new ResultData(result); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index 483d3cebb..d71556567 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -409,8 +409,8 @@ public class WxCouponServiceImpl implements WxCouponService { @Override public String pressSuccRate(WxCoupon wxCoupon) { String count = wxCouponMapper.pressSuccRate(wxCoupon); - if ("0.00".equals(count)) { - return "0%"; + if (StringUtils.isBlank(count) || "0.00".equals(count)) { + return "0%"; } else { return count + "%"; } diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 32ed345c6..7f5bda582 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -697,13 +697,16 @@ (select count(wo.id) from wx_coupon wc left join wx_order wo on wo.product_id = wc.id where wo.order_status = 1 and wc.type = 8 - and wo.create_date between #{startdate} and #{enddate}) + and wo.create_date between #{startdate} and #{enddate} + and wo.tenant_id = #{tenantId} + ) / (select count(wop.id) from wx_coupon wc left join wx_order wo on wo.product_id = wc.id left join wx_order_press wop on wop.order_id = wo.id where wop.first = 1 and wc.type = 8 - and wop.create_date between #{startdate} and #{enddate}) + and wop.create_date between #{startdate} and #{enddate} + and wo.tenant_id = #{tenantId} and wop.tenant_id = #{tenantId}) * 100 ,2)