手动清台设置
This commit is contained in:
@@ -1,8 +1,11 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.entity;
|
package com.chaozhanggui.system.cashierservice.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
public class TbShopTable implements Serializable {
|
public class TbShopTable implements Serializable {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@@ -36,133 +39,7 @@ public class TbShopTable implements Serializable {
|
|||||||
|
|
||||||
private String qrcode;
|
private String qrcode;
|
||||||
|
|
||||||
public String getQrcode() {
|
private Integer autoClear;
|
||||||
return qrcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setQrcode(String qrcode) {
|
|
||||||
this.qrcode = qrcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
public Integer getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Integer id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name == null ? null : name.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getShopId() {
|
|
||||||
return shopId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShopId(Integer shopId) {
|
|
||||||
this.shopId = shopId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getMaxCapacity() {
|
|
||||||
return maxCapacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMaxCapacity(Integer maxCapacity) {
|
|
||||||
this.maxCapacity = maxCapacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getSort() {
|
|
||||||
return sort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSort(Integer sort) {
|
|
||||||
this.sort = sort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getAreaId() {
|
|
||||||
return areaId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAreaId(Integer areaId) {
|
|
||||||
this.areaId = areaId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Byte getIsPredate() {
|
|
||||||
return isPredate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsPredate(Byte isPredate) {
|
|
||||||
this.isPredate = isPredate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getPredateAmount() {
|
|
||||||
return predateAmount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPredateAmount(BigDecimal predateAmount) {
|
|
||||||
this.predateAmount = predateAmount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(String status) {
|
|
||||||
this.status = status == null ? null : status.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Byte getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(Byte type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getAmount() {
|
|
||||||
return amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAmount(BigDecimal amount) {
|
|
||||||
this.amount = amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getPerhour() {
|
|
||||||
return perhour;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPerhour(BigDecimal perhour) {
|
|
||||||
this.perhour = perhour;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getView() {
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setView(String view) {
|
|
||||||
this.view = view == null ? null : view.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCreatedAt() {
|
|
||||||
return createdAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreatedAt(Long createdAt) {
|
|
||||||
this.createdAt = createdAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getUpdatedAt() {
|
|
||||||
return updatedAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUpdatedAt(Long updatedAt) {
|
|
||||||
this.updatedAt = updatedAt;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.chaozhanggui.system.cashierservice.bean.TableStateEnum;
|
import com.chaozhanggui.system.cashierservice.bean.TableStateEnum;
|
||||||
import com.chaozhanggui.system.cashierservice.dao.*;
|
import com.chaozhanggui.system.cashierservice.dao.*;
|
||||||
@@ -295,9 +296,12 @@ public class PayService {
|
|||||||
producer.printMechine(orderId);
|
producer.printMechine(orderId);
|
||||||
|
|
||||||
// 修改台桌状态
|
// 修改台桌状态
|
||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
TbShopTable shopTable = mpShopTableMapper.selectOne(new LambdaQueryWrapper<TbShopTable>().eq(TbShopTable::getQrcode, orderInfo.getTableId()));
|
||||||
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
if (shopTable.getAutoClear() == 1) {
|
||||||
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
||||||
|
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
||||||
|
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
||||||
|
}
|
||||||
|
|
||||||
String tableCartKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(),
|
String tableCartKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(),
|
||||||
orderInfo.getShopId());
|
orderInfo.getShopId());
|
||||||
@@ -318,9 +322,12 @@ public class PayService {
|
|||||||
tbOrderPaymentMapper.updateByPrimaryKeySelective(payment);
|
tbOrderPaymentMapper.updateByPrimaryKeySelective(payment);
|
||||||
|
|
||||||
// 修改台桌状态
|
// 修改台桌状态
|
||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
TbShopTable shopTable = mpShopTableMapper.selectOne(new LambdaQueryWrapper<TbShopTable>().eq(TbShopTable::getQrcode, orderInfo.getTableId()));
|
||||||
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
if (shopTable.getAutoClear() == 1) {
|
||||||
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
||||||
|
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
||||||
|
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
||||||
|
}
|
||||||
// 打印结算单
|
// 打印结算单
|
||||||
producer.printMechine(orderId);
|
producer.printMechine(orderId);
|
||||||
String tableCartKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(),
|
String tableCartKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(),
|
||||||
@@ -380,9 +387,12 @@ public class PayService {
|
|||||||
|
|
||||||
producer.printMechine(orderId);
|
producer.printMechine(orderId);
|
||||||
// 修改台桌状态
|
// 修改台桌状态
|
||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
TbShopTable shopTable = mpShopTableMapper.selectOne(new LambdaQueryWrapper<TbShopTable>().eq(TbShopTable::getQrcode, orderInfo.getTableId()));
|
||||||
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
if (shopTable.getAutoClear() == 1) {
|
||||||
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
||||||
|
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
||||||
|
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
||||||
|
}
|
||||||
// 打印结算单
|
// 打印结算单
|
||||||
String tableCartKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(),
|
String tableCartKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(),
|
||||||
orderInfo.getShopId());
|
orderInfo.getShopId());
|
||||||
@@ -399,9 +409,12 @@ public class PayService {
|
|||||||
payment.setUpdatedAt(System.currentTimeMillis());
|
payment.setUpdatedAt(System.currentTimeMillis());
|
||||||
tbOrderPaymentMapper.updateByPrimaryKeySelective(payment);
|
tbOrderPaymentMapper.updateByPrimaryKeySelective(payment);
|
||||||
// 修改台桌状态
|
// 修改台桌状态
|
||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
TbShopTable shopTable = mpShopTableMapper.selectOne(new LambdaQueryWrapper<TbShopTable>().eq(TbShopTable::getQrcode, orderInfo.getTableId()));
|
||||||
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
if (shopTable.getAutoClear() == 1) {
|
||||||
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
||||||
|
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
||||||
|
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
||||||
|
}
|
||||||
// 打印结算单
|
// 打印结算单
|
||||||
producer.printMechine(orderId);
|
producer.printMechine(orderId);
|
||||||
String tableCartKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(),
|
String tableCartKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(),
|
||||||
@@ -886,9 +899,12 @@ public class PayService {
|
|||||||
mqData.put("type", "pc");
|
mqData.put("type", "pc");
|
||||||
producer.sendStockSaleMsg(mqData);
|
producer.sendStockSaleMsg(mqData);
|
||||||
// 修改台桌状态
|
// 修改台桌状态
|
||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
TbShopTable shopTable = mpShopTableMapper.selectOne(new LambdaQueryWrapper<TbShopTable>().eq(TbShopTable::getQrcode, orderInfo.getTableId()));
|
||||||
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
if (shopTable.getAutoClear() == 1) {
|
||||||
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
||||||
|
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
||||||
|
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
||||||
|
}
|
||||||
|
|
||||||
String tableCartKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(),
|
String tableCartKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(),
|
||||||
orderInfo.getShopId());
|
orderInfo.getShopId());
|
||||||
@@ -980,9 +996,12 @@ public class PayService {
|
|||||||
redisUtil.del("SHOP:CODE:USER:" + "pc" + ":" + orderInfo.getShopId() + ":" + DateUtils.getDay() + TokenUtil.parseParamFromToken(token).getString("accountId"));
|
redisUtil.del("SHOP:CODE:USER:" + "pc" + ":" + orderInfo.getShopId() + ":" + DateUtils.getDay() + TokenUtil.parseParamFromToken(token).getString("accountId"));
|
||||||
|
|
||||||
// 修改台桌状态
|
// 修改台桌状态
|
||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
TbShopTable shopTable = mpShopTableMapper.selectOne(new LambdaQueryWrapper<TbShopTable>().eq(TbShopTable::getQrcode, orderInfo.getTableId()));
|
||||||
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
if (shopTable.getAutoClear() == 1) {
|
||||||
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
||||||
|
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
||||||
|
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
||||||
|
}
|
||||||
|
|
||||||
// 小程序购物车缓存
|
// 小程序购物车缓存
|
||||||
String tableCartKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(),
|
String tableCartKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(),
|
||||||
@@ -1071,9 +1090,12 @@ public class PayService {
|
|||||||
redisUtil.del("SHOP:CODE:USER:" + "pc" + ":" + orderInfo.getShopId() + ":" + DateUtils.getDay() + TokenUtil.parseParamFromToken(token).getString("accountId"));
|
redisUtil.del("SHOP:CODE:USER:" + "pc" + ":" + orderInfo.getShopId() + ":" + DateUtils.getDay() + TokenUtil.parseParamFromToken(token).getString("accountId"));
|
||||||
|
|
||||||
// 修改台桌状态
|
// 修改台桌状态
|
||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
TbShopTable shopTable = mpShopTableMapper.selectOne(new LambdaQueryWrapper<TbShopTable>().eq(TbShopTable::getQrcode, orderInfo.getTableId()));
|
||||||
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
if (shopTable.getAutoClear() == 1) {
|
||||||
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
||||||
|
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
||||||
|
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
||||||
|
}
|
||||||
clearTableInfoCache(orderInfo);
|
clearTableInfoCache(orderInfo);
|
||||||
|
|
||||||
return Result.success(CodeEnum.SUCCESS);
|
return Result.success(CodeEnum.SUCCESS);
|
||||||
@@ -1398,11 +1420,6 @@ public class PayService {
|
|||||||
}
|
}
|
||||||
redisUtil.del("SHOP:CODE:USER:" + "pc" + ":" + orderInfo.getShopId() + ":" + DateUtils.getDay() + TokenUtil.parseParamFromToken(token).getString("accountId"));
|
redisUtil.del("SHOP:CODE:USER:" + "pc" + ":" + orderInfo.getShopId() + ":" + DateUtils.getDay() + TokenUtil.parseParamFromToken(token).getString("accountId"));
|
||||||
|
|
||||||
// 修改台桌状态
|
|
||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
|
||||||
.eq(TbShopTable::getQrcode, orderInfo.getTableId())
|
|
||||||
.set(TbShopTable::getStatus, TableStateEnum.IDLE.getState()));
|
|
||||||
|
|
||||||
|
|
||||||
return Result.success(CodeEnum.SUCCESS);
|
return Result.success(CodeEnum.SUCCESS);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user