处理 设备在线 发消息

This commit is contained in:
gong
2025-11-24 16:37:56 +08:00
parent e76a85b521
commit 7146128b4c
15 changed files with 156 additions and 38 deletions

View File

@@ -143,4 +143,14 @@ public class RabbitConfig {
public Binding bindingBirthdayGiftSmsExchange(Queue birthdayGiftSmsQueue, DirectExchange exchange) {
return BindingBuilder.bind(birthdayGiftSmsQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.BIRTHDAY_GIFT_SMS_QUEUE);
}
//------------------------------------------------------ 订单商品状态
@Bean
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);
}
}

View File

@@ -19,6 +19,11 @@ public interface RabbitConstants {
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 ORDER_PRODUCT_STATUS_QUEUE = "order.product.status.queue";
/**
* 1,2,applySmsTemp 模版审核
* 1,2,sendMarkSms 发送营销短信

View File

@@ -121,6 +121,13 @@ public class RabbitPublisher {
sendMsg(RabbitConstants.Queue.BIRTHDAY_GIFT_SMS_QUEUE, param);
}
/**
* 订单商品状态消息
*/
public void sendOrderProductStatusMsg(String qrContent) {
sendMsg(RabbitConstants.Queue.ORDER_PRODUCT_STATUS_QUEUE, qrContent);
}
private void sendMsg(String queue, String msg) {
log.info("开始发送mq消息,exchange:{}, queue: {}, msg: {}", activeProfile + "-" + RabbitConstants.Exchange.CASH_EXCHANGE, activeProfile + "-" + queue, msg);
rabbitTemplate.convertAndSend(activeProfile + "-" + RabbitConstants.Exchange.CASH_EXCHANGE, activeProfile + "-" + queue, msg);

View File

@@ -59,7 +59,7 @@ public class SysDevicesDTO implements Serializable {
/**
* 在线状态0 离线1 在线
*/
private Integer unlineStatus;
private Integer onlineStatus;
/**
* 最后上线时间

View File

@@ -29,7 +29,7 @@ public class SysDevicesPageDTO {
/**
* 在线状态0 离线1 在线
*/
private Integer unlineStatus;
private Integer onlineStatus;
/**
* 页码

View File

@@ -2,6 +2,7 @@ package com.czg.system.entity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;
@@ -32,7 +33,7 @@ public class SysDevices implements Serializable {
/**
* 主键
*/
@Id
@Id(keyType = KeyType.Auto)
private Long id;
/**
@@ -53,7 +54,7 @@ public class SysDevices implements Serializable {
/**
* 在线状态0 离线1 在线
*/
private Integer unlineStatus;
private Integer onlineStatus;
/**
* 最后上线时间

View File

@@ -20,5 +20,7 @@ public interface SysDevicesService extends IService<SysDevices> {
Long deleteDevice(Long id);
Page<SysDevicesDTO> queryDevice(SysDevicesPageDTO reqDTO);
Page<SysDevicesDTO> queryDevicePage(SysDevicesPageDTO reqDTO);
void updateDeviceOnlineStatus(String sn, Integer online);
}