Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -0,0 +1,315 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName tb_call_config
|
||||
*/
|
||||
@TableName(value ="tb_call_config")
|
||||
public class TbCallConfig implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 小程序页面地址
|
||||
*/
|
||||
private String pageAddress;
|
||||
|
||||
/**
|
||||
* 线上取号 1是 0否
|
||||
*/
|
||||
private Integer isOnline;
|
||||
|
||||
/**
|
||||
* 背景图片
|
||||
*/
|
||||
private String bgCover;
|
||||
|
||||
/**
|
||||
* 成功提示
|
||||
*/
|
||||
private String successMsg;
|
||||
|
||||
/**
|
||||
* 临近提示
|
||||
*/
|
||||
private String nearMsg;
|
||||
|
||||
/**
|
||||
* 过号提示
|
||||
*/
|
||||
private String callingMsg;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Integer shopId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否过号顺延
|
||||
*/
|
||||
private Integer isPostpone;
|
||||
|
||||
/**
|
||||
* 顺延号码数量
|
||||
*/
|
||||
private Integer postponeNum;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序页面地址
|
||||
*/
|
||||
public String getPageAddress() {
|
||||
return pageAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序页面地址
|
||||
*/
|
||||
public void setPageAddress(String pageAddress) {
|
||||
this.pageAddress = pageAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* 线上取号 1是 0否
|
||||
*/
|
||||
public Integer getIsOnline() {
|
||||
return isOnline;
|
||||
}
|
||||
|
||||
/**
|
||||
* 线上取号 1是 0否
|
||||
*/
|
||||
public void setIsOnline(Integer isOnline) {
|
||||
this.isOnline = isOnline;
|
||||
}
|
||||
|
||||
/**
|
||||
* 背景图片
|
||||
*/
|
||||
public String getBgCover() {
|
||||
return bgCover;
|
||||
}
|
||||
|
||||
/**
|
||||
* 背景图片
|
||||
*/
|
||||
public void setBgCover(String bgCover) {
|
||||
this.bgCover = bgCover;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功提示
|
||||
*/
|
||||
public String getSuccessMsg() {
|
||||
return successMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功提示
|
||||
*/
|
||||
public void setSuccessMsg(String successMsg) {
|
||||
this.successMsg = successMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 临近提示
|
||||
*/
|
||||
public String getNearMsg() {
|
||||
return nearMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 临近提示
|
||||
*/
|
||||
public void setNearMsg(String nearMsg) {
|
||||
this.nearMsg = nearMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 过号提示
|
||||
*/
|
||||
public String getCallingMsg() {
|
||||
return callingMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 过号提示
|
||||
*/
|
||||
public void setCallingMsg(String callingMsg) {
|
||||
this.callingMsg = callingMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
public Integer getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
public void setShopId(Integer shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否过号顺延
|
||||
*/
|
||||
public Integer getIsPostpone() {
|
||||
return isPostpone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否过号顺延
|
||||
*/
|
||||
public void setIsPostpone(Integer isPostpone) {
|
||||
this.isPostpone = isPostpone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 顺延号码数量
|
||||
*/
|
||||
public Integer getPostponeNum() {
|
||||
return postponeNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 顺延号码数量
|
||||
*/
|
||||
public void setPostponeNum(Integer postponeNum) {
|
||||
this.postponeNum = postponeNum;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
TbCallConfig other = (TbCallConfig) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getPageAddress() == null ? other.getPageAddress() == null : this.getPageAddress().equals(other.getPageAddress()))
|
||||
&& (this.getIsOnline() == null ? other.getIsOnline() == null : this.getIsOnline().equals(other.getIsOnline()))
|
||||
&& (this.getBgCover() == null ? other.getBgCover() == null : this.getBgCover().equals(other.getBgCover()))
|
||||
&& (this.getSuccessMsg() == null ? other.getSuccessMsg() == null : this.getSuccessMsg().equals(other.getSuccessMsg()))
|
||||
&& (this.getNearMsg() == null ? other.getNearMsg() == null : this.getNearMsg().equals(other.getNearMsg()))
|
||||
&& (this.getCallingMsg() == null ? other.getCallingMsg() == null : this.getCallingMsg().equals(other.getCallingMsg()))
|
||||
&& (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()))
|
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
|
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
|
||||
&& (this.getIsPostpone() == null ? other.getIsPostpone() == null : this.getIsPostpone().equals(other.getIsPostpone()))
|
||||
&& (this.getPostponeNum() == null ? other.getPostponeNum() == null : this.getPostponeNum().equals(other.getPostponeNum()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getPageAddress() == null) ? 0 : getPageAddress().hashCode());
|
||||
result = prime * result + ((getIsOnline() == null) ? 0 : getIsOnline().hashCode());
|
||||
result = prime * result + ((getBgCover() == null) ? 0 : getBgCover().hashCode());
|
||||
result = prime * result + ((getSuccessMsg() == null) ? 0 : getSuccessMsg().hashCode());
|
||||
result = prime * result + ((getNearMsg() == null) ? 0 : getNearMsg().hashCode());
|
||||
result = prime * result + ((getCallingMsg() == null) ? 0 : getCallingMsg().hashCode());
|
||||
result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
|
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
|
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
|
||||
result = prime * result + ((getIsPostpone() == null) ? 0 : getIsPostpone().hashCode());
|
||||
result = prime * result + ((getPostponeNum() == null) ? 0 : getPostponeNum().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", pageAddress=").append(pageAddress);
|
||||
sb.append(", isOnline=").append(isOnline);
|
||||
sb.append(", bgCover=").append(bgCover);
|
||||
sb.append(", successMsg=").append(successMsg);
|
||||
sb.append(", nearMsg=").append(nearMsg);
|
||||
sb.append(", callingMsg=").append(callingMsg);
|
||||
sb.append(", shopId=").append(shopId);
|
||||
sb.append(", createTime=").append(createTime);
|
||||
sb.append(", updateTime=").append(updateTime);
|
||||
sb.append(", isPostpone=").append(isPostpone);
|
||||
sb.append(", postponeNum=").append(postponeNum);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,469 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName tb_call_queue
|
||||
*/
|
||||
@TableName(value ="tb_call_queue")
|
||||
public class TbCallQueue implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 叫号台桌类型id
|
||||
*/
|
||||
private Integer callTableId;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
private String shopName;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Integer shopId;
|
||||
|
||||
/**
|
||||
* -1已取消 0排队中 1叫号中 2已入座 3 已过号
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 排号时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 叫号时间
|
||||
*/
|
||||
private Date callTime;
|
||||
|
||||
/**
|
||||
* 叫号次数
|
||||
*/
|
||||
private Integer callCount;
|
||||
|
||||
/**
|
||||
* 过号时间
|
||||
*/
|
||||
private Date passTime;
|
||||
|
||||
/**
|
||||
* 取消时间
|
||||
*/
|
||||
private Date cancelTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String note;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 订阅提醒 0未订阅 1已订阅
|
||||
*/
|
||||
private Integer subState;
|
||||
|
||||
/**
|
||||
* 确认时间
|
||||
*/
|
||||
private Date confirmTime;
|
||||
|
||||
/**
|
||||
* 叫号号码
|
||||
*/
|
||||
private String callNum;
|
||||
|
||||
/**
|
||||
* 创建年月日
|
||||
*/
|
||||
private String createDay;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 叫号台桌类型id
|
||||
*/
|
||||
public Integer getCallTableId() {
|
||||
return callTableId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 叫号台桌类型id
|
||||
*/
|
||||
public void setCallTableId(Integer callTableId) {
|
||||
this.callTableId = callTableId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
public String getShopName() {
|
||||
return shopName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
public void setShopName(String shopName) {
|
||||
this.shopName = shopName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
public Integer getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
public void setShopId(Integer shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
* -1已取消 0排队中 1叫号中 2已入座 3 已过号
|
||||
*/
|
||||
public Integer getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* -1已取消 0排队中 1叫号中 2已入座 3 已过号
|
||||
*/
|
||||
public void setState(Integer state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
/**
|
||||
* 排号时间
|
||||
*/
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 排号时间
|
||||
*/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 叫号时间
|
||||
*/
|
||||
public Date getCallTime() {
|
||||
return callTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 叫号时间
|
||||
*/
|
||||
public void setCallTime(Date callTime) {
|
||||
this.callTime = callTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 叫号次数
|
||||
*/
|
||||
public Integer getCallCount() {
|
||||
return callCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 叫号次数
|
||||
*/
|
||||
public void setCallCount(Integer callCount) {
|
||||
this.callCount = callCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 过号时间
|
||||
*/
|
||||
public Date getPassTime() {
|
||||
return passTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 过号时间
|
||||
*/
|
||||
public void setPassTime(Date passTime) {
|
||||
this.passTime = passTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消时间
|
||||
*/
|
||||
public Date getCancelTime() {
|
||||
return cancelTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消时间
|
||||
*/
|
||||
public void setCancelTime(Date cancelTime) {
|
||||
this.cancelTime = cancelTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Integer getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setUserId(Integer userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setOpenId(String openId) {
|
||||
this.openId = openId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订阅提醒 0未订阅 1已订阅
|
||||
*/
|
||||
public Integer getSubState() {
|
||||
return subState;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订阅提醒 0未订阅 1已订阅
|
||||
*/
|
||||
public void setSubState(Integer subState) {
|
||||
this.subState = subState;
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认时间
|
||||
*/
|
||||
public Date getConfirmTime() {
|
||||
return confirmTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认时间
|
||||
*/
|
||||
public void setConfirmTime(Date confirmTime) {
|
||||
this.confirmTime = confirmTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 叫号号码
|
||||
*/
|
||||
public String getCallNum() {
|
||||
return callNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 叫号号码
|
||||
*/
|
||||
public void setCallNum(String callNum) {
|
||||
this.callNum = callNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建年月日
|
||||
*/
|
||||
public String getCreateDay() {
|
||||
return createDay;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建年月日
|
||||
*/
|
||||
public void setCreateDay(String createDay) {
|
||||
this.createDay = createDay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
TbCallQueue other = (TbCallQueue) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getCallTableId() == null ? other.getCallTableId() == null : this.getCallTableId().equals(other.getCallTableId()))
|
||||
&& (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
|
||||
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
|
||||
&& (this.getShopName() == null ? other.getShopName() == null : this.getShopName().equals(other.getShopName()))
|
||||
&& (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()))
|
||||
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
|
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
|
||||
&& (this.getCallTime() == null ? other.getCallTime() == null : this.getCallTime().equals(other.getCallTime()))
|
||||
&& (this.getCallCount() == null ? other.getCallCount() == null : this.getCallCount().equals(other.getCallCount()))
|
||||
&& (this.getPassTime() == null ? other.getPassTime() == null : this.getPassTime().equals(other.getPassTime()))
|
||||
&& (this.getCancelTime() == null ? other.getCancelTime() == null : this.getCancelTime().equals(other.getCancelTime()))
|
||||
&& (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote()))
|
||||
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
|
||||
&& (this.getOpenId() == null ? other.getOpenId() == null : this.getOpenId().equals(other.getOpenId()))
|
||||
&& (this.getSubState() == null ? other.getSubState() == null : this.getSubState().equals(other.getSubState()))
|
||||
&& (this.getConfirmTime() == null ? other.getConfirmTime() == null : this.getConfirmTime().equals(other.getConfirmTime()))
|
||||
&& (this.getCallNum() == null ? other.getCallNum() == null : this.getCallNum().equals(other.getCallNum()))
|
||||
&& (this.getCreateDay() == null ? other.getCreateDay() == null : this.getCreateDay().equals(other.getCreateDay()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getCallTableId() == null) ? 0 : getCallTableId().hashCode());
|
||||
result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
|
||||
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
|
||||
result = prime * result + ((getShopName() == null) ? 0 : getShopName().hashCode());
|
||||
result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
|
||||
result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
|
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
|
||||
result = prime * result + ((getCallTime() == null) ? 0 : getCallTime().hashCode());
|
||||
result = prime * result + ((getCallCount() == null) ? 0 : getCallCount().hashCode());
|
||||
result = prime * result + ((getPassTime() == null) ? 0 : getPassTime().hashCode());
|
||||
result = prime * result + ((getCancelTime() == null) ? 0 : getCancelTime().hashCode());
|
||||
result = prime * result + ((getNote() == null) ? 0 : getNote().hashCode());
|
||||
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
|
||||
result = prime * result + ((getOpenId() == null) ? 0 : getOpenId().hashCode());
|
||||
result = prime * result + ((getSubState() == null) ? 0 : getSubState().hashCode());
|
||||
result = prime * result + ((getConfirmTime() == null) ? 0 : getConfirmTime().hashCode());
|
||||
result = prime * result + ((getCallNum() == null) ? 0 : getCallNum().hashCode());
|
||||
result = prime * result + ((getCreateDay() == null) ? 0 : getCreateDay().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", callTableId=").append(callTableId);
|
||||
sb.append(", phone=").append(phone);
|
||||
sb.append(", name=").append(name);
|
||||
sb.append(", shopName=").append(shopName);
|
||||
sb.append(", shopId=").append(shopId);
|
||||
sb.append(", state=").append(state);
|
||||
sb.append(", createTime=").append(createTime);
|
||||
sb.append(", callTime=").append(callTime);
|
||||
sb.append(", callCount=").append(callCount);
|
||||
sb.append(", passTime=").append(passTime);
|
||||
sb.append(", cancelTime=").append(cancelTime);
|
||||
sb.append(", note=").append(note);
|
||||
sb.append(", userId=").append(userId);
|
||||
sb.append(", openId=").append(openId);
|
||||
sb.append(", subState=").append(subState);
|
||||
sb.append(", confirmTime=").append(confirmTime);
|
||||
sb.append(", callNum=").append(callNum);
|
||||
sb.append(", createDay=").append(createDay);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,315 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName tb_call_table
|
||||
*/
|
||||
@TableName(value ="tb_call_table")
|
||||
public class TbCallTable implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String note;
|
||||
|
||||
/**
|
||||
* 等待时间分钟
|
||||
*/
|
||||
private Integer waitTime;
|
||||
|
||||
/**
|
||||
* 前缀
|
||||
*/
|
||||
private String prefix;
|
||||
|
||||
/**
|
||||
* 起始号码
|
||||
*/
|
||||
private Integer start;
|
||||
|
||||
/**
|
||||
* 临近几桌提醒
|
||||
*/
|
||||
private Integer nearNum;
|
||||
|
||||
/**
|
||||
* 0禁用 1使用
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Integer shopId;
|
||||
|
||||
/**
|
||||
* 二维码地址
|
||||
*/
|
||||
private String qrcode;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
/**
|
||||
* 等待时间分钟
|
||||
*/
|
||||
public Integer getWaitTime() {
|
||||
return waitTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 等待时间分钟
|
||||
*/
|
||||
public void setWaitTime(Integer waitTime) {
|
||||
this.waitTime = waitTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 前缀
|
||||
*/
|
||||
public String getPrefix() {
|
||||
return prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* 前缀
|
||||
*/
|
||||
public void setPrefix(String prefix) {
|
||||
this.prefix = prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* 起始号码
|
||||
*/
|
||||
public Integer getStart() {
|
||||
return start;
|
||||
}
|
||||
|
||||
/**
|
||||
* 起始号码
|
||||
*/
|
||||
public void setStart(Integer start) {
|
||||
this.start = start;
|
||||
}
|
||||
|
||||
/**
|
||||
* 临近几桌提醒
|
||||
*/
|
||||
public Integer getNearNum() {
|
||||
return nearNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 临近几桌提醒
|
||||
*/
|
||||
public void setNearNum(Integer nearNum) {
|
||||
this.nearNum = nearNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 0禁用 1使用
|
||||
*/
|
||||
public Integer getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* 0禁用 1使用
|
||||
*/
|
||||
public void setState(Integer state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
public Integer getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
public void setShopId(Integer shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 二维码地址
|
||||
*/
|
||||
public String getQrcode() {
|
||||
return qrcode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 二维码地址
|
||||
*/
|
||||
public void setQrcode(String qrcode) {
|
||||
this.qrcode = qrcode;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
TbCallTable other = (TbCallTable) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
|
||||
&& (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote()))
|
||||
&& (this.getWaitTime() == null ? other.getWaitTime() == null : this.getWaitTime().equals(other.getWaitTime()))
|
||||
&& (this.getPrefix() == null ? other.getPrefix() == null : this.getPrefix().equals(other.getPrefix()))
|
||||
&& (this.getStart() == null ? other.getStart() == null : this.getStart().equals(other.getStart()))
|
||||
&& (this.getNearNum() == null ? other.getNearNum() == null : this.getNearNum().equals(other.getNearNum()))
|
||||
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
|
||||
&& (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()))
|
||||
&& (this.getQrcode() == null ? other.getQrcode() == null : this.getQrcode().equals(other.getQrcode()))
|
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
|
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
|
||||
result = prime * result + ((getNote() == null) ? 0 : getNote().hashCode());
|
||||
result = prime * result + ((getWaitTime() == null) ? 0 : getWaitTime().hashCode());
|
||||
result = prime * result + ((getPrefix() == null) ? 0 : getPrefix().hashCode());
|
||||
result = prime * result + ((getStart() == null) ? 0 : getStart().hashCode());
|
||||
result = prime * result + ((getNearNum() == null) ? 0 : getNearNum().hashCode());
|
||||
result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
|
||||
result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
|
||||
result = prime * result + ((getQrcode() == null) ? 0 : getQrcode().hashCode());
|
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
|
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", name=").append(name);
|
||||
sb.append(", note=").append(note);
|
||||
sb.append(", waitTime=").append(waitTime);
|
||||
sb.append(", prefix=").append(prefix);
|
||||
sb.append(", start=").append(start);
|
||||
sb.append(", nearNum=").append(nearNum);
|
||||
sb.append(", state=").append(state);
|
||||
sb.append(", shopId=").append(shopId);
|
||||
sb.append(", qrcode=").append(qrcode);
|
||||
sb.append(", createTime=").append(createTime);
|
||||
sb.append(", updateTime=").append(updateTime);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CallNumPrintDTO {
|
||||
private Integer callQueueId;
|
||||
private Integer shopId;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity.po;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CallNumPrintPO {
|
||||
private String shopName;
|
||||
private String tableName;
|
||||
private String tableNote;
|
||||
private String preNum;
|
||||
private String callNum;
|
||||
private String codeUrl;
|
||||
private String shopNote;
|
||||
private Date takeTime;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.chaozhanggui.system.cashierservice.mapper;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbCallConfig;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【tb_call_config】的数据库操作Mapper
|
||||
* @createDate 2024-09-19 14:35:05
|
||||
* @Entity com.chaozhanggui.system.cashierservice.entity.TbCallConfig
|
||||
*/
|
||||
public interface TbCallConfigMapper extends BaseMapper<TbCallConfig> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.chaozhanggui.system.cashierservice.mapper;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbCallQueue;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【tb_call_queue】的数据库操作Mapper
|
||||
* @createDate 2024-09-19 14:35:05
|
||||
* @Entity com.chaozhanggui.system.cashierservice.entity.TbCallQueue
|
||||
*/
|
||||
public interface TbCallQueueMapper extends BaseMapper<TbCallQueue> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.chaozhanggui.system.cashierservice.mapper;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbCallTable;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【tb_call_table】的数据库操作Mapper
|
||||
* @createDate 2024-09-19 14:35:05
|
||||
* @Entity com.chaozhanggui.system.cashierservice.entity.TbCallTable
|
||||
*/
|
||||
public interface TbCallTableMapper extends BaseMapper<TbCallTable> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.*;
|
||||
import com.chaozhanggui.system.cashierservice.entity.*;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.CallNumPrintDTO;
|
||||
import com.chaozhanggui.system.cashierservice.model.CategoryInfo;
|
||||
import com.chaozhanggui.system.cashierservice.model.OrderDetailPO;
|
||||
import com.chaozhanggui.system.cashierservice.mybatis.MPOrderDetailMapper;
|
||||
@@ -88,9 +89,9 @@ public class PrintConsumer {
|
||||
if (orderDetails.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
getPrintMachine(Integer.valueOf(orderInfo.getShopId()), "cash").forEach(machine -> {
|
||||
getPrintMachine(Integer.valueOf(orderInfo.getShopId()), "cash", "one").forEach(machine -> {
|
||||
log.info("打印机信息: {}", machine);
|
||||
printerHandler.handleRequest(machine, isReturn, orderInfo, orderDetails);
|
||||
printerHandler.handleRequest(machine, isReturn, orderInfo, orderDetails, null);
|
||||
});
|
||||
|
||||
} catch (Exception e) {
|
||||
@@ -111,10 +112,9 @@ public class PrintConsumer {
|
||||
TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId()));
|
||||
Utils.checkValueUnReturn(shopInfo, "店铺信息不存在");
|
||||
|
||||
getPrintMachine(shopInfo.getId(), "cash").forEach(machine -> {
|
||||
getPrintMachine(shopInfo.getId(), "cash", "normal").forEach(machine -> {
|
||||
List<TbOrderDetail> tbOrderDetails = tbOrderDetailMapper.selectAllByOrderId(orderInfo.getId());
|
||||
printerHandler.handleRequest(machine, isReturn, orderInfo, tbOrderDetails);
|
||||
|
||||
printerHandler.handleRequest(machine, isReturn, orderInfo, tbOrderDetails, null);
|
||||
// printPlaceTicket(isReturn, machine, orderInfo, shopInfo);
|
||||
});
|
||||
|
||||
@@ -123,6 +123,21 @@ public class PrintConsumer {
|
||||
}
|
||||
}
|
||||
|
||||
@RabbitListener(queues = {RabbitConstants.QUEUE_PRINT_CALL_TABLE})
|
||||
public void printCallTableListener(String msg) {
|
||||
try {
|
||||
log.info("打印消息mq 接收到打印取号小票消息,消息内容: {}", msg);
|
||||
CallNumPrintDTO printDTO = JSONObject.parseObject(msg, CallNumPrintDTO.class);
|
||||
|
||||
getPrintMachine(printDTO.getShopId(), "cash", "callTicket").forEach(machine -> {
|
||||
printerHandler.handleRequest(machine, false, null, null, printDTO);
|
||||
});
|
||||
|
||||
} catch (Exception e) {
|
||||
log.warn("打印菜品失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkMachineModel(String type, TbPrintMachine machine) {
|
||||
Utils.checkValueUnReturn(machine, "打印机为null");
|
||||
JSONObject config = JSONObject.parseObject(machine.getConfig());
|
||||
@@ -131,7 +146,7 @@ public class PrintConsumer {
|
||||
}
|
||||
|
||||
|
||||
private List<TbPrintMachine> getPrintMachine(Integer shopId, String subType) {
|
||||
private List<TbPrintMachine> getPrintMachine(Integer shopId, String subType, String model) {
|
||||
TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(shopId);
|
||||
if (ObjectUtil.isEmpty(shopInfo)) {
|
||||
log.error("店铺信息不存在");
|
||||
@@ -147,6 +162,10 @@ public class PrintConsumer {
|
||||
log.error("店铺未配置打印机,店铺id: {}", shopId);
|
||||
return list;
|
||||
}
|
||||
|
||||
list = list.stream()
|
||||
.filter(item -> StrUtil.isNotBlank(item.getConfig())
|
||||
&& model.equals(JSONObject.parseObject(item.getConfig()).getString("model"))).collect(Collectors.toList());
|
||||
log.info("打印机列表: {}", list);
|
||||
return list;
|
||||
|
||||
|
||||
@@ -166,4 +166,13 @@ public class RabbitConfig {
|
||||
return BindingBuilder.bind(printPlaceQueue).to(printExchange).with(RabbitConstants.ROUTING_KEY_PRINT_PLACE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
Queue printCallTableQueue() {
|
||||
return new Queue(RabbitConstants.QUEUE_PRINT_CALL_TABLE);
|
||||
}
|
||||
@Bean
|
||||
Binding bindingCallTablePrint(Queue printCallTableQueue, DirectExchange printExchange) {
|
||||
return BindingBuilder.bind(printCallTableQueue).to(printExchange).with(RabbitConstants.ROUTING_KEY_CALL_TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -63,8 +63,11 @@ public interface RabbitConstants {
|
||||
String EXCHANGE_PRINT = "exchange.print";
|
||||
// 菜品打印
|
||||
String QUEUE_PRINT_DISHES = "queue.dishes.print";
|
||||
String ROUTING_KEY_PRINT_DISHES = "routing.dishes.print";
|
||||
String ROUTING_KEY_PRINT_DISHES = "routing.dishes.print1";
|
||||
// 下单打印
|
||||
String QUEUE_PRINT_PLACE = "queue.place.order.print";
|
||||
String ROUTING_KEY_PRINT_PLACE = "routing.place.order.print";
|
||||
// 排号打印
|
||||
String QUEUE_PRINT_CALL_TABLE = "queue.print.call.table";
|
||||
String ROUTING_KEY_CALL_TABLE = "routing.call.table";
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.chaozhanggui.system.cashierservice.dao.TbShopUserMapper;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbOrderInfo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbPrintMachine;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.CallNumPrintDTO;
|
||||
import com.chaozhanggui.system.cashierservice.model.OrderDetailPO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -37,4 +38,9 @@ public class FeiPrinter extends PrinterHandler{
|
||||
protected void normalOrderPrint(TbOrderInfo orderInfo, TbPrintMachine machine, String balance, List<OrderDetailPO.Detail> detailList) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void callNumPrint(CallNumPrintDTO printDTO) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.chaozhanggui.system.cashierservice.dao.TbProductMapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbProductSkuMapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbShopUserMapper;
|
||||
import com.chaozhanggui.system.cashierservice.entity.*;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.CallNumPrintDTO;
|
||||
import com.chaozhanggui.system.cashierservice.model.CategoryInfo;
|
||||
import com.chaozhanggui.system.cashierservice.model.OrderDetailPO;
|
||||
import com.chaozhanggui.system.cashierservice.util.DateUtils;
|
||||
@@ -41,7 +42,7 @@ public abstract class PrinterHandler {
|
||||
this.tbShopUserMapper = tbShopUserMapper;
|
||||
}
|
||||
|
||||
protected void print(TbPrintMachine machine, boolean isReturn, TbOrderInfo orderInfo, List<TbOrderDetail> tbOrderDetailList) {
|
||||
protected void print(TbPrintMachine machine, boolean isReturn, TbOrderInfo orderInfo, List<TbOrderDetail> tbOrderDetailList, CallNumPrintDTO printDTO) {
|
||||
String configStr = machine.getConfig();
|
||||
Utils.checkValueUnReturn(configStr, "打印机配置为空");
|
||||
JSONObject config = JSONObject.parseObject(configStr);
|
||||
@@ -119,18 +120,22 @@ public abstract class PrinterHandler {
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "callTicket":
|
||||
callNumPrint(printDTO);
|
||||
break;
|
||||
default:
|
||||
log.warn("未知打印类型: {}", model);
|
||||
}
|
||||
}
|
||||
|
||||
public void handleRequest(TbPrintMachine machine, boolean isReturn, TbOrderInfo orderInfo, List<TbOrderDetail> tbOrderDetailList) {
|
||||
public void handleRequest(TbPrintMachine machine, Boolean isReturn, TbOrderInfo orderInfo, List<TbOrderDetail> tbOrderDetailList, CallNumPrintDTO printDTO) {
|
||||
if (canHandleRequest(machine.getContentType(), machine.getConnectionType())) {
|
||||
log.info("打印机: {}, 是否退款单: {}, 订单信息: {}, 订单详情信息: {}", machine, isReturn, orderInfo, tbOrderDetailList);
|
||||
print(machine, isReturn, orderInfo, tbOrderDetailList);
|
||||
print(machine, isReturn, orderInfo, tbOrderDetailList, printDTO);
|
||||
} else if (nextPrinter != null) {
|
||||
log.info("当前打印机无法处理: {},将请求传递给下一个打印机:{}...", this, nextPrinter);
|
||||
nextPrinter.handleRequest(machine, isReturn, orderInfo, tbOrderDetailList);
|
||||
nextPrinter.handleRequest(machine, isReturn, orderInfo, tbOrderDetailList, printDTO);
|
||||
} else {
|
||||
log.warn("未找到匹配打印机");
|
||||
}
|
||||
@@ -144,6 +149,8 @@ public abstract class PrinterHandler {
|
||||
|
||||
protected abstract void normalOrderPrint(TbOrderInfo orderInfo, TbPrintMachine machine, String balance, List<OrderDetailPO.Detail> detailList);
|
||||
|
||||
protected abstract void callNumPrint(CallNumPrintDTO printDTO);
|
||||
|
||||
// 抽象方法,子类实现判断能否处理请求
|
||||
boolean canHandleRequest(String currentBrand, String connectType) {
|
||||
log.info("handle判断是否可处理: {}, 连接类型: {}, handler类型: {}", currentBrand, connectType, printerBrand);
|
||||
|
||||
@@ -2,18 +2,21 @@ package com.chaozhanggui.system.cashierservice.rabbit.print;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbProductMapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbProductSkuMapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbShopInfoMapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbShopUserMapper;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbOrderInfo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbPrintMachine;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.*;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.CallNumPrintDTO;
|
||||
import com.chaozhanggui.system.cashierservice.entity.po.CallNumPrintPO;
|
||||
import com.chaozhanggui.system.cashierservice.mapper.TbCallQueueMapper;
|
||||
import com.chaozhanggui.system.cashierservice.mapper.TbCallTableMapper;
|
||||
import com.chaozhanggui.system.cashierservice.model.OrderDetailPO;
|
||||
import com.chaozhanggui.system.cashierservice.util.DateUtils;
|
||||
import com.chaozhanggui.system.cashierservice.util.PrinterUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -22,11 +25,18 @@ import java.util.List;
|
||||
@Slf4j
|
||||
@Component
|
||||
public class YxyPrinter extends PrinterHandler{
|
||||
private final TbCallQueueMapper tbCallQueueMapper;
|
||||
private final TbCallTableMapper tbCallTableMapper;
|
||||
@Value("${wx.mini.page.call}")
|
||||
private String callPageUrl;
|
||||
|
||||
private final TbShopInfoMapper shopInfoMapper;
|
||||
|
||||
public YxyPrinter(TbShopInfoMapper shopInfoMapper, TbProductMapper productMapper, TbProductSkuMapper productSkuMapper, TbShopUserMapper shopUserMapper) {
|
||||
public YxyPrinter(TbShopInfoMapper shopInfoMapper, TbProductMapper productMapper, TbProductSkuMapper productSkuMapper, TbShopUserMapper shopUserMapper, TbCallQueueMapper tbCallQueueMapper, TbCallTableMapper tbCallTableMapper) {
|
||||
super("yxyPrinter", productMapper, productSkuMapper, shopUserMapper);
|
||||
this.shopInfoMapper = shopInfoMapper;
|
||||
this.tbCallQueueMapper = tbCallQueueMapper;
|
||||
this.tbCallTableMapper = tbCallTableMapper;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,4 +93,36 @@ public class YxyPrinter extends PrinterHandler{
|
||||
PrinterUtils.printTickets(voiceJson, 3, 1, machine.getAddress(), data);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void callNumPrint(CallNumPrintDTO printDTO) {
|
||||
TbCallQueue queue = tbCallQueueMapper.selectById(printDTO.getCallQueueId());
|
||||
if (queue == null) {
|
||||
log.warn("叫号记录不存在");
|
||||
return;
|
||||
}
|
||||
|
||||
TbCallTable tbCallTable = tbCallTableMapper.selectById(queue.getCallTableId());
|
||||
TbShopInfo shopInfo = shopInfoMapper.selectByPrimaryKey(queue.getShopId());
|
||||
CallNumPrintPO po = new CallNumPrintPO();
|
||||
po.setCallNum(queue.getCallNum());
|
||||
po.setShopName(shopInfo.getShopName());
|
||||
po.setTableName(tbCallTable.getName());
|
||||
po.setTableNote(tbCallTable.getNote());
|
||||
po.setPreNum(tbCallQueueMapper.selectCount(new LambdaQueryWrapper<TbCallQueue>()
|
||||
.eq(TbCallQueue::getShopId, queue.getShopId())
|
||||
.eq(TbCallQueue::getCallTableId, queue.getCallTableId())
|
||||
.lt(TbCallQueue::getId, queue.getId())
|
||||
.in(TbCallQueue::getState, 0, 1)).toString());
|
||||
po.setCallNum(queue.getCallNum());
|
||||
po.setCodeUrl(StrUtil.format(callPageUrl, queue.getShopId(), queue.getId()));
|
||||
po.setTakeTime(queue.getCreateTime());
|
||||
po.setShopNote("过号顺延三桌 三桌后需重新排号 谢谢理解!");
|
||||
String data = PrinterUtils.getCallNumPrintData(po);
|
||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一条新的排号记录\"}";
|
||||
PrinterUtils.printTickets(voiceJson, 3, 1, "ZF544PG03W00005", data);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.chaozhanggui.system.cashierservice.util;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.CallNumPrintDTO;
|
||||
import com.chaozhanggui.system.cashierservice.entity.po.CallNumPrintPO;
|
||||
import com.chaozhanggui.system.cashierservice.entity.po.ProductInfo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.po.ProductInfoPO;
|
||||
import com.chaozhanggui.system.cashierservice.model.HandoverInfo;
|
||||
@@ -188,6 +191,38 @@ public class PrinterUtils {
|
||||
|
||||
}
|
||||
|
||||
public static String getCallNumPrintData(CallNumPrintPO po) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("<C><B>").append(po.getShopName()).append("</B></C><BR><BR>")
|
||||
.append("------------------------<BR>")
|
||||
.append(StrUtil.format(StrUtil.format("<C><B>{} {}</B></C><BR>", po.getTableName(), po.getCallNum())))
|
||||
.append(StrUtil.format("<C>前面有{}桌</C><BR>", po.getPreNum()))
|
||||
.append(StrUtil.format("<C><QR>{}</QR></C><BR>", po.getCodeUrl()))
|
||||
.append("<C><B>怕过号扫一扫<B></C><BR>")
|
||||
.append("------------------------<BR>")
|
||||
.append(StrUtil.format("<S>{}</S><BR>", po.getShopNote()))
|
||||
.append("------------------------<BR>").append("<S>取号时间:").append(DateUtils.getTime(po.getTakeTime()))
|
||||
.append("</S><BR>").append("<S>打印时间:").append(DateUtils.getTime(new Date())).append("</S><BR>")
|
||||
.append("<OUT:180>").append("<PCUT>");
|
||||
|
||||
// sb.append("<C><B>为伽利略</B></C><BR><BR>")
|
||||
// .append("------------------------<BR>")
|
||||
// .append(StrUtil.format("<C><B>小桌 A10</B></C><BR>"))
|
||||
//// .append(StrUtil.format("<C><B>{} {} {}</B></C><BR><BR>", printDTO.getTableName(), printDTO.getTableNote(), printDTO.getCallNum()))
|
||||
// .append("<C>前面有9桌</C><BR>")
|
||||
// .append("<C><QR>https://www.baidu.com</QR></C><BR>")
|
||||
// .append("<C><B>怕过号扫一扫<B></C><BR>")
|
||||
// .append("------------------------<BR>")
|
||||
// .append("<S>过号顺延三桌 三桌后直接作废 谢谢理解!</S><BR>")
|
||||
// .append("------------------------<BR>")
|
||||
// .append("<S>取号时间:" + DateUtils.getTime(new Date()) + "</S><BR>")
|
||||
// .append("<S>打印时间:" + DateUtils.getTime(new Date()) + "</S><BR>")
|
||||
// .append("<OUT:180>").append("<PCUT>");
|
||||
return sb.toString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static String handoverprintData(HandoverInfo handoverInfo) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
28
src/main/resources/mapper/TbCallConfigMapper.xml
Normal file
28
src/main/resources/mapper/TbCallConfigMapper.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.chaozhanggui.system.cashierservice.mapper.TbCallConfigMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbCallConfig">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="pageAddress" column="page_address" jdbcType="VARCHAR"/>
|
||||
<result property="isOnline" column="is_online" jdbcType="TINYINT"/>
|
||||
<result property="bgCover" column="bg_cover" jdbcType="VARCHAR"/>
|
||||
<result property="successMsg" column="success_msg" jdbcType="VARCHAR"/>
|
||||
<result property="nearMsg" column="near_msg" jdbcType="VARCHAR"/>
|
||||
<result property="callingMsg" column="calling_msg" jdbcType="VARCHAR"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="isPostpone" column="is_postpone" jdbcType="TINYINT"/>
|
||||
<result property="postponeNum" column="postpone_num" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,page_address,is_online,
|
||||
bg_cover,success_msg,near_msg,
|
||||
calling_msg,shop_id,create_time,
|
||||
update_time,is_postpone,postpone_num
|
||||
</sql>
|
||||
</mapper>
|
||||
38
src/main/resources/mapper/TbCallQueueMapper.xml
Normal file
38
src/main/resources/mapper/TbCallQueueMapper.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.chaozhanggui.system.cashierservice.mapper.TbCallQueueMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbCallQueue">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="callTableId" column="call_table_id" jdbcType="INTEGER"/>
|
||||
<result property="phone" column="phone" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="shopName" column="shop_name" jdbcType="VARCHAR"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="state" column="state" jdbcType="TINYINT"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="callTime" column="call_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="callCount" column="call_count" jdbcType="INTEGER"/>
|
||||
<result property="passTime" column="pass_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="cancelTime" column="cancel_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="note" column="note" jdbcType="VARCHAR"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="openId" column="open_id" jdbcType="VARCHAR"/>
|
||||
<result property="subState" column="sub_state" jdbcType="TINYINT"/>
|
||||
<result property="confirmTime" column="confirm_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="callNum" column="call_num" jdbcType="VARCHAR"/>
|
||||
<result property="createDay" column="create_day" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,call_table_id,phone,
|
||||
name,shop_name,shop_id,
|
||||
state,create_time,call_time,
|
||||
call_count,pass_time,cancel_time,
|
||||
note,user_id,open_id,
|
||||
sub_state,confirm_time,call_num,
|
||||
create_day
|
||||
</sql>
|
||||
</mapper>
|
||||
28
src/main/resources/mapper/TbCallTableMapper.xml
Normal file
28
src/main/resources/mapper/TbCallTableMapper.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.chaozhanggui.system.cashierservice.mapper.TbCallTableMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbCallTable">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="note" column="note" jdbcType="VARCHAR"/>
|
||||
<result property="waitTime" column="wait_time" jdbcType="INTEGER"/>
|
||||
<result property="prefix" column="prefix" jdbcType="VARCHAR"/>
|
||||
<result property="start" column="start" jdbcType="INTEGER"/>
|
||||
<result property="nearNum" column="near_num" jdbcType="INTEGER"/>
|
||||
<result property="state" column="state" jdbcType="TINYINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="qrcode" column="qrcode" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,name,note,
|
||||
wait_time,prefix,start,
|
||||
near_num,state,shop_id,
|
||||
qrcode,create_time,update_time
|
||||
</sql>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user