1.获取桌码通过tableId获取

This commit is contained in:
2024-08-31 16:45:08 +08:00
parent ed78691326
commit 4101c5235b
3 changed files with 9 additions and 6 deletions

View File

@@ -654,6 +654,7 @@ public class OrderService {
return Result.fail(CARTEXIST);
}
for (TbCashierCart cashierCart : list) {
TbProductSkuWithBLOBs tbProduct = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getSkuId()));
@@ -719,6 +720,7 @@ public class OrderService {
orderInfo.setUserId(orderVo.getUserId());
orderInfo.setUseType(StrUtil.isNotBlank(orderVo.getTableId()) ? "postPay" : "afterPay");
orderInfo.setTableName(shopTable != null ? shopTable.getName() : null);
orderInfo.setPayAmount(BigDecimal.ZERO);
if (StrUtil.isNotBlank(orderVo.getTableId())) {
orderInfo.setTableId(orderVo.getTableId());
@@ -883,10 +885,11 @@ public class OrderService {
return orderCode;
}
public Result createCode(String shopId, String clientType, String userId, String type) {
public Result createCode(String shopId, String clientType, String userId, String type, String tableId) {
String day = DateUtils.getDay();
JSONObject jsonObject = new JSONObject();
String key="SHOP:CODE:USER:" + clientType + ":" + shopId + ":" + day + userId;
// String key="SHOP:CODE:USER:" + clientType + ":" + shopId + ":" + day + userId;
String key="SHOP:CODE:USER:" + clientType + ":" + shopId + ":" + day + ":" + tableId;
String userCode = redisUtil.getMessage(key)+"";
if ("1".equals(type)) {
String code = "#" + generateOrderCode(day, clientType, shopId);