fix: 修复工单未读消息redis缓存设置问题

This commit is contained in:
曹鹏飞 2025-06-10 17:08:23 +08:00
parent 143484583b
commit b5fe4401e9
2 changed files with 3 additions and 1 deletions

View File

@ -710,8 +710,9 @@ public class TicketController extends ControllerBase {
}
}
}
notReadeds.removeIf(StrUtil::isBlank);
if (CollectionUtil.isNotEmpty(notReadeds)) {
stringRedisTemplate.opsForSet().add(key, notReadeds.stream().toArray(String[]::new));
stringRedisTemplate.opsForSet().add(key, notReadeds.toArray(String[]::new));
vo.setNotReadCount(notReadeds.size());
vo.setFirstMessageId(notReadeds.iterator().next());
}

View File

@ -150,6 +150,7 @@ public class TicketController extends ControllerBase {
ticketChatService.add(new TicketChatDTO()
.setTicketId(ticket.getId())
.setMessages(Collections.singletonList(new ChatMessageDTO()
.setId(cn.hutool.core.util.IdUtil.getSnowflakeNextIdStr())
.setFrom("system")
.setTicketState(ticket.getState())
.setSenderId(0)