退单金额

This commit is contained in:
2026-04-21 17:42:52 +08:00
parent 8665a8d4dc
commit f873674f73
2 changed files with 12 additions and 11 deletions

View File

@@ -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<OrderDetail> 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<OrderDetail> 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<OrderDetail> detailList, String operator) {
private void sendOrderPrintMsg(Long shopId, Long orderId, Integer placeNum, String printType, List<OrderDetail> detailList, String operator, String amount) {
FunUtils.safeRunVoid(() -> {
List<OrderDetailPrintDTO> 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);
}