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.Data;
|
|
|
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设备传来的数据
|
|
|
|
|
* @author wjh
|
|
|
|
|
* 2024/3/20
|
|
|
|
|
*/
|
|
|
|
|
@Data
|
|
|
|
|
public class IotDeviceInfo {
|
2024-11-06 17:59:11 +08:00
|
|
|
|
private String mac;
|
|
|
|
|
|
2024-04-19 16:36:24 +08:00
|
|
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
|
|
|
private Date at; // 时间
|
|
|
|
|
|
|
|
|
|
private BigDecimal v; // 电压
|
2024-09-19 16:10:04 +08:00
|
|
|
|
private BigDecimal p; // 功率(瓦)
|
2024-04-19 16:36:24 +08:00
|
|
|
|
private BigDecimal a; // 电流
|
2024-08-15 21:23:07 +08:00
|
|
|
|
private BigDecimal w; // 总用电量(度)
|
2024-04-19 16:36:24 +08:00
|
|
|
|
private String s; // 开关状态,0不通电,1闭合通电
|
|
|
|
|
private BigDecimal m; // 剩余电量(度)
|
2024-09-25 18:30:23 +08:00
|
|
|
|
private String set; // 开关设置状态
|
2024-05-20 16:04:35 +08:00
|
|
|
|
private BigDecimal time; // 剩余时间(秒)
|
2024-07-19 17:48:58 +08:00
|
|
|
|
private String model; // 型号
|
|
|
|
|
private String wifi; // WIFI
|
2024-10-18 10:06:09 +08:00
|
|
|
|
private String version; // 版本号
|
2024-12-16 21:36:17 +08:00
|
|
|
|
private BigDecimal vxs; // 电压系数
|
2024-04-19 16:36:24 +08:00
|
|
|
|
|
|
|
|
|
public static IotDeviceInfo newDefaultInstance() {
|
2025-01-15 17:14:48 +08:00
|
|
|
|
IotDeviceInfo info = new IotDeviceInfo();
|
|
|
|
|
info.setV(BigDecimal.ZERO);
|
|
|
|
|
info.setP(BigDecimal.ZERO);
|
|
|
|
|
info.setA(BigDecimal.ZERO);
|
|
|
|
|
info.setW(BigDecimal.ZERO);
|
|
|
|
|
info.setS("0");
|
|
|
|
|
info.setM(BigDecimal.ZERO);
|
|
|
|
|
info.setSet(DeviceOutageWay.IMMEDIATE.getValue());
|
|
|
|
|
info.setTime(BigDecimal.ZERO);
|
|
|
|
|
info.setModel(null);
|
|
|
|
|
info.setVersion(null);
|
|
|
|
|
info.setVxs(BigDecimal.ONE);
|
|
|
|
|
return info;
|
2024-04-19 16:36:24 +08:00
|
|
|
|
}
|
|
|
|
|
}
|