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); }