厨房小票二维码打印开关

This commit is contained in:
2026-04-27 11:48:48 +08:00
parent b1a39167ac
commit 772ba6376a
8 changed files with 26 additions and 7 deletions

View File

@@ -292,6 +292,10 @@ public class ShopInfoEditDTO {
* 数签子
*/
private Integer isCountStick;
/**
* 后厨单菜二维码
*/
private Integer isKitchenCode;
/**
* 退菜退库存模式 1跟随商品分类 2 跟随单商品
*/

View File

@@ -135,6 +135,10 @@ public class ShopConfig implements Serializable {
* 数签子
*/
private Integer isCountStick;
/**
* 后厨单菜二维码
*/
private Integer isKitchenCode;
/**
* 退菜退库存模式 1跟随商品分类 2 跟随单商品
*/

View File

@@ -361,6 +361,11 @@ public class ShopInfo implements Serializable {
*/
@Column(ignore = true)
private Integer isCountStick;
/**
* 后厨单菜二维码
*/
@Column(ignore = true)
private Integer isKitchenCode;
/**
* 退菜退库存模式 1跟随商品分类 2 跟随单商品
*/

View File

@@ -60,8 +60,8 @@ public class FeiPrinter extends PrinterHandler implements PrinterImpl {
}
@Override
protected void onlyKitchenPrint(OrderInfo orderInfo, OrderDetail orderDetail, PrintMachine machine) {
String buildDishPrintData = buildOnlyKitchenPrintData(getPickupNum(orderInfo), orderDetail);
protected void onlyKitchenPrint(Integer isCode, OrderInfo orderInfo, OrderDetail orderDetail, PrintMachine machine) {
String buildDishPrintData = buildOnlyKitchenPrintData(isCode, getPickupNum(orderInfo), orderDetail);
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
if (1 == machine.getVolumeSwitch()) {
voiceJson = "{\"bizType\":\"2\",\"content\":\"新单来了,请注意查看\"}";

View File

@@ -155,7 +155,8 @@ public class PrintConfig implements ApplicationRunner {
machine.setVolumeSwitch(0);
}
isNotice = false;
FunUtils.safeRunVoid(() -> printer.onlyKitchenPrint(orderInfo, item, machine),
ShopInfo shopInfo = shopInfoService.getById(orderInfo.getShopId());
FunUtils.safeRunVoid(() -> printer.onlyKitchenPrint(shopInfo.getIsKitchenCode(), orderInfo, item, machine),
"订单id:{} ,后厨分单打印失败", orderInfo.getId());
// 保存已打印信息
redisService.set(RedisCst.kitchenOnly(orderInfo.getId(), machine.getId(), item.getId()), "", 20);

View File

@@ -337,7 +337,7 @@ public abstract class PrinterHandler {
/**
* 后厨 菜品打印
*/
protected abstract void onlyKitchenPrint(OrderInfo orderInfo, OrderDetail orderDetail, PrintMachine machine);
protected abstract void onlyKitchenPrint(Integer isCode, OrderInfo orderInfo, OrderDetail orderDetail, PrintMachine machine);
/**
* 后厨 退菜整单打印

View File

@@ -468,7 +468,7 @@ public interface PrinterImpl {
* @param pickupNumber 取餐号
* @return 元数据
*/
default String buildOnlyKitchenPrintData(String pickupNumber, OrderDetail orderDetail) {
default String buildOnlyKitchenPrintData(Integer isCode, String pickupNumber, OrderDetail orderDetail) {
PrintSignLabel signLabelInfo = getSignLabelInfo();
StringBuilder builder = new StringBuilder();
builder.append(formatLabel(pickupNumber, signLabelInfo.centerBold))
@@ -527,6 +527,10 @@ public interface PrinterImpl {
builder.append(formatLabel("【加急】", signLabelInfo.center, signLabelInfo.bold))
.append(signLabelInfo.br);
}
if (1 == isCode) {
builder.append(formatLabel("UP_ORDER_DETAIL:" + orderDetail.getId(), signLabelInfo.center, signLabelInfo.qr))
.append(signLabelInfo.br);
}
builder.append(signLabelInfo.br)
.append(signLabelInfo.getOut(150))
.append(signLabelInfo.cut);

View File

@@ -55,8 +55,8 @@ public class YxyPrinter extends PrinterHandler implements PrinterImpl {
@Override
protected void onlyKitchenPrint(OrderInfo orderInfo, OrderDetail orderDetail, PrintMachine machine) {
String buildDishPrintData = buildOnlyKitchenPrintData(getPickupNum(orderInfo), orderDetail);
protected void onlyKitchenPrint(Integer isCode, OrderInfo orderInfo, OrderDetail orderDetail, PrintMachine machine) {
String buildDishPrintData = buildOnlyKitchenPrintData(isCode, getPickupNum(orderInfo), orderDetail);
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
if (1 == machine.getVolumeSwitch()) {
voiceJson = "{\"bizType\":\"2\",\"content\":\"新单来了,请注意查看\"}";
@@ -253,6 +253,7 @@ public class YxyPrinter extends PrinterHandler implements PrinterImpl {
/**
* 签名Token
*
* @param timestamp 时间戳13位
* @param requestId 请求ID自定义
* @return token信息