取号打票

This commit is contained in:
2024-09-19 16:53:51 +08:00
parent e525d7e058
commit 9cd49383ff
6 changed files with 48 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
package cn.ysk.cashier.utils;
import cn.ysk.cashier.cons.rabbit.RabbitConstants;
import cn.ysk.cashier.dto.CallNumPrintDTO;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.connection.CorrelationData;
@@ -30,7 +31,7 @@ public class RabbitMsgUtils implements RabbitTemplate.ConfirmCallback {
private <T> void sendMsg(String exchange, String routingKey, T data, String note, boolean isJson) {
CorrelationData correlationId = new CorrelationData(UUID.randomUUID().toString());
log.info("开始发送{}mq消息, msgId: {}, exchange: {}, routingKey: {}, data: {}", correlationId.getId(), note, exchange, routingKey, data);
log.info("开始发送{}mq消息, msgId: {}, exchange: {}, routingKey: {}, data: {}", note, correlationId.getId(), exchange, routingKey, data);
rabbitTemplate.convertAndSend(exchange, routingKey, isJson ? JSONObject.toJSONString(data) : data, correlationId);
}
@@ -70,4 +71,11 @@ public class RabbitMsgUtils implements RabbitTemplate.ConfirmCallback {
sendMsg(RabbitConstants.EXCHANGE_PRINT, RabbitConstants.ROUTING_KEY_PRINT_PLACE, jsonObject, "订单打印", false);
}
public void printCallNumTicket(Integer callQueueId, Integer shopId) {
CallNumPrintDTO printDTO = new CallNumPrintDTO();
printDTO.setCallQueueId(callQueueId);
printDTO.setShopId(shopId);
sendMsg(RabbitConstants.EXCHANGE_PRINT, RabbitConstants.ROUTING_KEY_CALL_TABLE, printDTO, "排号小票打印", true);
}
}