就餐模式获取修改

This commit is contained in:
2024-09-29 14:50:28 +08:00
parent 6327b6cd3b
commit 70ad132780
2 changed files with 4 additions and 15 deletions

View File

@@ -52,17 +52,7 @@ public class CartConsumer {
else if (jsonObject.getString("type").equals("queryCart") ) {
cartService.queryCart(jsonObject);
} else if(jsonObject.getString("type").equals("createOrder")){
ShopEatTypeInfoDTO eatModel = shopUtils.getEatModel(tableId, shopId);
String tableCartKey = RedisCst.getTableCartKey(shopId, eatModel.isOpenDineIn() ? tableId : null, userId);
String cartDetail = redisUtil.getMessage(tableCartKey);
if (StringUtils.isEmpty(cartDetail)){
log.info("createOrder购物车为空");
throw new MsgException("购物车为空无法下单");
}
JSONArray array = JSON.parseArray(cartDetail);
if (!array.isEmpty()){
cartService.createOrder(jsonObject);
}
cartService.createOrder(jsonObject);
}
// else if(jsonObject.getString("type").equals("clearCart")){
// cartService.clearCart(jsonObject);