打印数据

This commit is contained in:
2026-04-16 14:38:14 +08:00
parent 710cca65d6
commit cef7e5315a
27 changed files with 467 additions and 86 deletions

View File

@@ -82,6 +82,16 @@ public class RabbitConfig {
return BindingBuilder.bind(otherPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.OTHER_PRINT_QUEUE);
}
@Bean
public Queue otherPrintLocalQueue() {
return new Queue(activeProfile + "-" + RabbitConstants.Queue.OTHER_PRINT_LOCAL_QUEUE, true, false, false);
}
@Bean
public Binding bindingOtherPrintLocalExchange(Queue otherPrintLocalQueue, DirectExchange exchange) {
return BindingBuilder.bind(otherPrintLocalQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.OTHER_PRINT_LOCAL_QUEUE);
}
//------------------------------------------------------订单取消
@Bean
public Queue orderCancelQueue() {
@@ -115,6 +125,7 @@ public class RabbitConfig {
public Binding bindingProductInfoChange(Queue productInfoChangeQueue, DirectExchange exchange) {
return BindingBuilder.bind(productInfoChangeQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.PRODUCT_INFO_CHANGE_QUEUE);
}
//------------------------------------------------------ 耗材信息更新
@Bean
public Queue consInfoChangeQueue() {

View File

@@ -19,6 +19,7 @@ public interface RabbitConstants {
public static final String ORDER_MACHINE_PRINT_QUEUE = "order.machine.print.queue";
public static final String OTHER_PRINT_QUEUE = "other.print.queue";
public static final String OTHER_PRINT_LOCAL_QUEUE = "other.print.local.queue";
public static final String PRODUCT_INFO_CHANGE_QUEUE = "product.info.change.queue";
public static final String CONS_INFO_CHANGE_QUEUE = "cons.info.change.queue";

View File

@@ -155,6 +155,7 @@ public class RabbitPublisher {
* STOCK_CHECK 库存盘点
* HANDOVER 交班单
* CALL 排队取号
*
* @param printType {@link com.czg.service.order.print.PrinterHandler.PrintTypeEnum}
*/
public void sendOtherPrintMsg(Long shopId, Object data, String printType) {
@@ -167,4 +168,14 @@ public class RabbitPublisher {
rabbitTemplate.convertAndSend(exchange, queueName, msg);
}
public void sendOtherPrintLocalMsg(Long shopId, String printType, Long dataId) {
String exchange = activeProfile + "-" + RabbitConstants.Exchange.CASH_EXCHANGE;
String queueName = activeProfile + "-" + RabbitConstants.Queue.OTHER_PRINT_LOCAL_QUEUE;
Map<String, Object> msg = new HashMap<>();
msg.put("shopId", shopId);
msg.put("dataId", dataId);
msg.put("printType", printType);
rabbitTemplate.convertAndSend(exchange, queueName, msg);
}
}