|
@@ -256,6 +256,9 @@ public class ExamController extends ControllerSupport {
|
|
|
@GetMapping("{examId}")
|
|
|
public ExamDomain getExamById(@PathVariable Long examId) {
|
|
|
ExamEntity one = examRepo.findOne(examId);
|
|
|
+ if (null == one) {
|
|
|
+ throw new StatusException("E-001250", "examId is wrong");
|
|
|
+ }
|
|
|
validateRootOrgIsolation(one.getRootOrgId());
|
|
|
|
|
|
ExamDomain domain = new ExamDomain();
|
|
@@ -345,6 +348,12 @@ public class ExamController extends ControllerSupport {
|
|
|
@GetMapping("allProperties/{examId}")
|
|
|
public Map<String, String> getAllExamProperties(@PathVariable Long examId) {
|
|
|
|
|
|
+ ExamEntity examEntity = examRepo.findOne(examId);
|
|
|
+ if (null == examEntity) {
|
|
|
+ throw new StatusException("E-001250", "examId is wrong");
|
|
|
+ }
|
|
|
+ validateRootOrgIsolation(examEntity.getRootOrgId());
|
|
|
+
|
|
|
Map<String, String> map = Maps.newHashMap();
|
|
|
List<ExamPropertyEntity> list = examPropertyRepo.findByexamId(examId);
|
|
|
for (ExamPropertyEntity cur : list) {
|
|
@@ -362,9 +371,15 @@ public class ExamController extends ControllerSupport {
|
|
|
* @param examId
|
|
|
* @return
|
|
|
*/
|
|
|
- @ApiOperation(value = "考试批次所有属性")
|
|
|
+ @ApiOperation(value = "查询考试批次单个属性")
|
|
|
@GetMapping("property/{examId}/{key}")
|
|
|
public String getExamProperty(@PathVariable Long examId, @PathVariable String key) {
|
|
|
+ ExamEntity examEntity = examRepo.findOne(examId);
|
|
|
+ if (null == examEntity) {
|
|
|
+ throw new StatusException("E-001250", "examId is wrong");
|
|
|
+ }
|
|
|
+ validateRootOrgIsolation(examEntity.getRootOrgId());
|
|
|
+
|
|
|
ExamProperty ep = ExamProperty.valueOf(key);
|
|
|
ExamPropertyEntity one = examPropertyRepo.findByexamIdAndKeyId(examId, ep.getKeyId());
|
|
|
if (null == one) {
|
|
@@ -373,6 +388,25 @@ public class ExamController extends ControllerSupport {
|
|
|
return one.getValue();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param examId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "查询考生考试批次单个属性")
|
|
|
+ @GetMapping("studentOrgProperty/{examId}/{key}")
|
|
|
+ public String getStudentOrgProperty(@PathVariable Long examId, @PathVariable String key) {
|
|
|
+ User accessUser = getAccessUser();
|
|
|
+ ExamEntity examEntity = examRepo.findOne(examId);
|
|
|
+ if (null == examEntity) {
|
|
|
+ throw new StatusException("E-001250", "examId is wrong");
|
|
|
+ }
|
|
|
+ validateRootOrgIsolation(examEntity.getRootOrgId());
|
|
|
+ return examService.getOrgProperty(examId, accessUser.getOrgId(), key);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 方法注释
|
|
|
*
|