| @@ -15,7 +15,7 @@ public enum EnumPayWay { | |||||
| PAY_WAY_POS_NEU(11, "POS 东软",EnumPayWayType.NEU_POS,null,EnumCardSpendFrom.POS), | PAY_WAY_POS_NEU(11, "POS 东软",EnumPayWayType.NEU_POS,null,EnumCardSpendFrom.POS), | ||||
| PAY_WAY_NOT_UNPAY_MERCHANT(91, "商户注券,无需支付",null,null,null), | PAY_WAY_NOT_UNPAY_MERCHANT(91, "商户注券,无需支付",null,null,null), | ||||
| PAY_WAY_NOT_UNPAY_VERRIFY(92, "核销发券,无需支付",null,null,null), | PAY_WAY_NOT_UNPAY_VERRIFY(92, "核销发券,无需支付",null,null,null), | ||||
| PAY_WAY_NOT_UNPAY_B_MA(93, "B端扫码支付发券,无需支付",null,null,null), | |||||
| PAY_WAY_NOT_UNPAY_B_MA(93, "支付发券,无需支付",null,null,null), | |||||
| PAY_WAY_NOT_UNPAY_CAR_STOP(94, "停车发券,无需支付",null,null,null), | PAY_WAY_NOT_UNPAY_CAR_STOP(94, "停车发券,无需支付",null,null,null), | ||||
| PAY_WAY_NOT_UNPAY_SYSTEM_SEND(95, "系统定时发放券,无需支付",null,null,null), | PAY_WAY_NOT_UNPAY_SYSTEM_SEND(95, "系统定时发放券,无需支付",null,null,null), | ||||
| PAY_WAY_NOT_UNPAY_BATCH_SEND(96, "后台批量发券,无需支付",null,null,null), | PAY_WAY_NOT_UNPAY_BATCH_SEND(96, "后台批量发券,无需支付",null,null,null), | ||||
| @@ -252,20 +252,35 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||||
| return false; | return false; | ||||
| } else if (wxCouponSend.getSendType().equals(EnumCouponSendSendType.B_MICROPAY.getCode())) { | } else if (wxCouponSend.getSendType().equals(EnumCouponSendSendType.B_MICROPAY.getCode())) { | ||||
| if (param.getClass().equals(WxOrder.class)){ | |||||
| WxOrder wxOrder = (WxOrder) param; | |||||
| WxOrder wxOrder = (WxOrder) param; | |||||
| try { | |||||
| JSONObject jo = JSONObject.parseObject(wxCouponSend.getConditions()); | |||||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectById(wxOrder.getProductId()); | |||||
| try { | |||||
| JSONObject jo = JSONObject.parseObject(wxCouponSend.getConditions()); | |||||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectById(wxOrder.getProductId()); | |||||
| if (wxMerchantBUser.getMerchantId() != null | |||||
| && wxMerchantBUser.getMerchantId().equals(jo.getLong("id"))) { | |||||
| return true; | |||||
| } | |||||
| } catch (Exception e) { | |||||
| logger.error("收银发券条件判断错误:ID=" + wxCouponSend.getId() + e.getMessage()); | |||||
| } | |||||
| }else if(param.getClass().equals(WxThirdPartyOrders.class)){ | |||||
| WxThirdPartyOrders thirdOrder = (WxThirdPartyOrders) param; | |||||
| if (wxMerchantBUser.getMerchantId() != null | |||||
| && wxMerchantBUser.getMerchantId().equals(jo.getLong("id"))) { | |||||
| return true; | |||||
| try { | |||||
| JSONObject jo = JSONObject.parseObject(wxCouponSend.getConditions()); | |||||
| if (thirdOrder.getMerchantId() != null | |||||
| && thirdOrder.getMerchantId().equals(jo.getLong("id"))) { | |||||
| return true; | |||||
| } | |||||
| } catch (Exception e) { | |||||
| logger.error("收银发券条件判断错误:ID=" + wxCouponSend.getId() + e.getMessage()); | |||||
| } | } | ||||
| } catch (Exception e) { | |||||
| logger.error("收银发券条件判断错误:ID=" + wxCouponSend.getId() + e.getMessage()); | |||||
| } | } | ||||
| return false; | return false; | ||||
| } else if (wxCouponSend.getSendType().equals(EnumCouponSendSendType.COUPON_VERIFY.getCode())) { | } else if (wxCouponSend.getSendType().equals(EnumCouponSendSendType.COUPON_VERIFY.getCode())) { | ||||
| @@ -47,6 +47,8 @@ public class WxThirdPartyOrdersServiceImpl implements WxThirdPartyOrdersService | |||||
| @Autowired | @Autowired | ||||
| WxCreditHistoryService wxCreditHistoryService; | WxCreditHistoryService wxCreditHistoryService; | ||||
| @Autowired | |||||
| WxCouponSendService wxCouponSendService; | |||||
| @Override | @Override | ||||
| @@ -172,6 +174,12 @@ public class WxThirdPartyOrdersServiceImpl implements WxThirdPartyOrdersService | |||||
| record.setPointsUpdateTime(creditHistory.getCreateDate()); | record.setPointsUpdateTime(creditHistory.getCreateDate()); | ||||
| this.updatePoints(record); | this.updatePoints(record); | ||||
| } | } | ||||
| try { | |||||
| wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.B_MICROPAY, record,EnumPayWay.PAY_WAY_NOT_UNPAY_B_MA); | |||||
| } catch (Exception e) { | |||||
| logger.error("B端刷卡支付发券: " + e.getMessage()); | |||||
| } | |||||
| redisLock.unlock(lockKey, timeStr); | redisLock.unlock(lockKey, timeStr); | ||||
| }else { | }else { | ||||
| logger.debug("CacheAspect 读库等待中, key:{}: " + lockKey); | logger.debug("CacheAspect 读库等待中, key:{}: " + lockKey); | ||||