task 修复2

This commit is contained in:
tianfeng 2025-10-23 19:02:14 +08:00
parent 9622cac009
commit 91b5cb524c

View File

@ -139,7 +139,7 @@ public class TaskListener implements MessageListener {
} else {
int result = Integer.parseInt(inc) + 1;
eventBody.setTargetValue(10);
eventBody.setCompleteValue(result);
eventBody.setCompleteValue(Math.min(result, 10));
boolean updated = updateTaskStatus(eventBody);
if (updated) {
redisService.increment(redisKey, 1);
@ -220,7 +220,7 @@ public class TaskListener implements MessageListener {
Long friendsCount = relationshipFriendService.selectMyFriendsCount(eventBody.getUserId());
eventBody.setTargetValue(10);
eventBody.setCompleteValue(friendsCount.intValue());
eventBody.setCompleteValue(Math.min(friendsCount.intValue(), 10));
updateTaskStatus(eventBody);
}
@ -278,7 +278,7 @@ public class TaskListener implements MessageListener {
} else {
int result = Integer.parseInt(countStr) + num;
eventBody.setTargetValue(10);
eventBody.setCompleteValue(result);
eventBody.setCompleteValue(Math.min(result, 10));
boolean updated = updateTaskStatus(eventBody);
if (updated) {
redisService.increment(redisKey, 1);
@ -352,7 +352,7 @@ public class TaskListener implements MessageListener {
} else {
int result = Integer.parseInt(inc) + 1;
eventBody.setTargetValue(3);
eventBody.setCompleteValue(result);
eventBody.setCompleteValue(Math.min(result, 3));
boolean updated = updateTaskStatus(eventBody);
if (updated) {
redisService.increment(redisKey, 1);