就餐模式获取修改
This commit is contained in:
@@ -178,20 +178,20 @@ public class CartService {
|
||||
}
|
||||
String tableCartKey = RedisCst.getTableCartKey(shopId, tableId, userId);
|
||||
TbCashierCart seatCartInfo = null;
|
||||
if (redisUtil.exists(tableCartKey)) {
|
||||
array = JSON.parseArray(redisUtil.getMessage(tableCartKey));
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject object = array.getJSONObject(i);
|
||||
TbCashierCart cashierCart = JSONUtil.parseJSONStr2T(object.toJSONString(), TbCashierCart.class);
|
||||
if (cashierCart.getNumber() > 0) {
|
||||
amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee())));
|
||||
}
|
||||
|
||||
if ("-999".equals(cashierCart.getProductId())) {
|
||||
seatCartInfo = cashierCart;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// if (redisUtil.exists(tableCartKey)) {
|
||||
// array = JSON.parseArray(redisUtil.getMessage(tableCartKey));
|
||||
// for (int i = 0; i < array.size(); i++) {
|
||||
// JSONObject object = array.getJSONObject(i);
|
||||
// TbCashierCart cashierCart = JSONUtil.parseJSONStr2T(object.toJSONString(), TbCashierCart.class);
|
||||
// if (cashierCart.getNumber() > 0) {
|
||||
// amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee())));
|
||||
// }
|
||||
//
|
||||
// if ("-999".equals(cashierCart.getProductId())) {
|
||||
// seatCartInfo = cashierCart;
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// 查询购物车所有信息
|
||||
LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>()
|
||||
.eq(TbCashierCart::getShopId, shopId)
|
||||
@@ -215,9 +215,9 @@ public class CartService {
|
||||
if (cashierCart.getIsVip().equals((byte) 1)) continue;
|
||||
amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee())));
|
||||
}
|
||||
redisUtil.saveMessage(tableCartKey, array.toString());
|
||||
redisUtil.saveMessage(tableCartKey, array.toString(), 60 * 60 * 12L);
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
redisUtil.saveMessage(RedisCst.getCurrentTableSeatCount(shopEatTypeInfoDTO.getShopInfo().getId(), tableId), JSONObject.toJSONString(seatCartInfo), 60 * 60 * 12L);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user