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

    /** 学习id */
    private Integer studyId;

    /** 学习资料id */
    private Integer resourceId;
    @Excel(name = "学习资料标题")
    private String title;
    private CmcResource resource;
    @Excel(name = "学习资料类型")
    private String type;

    /** 用户id */
    private Long userId;
    @Excel(name = "姓名")
    private String nickName;
    private SysUser user;

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

    /** 上次位置（视频文本百分比） */
    @Excel(name = "上次位置", readConverterExp = "视=频文本百分比")
    private String lastPoint;

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

    /** 可获学时 */
    @Excel(name = "可获学时")
    private Double getHours;

    public void setStudyId(Integer studyId) 
    {
        this.studyId = studyId;
    }

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

    public Integer getResourceId() 
    {
        return resourceId;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setDeptId(Long deptId)
    {
        this.deptId = deptId;
    }

    public Long getDeptId()
    {
        return deptId;
    }
    public void setLastPoint(String lastPoint) 
    {
        this.lastPoint = lastPoint;
    }

    public String getLastPoint() 
    {
        return lastPoint;
    }
    public void setTitle(String title)
    {
        this.title = title;
    }

    public String getTitle()
    {
        return title;
    }
    public void setType(String type)
    {
        this.type = type;
    }

    public String getType()
    {
        return type;
    }
    public void setLastTime(Date lastTime) 
    {
        this.lastTime = lastTime;
    }

    public Date getLastTime() 
    {
        return lastTime;
    }
    public void setGetHours(Double getHours) 
    {
        this.getHours = getHours;
    }

    public Double getGetHours() 
    {
        return getHours;
    }
    public void setResource(CmcResource resource)
    {
        this.resource = resource;
    }

    public CmcResource getResource()
    {
        return resource;
    }
    public void setUser(SysUser user)
    {
        this.user = user;
        this.nickName = user == null ? "" : user.getNickName();
    }

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

    public SysDept getDept()
    {
        return dept;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("studyId", getStudyId())
            .append("resourceId", getResourceId())
            .append("userId", getUserId())
            .append("lastPoint", getLastPoint())
            .append("lastTime", getLastTime())
            .append("getHours", getGetHours())
            .toString();
    }
}
