From 24f7f046f8854d63839ad52d0cff34ea45a0f449 Mon Sep 17 00:00:00 2001 From: gongzuming <gongzuming> Date: 星期二, 12 十一月 2024 13:10:17 +0800 Subject: [PATCH] 优化 --- src/main/java/com/mzl/flower/service/impl/coupon/CouponTemplateServiceImpl2.java | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/mzl/flower/service/impl/coupon/CouponTemplateServiceImpl2.java b/src/main/java/com/mzl/flower/service/impl/coupon/CouponTemplateServiceImpl2.java index 72c3b73..154b128 100644 --- a/src/main/java/com/mzl/flower/service/impl/coupon/CouponTemplateServiceImpl2.java +++ b/src/main/java/com/mzl/flower/service/impl/coupon/CouponTemplateServiceImpl2.java @@ -293,6 +293,7 @@ couponRecordDO.setPoint(couponTemplateDO.getPoint()); couponRecordDO.setMemberId(couponTemplateDO.getMemberId()); couponRecordDO.setImageUrl(couponTemplateDO.getImageUrl()); + couponRecordDO.setCouponDescription(couponTemplateDO.getCouponDescription()); // 创建相关信息 couponRecordDO.create(SecurityUtils.getUserId()); @@ -441,9 +442,9 @@ recordDTO.setCustomerId(customer.getId()); couponRecordService.createCouponRecord(recordDTO); - //更新优惠券数量 - couponTemplateDO.setCouponAmount(couponTemplateDO.getCouponAmount()-dto.getNum()); - couponTemplateService.updateById(couponTemplateDO); +// //更新优惠券数量 +// couponTemplateDO.setCouponAmount(couponTemplateDO.getCouponAmount()-dto.getNum()); +// couponTemplateService.updateById(couponTemplateDO); //更新积分汇总 cp.setUsedPoint(cp.getUsedPoint()+couponTemplateDO.getPoint()); @@ -460,9 +461,6 @@ detail.setRemarks(couponTemplateDO.getCouponName()); detail.create(SecurityUtils.getUserId()); customerPointDetailMapper.insert(detail); - }catch (Exception e){ - log.error("兑换失败",e); - throw new ValidationException("兑换失败"); }finally { lockService.releaseObjectLock(key,""); } @@ -492,6 +490,12 @@ } @Override + public boolean expireActivityCouponTemplateAll() { + + return couponTemplateMapperCustom.expireActivityCouponTemplateAll()>0; + } + + @Override public List<CouponTemplateVO> getActivityEffectList(QueryActivityEffectCouponDTO dto) { return couponTemplateMapperCustom.getActivityEffectList(dto); -- Gitblit v1.9.3