From ec2e9d15da0b196267a6b490bbe765b408d273f5 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期四, 28 八月 2025 20:14:02 +0800 Subject: [PATCH] bug修改 --- cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java index e5baec9..edef607 100644 --- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java +++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java @@ -125,7 +125,10 @@ .le(StringUtils.hasLength(vipDetailDto.getUseEndTime()), VipDetail::getUseTime, vipDetailDto.getUseEndTime()) .eq(vipDetailDto.getOperatorId() != null, VipDetail::getOperatorId, vipDetailDto.getOperatorId()) .eq(vipDetailDto.getType() != null, VipDetail::getType, vipDetailDto.getType()) - .eq(vipDetailDto.getStatus() != null, VipDetail::getStatus, vipDetailDto.getStatus()).list(); + .eq(vipDetailDto.getStatus() != null, VipDetail::getStatus, vipDetailDto.getStatus()) + .orderByDesc(VipDetail::getInsertTime) + .list(); + // 使用 Stream + 手动拷贝提升性能和可读性(或使用 MapStruct) vipDetailVOS = list.stream().map(vipDetail -> { @@ -952,6 +955,7 @@ VipDetail vipDetailServiceById = vipDetailService.getById(userCoupon.getVipDetailId()); vipDetailServiceById.setUseTime(new Date()); vipDetailServiceById.setStatus(2); + vipDetailService.updateById(vipDetailServiceById); } } -- Gitblit v1.7.1