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_resource
 * 
 * @author cmc
 * @date 2025-03-05
 */
public class CmcResource extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 资料id */
    private Integer resourceId;

    /** 上传人 */
    private Long uploader;
    @Excel(name = "上传人")
    private String uploadUserName;
    private SysUser uploadUser;

    /** 上传部门 */
    private Long uploadDept;
    @Excel(name = "上传部门")
    private String deptName;
    private SysDept dept;

    /** 标题 */
    @Excel(name = "标题")
    private String title;

    /** 上传附件 */
    @Excel(name = "上传附件")
    private String sourcePath;

    /** 文件类型 */
    @Excel(name = "文件类型")
    private String type;

    /** 专业领域 */
    private Integer fieldId;
    private CmcResourceField resourceField;
    @Excel(name = "专业领域")
    private String field;

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

    /** 学习时长 */
    @Excel(name = "学习时长")
    private Double hours;

    public void setResourceId(Integer resourceId) 
    {
        this.resourceId = resourceId;
    }

    public Integer getResourceId() 
    {
        return resourceId;
    }
    public void setUploader(Long uploader) 
    {
        this.uploader = uploader;
    }

    public Long getUploader() 
    {
        return uploader;
    }
    public void setUploadDept(Long uploadDept) 
    {
        this.uploadDept = uploadDept;
    }

    public Long getUploadDept() 
    {
        return uploadDept;
    }
    public void setTitle(String title) 
    {
        this.title = title;
    }

    public String getTitle() 
    {
        return title;
    }
    public void setSourcePath(String sourcePath) 
    {
        this.sourcePath = sourcePath;
    }

    public String getSourcePath() 
    {
        return sourcePath;
    }
    public void setType(String type) 
    {
        this.type = type;
    }

    public String getType() 
    {
        return type;
    }
    public void setField(String field)
    {
        this.field = field;
    }

    public String getField()
    {
        return field;
    }
    public void setFieldId(Integer fieldId)
    {
        this.fieldId = fieldId;
    }

    public Integer getFieldId()
    {
        return fieldId;
    }
    public void setUploadTime(Date uploadTime) 
    {
        this.uploadTime = uploadTime;
    }

    public Date getUploadTime() 
    {
        return uploadTime;
    }
    public void setHours(Double hours)
    {
        this.hours = hours;
    }

    public Double getHours()
    {
        return hours;
    }
    public void setUploadUser(SysUser uploadUser)
    {
        this.uploadUser = uploadUser;
        this.uploadUserName = uploadUser == null ? "" : uploadUser.getNickName();
    }

    public SysUser getUploadUser()
    {
        return uploadUser;
    }
    public void setDept(SysDept dept)
    {
        this.dept = dept;
        this.deptName = dept == null ? "" : dept.getDeptName();
    }

    public SysDept getDept()
    {
        return dept;
    }
    public void setResourceField(CmcResourceField resourceField)
    {
        this.resourceField = resourceField;
        this.field = resourceField == null ? "" : resourceField.getField();
    }

    public CmcResourceField getResourceField()
    {
        return resourceField;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("resourceId", getResourceId())
            .append("uploader", getUploader())
            .append("uploadDept", getUploadDept())
            .append("title", getTitle())
            .append("sourcePath", getSourcePath())
            .append("type", getType())
            .append("fieldId", getFieldId())
            .append("uploadTime", getUploadTime())
            .append("hours", getHours())
            .toString();
    }
}
