订单15分钟到期 状态监听 库存回滚

商品排序值 初始化
出入库 日志记录
酒品管理
购物车次日清空
This commit is contained in:
2024-06-17 17:55:56 +08:00
parent 8d956b3cfd
commit 6c30aa2abd
20 changed files with 228 additions and 94 deletions

View File

@@ -1,5 +1,6 @@
package cn.ysk.cashier.config;
import cn.ysk.cashier.service.order.TbOrderInfoService;
import cn.ysk.cashier.service.shop.TbShopInfoService;
import cn.ysk.cashier.system.service.UserService;
import cn.ysk.cashier.utils.CacheKey;
@@ -30,6 +31,10 @@ public class RedisKeyExpirationListener implements MessageListener {
@Autowired
private UserService userServiceu;
@Lazy
@Autowired
private TbOrderInfoService tbOrderInfoService;
//redis key失效监听
@Bean
public RedisMessageListenerContainer redisMessageListenerContainer(RedisConnectionFactory connectionFactory) {
@@ -50,6 +55,10 @@ public class RedisKeyExpirationListener implements MessageListener {
log.info("商户到期 账户名为:{}",account);
shopInfoService.update(account);
userServiceu.upEnableByusername(account);
}else if(expiredKey.startsWith(CacheKey.ORDER_EXPIRED)){
log.info("监听到订单过期,{}",expiredKey);
String orderId = expiredKey.substring(CacheKey.ORDER_EXPIRED.length());
tbOrderInfoService.expired(orderId);
}
}
}