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

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

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import cn.com.qmth.stmms.biz.mark.model.PictureConfigItem;
import cn.com.qmth.stmms.common.enums.CardSource;

/**
 * 卡格式
 */
@Entity
@Table(name = "eb_answer_card")
public class AnswerCard implements Serializable {

    private static final long serialVersionUID = 9094397873995690949L;

    @EmbeddedId
    private AnswerCardPK pk;

    private String code;

    @Column(name = "paper_count", nullable = false)
    private Integer paperCount;

    @Enumerated(EnumType.STRING)
    @Column(name = "source", length = 16, nullable = false)
    private CardSource source;

    @Column(name = "need_adapte", nullable = true)
    private Boolean needAdapte;

    @Column(name = "single_page", nullable = true)
    private Boolean singlePage;

    private String parameter;

    private String remark;

    private String md5;

    private Integer dpi;

    @Column(name = "slice_config", nullable = false)
    private String sliceConfig;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "update_time")
    private Date updateTime;

    public AnswerCard() {
        this.pk = new AnswerCardPK();
    }

    public Integer getExamId() {
        return pk.getExamId();
    }

    public void setExamId(Integer examId) {
        pk.setExamId(examId);
    }

    public Integer getNumber() {
        return pk.getNumber();
    }

    public void setNumber(Integer number) {
        pk.setNumber(number);
    }

    public Integer getPaperCount() {
        return paperCount;
    }

    public void setPaperCount(Integer paperCount) {
        this.paperCount = paperCount;
    }

    public CardSource getSource() {
        return source;
    }

    public void setSource(CardSource source) {
        this.source = source;
    }

    public Boolean getNeedAdapte() {
        return needAdapte;
    }

    public void setNeedAdapte(Boolean needAdapte) {
        this.needAdapte = needAdapte;
    }

    public Boolean getSinglePage() {
        return singlePage;
    }

    public void setSinglePage(Boolean singlePage) {
        this.singlePage = singlePage;
    }

    public String getParameter() {
        return parameter;
    }

    public void setParameter(String parameter) {
        this.parameter = parameter;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getMd5() {
        return md5;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }

    public String getSliceConfig() {
        return sliceConfig;
    }

    public void setSliceConfig(String sliceConfig) {
        this.sliceConfig = sliceConfig;
    }

    public List<PictureConfigItem> getSliceConfigList() {
        return PictureConfigItem.parse(sliceConfig);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getDpi() {
        return dpi;
    }

    public void setDpi(Integer dpi) {
        this.dpi = dpi;
    }

}
