package com.ruoyi.bst.device.domain;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.validate.ValidGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 设备对象 bst_device
 *
 * @author ruoyi
 * @date 2025-04-23
 */
@Data
public class Device extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    private Long deviceId;

    @Excel(name = "设备编号", readConverterExp = "设备编号（SN)")
    @ApiModelProperty("设备编号")
    @NotBlank(message = "SN不可以为空",groups = {ValidGroup.Create.class})
    private String deviceNo;

    @Excel(name = "所属卡座ID")
    @ApiModelProperty("所属店铺id")
    private Long boothId;

    @Excel(name = "所属店铺ID")
    @ApiModelProperty("所属店铺ID")
    private Long storeId;

    @Excel(name = "所属用户id")
    @ApiModelProperty("所属用户id")
    private Long userId;

    @Excel(name = "型号id")
    @ApiModelProperty("型号id")
    @NotNull(message = "设备型号不可以为空",groups = {ValidGroup.Create.class})
    private Long modelId;

    @Excel(name = "设备名称")
    @ApiModelProperty("设备名称")
    private String deviceName;

    @Excel(name = "设备Mac号")
    @ApiModelProperty("设备Mac号")
    @NotBlank(message = "设备MAC号不可以为空",groups = {ValidGroup.Create.class})
    private String mac;

    @Excel(name = "设备Mac号2")
    @ApiModelProperty("设备Mac号2")
    private String mac2;

    @Excel(name = "总用电量(kwh)")
    @ApiModelProperty("总用电量(kwh)")
    private BigDecimal totalElectriQuantity;

    @Excel(name = "在线状态：0-不在线；1-在线")
    @ApiModelProperty("在线状态：0-不在线；1-在线")
    private String onlineStatus;

    @Excel(name = "状态：1正常，2使用中，3维修中")
    @ApiModelProperty("状态：1正常，2使用中，3维修中")
    private String status;

    @Excel(name = "实时功率，单位：kw千瓦")
    @ApiModelProperty("实时功率，单位：kw千瓦")
    private BigDecimal realTimePower;

    @Excel(name = "电流：单位：A")
    @ApiModelProperty("电流：单位：A")
    private BigDecimal electricity;

    @Excel(name = "电压：单位：V")
    @ApiModelProperty("电压：单位：V")
    private BigDecimal voltage;

    @Excel(name = "开关设置", readConverterExp = "0=正,1=反")
    @ApiModelProperty("开关设置")
    private String set;

    @Excel(name = "wifi名称")
    @ApiModelProperty("wifi名称")
    private String wifi;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "上次拉取设备信息时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("上次拉取设备信息时间")
    private Date lastPullTime;

    @Excel(name = "总电量初始读数")
    @ApiModelProperty("总电量初始读数")
    private BigDecimal initReading;

    @Excel(name = "开关状态，0断电，1通电")
    @ApiModelProperty("开关状态，0断电，1通电")
    private String powerStatus;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "设备到期时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("设备到期时间")
    private LocalDateTime expireTime;

    @Excel(name = "用户自定义图片")
    @ApiModelProperty("用户自定义图片")
    private String customPicture;

    @Excel(name = "剩余时长", readConverterExp = "秒=")
    @ApiModelProperty("剩余时长")
    private BigDecimal remainTime;

    @Excel(name = "剩余电量", readConverterExp = "度=")
    @ApiModelProperty("剩余电量")
    private BigDecimal surplusEle;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后在线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("最后在线时间")
    private LocalDateTime lastOnlineTime;

    @Excel(name = "在线状态1：0-不在线；1-在线")
    @ApiModelProperty("在线状态1：0-不在线；1-在线")
    private String onlineStatus1;

    @Excel(name = "在线状态2：0-不在线；1-在线")
    @ApiModelProperty("在线状态2：0-不在线；1-在线")
    private String onlineStatus2;

    @Excel(name = "设备版本号")
    @ApiModelProperty("设备版本号")
    private String version;

    @Excel(name = "结束使用的电量", readConverterExp = "度=")
    @ApiModelProperty("结束使用的电量")
    private BigDecimal expireEle;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后一次设置总电量初始读数的时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("最后一次设置总电量初始读数的时间")
    private Date lastInitReading;

    @Excel(name = "电压系数")
    @ApiModelProperty("电压系数")
    private BigDecimal vxs;

    @Excel(name = "物联网卡号IMSI")
    @ApiModelProperty("物联网卡号IMSI")
    private String imsi;

    @Excel(name = "电量系数")
    @ApiModelProperty("电量系数")
    private BigDecimal wxs;

    @Excel(name = "最后一次恢复余额的时间")
    @ApiModelProperty("最后一次恢复余额的时间")
    private Long lastRecoverTime;

    @Excel(name = "开启时长")
    @ApiModelProperty("开启时长")
    private Long duration;

}
