package com.ruoyi.oa.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.entity.SysUser;

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;

/**
 * cmc仪器记录对象 cmc_device_log
 * 
 * @author cmc
 * @date 2025-06-10
 */
public class CmcDeviceLog extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 使用记录id */
    private Integer logId;

    /** 设备id */
    @Excel(name = "设备编码")
    private String deviceNumber;
    @Excel(name = "设备名称")
    private String name;
    @Excel(name = "出厂编号")
    private String code;
    @Excel(name = "品牌")
    private String brand;
    @Excel(name = "系列")
    private String series;
    private Integer deviceId;

    /** 项目id */
    @Excel(name = "项目编号")
    private String projectNumber;
    @Excel(name = "项目名称")
    private String projectName;
    private String projectId;

    /** 用途类型 */
    @Excel(name = "用途类型")
    private String usageType;

    /** 使用日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "使用日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date useDate;

    /** 天气 */
    @Excel(name = "天气")
    private String weather;

    /** 点号 */
    @Excel(name = "点号")
    private String position;

    /** 高值类型 */
    @Excel(name = "高值类型")
    private String heightType;

    /** 高值 */
    @Excel(name = "高值")
    private Double height;

    /** 干温 */
    @Excel(name = "干温")
    private String dryTemperature;

    /** 湿温 */
    @Excel(name = "湿温")
    private String wetTemperature;

    /** 气压 */
    @Excel(name = "气压")
    private String airPressure;

    /** 开机时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @Excel(name = "开机时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
    private Date powerOn;

    /** 关机时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @Excel(name = "关机时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
    private Date powerOff;

    /** 记录员 */
    @Excel(name = "记录员")
    private String nickName;
    private Long userId;

    private SysUser user;

    private CmcProject project;

    private CmcDevice device;

    public void setLogId(Integer logId) 
    {
        this.logId = logId;
    }

    public Integer getLogId() 
    {
        return logId;
    }
    public void setDeviceId(Integer deviceId) 
    {
        this.deviceId = deviceId;
    }

    public Integer getDeviceId() 
    {
        return deviceId;
    }
    public void setDevice(CmcDevice device)
    {
        this.device = device;
        if (device != null) {
            this.deviceNumber = device.getDeviceNumber();
            this.brand = device.getBrand();
            this.series = device.getSeries();
            this.name = device.getName();
            this.code = device.getCode();
        }
    }

    public CmcDevice getDevice()
    {
        return device;
    }
    public void setProjectId(String projectId) 
    {
        this.projectId = projectId;
    }

    public String getProjectId() 
    {
        return projectId;
    }
    public void setProject(CmcProject project)
    {
        this.project = project;
        this.projectNumber = project == null ? "" : project.getProjectNumber();
        this.projectName = project == null ? "" : project.getProjectName();
    }

    public CmcProject getProject()
    {
        return project;
    }
    public void setUsageType(String usageType) 
    {
        this.usageType = usageType;
    }

    public String getUsageType() 
    {
        return usageType;
    }
    public void setUseDate(Date useDate) 
    {
        this.useDate = useDate;
    }

    public Date getUseDate() 
    {
        return useDate;
    }
    public void setWeather(String weather) 
    {
        this.weather = weather;
    }

    public String getWeather() 
    {
        return weather;
    }
    public void setPosition(String position) 
    {
        this.position = position;
    }

    public String getPosition() 
    {
        return position;
    }
    public void setHeightType(String heightType) 
    {
        this.heightType = heightType;
    }

    public String getHeightType() 
    {
        return heightType;
    }
    public void setHeight(Double height)
    {
        this.height = height;
    }

    public Double getHeight()
    {
        return height;
    }
    public void setDryTemperature(String dryTemperature) 
    {
        this.dryTemperature = dryTemperature;
    }

    public String getDryTemperature() 
    {
        return dryTemperature;
    }
    public void setWetTemperature(String wetTemperature) 
    {
        this.wetTemperature = wetTemperature;
    }

    public String getWetTemperature() 
    {
        return wetTemperature;
    }
    public void setAirPressure(String airPressure) 
    {
        this.airPressure = airPressure;
    }

    public String getAirPressure() 
    {
        return airPressure;
    }
    public void setPowerOn(Date powerOn) 
    {
        this.powerOn = powerOn;
    }

    public Date getPowerOn() 
    {
        return powerOn;
    }
    public void setPowerOff(Date powerOff) 
    {
        this.powerOff = powerOff;
    }

    public Date getPowerOff() 
    {
        return powerOff;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setUser(SysUser user)
    {
        this.user = user;
        this.nickName = user != null ? user.getNickName() : "";
    }

    public SysUser getUser()
    {
        return user;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("logId", getLogId())
            .append("deviceId", getDeviceId())
            .append("projectId", getProjectId())
            .append("usageType", getUsageType())
            .append("useDate", getUseDate())
            .append("weather", getWeather())
            .append("position", getPosition())
            .append("heightType", getHeightType())
            .append("dryTemperature", getDryTemperature())
            .append("wetTemperature", getWetTemperature())
            .append("airPressure", getAirPressure())
            .append("powerOn", getPowerOn())
            .append("powerOff", getPowerOff())
            .append("userId", getUserId())
            .toString();
    }
}
