|
|
|
@@ -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; |
|
|
|
} |
|
|
|
|