排队取号小票未打印BUG修复

This commit is contained in:
谭凯凯
2024-10-17 11:31:12 +08:00
committed by Tankaikai
parent fc7877fcd6
commit dcdcbe3b61

View File

@@ -41,22 +41,24 @@ public abstract class PrinterHandler {
protected void print(TbPrintMachine machine, boolean isReturn, TbOrderInfo orderInfo, List<TbOrderDetail> tbOrderDetailList, CallNumPrintDTO printDTO) {
String printMethod = machine.getPrintMethod();
if (StrUtil.isBlank(printMethod)) {
if (StrUtil.isBlank(printMethod) && StrUtil.isBlank(machine.getPrintType())) {
throw new MsgException("打印机配置为空");
}
List<CategoryInfo> categoryInfos = JSONUtil.parseJSONStr2TList(StrUtil.emptyToDefault(machine.getCategoryList(), "[]"), CategoryInfo.class);
//仅打印后厨-一菜一品
if ("one".equals(printMethod)) {
onlyKitchen(machine, orderInfo, tbOrderDetailList, categoryInfos, isReturn);
} else if ("normal".equals(printMethod)) {
//仅打印前台
onlyFrontDesk(machine, orderInfo, tbOrderDetailList, isReturn);
} else if ("all".equals(printMethod)) {
//全部打印 前台+后厨
onlyFrontDesk(machine, orderInfo, tbOrderDetailList, isReturn);
onlyKitchen(machine, orderInfo, tbOrderDetailList, categoryInfos, isReturn);
} else {
log.warn("未知打印类型: {}", printMethod);
if(StrUtil.isNotBlank(printMethod)){
List<CategoryInfo> categoryInfos = JSONUtil.parseJSONStr2TList(StrUtil.emptyToDefault(machine.getCategoryList(), "[]"), CategoryInfo.class);
//仅打印后厨-一菜一品
if ("one".equals(printMethod)) {
onlyKitchen(machine, orderInfo, tbOrderDetailList, categoryInfos, isReturn);
} else if ("normal".equals(printMethod)) {
//仅打印前台
onlyFrontDesk(machine, orderInfo, tbOrderDetailList, isReturn);
} else if ("all".equals(printMethod)) {
//全部打印 前台+后厨
onlyFrontDesk(machine, orderInfo, tbOrderDetailList, isReturn);
onlyKitchen(machine, orderInfo, tbOrderDetailList, categoryInfos, isReturn);
} else {
log.warn("未知打印类型: {}", printMethod);
}
}
if (StrUtil.isBlank(machine.getPrintType())) {
return;
@@ -71,9 +73,6 @@ public abstract class PrinterHandler {
return;
}
callNumPrint(machine, printDTO);
if (StrUtil.isBlank(printMethod)) {
throw new MsgException("打印机配置为空");
}
}
/**