package com.qmth.distributed.print.business.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.distributed.print.business.bean.dto.report.ReportExamStudentDto;
import com.qmth.teachcloud.common.contant.SystemConstant;
import com.qmth.teachcloud.common.util.JacksonUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 报告考生表
 * </p>
 *
 * @author wangliang
 * @since 2024-02-18
 */
@ApiModel(value = "TRExamStudent对象", description = "报告考生表")
public class TRExamStudent implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "报告id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long rBasicInfoId;

    @ApiModelProperty(value = "考生姓名")
    private String name;

    @ApiModelProperty(value = "学号")
    private String studentCode;

    @ApiModelProperty(value = "行政班级")
    private String administrativeClass;

    @ApiModelProperty(value = "综合成绩")
    private Double score;

    @ApiModelProperty(value = "考生课程考核成绩评价明细结果")
    private String resultDetail;

    public TRExamStudent() {

    }

    public TRExamStudent(Long rBasicInfoId, String name, String studentCode) {
        this.id = SystemConstant.getDbUuid();
        this.rBasicInfoId = rBasicInfoId;
        this.name = name;
        this.studentCode = studentCode;
    }

    public TRExamStudent(Long rBasicInfoId, ReportExamStudentDto reportExamStudentDto) {
        this.id = SystemConstant.getDbUuid();
        this.rBasicInfoId = rBasicInfoId;
        this.name = reportExamStudentDto.getName();
        this.administrativeClass = reportExamStudentDto.getAdministrativeClass();
        this.studentCode = reportExamStudentDto.getStudentCode();
        this.score = reportExamStudentDto.getScore();
        this.resultDetail = JacksonUtil.parseJson(reportExamStudentDto.getTargetList());
    }

    public Double getScore() {
        return score;
    }

    public void setScore(Double score) {
        this.score = score;
    }

    public Long getId() {
        return id;
    }

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

    public Long getrBasicInfoId() {
        return rBasicInfoId;
    }

    public void setrBasicInfoId(Long rBasicInfoId) {
        this.rBasicInfoId = rBasicInfoId;
    }

    public String getName() {
        return name;
    }

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

    public String getStudentCode() {
        return studentCode;
    }

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

    public String getAdministrativeClass() {
        return administrativeClass;
    }

    public void setAdministrativeClass(String administrativeClass) {
        this.administrativeClass = administrativeClass;
    }

    public String getResultDetail() {
        return resultDetail;
    }

    public void setResultDetail(String resultDetail) {
        this.resultDetail = resultDetail;
    }
}
