From 90c7481daf6f761ff4fbf85393bd6422e31727a7 Mon Sep 17 00:00:00 2001 From: xhxu Date: Tue, 13 Jul 2021 18:25:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E9=93=B6=E5=8F=91=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxCouponSendServiceImpl.java | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java index 3ac311515..eb2e4a891 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java @@ -260,32 +260,46 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { if(StringUtils.isBlank(wxCouponSend.getConditions())){ return true; } + if (param.getClass().equals(WxOrder.class)){ WxOrder wxOrder = (WxOrder) param; try { JSONObject jo = JSONObject.parseObject(wxCouponSend.getConditions()); + Long sendId = jo.getLong("id"); + int miniPayment = jo.getIntValue("miniPayment")*100; + if(sendId == null && wxOrder.getPayment().intValue() >= miniPayment){ + return true; + } WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectById(wxOrder.getProductId()); - - if (wxMerchantBUser.getMerchantId() != null - && wxMerchantBUser.getMerchantId().equals(jo.getLong("id"))) { + if (sendId != null && wxMerchantBUser.getMerchantId() != null + && wxMerchantBUser.getMerchantId().equals(sendId) + && wxOrder.getPayment().intValue() >= miniPayment) { return true; } + logger.info("收银台发券条件判断--不满足{}"+wxOrder.getId()); } catch (Exception e) { - logger.error("收银发券条件判断错误:ID=" + wxCouponSend.getId() + e.getMessage()); + logger.error("收银台发券条件判断错误:ID=" + wxCouponSend.getId() + e.getMessage()); } }else if(param instanceof BusinessCircleBase){ BusinessCircleBase circleBase = (BusinessCircleBase) param; try { JSONObject jo = JSONObject.parseObject(wxCouponSend.getConditions()); + Long sendId = jo.getLong("id"); + int miniPayment = jo.getIntValue("miniPayment")*100; + if(sendId == null && circleBase.getPayAmount().intValue() >= miniPayment){ + return true; + } - if (circleBase.getMerchantId() != null - && circleBase.getMerchantId().equals(jo.getLong("id"))) { + if (sendId != null && circleBase.getMerchantId() != null + && circleBase.getMerchantId().equals(sendId) + && circleBase.getPayAmount().intValue() >= miniPayment) { return true; } + logger.info("商圈收银发券条件判断--不满足{}"+circleBase.getId()); } catch (Exception e) { - logger.error("收银发券条件判断错误:ID=" + wxCouponSend.getId() + e.getMessage()); + logger.error("商圈收银条件判断错误:ID=" + wxCouponSend.getId() + e.getMessage()); } } @@ -337,7 +351,6 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { BusinessCircleBase circleBase = (BusinessCircleBase) param; cUserId = circleBase.getCUserId(); tenantEntity = circleBase; - break; }else{ return false; }