update 清缓存

This commit is contained in:
2023-03-14 10:06:09 +08:00
parent 1b3fa33bb8
commit 76835fbcba

View File

@@ -122,8 +122,10 @@ public class TransactionService {
@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
public void doUpdateOrder(OrderTransactionDTO dto) {
String orderCode = null;
String transactionCode = null;
if (Objects.nonNull(dto.getOrderBasicInfo())) {
orderCode = dto.getOrderBasicInfo().getOrderCode();
transactionCode = dto.getOrderBasicInfo().getTransactionCode();
orderBasicInfoMapper.updateOrderBasicInfo(dto.getOrderBasicInfo());
}
@@ -135,6 +137,8 @@ public class TransactionService {
if (StringUtils.isNotBlank(orderCode)) {
String redisKey = CacheConstants.GET_ORDER_INFO_BY_ORDER_CODE + orderCode;
redisCache.deleteObject(redisKey);
String redisKey2 = CacheConstants.GET_ORDER_INFO_BY_TRANSACTION_CODE + transactionCode;
redisCache.deleteObject(redisKey2);
}
}