This commit is contained in:
sxu 2024-12-23 18:43:11 +08:00
parent 179ddfa584
commit 6e2b957cce
1 changed files with 4 additions and 1 deletions

View File

@ -111,7 +111,10 @@ public class BmMessageServiceImpl implements IBmMessageService {
bmMessage.setFromUser(SecurityUtils.getLoginUser().getSysUser().getUserId());
bmMessage.setUuid(String.valueOf(UUID.randomUUID()));
String msgKey = MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE + companyId + ":" + bmMessage.getToCompany();
(SpringUtils.getBean(RedisService.class)).setCacheObject(msgKey, Arrays.asList(bmMessage), MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE_HOURS, TimeUnit.HOURS);
JSONArray arrayCache = SpringUtils.getBean(RedisService.class).getCacheObject(msgKey);
List<BmMessage> list = arrayCache.toList(BmMessage.class);
list.add(bmMessage);
(SpringUtils.getBean(RedisService.class)).setCacheObject(msgKey, list, MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE_HOURS, TimeUnit.HOURS);
return bmMessageMapper.insertBmMessage(bmMessage);
} catch (Exception e) {
throw new ServiceException("错误信息描述");