店铺管理-店铺配置:打印机设置相关接口
This commit is contained in:
@@ -255,7 +255,7 @@ public class PrintMechineConsumer {
|
||||
String data = PrinterUtils.getCashPrintData(detailPO, printType, orderInfo.getOrderType());
|
||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔新的订单,请及时处理\"}";
|
||||
|
||||
PrinterUtils.printTickets(voiceJson, 3, 1, tbPrintMachineWithBLOBs.getAddress(), data);
|
||||
PrinterUtils.printTickets(voiceJson, 3, Integer.valueOf(printerNum), tbPrintMachineWithBLOBs.getAddress(), data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -630,7 +630,7 @@ public class PrintMechineConsumer {
|
||||
}
|
||||
|
||||
log.error("打印数据2>>>>>>>>>>>>>>>>>>>>>>>>: {}", JSON.toJSONString(detailPO));
|
||||
FeieyunPrintUtil.getCashPrintData(detailPO, tbPrintMachineWithBLOBs.getAddress(), printType, printType);
|
||||
FeieyunPrintUtil.getCashPrintData(detailPO, tbPrintMachineWithBLOBs.getAddress(), printType, printType, printerNum);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -85,7 +85,12 @@ public class FeiPrinter extends PrinterHandler {
|
||||
"0", detailList, orderInfo.getRemark(), orderInfo.getDiscountAmount() == null ? null : orderInfo.getDiscountAmount().toPlainString(), orderInfo.getDiscountRatio() == null ? null : orderInfo.getDiscountRatio().toPlainString());
|
||||
String printType = "退款单";
|
||||
log.error("打印数据3>>>>>>>>>>>>>>>>>>>>>>>>: {}", JSON.toJSONString(detailPO));
|
||||
String[] resp = FeieyunPrintUtil.getCashPrintData(detailPO, machine.getAddress(), printType, printType);
|
||||
String printerNum = "1";
|
||||
if (StrUtil.isNotBlank(machine.getPrintQty())) {
|
||||
printerNum = machine.getPrintQty().split("\\^")[1];
|
||||
}
|
||||
StrUtil.blankToDefault(machine.getPrintQty(), "");
|
||||
String[] resp = FeieyunPrintUtil.getCashPrintData(detailPO, machine.getAddress(), printType, printType, printerNum);
|
||||
shopPrintLogService.save(machine, "退款单", resp[0], resp[1]);
|
||||
}
|
||||
|
||||
@@ -100,7 +105,11 @@ public class FeiPrinter extends PrinterHandler {
|
||||
"0", detailList, orderInfo.getRemark(), orderInfo.getDiscountAmount() == null ? null : orderInfo.getDiscountAmount().toPlainString(), orderInfo.getDiscountRatio() == null ? null : orderInfo.getDiscountRatio().toPlainString());
|
||||
String printType = "结算单";
|
||||
log.error("打印数据1>>>>>>>>>>>>>>>>>>>>>>>>: {}", JSON.toJSONString(detailPO));
|
||||
String[] resp = FeieyunPrintUtil.getCashPrintData(detailPO, machine.getAddress(), printType, printType);
|
||||
String printerNum = "1";
|
||||
if (StrUtil.isNotBlank(machine.getPrintQty())) {
|
||||
printerNum = machine.getPrintQty().split("\\^")[1];
|
||||
}
|
||||
String[] resp = FeieyunPrintUtil.getCashPrintData(detailPO, machine.getAddress(), printType, printType, printerNum);
|
||||
shopPrintLogService.save(machine, "结算单", resp[0], resp[1]);
|
||||
}
|
||||
|
||||
@@ -130,7 +139,7 @@ public class FeiPrinter extends PrinterHandler {
|
||||
po.setTakeTime(queue.getCreateTime());
|
||||
po.setShopNote(StrUtil.format("过号顺延{}桌 {}桌后需重新排号 谢谢理解!", tbCallTable.getPostponeNum(), tbCallTable.getPostponeNum()));
|
||||
String data = FeieyunPrintUtil.getCallNumPrintData(po);
|
||||
String resp = FeieyunPrintUtil.print(data, machine.getAddress());
|
||||
String resp = FeieyunPrintUtil.print(data, machine.getAddress(), "1");
|
||||
shopPrintLogService.save(machine, "叫号单", data, resp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public abstract class PrinterHandler {
|
||||
if (StrUtil.isBlank(printMethod) && StrUtil.isBlank(machine.getPrintType())) {
|
||||
throw new MsgException("打印机配置为空");
|
||||
}
|
||||
if(StrUtil.isNotBlank(printMethod)){
|
||||
if (StrUtil.isNotBlank(printMethod)) {
|
||||
List<CategoryInfo> categoryInfos = JSONUtil.parseJSONStr2TList(StrUtil.emptyToDefault(machine.getCategoryList(), "[]"), CategoryInfo.class);
|
||||
//仅打印后厨-一菜一品
|
||||
if ("one".equals(printMethod)) {
|
||||
@@ -72,6 +72,9 @@ public abstract class PrinterHandler {
|
||||
if (!CollUtil.contains(optionList, "queue")) {
|
||||
return;
|
||||
}
|
||||
if (printDTO == null) {
|
||||
return;
|
||||
}
|
||||
callNumPrint(machine, printDTO);
|
||||
}
|
||||
|
||||
@@ -92,7 +95,10 @@ public abstract class PrinterHandler {
|
||||
log.error("商品不存在, id: {}", item.getProductSkuId());
|
||||
return;
|
||||
}
|
||||
|
||||
if (StrUtil.isEmpty(machine.getClassifyPrint())) {
|
||||
log.error("分类打印是空, classifyPrint: {}", machine.getClassifyPrint());
|
||||
return;
|
||||
}
|
||||
long count = categoryInfos.stream().filter(c ->
|
||||
c.getId().toString().equals(categoryId)
|
||||
).count();
|
||||
|
||||
Reference in New Issue
Block a user