进件
This commit is contained in:
@@ -21,12 +21,24 @@ 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 entryManagerQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.SHOP_ENTRY_MANAGER, true, false, false);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding entryManagerExchange(Queue entryManagerQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(entryManagerQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.SHOP_ENTRY_MANAGER);
|
||||
}
|
||||
|
||||
//------------------------------------------------------订单打印队列
|
||||
@Bean
|
||||
public Queue orderPrintQueue() {
|
||||
@@ -36,6 +48,7 @@ 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);
|
||||
@@ -51,6 +64,7 @@ public class RabbitConfig {
|
||||
// args.put("x-message-ttl", 180000);
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_MACHINE_PRINT_QUEUE, true, false, false);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingOrderMachinePrintExchange(Queue orderMachinePrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderMachinePrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_MACHINE_PRINT_QUEUE);
|
||||
@@ -61,6 +75,7 @@ public class RabbitConfig {
|
||||
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);
|
||||
@@ -69,11 +84,12 @@ public class RabbitConfig {
|
||||
//------------------------------------------------------叫号 打票
|
||||
@Bean
|
||||
public Queue callTablePrintQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.CALL_TABLE_PRINT_QUEUE, true, false, false);
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.CALL_TABLE_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);
|
||||
return BindingBuilder.bind(callTablePrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.CALL_TABLE_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------订单取消
|
||||
@@ -81,9 +97,10 @@ public class RabbitConfig {
|
||||
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);
|
||||
public Binding bindingOrderCancelExchange(Queue orderCancelQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderCancelQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_CANCEL_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------ 订单库存更新
|
||||
@@ -91,6 +108,7 @@ public class RabbitConfig {
|
||||
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);
|
||||
@@ -102,6 +120,7 @@ public class RabbitConfig {
|
||||
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);
|
||||
@@ -112,6 +131,7 @@ public class RabbitConfig {
|
||||
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);
|
||||
@@ -119,6 +139,7 @@ public class RabbitConfig {
|
||||
|
||||
|
||||
//------------------------------------------------------ 申请短信模板队列
|
||||
|
||||
/**
|
||||
* 1,2,applySmsTemp 模版审核
|
||||
* 1,2,sendMarkSms 发送营销短信
|
||||
@@ -129,16 +150,18 @@ public class RabbitConfig {
|
||||
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 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);
|
||||
@@ -149,6 +172,7 @@ public class RabbitConfig {
|
||||
public Queue orderProductStatusQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_PRODUCT_STATUS_QUEUE, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingOrderProductStatusExchange(Queue orderProductStatusQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderProductStatusQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_PRODUCT_STATUS_QUEUE);
|
||||
@@ -160,6 +184,7 @@ public class RabbitConfig {
|
||||
public Queue orderDetailStatusQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_DETAIL_STATUS_QUEUE, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingOrderDetailStatusExchange(Queue orderDetailStatusQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderDetailStatusQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_DETAIL_STATUS_QUEUE);
|
||||
|
||||
@@ -10,13 +10,14 @@ public interface RabbitConstants {
|
||||
}
|
||||
|
||||
class Queue {
|
||||
public static final String SHOP_ENTRY_MANAGER = "shop.entry.manager";
|
||||
public static final String ORDER_STOCK_QUEUE = "order.stock.queue";
|
||||
public static final String ORDER_REFUND_QUEUE = "order.refund.queue";
|
||||
public static final String ORDER_CANCEL_QUEUE = "order.cancel.queue";
|
||||
public static final String ORDER_PRINT_QUEUE = "order.print.queue";
|
||||
public static final String ORDER_MACHINE_PRINT_QUEUE = "order.machine.print.queue";
|
||||
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 CALL_TABLE_QUEUE = "call.table.print.queue";
|
||||
public static final String PRODUCT_INFO_CHANGE_QUEUE = "product.info.change.queue";
|
||||
|
||||
/**
|
||||
|
||||
@@ -130,6 +130,13 @@ public class RabbitPublisher {
|
||||
sendMsg(RabbitConstants.Queue.ORDER_PRODUCT_STATUS_QUEUE, qrContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单商品状态消息
|
||||
*/
|
||||
public void sendEntryManagerMsg(String shopId) {
|
||||
sendMsg(RabbitConstants.Queue.SHOP_ENTRY_MANAGER, shopId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 订单商品状态消息
|
||||
|
||||
Reference in New Issue
Block a user