耗材重复扣取问题

This commit is contained in:
SongZhang 2024-07-12 14:03:27 +08:00
parent 989bdbad73
commit 1fd127023f
2 changed files with 10 additions and 8 deletions

View File

@ -801,14 +801,16 @@ public class CartService {
object.put("updatedAt", System.currentTimeMillis());
object.put("orderId", orderId + "");
// 发送mq消息
JSONObject jsonObject2 = new JSONObject();
jsonObject2.put("orderId", orderInfo.getId());
jsonObject2.put("type", "create");
jsonObject2.put("cartId", cashierCart.getId());
log.info("开始发送mq消息消耗耗材消息内容{}", jsonObject2);
producer.cons(jsonObject2.toString());
}
// 发送mq消息
JSONObject jsonObject2 = new JSONObject();
jsonObject2.put("orderId", orderInfo.getId());
jsonObject2.put("type", "create");
log.info("开始发送mq消息消耗耗材消息内容{}", jsonObject2);
producer.cons(jsonObject2.toString());
redisUtil.saveMessage(RedisCst.TABLE_CART.concat(jsonObject.getString("tableId")).concat("-").concat(shopId), array.toJSONString());
orderInfo.setDetailList(orderDetails);
JSONObject jsonObject1 = new JSONObject();

View File

@ -173,7 +173,7 @@ public class TaskScheduler {
return randomMilliseconds;
}
@Scheduled(fixedRate = 60000)
@Scheduled(fixedRate = 60000 * 60)
public void clearSongOrder() {
log.info("定时任务执行,清楚过期歌曲订单");
shopSongOrderService.clearExpireOrder();