From 905063987a1475f5056254d8dc6b827722d2b6cf Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Thu, 19 Sep 2024 15:30:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=92=E5=8F=B7=E5=B0=8F?= =?UTF-8?q?=E7=A5=A8=E6=89=93=E5=8D=B0=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashierservice/entity/TbCallConfig.java | 315 ++++++++++++ .../cashierservice/entity/TbCallQueue.java | 469 ++++++++++++++++++ .../cashierservice/entity/TbCallTable.java | 315 ++++++++++++ .../entity/dto/CallNumPrintDTO.java | 11 + .../entity/po/CallNumPrintPO.java | 17 + .../mapper/TbCallConfigMapper.java | 18 + .../mapper/TbCallQueueMapper.java | 18 + .../mapper/TbCallTableMapper.java | 18 + .../cashierservice/rabbit/PrintConsumer.java | 31 +- .../cashierservice/rabbit/RabbitConfig.java | 9 + .../rabbit/RabbitConstants.java | 5 +- .../rabbit/print/FeiPrinter.java | 6 + .../rabbit/print/PrinterHandler.java | 15 +- .../rabbit/print/YxyPrinter.java | 52 +- .../cashierservice/util/PrinterUtils.java | 35 ++ .../resources/mapper/TbCallConfigMapper.xml | 28 ++ .../resources/mapper/TbCallQueueMapper.xml | 38 ++ .../resources/mapper/TbCallTableMapper.xml | 28 ++ 18 files changed, 1412 insertions(+), 16 deletions(-) create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCallConfig.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCallQueue.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCallTable.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/CallNumPrintDTO.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/po/CallNumPrintPO.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/mapper/TbCallConfigMapper.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/mapper/TbCallQueueMapper.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/mapper/TbCallTableMapper.java create mode 100644 src/main/resources/mapper/TbCallConfigMapper.xml create mode 100644 src/main/resources/mapper/TbCallQueueMapper.xml create mode 100644 src/main/resources/mapper/TbCallTableMapper.xml diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCallConfig.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCallConfig.java new file mode 100644 index 0000000..6b4e3b3 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCallConfig.java @@ -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(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCallQueue.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCallQueue.java new file mode 100644 index 0000000..f24b4d2 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCallQueue.java @@ -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(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCallTable.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCallTable.java new file mode 100644 index 0000000..af53a04 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCallTable.java @@ -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(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/CallNumPrintDTO.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/CallNumPrintDTO.java new file mode 100644 index 0000000..aec5ab9 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/CallNumPrintDTO.java @@ -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; +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/po/CallNumPrintPO.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/po/CallNumPrintPO.java new file mode 100644 index 0000000..06ccd88 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/po/CallNumPrintPO.java @@ -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; +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/mapper/TbCallConfigMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/mapper/TbCallConfigMapper.java new file mode 100644 index 0000000..dc16448 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/mapper/TbCallConfigMapper.java @@ -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 { + +} + + + + diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/mapper/TbCallQueueMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/mapper/TbCallQueueMapper.java new file mode 100644 index 0000000..07d6081 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/mapper/TbCallQueueMapper.java @@ -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 { + +} + + + + diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/mapper/TbCallTableMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/mapper/TbCallTableMapper.java new file mode 100644 index 0000000..b84eb65 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/mapper/TbCallTableMapper.java @@ -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 { + +} + + + + diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/PrintConsumer.java b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/PrintConsumer.java index c46e148..3d4dcbd 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/PrintConsumer.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/PrintConsumer.java @@ -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 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 getPrintMachine(Integer shopId, String subType) { + private List 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; diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/RabbitConfig.java b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/RabbitConfig.java index 25a4ef5..19dbce6 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/RabbitConfig.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/RabbitConfig.java @@ -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); + } + } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/RabbitConstants.java b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/RabbitConstants.java index c506f13..9b792b8 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/RabbitConstants.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/RabbitConstants.java @@ -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"; } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/FeiPrinter.java b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/FeiPrinter.java index 2af3f0f..89ec1ec 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/FeiPrinter.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/FeiPrinter.java @@ -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 detailList) { } + + @Override + protected void callNumPrint(CallNumPrintDTO printDTO) { + + } } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/PrinterHandler.java b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/PrinterHandler.java index 9008941..3fc5dfc 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/PrinterHandler.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/PrinterHandler.java @@ -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 tbOrderDetailList) { + protected void print(TbPrintMachine machine, boolean isReturn, TbOrderInfo orderInfo, List 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 tbOrderDetailList) { + public void handleRequest(TbPrintMachine machine, Boolean isReturn, TbOrderInfo orderInfo, List 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 detailList); + protected abstract void callNumPrint(CallNumPrintDTO printDTO); + // 抽象方法,子类实现判断能否处理请求 boolean canHandleRequest(String currentBrand, String connectType) { log.info("handle判断是否可处理: {}, 连接类型: {}, handler类型: {}", currentBrand, connectType, printerBrand); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/YxyPrinter.java b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/YxyPrinter.java index 2c317fc..03e1ed6 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/YxyPrinter.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/YxyPrinter.java @@ -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() + .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) { + + } } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/PrinterUtils.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/PrinterUtils.java index a9f691f..a16b2f9 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/util/PrinterUtils.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/PrinterUtils.java @@ -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("").append(po.getShopName()).append("

") + .append("------------------------
") + .append(StrUtil.format(StrUtil.format("{} {}
", po.getTableName(), po.getCallNum()))) + .append(StrUtil.format("前面有{}桌
", po.getPreNum())) + .append(StrUtil.format("{}
", po.getCodeUrl())) + .append("怕过号扫一扫
") + .append("------------------------
") + .append(StrUtil.format("{}
", po.getShopNote())) + .append("------------------------
").append("取号时间:").append(DateUtils.getTime(po.getTakeTime())) + .append("
").append("打印时间:").append(DateUtils.getTime(new Date())).append("
") + .append("").append(""); + +// sb.append("为伽利略

") +// .append("------------------------
") +// .append(StrUtil.format("小桌 A10
")) +//// .append(StrUtil.format("{} {} {}

", printDTO.getTableName(), printDTO.getTableNote(), printDTO.getCallNum())) +// .append("前面有9桌
") +// .append("https://www.baidu.com
") +// .append("怕过号扫一扫
") +// .append("------------------------
") +// .append("过号顺延三桌 三桌后直接作废 谢谢理解!
") +// .append("------------------------
") +// .append("取号时间:" + DateUtils.getTime(new Date()) + "
") +// .append("打印时间:" + DateUtils.getTime(new Date()) + "
") +// .append("").append(""); + return sb.toString(); + + } + public static String handoverprintData(HandoverInfo handoverInfo) { StringBuilder sb = new StringBuilder(); diff --git a/src/main/resources/mapper/TbCallConfigMapper.xml b/src/main/resources/mapper/TbCallConfigMapper.xml new file mode 100644 index 0000000..c26eaa9 --- /dev/null +++ b/src/main/resources/mapper/TbCallConfigMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + id,page_address,is_online, + bg_cover,success_msg,near_msg, + calling_msg,shop_id,create_time, + update_time,is_postpone,postpone_num + + diff --git a/src/main/resources/mapper/TbCallQueueMapper.xml b/src/main/resources/mapper/TbCallQueueMapper.xml new file mode 100644 index 0000000..77e10fe --- /dev/null +++ b/src/main/resources/mapper/TbCallQueueMapper.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + diff --git a/src/main/resources/mapper/TbCallTableMapper.xml b/src/main/resources/mapper/TbCallTableMapper.xml new file mode 100644 index 0000000..2e1f86e --- /dev/null +++ b/src/main/resources/mapper/TbCallTableMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + id,name,note, + wait_time,prefix,start, + near_num,state,shop_id, + qrcode,create_time,update_time + +