From 71cfd413f5e34ac24d9278a21d283f13155b9596 Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 26 Mar 2019 23:41:00 +0800 Subject: [PATCH] =?UTF-8?q?[=E8=90=A5=E9=94=80=E6=95=B0=E6=8D=AE][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E7=A0=8D=E4=BB=B7=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E7=8E=87=E5=8A=A0=E7=A7=9F=E6=88=B7id]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/service/impl/WxChartServiceImpl.java | 1 + .../com/iformall/service/impl/WxCouponServiceImpl.java | 4 ++-- .../src/main/resources/mapper/WxCouponMapper.xml | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) 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)