打印机相关实现

This commit is contained in:
张松
2025-02-25 19:15:34 +08:00
parent eb748897cf
commit 97746b7d33
6 changed files with 160 additions and 137 deletions

View File

@@ -46,14 +46,14 @@ public class PrintMqListener {
log.info("接收到订单打印消息:{}", orderId);
MqLog mqLog = new MqLog().setQueue(RabbitConstants.Queue.ORDER_PRINT_QUEUE).setMsg(orderId).setType("orderPrint").setPlat("java.account").setCreateTime(DateUtil.date().toLocalDateTime());
try {
OrderInfo orderInfo = orderInfoService.getById(orderId);
if (orderInfo == null) {
log.error("订单信息不存在, {}", orderId);
throw new RuntimeException("订单信息不存在");
}
// OrderInfo orderInfo = orderInfoService.getById(orderId);
// if (orderInfo == null) {
// log.error("订单信息不存在, {}", orderId);
// throw new RuntimeException("订单信息不存在");
// }
getPrintMachine(orderInfo.getShopId(), "cash", "one", "order").forEach(machine -> {
printerHandler.handleRequest(machine, orderInfo);
getPrintMachine(1L, "cash", "queue", "queue").forEach(machine -> {
printerHandler.handleRequest(machine, null, 1L);
// printPlaceTicket(isReturn, machine, orderInfo, shopInfo);
});