打印 调整

This commit is contained in:
2026-04-15 18:17:41 +08:00
parent 44f896168f
commit 45fbdd514e
33 changed files with 1887 additions and 1155 deletions

View File

@@ -57,29 +57,24 @@ public class PrintMqListener {
if (orderId == null) {
throw new RuntimeException("订单打印失败未传递orderId");
}
//该字段表示 网络打印机是否打印订单 本地传参来的
Boolean printOrder = jsonObject.getBoolean("printOrder");
redisService.runFunAndCheckKey(() -> {
printerHandler.orderHandler(orderId, printOrder != null && !printOrder ? PrinterHandler.PrintTypeEnum.ONE : PrinterHandler.PrintTypeEnum.ONE_AND_ORDER, null);
if (printOrder) {
printerHandler.orderHandler(orderId, PrinterHandler.PrintTypeEnum.ORDER, null);
}
//菜品打印 全是后端
printerHandler.orderHandler(orderId, PrinterHandler.PrintTypeEnum.ONLY_KITCHEN, null);
printerHandler.orderHandler(orderId, PrinterHandler.PrintTypeEnum.ALL_KITCHEN, null);
return null;
}, RedisCst.getLockKey("orderPrint", orderId));
});
}
/**
* 交班打印
*/
@RabbitListener(queues = {"${spring.profiles.active}-" + RabbitConstants.Queue.ORDER_HANDOVER_PRINT_QUEUE})
public void handoverPrint(String id) {
invokeFun(RabbitConstants.Queue.ORDER_HANDOVER_PRINT_QUEUE, "handoverPrint", "java.order", id, (data) ->
printerHandler.handoverHandler(data));
}
/**
* 叫号打印
*/
@RabbitListener(queues = {"${spring.profiles.active}-" + RabbitConstants.Queue.CALL_TABLE_QUEUE})
public void callTablePrint(String id) {
invokeFun(RabbitConstants.Queue.CALL_TABLE_QUEUE, "callTable", "java.order", id, (data) ->
printerHandler.callHandler(data));
@RabbitListener(queues = {"${spring.profiles.active}-" + RabbitConstants.Queue.OTHER_PRINT_QUEUE})
public void otherPrint(Long shopId, Object o, String printTypeEnum) {
PrinterHandler.PrintTypeEnum typeEnum = PrinterHandler.PrintTypeEnum.valueOf(printTypeEnum);
printerHandler.otherHandler(shopId, o, typeEnum);
}
}