package cn.com.qmth.stmms.admin.dto;

import org.apache.commons.lang.StringUtils;

import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
import cn.com.qmth.stmms.common.annotation.ExcelField;

public class ExamStudentDTO {

    @ExcelField(title = "学习中心", align = 2, sort = 10)
    private String campusName;

    @ExcelField(title = "课程代码", align = 2, sort = 20)
    private String subjectCode;

    @ExcelField(title = "课程名称", align = 2, sort = 30)
    private String subjectName;

    @ExcelField(title = "层次", align = 2, sort = 40)
    private String subjectLevel;

    @ExcelField(title = "专业类型", align = 2, sort = 50)
    private String subjectCategory;

    @ExcelField(title = "准考证号", align = 2, sort = 60)
    private String examNumber;

    @ExcelField(title = "学号", align = 2, sort = 70)
    private String studentCode;

    @ExcelField(title = "姓名", align = 2, sort = 80)
    private String name;

    @ExcelField(title = "客观总分", align = 2, sort = 90)
    private double objectiveScore;

    @ExcelField(title = "主观总分", align = 2, sort = 100)
    private double subjectiveScore;

    @ExcelField(title = "总分", align = 2, sort = 110)
    private double totalScore;

    @ExcelField(title = "是否缺考", align = 2, sort = 120)
    private String absent;

    @ExcelField(title = "是否违纪", align = 2, sort = 130)
    private String breach;

    @ExcelField(title = "评分明细", align = 2, sort = 140)
    private String subjectiveScoreList;

    @ExcelField(title = "备注", align = 2, sort = 150)
    private String remark;

    public ExamStudentDTO(ExamStudent student) {
        setCampusName(student.getCampusName());
        setSubjectCode(student.getSubjectCode());
        setSubjectName(student.getSubjectName());
        setSubjectLevel(student.getSubjectLevel());
        setSubjectCategory(student.getSubjectCategory());
        setExamNumber(student.getExamNumber());
        setStudentCode(student.getStudentCode());
        setName(student.getName());
        setObjectiveScore(student.getObjectiveScore()!=null?student.getObjectiveScore():0d);
        setSubjectiveScore(student.getSubjectiveScore()!=null?student.getSubjectiveScore():0d);
        setSubjectiveScoreList(StringUtils.trimToEmpty(student.getSubjectiveScoreList()));
        setTotalScore(student.getTotalScore());
        setAbsent(student.isAbsent() || !student.isUpload()?"是":"否");
        setBreach(student.isBreach()?"是":"否");
        setRemark(StringUtils.trimToEmpty(student.getRemark()));
    }

    public String getCampusName() {
        return campusName;
    }

    public void setCampusName(String campusName) {
        this.campusName = campusName;
    }

    public String getSubjectCode() {
        return subjectCode;
    }

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

    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    public String getStudentCode() {
        return studentCode;
    }

    public void setStudentCode(String studentCode) {
        this.studentCode = studentCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getExamNumber() {
        return examNumber;
    }

    public void setExamNumber(String examNumber) {
        this.examNumber = examNumber;
    }

    public double getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(double totalScore) {
        this.totalScore = totalScore;
    }

    public double getObjectiveScore() {
        return objectiveScore;
    }

    public void setObjectiveScore(double objectiveScore) {
        this.objectiveScore = objectiveScore;
    }

    public double getSubjectiveScore() {
        return subjectiveScore;
    }

    public void setSubjectiveScore(double subjectiveScore) {
        this.subjectiveScore = subjectiveScore;
    }

    public String getSubjectiveScoreList() {
        return subjectiveScoreList;
    }

    public void setSubjectiveScoreList(String subjectiveScoreList) {
        this.subjectiveScoreList = subjectiveScoreList;
    }

    public String getRemark() {
        return remark;
    }

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

    public String getSubjectLevel() {
        return subjectLevel;
    }

    public void setSubjectLevel(String subjectLevel) {
        this.subjectLevel = subjectLevel;
    }

    public String getSubjectCategory() {
        return subjectCategory;
    }

    public void setSubjectCategory(String subjectCategory) {
        this.subjectCategory = subjectCategory;
    }

    public String getAbsent() {
        return absent;
    }

    public void setAbsent(String absent) {
        this.absent = absent;
    }

    public String getBreach() {
        return breach;
    }

    public void setBreach(String breach) {
        this.breach = breach;
    }
}
