From 482a84a6f1059fa4726892c0fcbd249c73ba2d1d Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 3 Sep 2023 18:06:15 +0800 Subject: [PATCH] =?UTF-8?q?603=20mall:=20=E4=BC=98=E6=83=A0=E5=88=B8?= =?UTF-8?q?=E9=80=80=E8=BF=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/coupon/vo/template/CouponTemplateBaseVO.java | 2 +- .../module/promotion/service/coupon/CouponServiceImpl.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateBaseVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateBaseVO.java index dff0d8d78..2529f79ac 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateBaseVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateBaseVO.java @@ -54,7 +54,7 @@ public class CouponTemplateBaseVO { @InEnum(PromotionProductScopeEnum.class) private Integer productScope; - @Schema(description = "商品范围编号的数组", example = "1,3") + @Schema(description = "商品范围编号的数组", example = "[1, 3]") private List productScopeValues; @Schema(description = "生效日期类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java index 4192126ad..f4b56260c 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java @@ -93,6 +93,7 @@ public class CouponServiceImpl implements CouponService { public void useCoupon(Long id, Long userId, Long orderId) { // 校验优惠劵 validCoupon(id, userId); + // 更新状态 int updateCount = couponMapper.updateByIdAndStatus(id, CouponStatusEnum.UNUSED.getStatus(), new CouponDO().setStatus(CouponStatusEnum.USED.getStatus()) @@ -116,10 +117,10 @@ public class CouponServiceImpl implements CouponService { // 退还 Integer status = LocalDateTimeUtils.beforeNow(coupon.getValidEndTime()) - // 退还时可能已经过期了 - ? CouponStatusEnum.EXPIRE.getStatus() + ? CouponStatusEnum.EXPIRE.getStatus() // 退还时可能已经过期了 : CouponStatusEnum.UNUSED.getStatus(); - int updateCount = couponMapper.updateByIdAndStatus(id, CouponStatusEnum.UNUSED.getStatus(), new CouponDO().setStatus(status)); + int updateCount = couponMapper.updateByIdAndStatus(id, CouponStatusEnum.UNUSED.getStatus(), + new CouponDO().setStatus(status)); if (updateCount == 0) { throw exception(COUPON_STATUS_NOT_USED); }