diff --git a/cash-common/cash-common-mq/src/main/java/com/czg/config/RabbitPublisher.java b/cash-common/cash-common-mq/src/main/java/com/czg/config/RabbitPublisher.java index 7cfef9e37..a8e379f77 100644 --- a/cash-common/cash-common-mq/src/main/java/com/czg/config/RabbitPublisher.java +++ b/cash-common/cash-common-mq/src/main/java/com/czg/config/RabbitPublisher.java @@ -140,10 +140,10 @@ public class RabbitPublisher { /** * 后付费订单打印消息 * - * @param orderId 订单id - * @param before 0后付费/1先付费 - * @param status 订单状态 0未完成/1完成 - * @param placeNum 第几次下单 + * @param orderId 订单id + * @param before 0后付费/1先付费 + * @param status 订单状态 0未完成/1完成 + * @param placeNum 第几次下单 */ public void sendOrderPrintMsg(Long orderId, Integer before, Integer status, Integer placeNum, String source) { log.info("订单打印消息, orderId:{},{},{},第:{}次下单,source:{}", @@ -162,11 +162,12 @@ public class RabbitPublisher { * @param printTypeEnum * @param data */ - public void sendOrderPrintLocalMsg(Long shopId, Long orderId, Integer placeNum, String printTypeEnum, String data, String operator) { + public void sendOrderPrintLocalMsg(Long shopId, Long orderId, Integer placeNum, String printTypeEnum, String data, String operator, String amount) { JSONObject jsonObject = new JSONObject(); jsonObject.put("shopId", shopId); jsonObject.put("orderId", orderId); jsonObject.put("placeNum", placeNum); + jsonObject.put("amount", amount); jsonObject.put("printType", printTypeEnum); jsonObject.put("data", data); jsonObject.put("operator", operator); diff --git a/cash-service/order-service/src/main/java/com/czg/service/order/print/PrintConfig.java b/cash-service/order-service/src/main/java/com/czg/service/order/print/PrintConfig.java index cb63b879d..4c72b4306 100644 --- a/cash-service/order-service/src/main/java/com/czg/service/order/print/PrintConfig.java +++ b/cash-service/order-service/src/main/java/com/czg/service/order/print/PrintConfig.java @@ -119,7 +119,7 @@ public class PrintConfig implements ApplicationRunner { orderDetailService.list(new QueryWrapper().eq(OrderDetail::getOrderId, orderInfo.getId())); default -> orderDetailList; }; - sendOrderPrintMsg(orderInfo.getShopId(), orderInfo.getId(), placeNum, printTypeEnum + "", null, ""); + sendOrderPrintMsg(orderInfo.getShopId(), orderInfo.getId(), placeNum, printTypeEnum + "", null, "", ""); for (PrintMachine machine : getPrintMachine(orderInfo.getShopId(), printTypeEnum)) { PrinterHandler printer = getPrinter(machine.getBrand()); switch (printTypeEnum) { @@ -254,7 +254,7 @@ public class PrintConfig implements ApplicationRunner { * 处理退菜退款订单打印 */ public void kitchenRefundAllHandler(String operator, OrderInfo orderInfo, List detailList) { - sendOrderPrintMsg(orderInfo.getShopId(), orderInfo.getId(), null, PrinterHandler.PrintTypeEnum.REFUND_KITCHEN + "", detailList, operator); + sendOrderPrintMsg(orderInfo.getShopId(), orderInfo.getId(), null, PrinterHandler.PrintTypeEnum.REFUND_KITCHEN + "", detailList, operator, ""); //后厨退菜单 getPrintMachine(orderInfo.getShopId(), PrinterHandler.PrintTypeEnum.REFUND_KITCHEN).forEach(machine -> { getPrinter(machine.getBrand()).returnKitchenPrint(operator, orderInfo, detailList, machine); @@ -276,11 +276,11 @@ public class PrintConfig implements ApplicationRunner { OrderInfo orderInfo, List detailList) { //前台退菜单 if ("退菜单".equals(printTitle)) { - sendOrderPrintMsg(orderInfo.getShopId(), orderInfo.getId(), null, PrinterHandler.PrintTypeEnum.RETURN_ORDER + "", detailList, operator); + sendOrderPrintMsg(orderInfo.getShopId(), orderInfo.getId(), null, PrinterHandler.PrintTypeEnum.RETURN_ORDER + "", detailList, operator, refundAmount); getPrintMachine(orderInfo.getShopId(), PrinterHandler.PrintTypeEnum.RETURN_ORDER).forEach(machine -> getPrinter(machine.getBrand()).returnOrderPrint(printTitle, operator, refundAmount, refundReason, refundType, orderInfo, machine, detailList)); } else if ("退款单".equals(printTitle)) { - sendOrderPrintMsg(orderInfo.getShopId(), orderInfo.getId(), null, PrinterHandler.PrintTypeEnum.REFUND_ORDER + "", detailList, operator); + sendOrderPrintMsg(orderInfo.getShopId(), orderInfo.getId(), null, PrinterHandler.PrintTypeEnum.REFUND_ORDER + "", detailList, operator, refundAmount); getPrintMachine(orderInfo.getShopId(), PrinterHandler.PrintTypeEnum.REFUND_ORDER).forEach(machine -> { PrinterHandler printer = getPrinter(machine.getBrand()); machine.setVolumeSwitch(0); @@ -374,7 +374,7 @@ public class PrintConfig implements ApplicationRunner { } - private void sendOrderPrintMsg(Long shopId, Long orderId, Integer placeNum, String printType, List detailList, String operator) { + private void sendOrderPrintMsg(Long shopId, Long orderId, Integer placeNum, String printType, List detailList, String operator, String amount) { FunUtils.safeRunVoid(() -> { List list = new ArrayList<>(); if (CollUtil.isNotEmpty(detailList)) { @@ -386,7 +386,7 @@ public class PrintConfig implements ApplicationRunner { return printDTO; }).toList(); } - rabbitPublisher.sendOrderPrintLocalMsg(shopId, orderId, placeNum, printType, JSONObject.toJSONString(list), operator); + rabbitPublisher.sendOrderPrintLocalMsg(shopId, orderId, placeNum, printType, JSONObject.toJSONString(list), operator, amount); }, "订单{}消息发送失败,订单信息: {}", printType, orderId); }