package com.ruoyi.oa.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.entity.SysDept;
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_material_give
 * 
 * @author cmc
 * @date 2024-07-31
 */
public class CmcMaterialGive extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 耗材发放id */
    private Integer giveId;

    /** 耗材id */
    @Excel(name = "耗材名称")
    private String name;
    @Excel(name = "品牌")
    private String brand;
    @Excel(name = "系列")
    private String series;
    private Integer materialId;

    /** 发放时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "发放时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date giveTime;

    /** 领用人 */
    @Excel(name = "领用人")
    private String acceptUserName;
    private Long accepter;

    /** 领用部门 */
    @Excel(name = "领用部门")
    private String deptName;
    private Long useDept;

    /** 领用数量 */
    @Excel(name = "领用数量")
    private Double giveNum;

    private SysUser acceptUser;

    private SysDept dept;

    private CmcMaterial material;

    public void setGiveId(Integer giveId) 
    {
        this.giveId = giveId;
    }

    public Integer getGiveId() 
    {
        return giveId;
    }
    public void setMaterialId(Integer materialId) 
    {
        this.materialId = materialId;
    }

    public Integer getMaterialId() {
        return materialId;
    }
    public void setMaterial(CmcMaterial material)
    {
        this.material = material;
        if (material != null) {
            this.brand = material.getBrand();
            this.series = material.getSeries();
            this.name = material.getName();
        }
    }

    public CmcMaterial getMaterial()
    {
        return material;
    }
    public void setGiveTime(Date giveTime) 
    {
        this.giveTime = giveTime;
    }

    public Date getGiveTime() 
    {
        return giveTime;
    }
    public void setAccepter(Long accepter) 
    {
        this.accepter = accepter;
    }

    public Long getAccepter() 
    {
        return accepter;
    }
    public void setAcceptUser(SysUser acceptUser)
    {
        this.acceptUser = acceptUser;
        this.acceptUserName = acceptUser == null ? "" : acceptUser.getNickName();
    }

    public SysUser getAcceptUser()
    {
        return acceptUser;
    }
    public void setUseDept(Long useDept) 
    {
        this.useDept = useDept;
    }

    public Long getUseDept() 
    {
        return useDept;
    }
    public void setDept(SysDept dept)
    {
        this.dept = dept;
        this.deptName = dept == null ? "" : dept.getDeptName();
    }

    public SysDept getDept()
    {
        return dept;
    }
    public void setGiveNum(Double giveNum) 
    {
        this.giveNum = giveNum;
    }

    public Double getGiveNum() 
    {
        return giveNum;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("giveId", getGiveId())
            .append("materialId", getMaterialId())
            .append("giveTime", getGiveTime())
            .append("accepter", getAccepter())
            .append("useDept", getUseDept())
            .append("giveNum", getGiveNum())
            .append("remark", getRemark())
            .toString();
    }
}
