package com.ruoyi.oa.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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_scrap
 * 
 * @author cmc
 * @date 2024-05-21
 */
public class CmcDeviceScrap extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 设备报废id */
    private Integer deviceScrapId;

    /** 车辆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;

    /** 原价值 */
    @Excel(name = "原价值")
    private BigDecimal cost;

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

    /** 报废原因 */
    @Excel(name = "报废原因")
    private String reason;

    /** 处理结果 */
    @Excel(name = "处理结果")
    private String deal;

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

    private CmcCar car;

    private CmcDevice device;

    public void setDeviceScrapId(Integer deviceScrapId)
    {
        this.deviceScrapId = deviceScrapId;
    }

    public Integer getDeviceScrapId()
    {
        return deviceScrapId;
    }
    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 setCarId(Integer carId)
    {
        this.carId = carId;
    }

    public Integer getCarId()
    {
        return carId;
    }
    public void setCar(CmcCar car)
    {
        this.car = car;
        this.licensePlate = car == null ? "" :car.getLicensePlate();
    }

    public CmcCar getCar()
    {
        return car;
    }
    public void setCost(BigDecimal cost) 
    {
        this.cost = cost;
    }

    public BigDecimal getCost() 
    {
        return cost;
    }
    public void setScrapDate(Date scrapDate) 
    {
        this.scrapDate = scrapDate;
    }

    public Date getScrapDate() 
    {
        return scrapDate;
    }
    public void setReason(String reason) 
    {
        this.reason = reason;
    }

    public String getReason() 
    {
        return reason;
    }
    public void setDeal(String deal) 
    {
        this.deal = deal;
    }

    public String getDeal() 
    {
        return deal;
    }
    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("deviceScrapId", getDeviceScrapId())
            .append("deviceId", getDeviceId())
            .append("carId", getCarId())
            .append("cost", getCost())
            .append("scrapDate", getScrapDate())
            .append("reason", getReason())
            .append("deal", getDeal())
            .append("remark", getRemark())
            .append("document", getDocument())
            .toString();
    }
}
