This commit is contained in:
sxu 2024-12-20 15:10:41 +08:00
parent 49f03b802c
commit 55092ce72c
2 changed files with 5 additions and 4 deletions

View File

@ -71,6 +71,7 @@ public class MaterialConstants {
/** 文件类型:合同照片 */ /** 文件类型:合同照片 */
public static final Integer APPENDICES_OF_CONTRACT = 20; //move to TmTaskTypeEnum public static final Integer APPENDICES_OF_CONTRACT = 20; //move to TmTaskTypeEnum
public static final String CACHE_MATERIAL_MALL_MESSAGE_CODE = "material-mall-message-code:"; public static final String CACHE_MATERIAL_MALL_MESSAGE = "material-mall-message:";
public static final Long CACHE_MATERIAL_MALL_MESSAGE_HOURS = 24L;
} }

View File

@ -52,7 +52,7 @@ public class BmMessageServiceImpl implements IBmMessageService {
@Override @Override
public List<BmMessage> selectBmMessageListFromCache(BmMessage bmMessage) { public List<BmMessage> selectBmMessageListFromCache(BmMessage bmMessage) {
List<BmMessage> bmMessages = redisService.getCacheList(MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE_CODE); List<BmMessage> bmMessages = redisService.getCacheList(MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE);
return bmMessages; return bmMessages;
} }
@ -69,9 +69,9 @@ public class BmMessageServiceImpl implements IBmMessageService {
bmMessage.setFromCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId()); bmMessage.setFromCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
bmMessage.setFromUser(SecurityUtils.getLoginUser().getSysUser().getUserId()); bmMessage.setFromUser(SecurityUtils.getLoginUser().getSysUser().getUserId());
bmMessage.setUuid(String.valueOf(UUID.randomUUID())); bmMessage.setUuid(String.valueOf(UUID.randomUUID()));
String msgKey = MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE_CODE; String msgKey = MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE;
String msgContent = JSONObject.toJSONString(bmMessage); String msgContent = JSONObject.toJSONString(bmMessage);
redisService.setCacheObject(msgKey, msgContent, verificationCodeConfig.getTime(), TimeUnit.MINUTES); redisService.setCacheObject(msgKey, msgContent, MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE_HOURS, TimeUnit.HOURS);
return bmMessageMapper.insertBmMessage(bmMessage); return bmMessageMapper.insertBmMessage(bmMessage);
} catch (Exception e) { } catch (Exception e) {
throw new ServiceException("错误信息描述"); throw new ServiceException("错误信息描述");