公会任务领取bug

This commit is contained in:
2025-09-18 11:50:06 +08:00
parent d9a738ecdc
commit 4fe4c7f809

View File

@@ -162,8 +162,9 @@ public class GuildTaskService {
GuildTaskReachRecord existOne = existRecordMap.get(levelInfo.getLevel());
if (existOne != null) {
//不是当天并且等级已经达标,计算下一级
RMap<Integer, Integer> receicveStatus = this.receicveStatus(existOne.getTaskKey(), existOne.getGuildId());
if (statDate.equals(existOne.getStatDate()) && !receicveStatus.containsKey(existOne.getLevel())) {
RMap<Integer, Integer> receicveStatus = receicveStatus(existOne.getTaskKey(), existOne.getGuildId(), existOne.getId());
RMap<Integer, Integer> oldReceicveStatus = oldReceicveStatus(existOne.getTaskKey(), existOne.getGuildId());
if (statDate.equals(existOne.getStatDate()) && (!receicveStatus.containsKey(existOne.getLevel()) || !oldReceicveStatus.containsKey(existOne.getLevel()))) {
existOne.setDiamondNum(diamond);
existOne.setAnchorNum(memberNum.intValue());
existOne.setAnchorMicReachNum(anchorReachNum);
@@ -428,10 +429,11 @@ public class GuildTaskService {
if (reachRecord.getReceiveStatus() > 0) {
throw new ServiceException(BusiStatus.ROOM_DAY_DIAMOND_REWARD_RECV_RECORD_EXIST);
}
RMap<Integer, Integer> receicveStatus = this.receicveStatus(reachRecord.getTaskKey(), reachRecord.getGuildId());
if (receicveStatus.fastPutIfAbsent(reachRecord.getLevel(), 1)) {
RMap<Integer, Integer> receicveStatus = this.receicveStatus(reachRecord.getTaskKey(), reachRecord.getGuildId(), reachId);
if (!receicveStatus.fastPutIfAbsent(reachRecord.getLevel(), 1)) {
throw new ServiceException(BusiStatus.ROOM_DAY_DIAMOND_REWARD_RECV_RECORD_EXIST);
}
receicveStatus.expire(Duration.ofDays(15));
Integer guildId = reachRecord.getGuildId();
Guild guild = guildService.getVaildGuildById(guildId);
if (guild == null) {
@@ -529,7 +531,11 @@ public class GuildTaskService {
baseSendService.sendSystemMsg(uidStr, tip);
}
private RMap<Integer, Integer> receicveStatus(String taskKey, Integer guildId) {
private RMap<Integer, Integer> receicveStatus(String taskKey, Integer guildId, Long reachId) {
return redissonClient.getMap(guild_task_receive.getKey(taskKey, guildId.toString(), reachId.toString()), new TypedJsonJacksonCodec(Integer.class, Integer.class));
}
private RMap<Integer, Integer> oldReceicveStatus(String taskKey, Integer guildId) {
return redissonClient.getMap(guild_task_receive.getKey(taskKey, guildId.toString()), new TypedJsonJacksonCodec(Integer.class, Integer.class));
}
}