From e321bec332223eb1263e52a818ef06e66c839dd3 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Thu, 20 Aug 2020 18:18:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=BF=94=E5=9B=9E=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/msdw/tms/entity/vo/EvaluationVO.java | 4 +- .../com/msdw/tms/entity/vo/QuestionsVO.java | 46 ++++++++++++++++++- .../service/impl/QuestionsServiceImpl.java | 14 ++++-- 3 files changed, 56 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/msdw/tms/entity/vo/EvaluationVO.java b/src/main/java/com/msdw/tms/entity/vo/EvaluationVO.java index c40b6e5..c4ce69e 100644 --- a/src/main/java/com/msdw/tms/entity/vo/EvaluationVO.java +++ b/src/main/java/com/msdw/tms/entity/vo/EvaluationVO.java @@ -1,8 +1,6 @@ package com.msdw.tms.entity.vo; -import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import com.msdw.tms.entity.QuestionsEntity; import lombok.Data; import java.io.Serializable; @@ -62,5 +60,5 @@ public class EvaluationVO implements Serializable { /** *试题列表 */ - private Set Questions; + private Set Questions; } diff --git a/src/main/java/com/msdw/tms/entity/vo/QuestionsVO.java b/src/main/java/com/msdw/tms/entity/vo/QuestionsVO.java index 9f37451..f1342ce 100644 --- a/src/main/java/com/msdw/tms/entity/vo/QuestionsVO.java +++ b/src/main/java/com/msdw/tms/entity/vo/QuestionsVO.java @@ -17,7 +17,7 @@ import java.io.Serializable; public class QuestionsVO implements Serializable { /** - * 自增主键 + * 主键 */ private Integer id; /** @@ -32,6 +32,30 @@ public class QuestionsVO implements Serializable { * 题干信息 */ private String questionStem; + /** + * A选项内容 + */ + private String optionA; + /** + * B选项内容 + */ + private String optionB; + /** + * C选项内容 + */ + private String optionC; + /** + * D选项内容 + */ + private String optionD; + /** + * E选项内容 + */ + private String optionE; + /** + * F选项内容 + */ + private String optionF; /** * 正确答案 */ @@ -40,6 +64,26 @@ public class QuestionsVO implements Serializable { * 答案解析 */ private String answerAnalysis; + /** + * 是否禁用:1:启用,0:禁用,默认是1启用 + */ + private Integer isEnable; + /** + * 是否删除:1使用,0删除,默认1使用 + */ + private Integer isDel; + /** + * 创建人 + */ + private String createUser; + /** + * 创建时间 + */ + private String createTime; + /** + * 修改人 + */ + private String modifyUser; /** * 修改时间,用于排序,创建时,修改时间等于创建时间 */ diff --git a/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java index db621c2..f282bb7 100644 --- a/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java @@ -102,6 +102,7 @@ public class QuestionsServiceImpl extends ServiceImpl judgments = this.list(queryWrapper.eq("question_type_no", Constant.QuestionType.TRUE_OR_FALSE.getType())); - set.addAll(getRandomList(judgmentNum, judgments)); } - evaluation.setQuestionNum(singleNum + multipleNum + judgmentNum); - } - evaluation.setQuestions(set); + Set collect = set.stream().map(item -> { + QuestionsVO questionsVO = new QuestionsVO(); + BeanUtils.copyProperties(item, questionsVO); + questionsVO.setCreateTime(handleTime(item.getCreateTime())); + questionsVO.setModifyTime(handleTime(item.getModifyTime())); + return questionsVO; + }).collect(Collectors.toSet()); + evaluation.setQuestions(collect); return evaluation; }