Browse Source

fixed 判断可用店铺

fushengqian 1 year ago
parent
commit
e746bb95d2

+ 2 - 1
fuint-application/src/main/java/com/fuint/common/service/impl/CouponServiceImpl.java

@@ -836,7 +836,8 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
         if (StringUtil.isNotEmpty(couponInfo.getStoreIds())) {
             if (StringUtil.isNotEmpty(couponInfo.getStoreIds())) {
                 String[] storeIds = couponInfo.getStoreIds().split(",");
-                if (storeIds.length > 0 && !Arrays.asList(storeIds).contains(orderInfo.getStoreId().toString())) {
+                String useStoreId = (orderInfo != null) ? orderInfo.getStoreId().toString() : (storeId > 0 ? storeId.toString() : "");
+                if (StringUtil.isNotEmpty(useStoreId) && storeIds.length > 0 && !Arrays.asList(storeIds).contains(useStoreId)) {
                     throw new BusinessCheckException("该卡券不能在当前门店使用");
                 }
             }