|
@@ -44,8 +44,6 @@ import java.util.stream.Collectors;
|
|
public class CouponServiceImpl extends AbstractPromotionServiceImpl<CouponMapper, Coupon> implements CouponService,
|
|
public class CouponServiceImpl extends AbstractPromotionServiceImpl<CouponMapper, Coupon> implements CouponService,
|
|
com.chelvc.cloud.vehicle.api.service.CouponService {
|
|
com.chelvc.cloud.vehicle.api.service.CouponService {
|
|
|
|
|
|
- private final GoodsService goodsService;
|
|
|
|
- private final UserCouponService userCouponService;
|
|
|
|
private final CouponActivityItemService couponActivityItemService;
|
|
private final CouponActivityItemService couponActivityItemService;
|
|
private final PromotionGoodsService promotionGoodsService;
|
|
private final PromotionGoodsService promotionGoodsService;
|
|
private final FullDiscountService fullDiscountService;
|
|
private final FullDiscountService fullDiscountService;
|
|
@@ -78,8 +76,8 @@ public class CouponServiceImpl extends AbstractPromotionServiceImpl<CouponMapper
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void deleteCoupon(@NonNull Long id) {
|
|
public void deleteCoupon(@NonNull Long id) {
|
|
- ResourceUtils.required(this.getById(id), "商品优惠卷不存在");
|
|
|
|
- this.baseMapper.deleteById(id);
|
|
|
|
|
|
+ ResourceUtils.required(this.getById(id), "商品优惠券不存在");
|
|
|
|
+ this.baseMapper.logicDelete(id);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -138,7 +136,7 @@ public class CouponServiceImpl extends AbstractPromotionServiceImpl<CouponMapper
|
|
@Override
|
|
@Override
|
|
public void batchDeleteCoupon(@NonNull List<Long> ids) {
|
|
public void batchDeleteCoupon(@NonNull List<Long> ids) {
|
|
// 关闭用户优惠券信息
|
|
// 关闭用户优惠券信息
|
|
- this.userCouponService.closeUserCoupon(ids);
|
|
|
|
|
|
+// this.userCouponService.closeUserCoupon(ids);
|
|
// 删除优惠券关联优惠券活动
|
|
// 删除优惠券关联优惠券活动
|
|
this.couponActivityItemService.removeByCouponId(ids);
|
|
this.couponActivityItemService.removeByCouponId(ids);
|
|
super.removePromotion(ids);
|
|
super.removePromotion(ids);
|
|
@@ -188,7 +186,7 @@ public class CouponServiceImpl extends AbstractPromotionServiceImpl<CouponMapper
|
|
// 关闭优惠券,删除相关会员优惠券和券活动
|
|
// 关闭优惠券,删除相关会员优惠券和券活动
|
|
if (startTime == null && endTime == null) {
|
|
if (startTime == null && endTime == null) {
|
|
//关闭用户优惠券信息
|
|
//关闭用户优惠券信息
|
|
- this.userCouponService.closeUserCoupon(ids);
|
|
|
|
|
|
+// this.userCouponService.closeUserCoupon(ids);
|
|
//删除优惠券关联优惠券活动
|
|
//删除优惠券关联优惠券活动
|
|
this.couponActivityItemService.removeByCouponId(ids);
|
|
this.couponActivityItemService.removeByCouponId(ids);
|
|
}
|
|
}
|
|
@@ -314,7 +312,7 @@ public class CouponServiceImpl extends AbstractPromotionServiceImpl<CouponMapper
|
|
throw new ResourceUnavailableException("指定商品范围关联id不能为空");
|
|
throw new ResourceUnavailableException("指定商品范围关联id不能为空");
|
|
}
|
|
}
|
|
for (String id : split) {
|
|
for (String id : split) {
|
|
- Goods goods = goodsService.getById(id);
|
|
|
|
|
|
+ Goods goods = null;
|
|
if (goods == null) {
|
|
if (goods == null) {
|
|
throw new ResourceUnavailableException("商品不存在");
|
|
throw new ResourceUnavailableException("商品不存在");
|
|
}
|
|
}
|