From e2011afa8a9d04567d5761c4422a0cbcc3282351 Mon Sep 17 00:00:00 2001 From: huangyw <1207046171@qq.com> Date: Sat, 23 Nov 2024 11:34:07 +0800 Subject: [PATCH] =?UTF-8?q?release-=20=E5=A4=9A=E6=AC=A1=E8=BF=9E=E7=BB=AD?= =?UTF-8?q?=E7=AD=BE=E5=88=B0=E9=A2=9D=E5=A4=96=E7=A7=AF=E5=88=86=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E5=A4=84=E7=90=86=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/service/UserPointLogService.java | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java b/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java index ff50c19..220b95a 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java @@ -220,11 +220,32 @@ public class UserPointLogService { if (userPointLogDao.findTodayByUserIdAndTaskPointId(userPointLog.getUserId(), userPointLog.getTaskPointId()) != null) { return; + } else if (Objects.equals(taskPointId, TaskPointIdConstants.DAILY_SIGN)) { + // 连续3天签到 + List daysByUserIdAndTaskPointId3 = userPointLogDao.findDaysByUserIdAndTaskPointId( + userPointLog.getUserId(), TaskPointIdConstants.DAILY_SIGN, 3 - 1); + if (daysByUserIdAndTaskPointId3.size() == 3 - 1) { + addByTaskDailyAndUserId(TaskPointIdConstants.DAILY_SIGN_3, userPointLog.getUserId()); + } + + // 连续7天签到 + List daysByUserIdAndTaskPointId7 = userPointLogDao.findDaysByUserIdAndTaskPointId( + userPointLog.getUserId(), TaskPointIdConstants.DAILY_SIGN, 7 - 1); + if (daysByUserIdAndTaskPointId7.size() == 7 - 1) { + addByTaskDailyAndUserId(TaskPointIdConstants.DAILY_SIGN_7, userPointLog.getUserId()); + } + + // 连续30天签到 + List daysByUserIdAndTaskPointId30 = userPointLogDao.findDaysByUserIdAndTaskPointId( + userPointLog.getUserId(), TaskPointIdConstants.DAILY_SIGN, 30 - 1); + if (daysByUserIdAndTaskPointId30.size() == 30 - 1) { + addByTaskDailyAndUserId(TaskPointIdConstants.DAILY_SIGN_30, userPointLog.getUserId()); + } } } else { List list = userPointLogDao.findUserPointLogsByUserIdAndTaskPointId( userPointLog.getUserId(), TaskPointIdConstants.NEW_USER_INVITE); - if (list.size() >= 3) { + if (list.size() >= 3 - 1) { // 邀请人数 >= 3人,并且没有获得对应的积分 List userPointLogsByUserIdAndTaskPointId3 = userPointLogDao.findUserPointLogsByUserIdAndTaskPointId( TaskPointIdConstants.INVITE_USER_3, userPointLog.getUserId()); @@ -233,7 +254,7 @@ public class UserPointLogService { TaskPointIdConstants.INVITE_USER_3, userPointLog.getUserId()); } } - if (list.size() >= 6) { + if (list.size() >= 6 - 1) { // 邀请人数 >= 6人,并且没有获得对应的积分 List userPointLogsByUserIdAndTaskPointId6 = userPointLogDao.findUserPointLogsByUserIdAndTaskPointId( TaskPointIdConstants.INVITE_USER_6, userPointLog.getUserId()); @@ -242,7 +263,7 @@ public class UserPointLogService { TaskPointIdConstants.INVITE_USER_6, userPointLog.getUserId()); } } - if (list.size() >= 10) { + if (list.size() >= 10 - 1) { // 邀请人数 >= 10人,并且没有获得对应的积分 List userPointLogsByUserIdAndTaskPointId10 = userPointLogDao.findUserPointLogsByUserIdAndTaskPointId( TaskPointIdConstants.INVITE_USER_10, userPointLog.getUserId()); @@ -251,7 +272,7 @@ public class UserPointLogService { TaskPointIdConstants.INVITE_USER_10, userPointLog.getUserId()); } } - if (list.size() >= 20) { + if (list.size() >= 20 - 1) { // 邀请人数 >= 20人,并且没有获得对应的积分 List userPointLogsByUserIdAndTaskPointId20 = userPointLogDao.findUserPointLogsByUserIdAndTaskPointId( TaskPointIdConstants.INVITE_USER_20, userPointLog.getUserId()); @@ -339,27 +360,6 @@ public class UserPointLogService { if (todayByUserIdAndTaskPointId == null) { // 今天还没签到 addByTaskDaily(TaskPointIdConstants.DAILY_SIGN, token); - - // 连续3天 - List daysByUserIdAndTaskPointId3 = userPointLogDao.findDaysByUserIdAndTaskPointId( - userLoginDto.getUserId(), TaskPointIdConstants.DAILY_SIGN, 3 - 1); - if (daysByUserIdAndTaskPointId3.size() == 3) { - addByTaskDaily(TaskPointIdConstants.DAILY_SIGN_3, token); - } - - // 连续7天 - List daysByUserIdAndTaskPointId7 = userPointLogDao.findDaysByUserIdAndTaskPointId( - userLoginDto.getUserId(), TaskPointIdConstants.DAILY_SIGN, 7 - 1); - if (daysByUserIdAndTaskPointId7.size() == 7) { - addByTaskDaily(TaskPointIdConstants.DAILY_SIGN_7, token); - } - - // 连续30天 - List daysByUserIdAndTaskPointId30 = userPointLogDao.findDaysByUserIdAndTaskPointId( - userLoginDto.getUserId(), TaskPointIdConstants.DAILY_SIGN, 30 - 1); - if (daysByUserIdAndTaskPointId30.size() == 30) { - addByTaskDaily(TaskPointIdConstants.DAILY_SIGN_30, token); - } } else { throw new BizException(ErrorConstants.DAILY_SIGN_ALREADY); }