限时折扣 互斥
This commit is contained in:
@@ -62,13 +62,18 @@ public class MkDiscountActivityServiceImpl extends ServiceImpl<MkDiscountActivit
|
||||
}
|
||||
|
||||
@Override
|
||||
public MkDiscountActivityDTO checkDiscountAct(Long shopId, boolean couponShare, boolean vipShare, boolean pointsShare) {
|
||||
public MkDiscountActivityDTO checkDiscountAct(Long shopId, boolean couponShare, boolean vipShare, boolean limitRateShare, boolean pointsShare) {
|
||||
MkDiscountActivityDTO activityDTO = getActivityByShopId(shopId);
|
||||
AssertUtil.isNull(activityDTO, "店铺未配置满减活动");
|
||||
//检查是否开启了优惠券抵扣
|
||||
if (couponShare && activityDTO.getCouponShare() == 0) {
|
||||
throw new CzgException("满减活动与优惠券不可共用");
|
||||
}
|
||||
//检查是否开启了限时折扣
|
||||
if (limitRateShare && activityDTO.getDiscountShare() == 0) {
|
||||
throw new CzgException("满减活动与限时折扣不可共用");
|
||||
|
||||
}
|
||||
//检查是否开启了会员抵扣
|
||||
if (vipShare && activityDTO.getVipPriceShare() == 0) {
|
||||
throw new CzgException("满减活动与会员价不可共用");
|
||||
@@ -87,7 +92,7 @@ public class MkDiscountActivityServiceImpl extends ServiceImpl<MkDiscountActivit
|
||||
if (shopInfo.getIsEnableDiscount() == null || shopInfo.getIsEnableDiscount() == 0) {
|
||||
return null;
|
||||
}
|
||||
MkDiscountActivity activity = mapper.selectOneByShopId(shopId,CzgStrUtils.getStrWeek());
|
||||
MkDiscountActivity activity = mapper.selectOneByShopId(shopId, CzgStrUtils.getStrWeek());
|
||||
if (activity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user