| @@ -1475,10 +1475,14 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public Map<Long, Boolean> couponMerchantAutoShare(WxCoupon wxCoupon) throws Exception { | public Map<Long, Boolean> couponMerchantAutoShare(WxCoupon wxCoupon) throws Exception { | ||||
| if (null == wxCoupon.getMerchantIds() || null == wxCoupon.getId() || null == wxCoupon.getType() || null == wxCoupon.getMerchantType()) { | |||||
| if (null == wxCoupon.getMerchantIds() || null == wxCoupon.getId()) { | |||||
| throw new MallinkException(Result.ERROR,"缺少参数"); | throw new MallinkException(Result.ERROR,"缺少参数"); | ||||
| } | } | ||||
| EnumAppPlat plat = EnumCouponType.getAppPlat(wxCoupon.getType()); | |||||
| WxCoupon coupon = wxCouponMapper.selectById(wxCoupon.getId(), wxCoupon.getTenantId()); | |||||
| if (null == coupon) { | |||||
| throw new MallinkException(Result.ERROR,"未查询到券"); | |||||
| } | |||||
| EnumAppPlat plat = EnumCouponType.getAppPlat(coupon.getType()); | |||||
| EnumPayWay payWay = EnumAppPlat.getPayWay(plat); | EnumPayWay payWay = EnumAppPlat.getPayWay(plat); | ||||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(wxCoupon,plat); | WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(wxCoupon,plat); | ||||
| if (cAppInfo == null) { | if (cAppInfo == null) { | ||||
| @@ -1493,7 +1497,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| PayShareAdapterService payShareServie = payServiceFactory.getPayShareAdapterService(payWay.getCode(),payAccount.getPayVersion()); | PayShareAdapterService payShareServie = payServiceFactory.getPayShareAdapterService(payWay.getCode(),payAccount.getPayVersion()); | ||||
| //直连模式,如果是单商户券,则都可以;如果是多商户券,抖音则只要开通了支付宝就可以,微信则不行。 | //直连模式,如果是单商户券,则都可以;如果是多商户券,抖音则只要开通了支付宝就可以,微信则不行。 | ||||
| if (payMchType == EnumPayMchType.DIRECT) { | if (payMchType == EnumPayMchType.DIRECT) { | ||||
| if (EnumCouponMerchantType.ONE_MERCHANT.getCode() == wxCoupon.getMerchantType()) { | |||||
| if (EnumCouponMerchantType.ONE_MERCHANT.getCode() == coupon.getMerchantType()) { | |||||
| return generateMerchantAutoShareAll(wxCoupon.getMerchantIds(),true); | return generateMerchantAutoShareAll(wxCoupon.getMerchantIds(),true); | ||||
| }else { | }else { | ||||
| if (plat == EnumAppPlat.TOUTIAO) { | if (plat == EnumAppPlat.TOUTIAO) { | ||||