取号打票
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user