Ver código fonte

update:私域优惠券限制

ct 3 dias atrás
pai
commit
bdea41a523

+ 7 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsCouponServiceImpl.java

@@ -141,6 +141,13 @@ public class FsCouponServiceImpl implements IFsCouponService
         if(fsUserCouponMapper.checkReceive(param.getUserId(),coupon.getCouponId())>0){
             return R.error("您已领取此券");
         }
+        //判断是否是私域优惠券
+        Integer couponType = coupon.getCouponType();
+        if(couponType!=null && couponType==5){
+            if (param.getCompanyId() == null || param.getCompanyUserId() == null) {
+                return R.error("您无法领取该优惠券");
+            }
+        }
         FsUserCoupon userCoupon=new FsUserCoupon();
         userCoupon.setUserId(param.getUserId());
         userCoupon.setStatus(0);