From 8029e7812732f265c18befadd3816c44894d95ce Mon Sep 17 00:00:00 2001 From: "938693313@qq.com" <938693313@qq.com> Date: Wed, 20 May 2026 11:39:27 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=96=B0=E5=A2=9EQ20=E9=A3=9E=E6=9C=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=8A=E6=8A=A5=E5=92=8C=E9=A3=9E=E6=9C=BA?= =?UTF-8?q?OSD=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../q20/influxdb/Q20BatteryReport.java | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 admin/src/main/java/com/multictrl/modules/business/q20/influxdb/Q20BatteryReport.java diff --git a/admin/src/main/java/com/multictrl/modules/business/q20/influxdb/Q20BatteryReport.java b/admin/src/main/java/com/multictrl/modules/business/q20/influxdb/Q20BatteryReport.java new file mode 100644 index 0000000..1c5b3b7 --- /dev/null +++ b/admin/src/main/java/com/multictrl/modules/business/q20/influxdb/Q20BatteryReport.java @@ -0,0 +1,112 @@ +package com.multictrl.modules.business.q20.influxdb; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.influxdb.annotations.Column; +import com.influxdb.annotations.Measurement; +import com.multictrl.common.utils.DateUtils; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.Instant; + +/** + * Q20设备电池数据 InfluxDB记录 + * + * @author 938693313@qq.com + * @since 1.0.0 2026/5/12 + */ +@AllArgsConstructor +@NoArgsConstructor +@Builder +@Data +@Schema(name = "Q20设备电池上报数据") +@Measurement(name = "q20_battery") +public class Q20BatteryReport { + + @Schema(description = "设备SN") + @Column(tag = true) + private String deviceSn; + + @Schema(description = "电池ID") + @Column(tag = true) + private String battery_id; + + @Schema(description = "架次号") + @Column(tag = true) + private String order_id; + + @Schema(hidden = true) + @Column(timestamp = true) + @JsonProperty("_time") + private Instant time; + + @Schema(description = "满电容量,单位mAh") + @Column + private Integer full_charge_capacity; + + @Schema(description = "剩余电量,单位%") + @Column + private Float charge_remaining; + + @Schema(description = "电压,单位mV") + @Column + private Integer voltage; + + @Schema(description = "电流,单位mA,放电为正充电为负") + @Column + private Integer current; + + @Schema(description = "低电量警告阈值,单位%") + @Column + private Integer low_volt_warn_value; + + @Schema(description = "电池状态:0异常/1开机/2充电中/3需保养") + @Column + private Integer status; + + @Schema(description = "电池温度,单位℃") + @Column + private Float temperature; + + @Schema(description = "充放电循环次数") + @Column + private Integer cycle_index; + + @Schema(description = "本次飞行时长,单位秒") + @Column + private Long time_flying; + + @Schema(description = "剩余可飞时间,单位秒") + @Column + private Integer time_remaining; + + @Schema(description = "剩余充电时间,单位秒") + @Column + private Integer charge_time_remaining; + + @Schema(description = "电池健康度,单位%") + @Column + private Integer health; + + @Schema(description = "电池标志位") + @Column + private Integer flags; + + @Schema(description = "电池唯一标识") + @Column + private String uid; + + @Schema(description = "电池固件版本") + @Column + private String version; + + private String timeStr; + + public void setTime(Instant time) { + this.time = time; + this.timeStr = DateUtils.utcToTime(time); + } +}