修复开发票时间太长导致redis不能回滚未读消息

This commit is contained in:
wen 2022-01-15 16:51:09 +08:00
parent 32e76be85b
commit 32c51c1f62

View File

@ -391,9 +391,15 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
if (xhpcInvoice.getIsRead().equals(IsReadStatusConst.READED)) {
return specificInvoicedResponse;
}
//一旦调了详情接口就去掉该已开发票的未读状态同时redis中的未读数量数据-1
//一旦调了详情接口就去掉该已开发票的未读状态同时再次查询用户未读的数量并将其设置到redis当中
xhpcInvoiceMapper.updateByInvoiceId(invoiceId);
reduceNoReadInvoiceCount(xhpcInvoice);
Long notReadCount = xhpcInvoiceMapper.findNotReadCount(xhpcInvoice.getCreatorId(), xhpcInvoice.getCreatorType());
String redisKey = generateRedisKey(xhpcInvoice);
if (notReadCount == 0) {
redisService.deleteObject(redisKey);
} else {
redisService.setCacheObject(redisKey, notReadCount);
}
return specificInvoicedResponse;
}