From b8f21f993fccd58e11bbc34d54565ec62755ad00 Mon Sep 17 00:00:00 2001 From: zhengfangyuan Date: Tue, 22 Nov 2022 15:47:33 +0800 Subject: [PATCH] fix bug --- .../com/iformall/service/impl/WxCouponServiceImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index 4fed358cc..64f49db8f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -1475,10 +1475,14 @@ public class WxCouponServiceImpl implements WxCouponService { } @Override public Map 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,"缺少参数"); } - 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); WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(wxCoupon,plat); if (cAppInfo == null) { @@ -1493,7 +1497,7 @@ public class WxCouponServiceImpl implements WxCouponService { PayShareAdapterService payShareServie = payServiceFactory.getPayShareAdapterService(payWay.getCode(),payAccount.getPayVersion()); //直连模式,如果是单商户券,则都可以;如果是多商户券,抖音则只要开通了支付宝就可以,微信则不行。 if (payMchType == EnumPayMchType.DIRECT) { - if (EnumCouponMerchantType.ONE_MERCHANT.getCode() == wxCoupon.getMerchantType()) { + if (EnumCouponMerchantType.ONE_MERCHANT.getCode() == coupon.getMerchantType()) { return generateMerchantAutoShareAll(wxCoupon.getMerchantIds(),true); }else { if (plat == EnumAppPlat.TOUTIAO) {