| @@ -260,32 +260,46 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||||
| if(StringUtils.isBlank(wxCouponSend.getConditions())){ | if(StringUtils.isBlank(wxCouponSend.getConditions())){ | ||||
| return true; | return true; | ||||
| } | } | ||||
| if (param.getClass().equals(WxOrder.class)){ | if (param.getClass().equals(WxOrder.class)){ | ||||
| WxOrder wxOrder = (WxOrder) param; | WxOrder wxOrder = (WxOrder) param; | ||||
| try { | try { | ||||
| JSONObject jo = JSONObject.parseObject(wxCouponSend.getConditions()); | 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()); | 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; | return true; | ||||
| } | } | ||||
| logger.info("收银台发券条件判断--不满足{}"+wxOrder.getId()); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("收银发券条件判断错误:ID=" + wxCouponSend.getId() + e.getMessage()); | |||||
| logger.error("收银台发券条件判断错误:ID=" + wxCouponSend.getId() + e.getMessage()); | |||||
| } | } | ||||
| }else if(param instanceof BusinessCircleBase){ | }else if(param instanceof BusinessCircleBase){ | ||||
| BusinessCircleBase circleBase = (BusinessCircleBase) param; | BusinessCircleBase circleBase = (BusinessCircleBase) param; | ||||
| try { | try { | ||||
| JSONObject jo = JSONObject.parseObject(wxCouponSend.getConditions()); | 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; | return true; | ||||
| } | } | ||||
| logger.info("商圈收银发券条件判断--不满足{}"+circleBase.getId()); | |||||
| } catch (Exception e) { | } 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; | BusinessCircleBase circleBase = (BusinessCircleBase) param; | ||||
| cUserId = circleBase.getCUserId(); | cUserId = circleBase.getCUserId(); | ||||
| tenantEntity = circleBase; | tenantEntity = circleBase; | ||||
| break; | |||||
| }else{ | }else{ | ||||
| return false; | return false; | ||||
| } | } | ||||