Skip to content

Commit

Permalink
'增加优惠券关闭作废优惠券'
Browse files Browse the repository at this point in the history
  • Loading branch information
chopper711 committed Dec 7, 2022
1 parent 9141f21 commit 51d2880
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,11 @@ public interface MemberCouponService extends IService<MemberCoupon> {
*/
boolean recoveryMemberCoupon(List<String> memberCouponIds);

/**
* 作废优惠券
*
* @param couponId 优惠券ID
*/
void voidCoupon(String couponId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,15 @@ public boolean recoveryMemberCoupon(List<String> memberCouponIds) {
return this.update(updateWrapper);
}

@Override
public void voidCoupon(String couponId) {
LambdaUpdateWrapper<MemberCoupon> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(MemberCoupon::getCouponId, couponId);
updateWrapper.set(MemberCoupon::getMemberCouponStatus, MemberCouponStatusEnum.CLOSED.name());
updateWrapper.set(MemberCoupon::getDeleteFlag, true);
this.update(updateWrapper);
}

/**
* 清除无效的会员优惠券
*
Expand Down

0 comments on commit 51d2880

Please sign in to comment.