分页数量
This commit is contained in:
@@ -21,7 +21,13 @@ public class RabbitConfig {
|
||||
|
||||
@Value("${spring.profiles.active}")
|
||||
private String activeProfile;
|
||||
@Bean
|
||||
@Primary
|
||||
public DirectExchange directExchange() {
|
||||
return new DirectExchange(activeProfile + "-" + RabbitConstants.Exchange.CASH_EXCHANGE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------订单打印队列
|
||||
@Bean
|
||||
public Queue orderPrintQueue() {
|
||||
// 创建一个用于存储队列参数的 Map
|
||||
@@ -30,7 +36,13 @@ public class RabbitConfig {
|
||||
args.put("x-message-ttl", 180000);
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_PRINT_QUEUE, true, false, false, args);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingOrderPrintExchange(Queue orderPrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------订单厨房票
|
||||
@Bean
|
||||
public Queue orderMachinePrintQueue() {
|
||||
// 创建一个用于存储队列参数的 Map
|
||||
@@ -39,82 +51,110 @@ public class RabbitConfig {
|
||||
// args.put("x-message-ttl", 180000);
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_MACHINE_PRINT_QUEUE, true, false, false);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue handoverPrintQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_HANDOVER_PRINT_QUEUE, true, false, false);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue callTablePrintQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.CALL_TABLE_PRINT_QUEUE, true, false, false);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue orderCancelQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_CANCEL_QUEUE, true);
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public Queue orderStockQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_STOCK_QUEUE, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue productInfoChangeQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.PRODUCT_INFO_CHANGE_QUEUE, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue orderRefundQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_REFUND_QUEUE, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public DirectExchange directExchange() {
|
||||
return new DirectExchange(activeProfile + "-" + RabbitConstants.Exchange.CASH_EXCHANGE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingOrderPrintExchange(Queue orderPrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingOrderCancelExchange(Queue orderPrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_CANCEL_QUEUE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingCallTablePrintExchange(Queue callTablePrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(callTablePrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.CALL_TABLE_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingHandoverPrintExchange(Queue handoverPrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(handoverPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_HANDOVER_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingOrderMachinePrintExchange(Queue orderMachinePrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderMachinePrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_MACHINE_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------交班打票
|
||||
@Bean
|
||||
public Queue handoverPrintQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_HANDOVER_PRINT_QUEUE, true, false, false);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingHandoverPrintExchange(Queue handoverPrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(handoverPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_HANDOVER_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------叫号 打票
|
||||
@Bean
|
||||
public Queue callTablePrintQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.CALL_TABLE_PRINT_QUEUE, true, false, false);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingCallTablePrintExchange(Queue callTablePrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(callTablePrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.CALL_TABLE_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------订单取消
|
||||
@Bean
|
||||
public Queue orderCancelQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_CANCEL_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingOrderCancelExchange(Queue orderPrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_CANCEL_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------ 订单库存更新
|
||||
@Bean
|
||||
public Queue orderStockQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_STOCK_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingOrderStockExchange(Queue orderStockQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderStockQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_STOCK_QUEUE);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------ 商品信息更新
|
||||
@Bean
|
||||
public Queue productInfoChangeQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.PRODUCT_INFO_CHANGE_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingProductInfoChange(Queue productInfoChangeQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(productInfoChangeQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.PRODUCT_INFO_CHANGE_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------ 订单退款
|
||||
@Bean
|
||||
public Queue orderRefundQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_REFUND_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingOrderRefundExchange(Queue orderRefundQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderRefundQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_REFUND_QUEUE);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------ 申请短信模板队列
|
||||
@Bean
|
||||
public Queue applySmsTemplateQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.APPLY_SMS_TEMPLATE_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingApplySmsTemplateExchange(Queue applySmsTemplateQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(applySmsTemplateQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.APPLY_SMS_TEMPLATE_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------ 发送微信模板队列
|
||||
@Bean
|
||||
public Queue sendWechatTemplateQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.SEND_WECHAT_TEMPLATE_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingSendWechatTemplateExchange(Queue sendWechatTemplateQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(sendWechatTemplateQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.SEND_WECHAT_TEMPLATE_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------ 发送营销短信队列
|
||||
@Bean
|
||||
public Queue sendMarketSmsQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.SEND_MARKET_SMS_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingSendMarketSmsExchange(Queue sendMarketSmsQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(sendMarketSmsQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.SEND_MARKET_SMS_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------ 生日礼品短信队列
|
||||
@Bean
|
||||
public Queue birthdayGiftSmsQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.BIRTHDAY_GIFT_SMS_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingBirthdayGiftSmsExchange(Queue birthdayGiftSmsQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(birthdayGiftSmsQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.BIRTHDAY_GIFT_SMS_QUEUE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,5 +18,22 @@ public interface RabbitConstants {
|
||||
public static final String ORDER_HANDOVER_PRINT_QUEUE = "order.handover.print.queue";
|
||||
public static final String CALL_TABLE_PRINT_QUEUE = "call.table.print.queue";
|
||||
public static final String PRODUCT_INFO_CHANGE_QUEUE = "product.info.change.queue";
|
||||
|
||||
/**
|
||||
* 申请短信模板队列
|
||||
*/
|
||||
public static final String APPLY_SMS_TEMPLATE_QUEUE = "apply.sms.temp";
|
||||
/**
|
||||
* 发送微信模板队列
|
||||
*/
|
||||
public static final String SEND_WECHAT_TEMPLATE_QUEUE = "send.wechat.temp";
|
||||
/**
|
||||
* 发送营销短信队列
|
||||
*/
|
||||
public static final String SEND_MARKET_SMS_QUEUE = "send.mark.sms";
|
||||
/**
|
||||
* 生日礼品短信队列
|
||||
*/
|
||||
public static final String BIRTHDAY_GIFT_SMS_QUEUE = "birthday.gift.sms";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,41 @@ public class RabbitPublisher {
|
||||
sendMsg(RabbitConstants.Queue.ORDER_HANDOVER_PRINT_QUEUE, id.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请短信模板消息
|
||||
*
|
||||
* @param param 申请短信模板请求 shop_id,sms_shop_template.id
|
||||
*/
|
||||
public void sendApplySmsTemplateMsg(String param) {
|
||||
sendMsg(RabbitConstants.Queue.APPLY_SMS_TEMPLATE_QUEUE, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送微信模板消息
|
||||
*
|
||||
* @param param 发送微信模板请求 shop_id,sms_push_event.id
|
||||
*/
|
||||
public void sendWechatTemplateMsg(String param) {
|
||||
sendMsg(RabbitConstants.Queue.SEND_WECHAT_TEMPLATE_QUEUE, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送营销短信队列
|
||||
*
|
||||
* @param param
|
||||
*/
|
||||
public void sendMarketSmsMsg(String param) {
|
||||
sendMsg(RabbitConstants.Queue.SEND_MARKET_SMS_QUEUE, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送生日礼品短信队列
|
||||
*
|
||||
* @param param
|
||||
*/
|
||||
public void sendBirthdayGiftSmsMsg(String param) {
|
||||
sendMsg(RabbitConstants.Queue.BIRTHDAY_GIFT_SMS_QUEUE, param);
|
||||
}
|
||||
|
||||
private void sendMsg(String queue, String msg) {
|
||||
log.info("开始发送mq消息,exchange:{}, queue: {}, msg: {}", activeProfile + "-" + RabbitConstants.Exchange.CASH_EXCHANGE, activeProfile + "-" + queue, msg);
|
||||
|
||||
Reference in New Issue
Block a user