2024-04-23 11:19:24 +08:00
|
|
|
|
package com.ruoyi.iot.domain;
|
2024-04-19 16:36:24 +08:00
|
|
|
|
|
2024-04-23 11:19:24 +08:00
|
|
|
|
import com.ruoyi.ss.device.domain.enums.DeviceOutageWay;
|
2024-04-19 16:36:24 +08:00
|
|
|
|
import lombok.Builder;
|
|
|
|
|
import lombok.Data;
|
|
|
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设备传来的数据
|
|
|
|
|
* @author wjh
|
|
|
|
|
* 2024/3/20
|
|
|
|
|
*/
|
|
|
|
|
@Data
|
|
|
|
|
@Builder
|
|
|
|
|
public class IotDeviceInfo {
|
|
|
|
|
private String id; // iot设备id
|
|
|
|
|
|
|
|
|
|
private String mac; // 设备mac
|
|
|
|
|
|
|
|
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
|
|
|
private Date at; // 时间
|
|
|
|
|
|
|
|
|
|
private BigDecimal v; // 电压
|
|
|
|
|
private BigDecimal p; // 功率
|
|
|
|
|
private BigDecimal a; // 电流
|
|
|
|
|
private BigDecimal w; // 电量
|
|
|
|
|
private String s; // 开关状态,0不通电,1闭合通电
|
|
|
|
|
private BigDecimal m; // 剩余电量(度)
|
|
|
|
|
private String set; // 欠费断电方式
|
|
|
|
|
|
|
|
|
|
public static IotDeviceInfo newDefaultInstance() {
|
|
|
|
|
return IotDeviceInfo.builder()
|
|
|
|
|
.v(BigDecimal.ZERO)
|
|
|
|
|
.p(BigDecimal.ZERO)
|
|
|
|
|
.a(BigDecimal.ZERO)
|
|
|
|
|
.w(BigDecimal.ZERO)
|
|
|
|
|
.s("0")
|
|
|
|
|
.m(BigDecimal.ZERO)
|
|
|
|
|
.set(DeviceOutageWay.IMMEDIATE.getValue())
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|