退菜打票实现
This commit is contained in:
@@ -2,6 +2,7 @@ package com.czg.controller.admin;
|
||||
|
||||
import com.czg.annotation.Debounce;
|
||||
import com.czg.annotation.SaStaffCheckPermission;
|
||||
import com.czg.config.RabbitPublisher;
|
||||
import com.czg.order.dto.OrderInfoAddDTO;
|
||||
import com.czg.order.dto.OrderInfoPrintDTO;
|
||||
import com.czg.order.dto.OrderInfoQueryDTO;
|
||||
@@ -35,6 +36,8 @@ public class AdminOrderController {
|
||||
private OrderInfoService orderInfoService;
|
||||
@Resource
|
||||
private PayService payService;
|
||||
@Resource
|
||||
private RabbitPublisher rabbitPublisher;
|
||||
|
||||
/**
|
||||
* 订单列表
|
||||
@@ -91,7 +94,11 @@ public class AdminOrderController {
|
||||
@PostMapping("/refundOrder")
|
||||
@Debounce(value = "#refundDTO.orderId")
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -53,6 +53,15 @@ public class RabbitPublisher {
|
||||
sendMsg(RabbitConstants.Queue.ORDER_PRINT_QUEUE, orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款订单打印消息
|
||||
* @param orderId 订单id
|
||||
*/
|
||||
public void sendOrderReturnPrintMsg(String orderId) {
|
||||
//厨房票
|
||||
sendMsg(RabbitConstants.Queue.ORDER_MACHINE_PRINT_QUEUE, orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 交班小票打印消息
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user