订单打印修改,发送方控制结算单打印

This commit is contained in:
张松
2025-03-17 11:28:11 +08:00
parent 066f70a3dd
commit d8a33f184f
5 changed files with 18 additions and 8 deletions

View File

@@ -54,8 +54,16 @@ public class PrintMqListener {
}
@RabbitListener(queues = {"${spring.profiles.active}-" + RabbitConstants.Queue.ORDER_MACHINE_PRINT_QUEUE})
public void orderPrint(String orderId) {
invokeFun("orderPrint", "java.order", orderId, (data) -> printerHandler.handler(data, PrinterHandler.PrintTypeEnum.ONE_AND_ORDER));
public void orderPrint(String req) {
invokeFun("orderPrint", "java.order", req, (data) -> {
JSONObject jsonObject = JSONObject.parseObject(data);
String orderId = jsonObject.getString("orderId");
if (orderId == null) {
throw new RuntimeException("订单打印失败未传递orderId");
}
Boolean printOrder = jsonObject.getBoolean("printOrder");
printerHandler.handler(data, printOrder != null && !printOrder ? PrinterHandler.PrintTypeEnum.ORDER : PrinterHandler.PrintTypeEnum.ONE_AND_ORDER);
});
}
/**