fix: 物联网平台,amqp数据接入并插入TD数据库相关逻辑编码。
This commit is contained in:
@@ -25,44 +25,44 @@ public class DeviceSensorData {
|
||||
private Double tfluorescence; // 荧光值
|
||||
private Double phaseDifference; // 相位差
|
||||
private Double battery; // 电池电量
|
||||
|
||||
|
||||
// Getter 方法,返回保留两位小数的值
|
||||
public Double getDissolvedOxygen() {
|
||||
return roundToTwoDecimals(dissolvedOxygen);
|
||||
}
|
||||
|
||||
|
||||
public Double getTemperature() {
|
||||
return roundToTwoDecimals(temperature);
|
||||
}
|
||||
|
||||
|
||||
public Double getSaturability() {
|
||||
return roundToTwoDecimals(saturability);
|
||||
}
|
||||
|
||||
|
||||
public Double getPh() {
|
||||
return roundToTwoDecimals(ph);
|
||||
}
|
||||
|
||||
|
||||
public Double getSalinity() {
|
||||
return roundToTwoDecimals(salinity);
|
||||
}
|
||||
|
||||
|
||||
public Double getTreference() {
|
||||
return roundToTwoDecimals(treference);
|
||||
}
|
||||
|
||||
|
||||
public Double getTfluorescence() {
|
||||
return roundToTwoDecimals(tfluorescence);
|
||||
}
|
||||
|
||||
|
||||
public Double getPhaseDifference() {
|
||||
return roundToTwoDecimals(phaseDifference);
|
||||
}
|
||||
|
||||
|
||||
public Double getBattery() {
|
||||
return roundToTwoDecimals(battery);
|
||||
}
|
||||
|
||||
|
||||
// 工具方法:保留两位小数
|
||||
private Double roundToTwoDecimals(Double value) {
|
||||
if (value == null) {
|
||||
@@ -74,11 +74,12 @@ public class DeviceSensorData {
|
||||
}
|
||||
|
||||
// 标签字段(元数据,不随时间频繁变化)
|
||||
private String tenantId = "111111"; // 租户ID(默认值)
|
||||
private String serialNum; // 设备序列号
|
||||
private long deviceId; // 设备ID(对应TDengine的BIGINT)
|
||||
private long userId; // 用户ID(对应TDengine的BIGINT)
|
||||
private Long deviceId; // 设备ID(对应TDengine的BIGINT)
|
||||
private Long userId; // 用户ID(对应TDengine的BIGINT)
|
||||
private String userName; // 用户名
|
||||
private String mobilePhone; // 手机号
|
||||
private String deviceName; // 设备名称
|
||||
private int deviceType; // 设备类型
|
||||
private Integer deviceType; // 设备类型
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user