package com.ruoyi.oa.domain;

import java.math.BigDecimal;
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_expense
 * 
 * @author cmc
 * @date 2024-05-21
 */
public class CmcDeviceExpense extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 设备费用id */
    private Integer deviceExpenseId;

    /** 车辆id */
    @Excel(name = "车牌号")
    private String licensePlate;
    private Integer carId;

    /** 设备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;

    /** 费用类型（0保险费,1维修保养费,2轮胎费,3检定费） */
    @Excel(name = "费用类型", readConverterExp = "0=保险费,1=维修/保养费,2=轮胎费,3=检定费")
    private String expenseType;

    /** 费用金额 */
    @Excel(name = "费用金额")
    private BigDecimal expense;

    /** 负责人id */
    @Excel(name = "负责人")
    private String nickName;
    private Long userId;

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

    /** 附件 */
//    @Excel(name = "附件")
    private String document;

    private SysUser user;

    private CmcCar car;

    private CmcDevice device;

    public void setDeviceExpenseId(Integer deviceExpenseId)
    {
        this.deviceExpenseId = deviceExpenseId;
    }

    public Integer getDeviceExpenseId()
    {
        return deviceExpenseId;
    }
    public void setDeviceId(Integer deviceId)
    {
        this.deviceId = deviceId;
    }

    public Integer getDeviceId()
    {
        return deviceId;
    }
    public void setCarId(Integer carId)
    {
        this.carId = carId;
    }

    public Integer getCarId()
    {
        return carId;
    }
    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 setCar(CmcCar car)
    {
        this.car = car;
        if (car != null) {
            this.licensePlate = car.getLicensePlate();
        }
    }

    public CmcCar getCar()
    {
        return car;
    }
    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;
    }
    public void setExpenseType(String expenseType) 
    {
        this.expenseType = expenseType;
    }

    public String getExpenseType() 
    {
        return expenseType;
    }
    public void setExpense(BigDecimal expense) 
    {
        this.expense = expense;
    }

    public BigDecimal getExpense() 
    {
        return expense;
    }
    public void setOccurDate(Date occurDate) 
    {
        this.occurDate = occurDate;
    }

    public Date getOccurDate() 
    {
        return occurDate;
    }
    public void setDocument(String document) 
    {
        this.document = document;
    }

    public String getDocument() 
    {
        return document;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("deviceExpenseId", getDeviceExpenseId())
            .append("deviceId", getDeviceId())
            .append("carId", getCarId())
            .append("userId", getUserId())
            .append("expenseType", getExpenseType())
            .append("expense", getExpense())
            .append("occurDate", getOccurDate())
            .append("remark", getRemark())
            .append("document", getDocument())
            .toString();
    }
}
