xiatian 5 жил өмнө
parent
commit
48e806d09e

+ 33 - 0
src/main/java/cn/com/qmth/examcloud/app/controller/ExamController.java

@@ -0,0 +1,33 @@
+package cn.com.qmth.examcloud.app.controller;
+
+import static cn.com.qmth.examcloud.app.model.Constants.PARAM_APP_KEY;
+import static cn.com.qmth.examcloud.app.model.Constants.PARAM_APP_TOKEN;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import cn.com.qmth.examcloud.app.model.Result;
+import cn.com.qmth.examcloud.app.service.CoreOeService;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import io.swagger.annotations.ApiOperation;
+
+@RestController
+@RequestMapping("${$rmp.ctr.examwork}/exam")
+public class ExamController extends ControllerSupport {
+
+    @Autowired
+    private CoreOeService oeService;
+
+	@ApiOperation(value = "查询考生的考试批次属性集")
+	@GetMapping("getExamPropertyFromCacheByStudentSession/{examId}/{keys}")
+	public Result getExamPropertyFromCacheByStudentSession(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token,@PathVariable Long examId,
+			@PathVariable String keys) throws Exception{
+	    return oeService.getExamPropertyFromCacheByStudentSession(key, token, examId, keys);
+	}
+
+
+}

+ 11 - 0
src/main/java/cn/com/qmth/examcloud/app/service/CoreOeService.java

@@ -235,4 +235,15 @@ public interface CoreOeService {
      */
     Result getExamRecordQuestions(String key, String token, Long examRecordDataId) throws Exception;
 
+    /**查询考生的考试批次属性集
+     * @param key
+     * @param token
+     * @param examId
+     * @param keys
+     * @return
+     * @throws Exception
+     */
+    Result getExamPropertyFromCacheByStudentSession(String key, String token, Long examId, String keys)
+            throws Exception;
+
 }

+ 11 - 0
src/main/java/cn/com/qmth/examcloud/app/service/impl/CoreOeServiceImpl.java

@@ -226,4 +226,15 @@ public class CoreOeServiceImpl implements CoreOeService {
         return result;
     }
 
+    @Override
+    public Result getExamPropertyFromCacheByStudentSession(String key, String token,Long examId,String keys) throws Exception {
+        //封装请求参数
+        final String requestUrl = String.format("%s/api/ecs_exam_work/exam/getExamPropertyFromCacheByStudentSession/"+examId+"/"+keys, sysProperty.getCoreExamWorkUrl());
+        Result<String> result = HttpUtils.doGet(requestUrl, key, token);
+        if (result.isSuccess()) {
+            //转换日期格式
+            result.setData(DateUtils.formatLongDate(result.getData()));
+        }
+        return result;
+    }
 }