xiatian před 3 dny
rodič
revize
dc8a0decf4

+ 504 - 0
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/bean/ExamVo.java

@@ -0,0 +1,504 @@
+package cn.com.qmth.stmms.biz.exam.bean;
+
+import java.util.Date;
+
+import org.apache.commons.lang.StringUtils;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import cn.com.qmth.stmms.biz.exam.model.Exam;
+import cn.com.qmth.stmms.biz.file.enums.FormatType;
+import cn.com.qmth.stmms.biz.mark.model.PictureConfigItem;
+import cn.com.qmth.stmms.common.enums.ExamStatus;
+import cn.com.qmth.stmms.common.enums.ExamType;
+import cn.com.qmth.stmms.common.enums.MarkMode;
+import cn.com.qmth.stmms.common.enums.ObjectiveStatus;
+import cn.com.qmth.stmms.common.enums.TrackCountPolicy;
+
+public class ExamVo {
+
+    public static final String SUBJECT_ID_SPLIT = ",";
+
+    private Integer id;
+
+    private String name;
+
+    private Integer schoolId;
+
+    private String code;
+
+    private Date examTime;
+
+    private ExamStatus status;
+
+    private String description;
+
+    /**
+     * 开启强制特殊标记
+     */
+    private Boolean forceSpecialTag;
+
+    /**
+     * 裁切图配置
+     */
+    private String sliceConfig;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    private Integer creatorId;
+
+    /**
+     * 统计配置
+     */
+    private String sasConfig;
+
+    /**
+     * 原图遮盖配置
+     */
+    private String sheetConfig;
+
+    /**
+     * 考试类型
+     */
+    private ExamType type;
+
+    /**
+     * 题卡类型
+     */
+    private FormatType cardType;
+
+    /**
+     * 禁止管理员以外人查看考生个人信息
+     */
+    private Boolean forbiddenInfo;
+
+    /**
+     * 禁止查看成绩
+     */
+    private Boolean forbiddenScore;
+
+    /**
+     * 客观题统分状态
+     */
+    private ObjectiveStatus objectiveStatus;
+
+    /**
+     * 评卷起始时间
+     */
+    private Date startTime;
+
+    /**
+     * 评卷结束时间
+     */
+    private Date endTime;
+
+    /**
+     * 强制评卷模式
+     */
+    private MarkMode markMode;
+
+    /**
+     * 开启/关闭 原卷显示
+     */
+    private Boolean sheetView;
+
+    /**
+     * 扫描配置
+     */
+    private String scanConfig;
+
+    /**
+     * 自动跳转
+     */
+    private Boolean autoScroll;
+
+    /**
+     * 是否裁切
+     */
+    private Boolean enableSplit;
+
+    /**
+     * 打回后是否显示原分值
+     */
+    private Boolean showReject;
+
+    /**
+     * 全卷多次复核时不能为同一账号
+     */
+    private Boolean inspectUnrepeated;
+
+    /**
+     * 全卷复核时强制试卷拉到底部
+     */
+    private Boolean inspectScrollBottom;
+
+    /**
+     * 回评卷数
+     */
+    private Integer remarkCount;
+
+    /**
+     * 评卷端是否显示客观分
+     */
+    private Boolean showObjectiveScore;
+
+    /**
+     * 全卷复核进度100%时才能再次复核
+     */
+    private Boolean inspectRoundLimit;
+
+    /**
+     * 轨迹次数规则
+     */
+    private TrackCountPolicy trackCountPolicy;
+
+    private String pictureConfig;
+
+    private Double passScore;
+
+    private Double excellentScore;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getSchoolId() {
+        return schoolId;
+    }
+
+    public void setSchoolId(Integer schoolId) {
+        this.schoolId = schoolId;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public Date getExamTime() {
+        return examTime;
+    }
+
+    public void setExamTime(Date examTime) {
+        this.examTime = examTime;
+    }
+
+    public ExamStatus getStatus() {
+        return status;
+    }
+
+    public void setStatus(ExamStatus status) {
+        this.status = status;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public Boolean getForceSpecialTag() {
+        return forceSpecialTag;
+    }
+
+    public void setForceSpecialTag(Boolean forceSpecialTag) {
+        this.forceSpecialTag = forceSpecialTag;
+    }
+
+    public String getSliceConfig() {
+        return sliceConfig;
+    }
+
+    public void setSliceConfig(String sliceConfig) {
+        this.sliceConfig = sliceConfig;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Integer getCreatorId() {
+        return creatorId;
+    }
+
+    public void setCreatorId(Integer creatorId) {
+        this.creatorId = creatorId;
+    }
+
+    public String getSasConfig() {
+        return sasConfig;
+    }
+
+    public void setSasConfig(String sasConfig) {
+        this.sasConfig = sasConfig;
+    }
+
+    public String getSheetConfig() {
+        return sheetConfig;
+    }
+
+    public void setSheetConfig(String sheetConfig) {
+        this.sheetConfig = sheetConfig;
+    }
+
+    public ExamType getType() {
+        return type;
+    }
+
+    public void setType(ExamType type) {
+        this.type = type;
+    }
+
+    public FormatType getCardType() {
+        return cardType;
+    }
+
+    public void setCardType(FormatType cardType) {
+        this.cardType = cardType;
+    }
+
+    public Boolean getForbiddenInfo() {
+        return forbiddenInfo;
+    }
+
+    public void setForbiddenInfo(Boolean forbiddenInfo) {
+        this.forbiddenInfo = forbiddenInfo;
+    }
+
+    public Boolean getForbiddenScore() {
+        return forbiddenScore;
+    }
+
+    public void setForbiddenScore(Boolean forbiddenScore) {
+        this.forbiddenScore = forbiddenScore;
+    }
+
+    public ObjectiveStatus getObjectiveStatus() {
+        return objectiveStatus;
+    }
+
+    public void setObjectiveStatus(ObjectiveStatus objectiveStatus) {
+        this.objectiveStatus = objectiveStatus;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public MarkMode getMarkMode() {
+        return markMode;
+    }
+
+    public void setMarkMode(MarkMode markMode) {
+        this.markMode = markMode;
+    }
+
+    public Boolean getSheetView() {
+        return sheetView;
+    }
+
+    public void setSheetView(Boolean sheetView) {
+        this.sheetView = sheetView;
+    }
+
+    public String getScanConfig() {
+        return scanConfig;
+    }
+
+    public void setScanConfig(String scanConfig) {
+        this.scanConfig = scanConfig;
+    }
+
+    public Boolean getAutoScroll() {
+        return autoScroll;
+    }
+
+    public void setAutoScroll(Boolean autoScroll) {
+        this.autoScroll = autoScroll;
+    }
+
+    public Boolean getEnableSplit() {
+        return enableSplit;
+    }
+
+    public void setEnableSplit(Boolean enableSplit) {
+        this.enableSplit = enableSplit;
+    }
+
+    public Boolean getShowReject() {
+        return showReject;
+    }
+
+    public void setShowReject(Boolean showReject) {
+        this.showReject = showReject;
+    }
+
+    public Boolean getInspectUnrepeated() {
+        return inspectUnrepeated;
+    }
+
+    public void setInspectUnrepeated(Boolean inspectUnrepeated) {
+        this.inspectUnrepeated = inspectUnrepeated;
+    }
+
+    public Boolean getInspectScrollBottom() {
+        return inspectScrollBottom;
+    }
+
+    public void setInspectScrollBottom(Boolean inspectScrollBottom) {
+        this.inspectScrollBottom = inspectScrollBottom;
+    }
+
+    public Integer getRemarkCount() {
+        return remarkCount;
+    }
+
+    public void setRemarkCount(Integer remarkCount) {
+        this.remarkCount = remarkCount;
+    }
+
+    public Boolean getShowObjectiveScore() {
+        return showObjectiveScore;
+    }
+
+    public void setShowObjectiveScore(Boolean showObjectiveScore) {
+        this.showObjectiveScore = showObjectiveScore;
+    }
+
+    public Boolean getInspectRoundLimit() {
+        return inspectRoundLimit;
+    }
+
+    public void setInspectRoundLimit(Boolean inspectRoundLimit) {
+        this.inspectRoundLimit = inspectRoundLimit;
+    }
+
+    public TrackCountPolicy getTrackCountPolicy() {
+        return trackCountPolicy;
+    }
+
+    public void setTrackCountPolicy(TrackCountPolicy trackCountPolicy) {
+        this.trackCountPolicy = trackCountPolicy;
+    }
+
+    public String getPictureConfig() {
+        return pictureConfig;
+    }
+
+    public void setPictureConfig(String pictureConfig) {
+        this.pictureConfig = pictureConfig;
+    }
+
+    public Double getPassScore() {
+        return passScore;
+    }
+
+    public void setPassScore(Double passScore) {
+        this.passScore = passScore;
+    }
+
+    public Double getExcellentScore() {
+        return excellentScore;
+    }
+
+    public void setExcellentScore(Double excellentScore) {
+        this.excellentScore = excellentScore;
+    }
+
+    public ExamVo of(Exam e) {
+        ExamVo vo = new ExamVo();
+        vo.setId(e.getId());
+        vo.setName(e.getName());
+        vo.setSchoolId(e.getSchoolId());
+        vo.setCode(e.getCode());
+        vo.setExamTime(e.getExamTime());
+        vo.setStatus(e.getStatus());
+        vo.setDescription(e.getDescription());
+        vo.setForceSpecialTag(e.isForceSpecialTag());
+        vo.setSliceConfig(e.getSliceConfig());
+        vo.setCreateTime(e.getCreateTime());
+        vo.setUpdateTime(e.getUpdateTime());
+        vo.setCreatorId(e.getCreatorId());
+        vo.setSasConfig(e.getSasConfig());
+        vo.setSheetConfig(e.getSheetConfig());
+        vo.setType(e.getType());
+        vo.setCardType(e.getCardType());
+        vo.setForbiddenInfo(e.isForbiddenInfo());
+        vo.setForbiddenScore(e.isForbiddenScore());
+        vo.setObjectiveStatus(e.getObjectiveStatus());
+        vo.setStartTime(e.getStartTime());
+        vo.setEndTime(e.getEndTime());
+        vo.setMarkMode(e.getMarkMode());
+        vo.setSheetView(e.isSheetView());
+        vo.setScanConfig(e.getScanConfig());
+        vo.setAutoScroll(e.isAutoScroll());
+        vo.setEnableSplit(e.isEnableSplit());
+        vo.setShowReject(e.isShowReject());
+        vo.setInspectUnrepeated(e.getInspectUnrepeated());
+        vo.setInspectScrollBottom(e.getInspectScrollBottom());
+        vo.setRemarkCount(e.getRemarkCount());
+        vo.setShowObjectiveScore(e.getShowObjectiveScore());
+        vo.setInspectRoundLimit(e.getInspectRoundLimit());
+        vo.setTrackCountPolicy(e.getTrackCountPolicy());
+        vo.setPictureConfig(buildPictureConfig(e.getSheetConfig()));
+        vo.setPassScore(e.getPassScore());
+        vo.setExcellentScore(e.getExcellentScore());
+        return vo;
+    }
+
+    protected String buildPictureConfig(String sheetConfig) {
+        if (StringUtils.isNotBlank(sheetConfig)) {
+            try {
+                ObjectMapper mapper = new ObjectMapper();
+                return mapper.writeValueAsString(PictureConfigItem.parse(sheetConfig));
+            } catch (JsonProcessingException e) {
+                e.printStackTrace();
+            }
+        }
+        return "";
+    }
+}