From 320d1c3ad6a02b588a6b324461973060de0d070c Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 6 Nov 2025 21:06:11 +0800 Subject: [PATCH] =?UTF-8?q?VIP=20=E9=80=81=E9=87=91=E5=B8=81=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0COUPON=5FEXCHANGE=20=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/red/circle/other/app/scheduler/DailyTask.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/DailyTask.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/DailyTask.java index e749e19f..d9ef38fb 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/DailyTask.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/scheduler/DailyTask.java @@ -338,12 +338,12 @@ public class DailyTask { // 分离购买记录和扣除记录 List purchasingRecords = allRecords.stream() - .filter(record -> "PURCHASING_GOLD_PROPS".equals(record.getOrigin())) + .filter(DailyTask::validType) .collect(Collectors.toList()); // 检查非PURCHASING_GOLD_PROPS类型的扣除天数记录 List deductionRecords = allRecords.stream() - .filter(record -> !"PURCHASING_GOLD_PROPS".equals(record.getOrigin()) && record.getDays() != null && record.getDays() < 0) + .filter(record -> !validType(record) && record.getDays() != null && record.getDays() < 0) .collect(Collectors.toList()); if (CollectionUtils.isEmpty(purchasingRecords)) { @@ -373,6 +373,10 @@ public class DailyTask { } } + private static boolean validType(RunningWaterUserProps record) { + return Arrays.asList("COUPON_EXCHANGE", "PURCHASING_GOLD_PROPS").contains(record.getOrigin()); + } + /** * 计算用户的有效期截止时间 * 根据购买记录和扣除记录,结合时间顺序累计计算有效期