时间返回格式修改

hehai
shijie 4 years ago
parent bb9c251e90
commit e321bec332
  1. 4
      src/main/java/com/msdw/tms/entity/vo/EvaluationVO.java
  2. 46
      src/main/java/com/msdw/tms/entity/vo/QuestionsVO.java
  3. 14
      src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java

@ -1,8 +1,6 @@
package com.msdw.tms.entity.vo; package com.msdw.tms.entity.vo;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.msdw.tms.entity.QuestionsEntity;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -62,5 +60,5 @@ public class EvaluationVO implements Serializable {
/** /**
*试题列表 *试题列表
*/ */
private Set<QuestionsEntity> Questions; private Set<QuestionsVO> Questions;
} }

@ -17,7 +17,7 @@ import java.io.Serializable;
public class QuestionsVO implements Serializable { public class QuestionsVO implements Serializable {
/** /**
* 自增主键 * 主键
*/ */
private Integer id; private Integer id;
/** /**
@ -32,6 +32,30 @@ public class QuestionsVO implements Serializable {
* 题干信息 * 题干信息
*/ */
private String questionStem; 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; private String answerAnalysis;
/**
* 是否禁用1启用0禁用默认是1启用
*/
private Integer isEnable;
/**
* 是否删除1使用0删除默认1使用
*/
private Integer isDel;
/**
* 创建人
*/
private String createUser;
/**
* 创建时间
*/
private String createTime;
/**
* 修改人
*/
private String modifyUser;
/** /**
* 修改时间用于排序创建时修改时间等于创建时间 * 修改时间用于排序创建时修改时间等于创建时间
*/ */

@ -102,6 +102,7 @@ public class QuestionsServiceImpl extends ServiceImpl<QuestionsDao, QuestionsEnt
BeanUtils.copyProperties(item, questionsVO); BeanUtils.copyProperties(item, questionsVO);
//处理时间格式 //处理时间格式
questionsVO.setCreateTime(handleTime(item.getCreateTime()));
questionsVO.setModifyTime(handleTime(item.getModifyTime())); questionsVO.setModifyTime(handleTime(item.getModifyTime()));
return questionsVO; return questionsVO;
@ -359,6 +360,7 @@ public class QuestionsServiceImpl extends ServiceImpl<QuestionsDao, QuestionsEnt
ossService.downloadFiles(response, xlsxTemplate.getFileName()); ossService.downloadFiles(response, xlsxTemplate.getFileName());
} }
// TODO 处理时间格式
@Override @Override
public EvaluationVO evaluation() { public EvaluationVO evaluation() {
@ -410,14 +412,18 @@ public class QuestionsServiceImpl extends ServiceImpl<QuestionsDao, QuestionsEnt
judgmentNum = evaluationRules.getJudgmentNum(); judgmentNum = evaluationRules.getJudgmentNum();
List<QuestionsEntity> judgments = this.list(queryWrapper.eq("question_type_no", List<QuestionsEntity> judgments = this.list(queryWrapper.eq("question_type_no",
Constant.QuestionType.TRUE_OR_FALSE.getType())); Constant.QuestionType.TRUE_OR_FALSE.getType()));
set.addAll(getRandomList(judgmentNum, judgments)); set.addAll(getRandomList(judgmentNum, judgments));
} }
evaluation.setQuestionNum(singleNum + multipleNum + judgmentNum); evaluation.setQuestionNum(singleNum + multipleNum + judgmentNum);
} }
evaluation.setQuestions(set); Set<QuestionsVO> 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; return evaluation;
} }

Loading…
Cancel
Save