package cn.com.qmth.stmms.biz.distributpaper.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import cn.com.qmth.stmms.biz.exam.model.Marker;
import cn.com.qmth.stmms.biz.exam.model.SubjectiveBlock;
import cn.com.qmth.stmms.common.enums.LibraryStatus;
import cn.com.qmth.stmms.common.enums.LibraryType;

@Entity
@Table(name = "m_problem_library")
public class ProblemLibrary implements Serializable {

    private static final long serialVersionUID = -8940367483803324547L;

    @Id
    @GeneratedValue
    private Integer id;

    /**
     * 学习中心CODE
     */
    @Column(name = "campus_code")
    private String campusCode;

    /**
     * 考试ID
     */
    @Column(name = "exam_id")
    private Integer examId;

    /**
     * 科目CODE
     */
    @Column(name = "subject_Code")
    private String subjectCode;

    /**
     * 库ID
     */
    @Column(name = "library_id")
    private Integer libraryId;

    /**
     * 类型：0：样卷1：试评2：正评
     */
    @Column(name = "type")
    @Enumerated(EnumType.ORDINAL)
    private LibraryType type;

    /**
     * 科目块ID
     */
    @Column(name = "block_id")
    private Integer blockId;

    /**
     * 密号
     */
    @Column(name = "secret_no")
    private Integer secretNo;

    /**
     * 原因
     */
    @Column(name = "reason")
    private Integer reason;

    /**
     * 发生时间
     */
    @Column(name = "submit_time")
    private Date submitTime;

    /**
     * 提交人ID
     */
    @Column(name = "submitter")
    private Integer submitter;

    /**
     * 状态
     */
    @Enumerated(EnumType.ORDINAL)
    @Column(name = "status")
    private LibraryStatus status;

    /**
     * 一评、二评
     */
    @Transient
    private Integer stage;

    @Transient
    private Marker marker;

    @Transient
    private SubjectiveBlock subjectiveBlock;

    @Transient
    private String pictureConfig;

    @Transient
    private List<String> pictureUrls;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getSecretNo() {
        return secretNo;
    }

    public void setSecretNo(Integer secretNo) {
        this.secretNo = secretNo;
    }

    public Integer getBlockId() {
        return blockId;
    }

    public void setBlockId(Integer blockId) {
        this.blockId = blockId;
    }

    public Integer getReason() {
        return reason;
    }

    public void setReason(Integer reason) {
        this.reason = reason;
    }

    public Date getSubmitTime() {
        return submitTime;
    }

    public void setSubmitTime(Date submitTime) {
        this.submitTime = submitTime;
    }

    public Integer getSubmitter() {
        return submitter;
    }

    public void setSubmitter(Integer submitter) {
        this.submitter = submitter;
    }

    public Marker getMarker() {
        return marker;
    }

    public void setMarker(Marker marker) {
        this.marker = marker;
    }

    public SubjectiveBlock getSubjectiveBlock() {
        return subjectiveBlock;
    }

    public void setSubjectiveBlock(SubjectiveBlock subjectiveBlock) {
        this.subjectiveBlock = subjectiveBlock;
    }

    public Integer getStage() {
        return stage;
    }

    public void setStage(Integer stage) {
        this.stage = stage;
    }

    public LibraryType getType() {
        return type;
    }

    public void setType(LibraryType type) {
        this.type = type;
    }

    public Integer getLibraryId() {
        return libraryId;
    }

    public void setLibraryId(Integer libraryId) {
        this.libraryId = libraryId;
    }

    public LibraryStatus getStatus() {
        return status;
    }

    public void setStatus(LibraryStatus status) {
        this.status = status;
    }

    public String getPictureConfig() {
        return pictureConfig;
    }

    public void setPictureConfig(String pictureConfig) {
        this.pictureConfig = pictureConfig;
    }

    public String getPictureUrls() {
        StringBuilder sb = new StringBuilder();
        sb.append("[");
        if (pictureUrls != null && pictureUrls.size() > 0) {
            int length = pictureUrls.size();
            for (int i = 0; i < length; i++) {
                sb.append("\"").append(pictureUrls.get(i)).append("\"");
                if (i < (length - 1)) {
                    sb.append(",");
                }
            }
        }
        sb.append("]");
        return sb.toString();
    }

    public void setPictureUrls(List<String> pictureUrls) {
        this.pictureUrls = pictureUrls;
    }

    public String getCampusCode() {
        return campusCode;
    }

    public void setCampusCode(String campusCode) {
        this.campusCode = campusCode;
    }

    public Integer getExamId() {
        return examId;
    }

    public void setExamId(Integer examId) {
        this.examId = examId;
    }

    public String getSubjectCode() {
        return subjectCode;
    }

    public void setSubjectCode(String subjectCode) {
        this.subjectCode = subjectCode;
    }

}
