fix: 物联网平台,amqp数据接入并插入TD数据库相关逻辑编码。
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
package com.intc.iot.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 水质告警历史记录
|
||||
*
|
||||
* @author intc
|
||||
*/
|
||||
@Data
|
||||
@TableName("aqu_alarm_history")
|
||||
public class AquAlarmHistory implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 塘口名称
|
||||
*/
|
||||
private String pondName;
|
||||
|
||||
/**
|
||||
* 告警类型(溶解氧、温度、pH、盐度、电池等)
|
||||
*/
|
||||
private String alarmType;
|
||||
|
||||
/**
|
||||
* 告警级别:1-一般 2-重要 3-紧急
|
||||
*/
|
||||
private Integer alarmLevel;
|
||||
|
||||
/**
|
||||
* 告警内容
|
||||
*/
|
||||
private String alarmContent;
|
||||
|
||||
/**
|
||||
* 告警值
|
||||
*/
|
||||
private Double alarmValue;
|
||||
|
||||
/**
|
||||
* 阈值(最小或最大)
|
||||
*/
|
||||
private Double thresholdValue;
|
||||
|
||||
/**
|
||||
* 告警状态:0-未处理 1-已处理 2-已恢复
|
||||
*/
|
||||
private Integer alarmStatus;
|
||||
|
||||
/**
|
||||
* 告警时间
|
||||
*/
|
||||
private LocalDateTime alarmTime;
|
||||
|
||||
/**
|
||||
* 恢复时间
|
||||
*/
|
||||
private LocalDateTime recoveryTime;
|
||||
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
private LocalDateTime handleTime;
|
||||
|
||||
/**
|
||||
* 处理人
|
||||
*/
|
||||
private Long handleBy;
|
||||
|
||||
/**
|
||||
* 处理备注
|
||||
*/
|
||||
private String handleRemark;
|
||||
|
||||
/**
|
||||
* 是否已通知:0-未通知 1-已通知
|
||||
*/
|
||||
private Integer notified;
|
||||
|
||||
/**
|
||||
* 通知记录ID(关联 aqu_call_notice)
|
||||
*/
|
||||
private Long noticeId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.intc.iot.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 告警电话通知记录
|
||||
* 对应 C# DbAquWarnCallNotice
|
||||
*
|
||||
* @author intc-iot
|
||||
*/
|
||||
@Data
|
||||
@TableName("aqu_call_notice")
|
||||
public class AquWarnCallNotice implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 通知手机号
|
||||
*/
|
||||
private String mobilePhone;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 塘口名称
|
||||
*/
|
||||
private String pondName;
|
||||
|
||||
/**
|
||||
* 设定的呼叫时间
|
||||
*/
|
||||
private LocalDateTime callTime;
|
||||
|
||||
/**
|
||||
* 呼叫状态
|
||||
* 0-未呼叫(NoCall)
|
||||
* 1-呼叫成功,等待结果反馈(CallSuccess)
|
||||
* 2-呼叫失败(CallFail)
|
||||
* 3-呼叫反馈成功(CallBackSuccess)
|
||||
* 4-呼叫反馈失败(CallBackFail)
|
||||
*/
|
||||
private Integer callStatus;
|
||||
|
||||
/**
|
||||
* 呼叫的CallId,CallStatus为1/3/4时有值
|
||||
*/
|
||||
private String callId;
|
||||
|
||||
// ==================== 以下为呼叫回执字段 ====================
|
||||
|
||||
/**
|
||||
* 呼叫结果状态码
|
||||
* 200000: 用户听完语音
|
||||
* 200001: 用户未听完挂断
|
||||
* 其他: 失败
|
||||
*/
|
||||
private String statusCode;
|
||||
|
||||
/**
|
||||
* 挂断方向(user: 用户挂断, system: 系统挂断)
|
||||
*/
|
||||
private String hangupDirection;
|
||||
|
||||
/**
|
||||
* 主叫号码
|
||||
*/
|
||||
private String caller;
|
||||
|
||||
/**
|
||||
* 被叫响铃时间
|
||||
*/
|
||||
private String ringTime;
|
||||
|
||||
/**
|
||||
* 通话时长(秒),未接通时为0
|
||||
*/
|
||||
private String duration;
|
||||
|
||||
/**
|
||||
* 话单类型(voice-普通话单,asr-asr话单,smart_transfer-智能外呼转接话单)
|
||||
*/
|
||||
private String voiceType;
|
||||
|
||||
/**
|
||||
* 呼叫发起时间
|
||||
*/
|
||||
private String originateTime;
|
||||
|
||||
/**
|
||||
* 通话接通时间
|
||||
*/
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 通话结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 结果描述
|
||||
*/
|
||||
private String statusMsg;
|
||||
|
||||
/**
|
||||
* 扩展字段回传
|
||||
*/
|
||||
private String outId;
|
||||
|
||||
/**
|
||||
* 通话类型(LOCAL-市话,PROVINCE-省内长途,DOMESTIC-国内长途,INTERNATIONAL-国际长途,UNKNOWN-未知)
|
||||
*/
|
||||
private String tollType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.intc.iot.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.intc.common.mybatis.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 设备实时数据
|
||||
*
|
||||
* @author intc
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("iot_device_realtime_data")
|
||||
public class DeviceRealtimeData extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 产品Key
|
||||
*/
|
||||
private String productKey;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* IoT平台设备ID
|
||||
*/
|
||||
private String iotId;
|
||||
|
||||
/**
|
||||
* 消息ID
|
||||
*/
|
||||
private String messageId;
|
||||
|
||||
/**
|
||||
* 数据类型:property-属性,event-事件
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 属性/事件标识符
|
||||
*/
|
||||
private String identifier;
|
||||
|
||||
/**
|
||||
* 数据内容(JSON格式)
|
||||
*/
|
||||
private String dataContent;
|
||||
|
||||
/**
|
||||
* 数据上报时间
|
||||
*/
|
||||
private LocalDateTime reportTime;
|
||||
|
||||
/**
|
||||
* 原始Topic
|
||||
*/
|
||||
private String topic;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.intc.iot.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 设备上下线状态记录
|
||||
* 对应 C# IOTTopicDeviceStatus
|
||||
*
|
||||
* @author intc-iot
|
||||
*/
|
||||
@Data
|
||||
@TableName("iot_device_status")
|
||||
public class IotDeviceStatus implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 产品Key
|
||||
*/
|
||||
private String productKey;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 设备IotId
|
||||
*/
|
||||
private String iotId;
|
||||
|
||||
/**
|
||||
* 状态(online-在线,offline-离线)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 状态变更时间(秒时间戳)
|
||||
*/
|
||||
private Long statusTime;
|
||||
|
||||
/**
|
||||
* 上次更新时间(秒时间戳)
|
||||
*/
|
||||
private Long lastTime;
|
||||
|
||||
/**
|
||||
* 客户端IP
|
||||
*/
|
||||
private String clientIp;
|
||||
|
||||
/**
|
||||
* 用户标识(可选)
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.intc.iot.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* VMS 语音回执实体
|
||||
* 对应 C# AliVmsCallBack
|
||||
*
|
||||
* @author intc-iot
|
||||
*/
|
||||
@Data
|
||||
@TableName("vms_callback")
|
||||
public class VmsCallback implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 呼叫唯一标识
|
||||
*/
|
||||
private String callId;
|
||||
|
||||
/**
|
||||
* 业务扩展字段(用于区分系统)
|
||||
*/
|
||||
private String outId;
|
||||
|
||||
/**
|
||||
* 状态码
|
||||
* 200000: 用户接听并听完
|
||||
* 200001: 用户未听完挂断
|
||||
* 其他: 失败
|
||||
*/
|
||||
private String statusCode;
|
||||
|
||||
/**
|
||||
* 状态描述
|
||||
*/
|
||||
private String statusMsg;
|
||||
|
||||
/**
|
||||
* 挂断方向
|
||||
* user: 用户挂断
|
||||
* system: 系统挂断
|
||||
*/
|
||||
private String hangupDirection;
|
||||
|
||||
/**
|
||||
* 被叫号码
|
||||
*/
|
||||
private String caller;
|
||||
|
||||
/**
|
||||
* 呼叫类型
|
||||
* tts: 文本转语音
|
||||
*/
|
||||
private String voiceType;
|
||||
|
||||
/**
|
||||
* 通话发起时间(秒时间戳)
|
||||
*/
|
||||
private Long originateTime;
|
||||
|
||||
/**
|
||||
* 通话开始时间(秒时间戳)
|
||||
*/
|
||||
private Long startTime;
|
||||
|
||||
/**
|
||||
* 通话结束时间(秒时间戳)
|
||||
*/
|
||||
private Long endTime;
|
||||
|
||||
/**
|
||||
* 振铃时长(秒)
|
||||
*/
|
||||
private Integer ringTime;
|
||||
|
||||
/**
|
||||
* 通话时长(秒)
|
||||
*/
|
||||
private Integer duration;
|
||||
|
||||
/**
|
||||
* 计费类型
|
||||
*/
|
||||
private String tollType;
|
||||
|
||||
/**
|
||||
* 是否已处理(0-未处理,1-已处理)
|
||||
*/
|
||||
private Integer processed;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.intc.iot.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 语音通知返回结果(Java 版)。
|
||||
*/
|
||||
@Data
|
||||
public class VmsNoticeResponse {
|
||||
|
||||
/** 是否调用成功 */
|
||||
private boolean success;
|
||||
|
||||
/** 阿里云返回的状态码 */
|
||||
private String code;
|
||||
|
||||
/** 状态码描述信息 */
|
||||
private String message;
|
||||
|
||||
/** 呼叫ID */
|
||||
private String callId;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.intc.iot.domain.bo;
|
||||
|
||||
import com.intc.common.mybatis.core.domain.BaseEntity;
|
||||
import com.intc.iot.domain.DeviceRealtimeData;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 设备实时数据业务对象
|
||||
*
|
||||
* @author intc
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = DeviceRealtimeData.class, reverseConvertGenerate = false)
|
||||
public class DeviceRealtimeDataBo extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 产品Key
|
||||
*/
|
||||
private String productKey;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* IoT平台设备ID
|
||||
*/
|
||||
private String iotId;
|
||||
|
||||
/**
|
||||
* 数据类型:property-属性,event-事件
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 属性/事件标识符
|
||||
*/
|
||||
private String identifier;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.intc.iot.domain.vo;
|
||||
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import com.intc.iot.domain.DeviceRealtimeData;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 设备实时数据视图对象
|
||||
*
|
||||
* @author intc
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = DeviceRealtimeData.class)
|
||||
public class DeviceRealtimeDataVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 产品Key
|
||||
*/
|
||||
@ExcelProperty(value = "产品Key")
|
||||
private String productKey;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@ExcelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* IoT平台设备ID
|
||||
*/
|
||||
@ExcelProperty(value = "设备ID")
|
||||
private String iotId;
|
||||
|
||||
/**
|
||||
* 消息ID
|
||||
*/
|
||||
@ExcelProperty(value = "消息ID")
|
||||
private String messageId;
|
||||
|
||||
/**
|
||||
* 数据类型:property-属性,event-事件
|
||||
*/
|
||||
@ExcelProperty(value = "数据类型")
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 属性/事件标识符
|
||||
*/
|
||||
@ExcelProperty(value = "标识符")
|
||||
private String identifier;
|
||||
|
||||
/**
|
||||
* 数据内容(JSON格式)
|
||||
*/
|
||||
@ExcelProperty(value = "数据内容")
|
||||
private String dataContent;
|
||||
|
||||
/**
|
||||
* 数据上报时间
|
||||
*/
|
||||
@ExcelProperty(value = "上报时间")
|
||||
private LocalDateTime reportTime;
|
||||
|
||||
/**
|
||||
* 原始Topic
|
||||
*/
|
||||
@ExcelProperty(value = "Topic")
|
||||
private String topic;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user