退菜打票实现

This commit is contained in:
张松
2025-03-11 17:03:20 +08:00
parent da750a1b79
commit 3757d92cba
2 changed files with 17 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package com.czg.controller.admin;
import com.czg.annotation.Debounce; import com.czg.annotation.Debounce;
import com.czg.annotation.SaStaffCheckPermission; import com.czg.annotation.SaStaffCheckPermission;
import com.czg.config.RabbitPublisher;
import com.czg.order.dto.OrderInfoAddDTO; import com.czg.order.dto.OrderInfoAddDTO;
import com.czg.order.dto.OrderInfoPrintDTO; import com.czg.order.dto.OrderInfoPrintDTO;
import com.czg.order.dto.OrderInfoQueryDTO; import com.czg.order.dto.OrderInfoQueryDTO;
@@ -35,6 +36,8 @@ public class AdminOrderController {
private OrderInfoService orderInfoService; private OrderInfoService orderInfoService;
@Resource @Resource
private PayService payService; private PayService payService;
@Resource
private RabbitPublisher rabbitPublisher;
/** /**
* 订单列表 * 订单列表
@@ -91,7 +94,11 @@ public class AdminOrderController {
@PostMapping("/refundOrder") @PostMapping("/refundOrder")
@Debounce(value = "#refundDTO.orderId") @Debounce(value = "#refundDTO.orderId")
public CzgResult<Object> refundOrder(@Validated @RequestBody OrderInfoRefundDTO refundDTO) { public CzgResult<Object> refundOrder(@Validated @RequestBody OrderInfoRefundDTO refundDTO) {
return payService.refundOrderBefore(refundDTO); CzgResult<Object> result = payService.refundOrderBefore(refundDTO);
if (result.getCode() == 200 && refundDTO.getRefundDetails() != null && !refundDTO.getRefundDetails().isEmpty()) {
rabbitPublisher.sendOrderReturnPrintMsg(refundDTO.getOrderId().toString());
}
return result;
} }
/** /**

View File

@@ -53,6 +53,15 @@ public class RabbitPublisher {
sendMsg(RabbitConstants.Queue.ORDER_PRINT_QUEUE, orderId); sendMsg(RabbitConstants.Queue.ORDER_PRINT_QUEUE, orderId);
} }
/**
* 退款订单打印消息
* @param orderId 订单id
*/
public void sendOrderReturnPrintMsg(String orderId) {
//厨房票
sendMsg(RabbitConstants.Queue.ORDER_MACHINE_PRINT_QUEUE, orderId);
}
/** /**
* 交班小票打印消息 * 交班小票打印消息
* *