release- 多次连续签到额外积分异步处理方式

release-2024-04-25
huangyw 11 hours ago
parent 96d857d5a3
commit 8dcea9e4c3

@ -221,23 +221,34 @@ public class UserPointLogService {
List<UserPointLog> daysByUserIdAndTaskPointId3 = userPointLogDao.findDaysByUserIdAndTaskPointId( List<UserPointLog> daysByUserIdAndTaskPointId3 = userPointLogDao.findDaysByUserIdAndTaskPointId(
userPointLog.getUserId(), TaskPointIdConstants.DAILY_SIGN, 3 - 1); userPointLog.getUserId(), TaskPointIdConstants.DAILY_SIGN, 3 - 1);
if (daysByUserIdAndTaskPointId3.size() == 3 - 1) { if (daysByUserIdAndTaskPointId3.size() == 3 - 1) {
List<UserPointLog> sign3 = userPointLogDao.findUserPointLogsByUserIdAndTaskPointId(
TaskPointIdConstants.DAILY_SIGN_3, userPointLog.getUserId());
if (sign3.isEmpty()) {
addByTaskDailyAndUserId(TaskPointIdConstants.DAILY_SIGN_3, userPointLog.getUserId()); addByTaskDailyAndUserId(TaskPointIdConstants.DAILY_SIGN_3, userPointLog.getUserId());
} }
}
// 连续7天签到 // 连续7天签到
List<UserPointLog> daysByUserIdAndTaskPointId7 = userPointLogDao.findDaysByUserIdAndTaskPointId( List<UserPointLog> daysByUserIdAndTaskPointId7 = userPointLogDao.findDaysByUserIdAndTaskPointId(
userPointLog.getUserId(), TaskPointIdConstants.DAILY_SIGN, 7 - 1); userPointLog.getUserId(), TaskPointIdConstants.DAILY_SIGN, 7 - 1);
if (daysByUserIdAndTaskPointId7.size() == 7 - 1) { if (daysByUserIdAndTaskPointId7.size() == 7 - 1) {
List<UserPointLog> sign7 = userPointLogDao.findUserPointLogsByUserIdAndTaskPointId(
TaskPointIdConstants.DAILY_SIGN_7, userPointLog.getUserId());
if (sign7.isEmpty()) {
addByTaskDailyAndUserId(TaskPointIdConstants.DAILY_SIGN_7, userPointLog.getUserId()); addByTaskDailyAndUserId(TaskPointIdConstants.DAILY_SIGN_7, userPointLog.getUserId());
} }
}
// 连续30天签到 // 连续30天签到
List<UserPointLog> daysByUserIdAndTaskPointId30 = userPointLogDao.findDaysByUserIdAndTaskPointId( List<UserPointLog> daysByUserIdAndTaskPointId30 = userPointLogDao.findDaysByUserIdAndTaskPointId(
userPointLog.getUserId(), TaskPointIdConstants.DAILY_SIGN, 30 - 1); userPointLog.getUserId(), TaskPointIdConstants.DAILY_SIGN, 30 - 1);
if (daysByUserIdAndTaskPointId30.size() == 30 - 1) { if (daysByUserIdAndTaskPointId30.size() == 30 - 1) {
List<UserPointLog> sign30 = userPointLogDao.findUserPointLogsByUserIdAndTaskPointId(
TaskPointIdConstants.DAILY_SIGN_30, userPointLog.getUserId());
if (sign30.isEmpty()) {
addByTaskDailyAndUserId(TaskPointIdConstants.DAILY_SIGN_30, userPointLog.getUserId()); addByTaskDailyAndUserId(TaskPointIdConstants.DAILY_SIGN_30, userPointLog.getUserId());
} }
} }
}
} else { } else {
List<UserPointLog> list = userPointLogDao.findUserPointLogsByUserIdAndTaskPointId( List<UserPointLog> list = userPointLogDao.findUserPointLogsByUserIdAndTaskPointId(
userPointLog.getUserId(), TaskPointIdConstants.NEW_USER_INVITE); userPointLog.getUserId(), TaskPointIdConstants.NEW_USER_INVITE);

Loading…
Cancel
Save