|
@@ -3,6 +3,7 @@ package cn.com.qmth.examcloud.core.examwork.api.controller;
|
|
|
import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
@@ -237,10 +238,24 @@ public class ExamController extends ControllerSupport {
|
|
|
*/
|
|
|
@ApiOperation(value = "按ID查询考试批次", notes = "ID查询")
|
|
|
@GetMapping("{examId}")
|
|
|
- public ExamEntity getExamById(@PathVariable Long examId) {
|
|
|
+ public ExamDomain getExamById(@PathVariable Long examId) {
|
|
|
ExamEntity one = examRepo.findOne(examId);
|
|
|
validateRootOrgIsolation(one.getRootOrgId());
|
|
|
- return one;
|
|
|
+
|
|
|
+ ExamDomain domain = new ExamDomain();
|
|
|
+ domain.setBeginTime(one.getBeginTime());
|
|
|
+ domain.setDuration(one.getDuration());
|
|
|
+ domain.setEnable(one.getEnable());
|
|
|
+ domain.setEndTime(one.getEndTime());
|
|
|
+ domain.setExamTimes(one.getExamTimes());
|
|
|
+ domain.setExamType(one.getExamType());
|
|
|
+ domain.setId(one.getId());
|
|
|
+ domain.setName(one.getName());
|
|
|
+ domain.setRemark(one.getRemark());
|
|
|
+ domain.setRootOrgId(one.getRootOrgId());
|
|
|
+ domain.setStarted(one.getBeginTime().before(new Date()));
|
|
|
+
|
|
|
+ return domain;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -312,6 +327,20 @@ public class ExamController extends ControllerSupport {
|
|
|
return saved;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "按ID查询考试批次", notes = "ID查询")
|
|
|
+ @GetMapping("{examId}")
|
|
|
+ public Map<String, String> getFullExamProperties(@PathVariable Long examId) {
|
|
|
+
|
|
|
+ Map<String, String> map = Maps.newHashMap();
|
|
|
+ List<ExamPropertyEntity> list = examPropertyRepo.findByexamId(examId);
|
|
|
+ for (ExamPropertyEntity cur : list) {
|
|
|
+ ExamProperty ep = ExamProperty.getByKeyId(cur.getKeyId());
|
|
|
+ map.put(ep.name(), cur.getValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 方法注释
|
|
|
*
|