订单打印修改,发送方控制结算单打印
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user