xiatian 5 yıl önce
ebeveyn
işleme
9f80356d3b

+ 8 - 8
src/main/java/cn/com/qmth/examcloud/app/controller/PracticeExamRestController.java

@@ -63,8 +63,8 @@ public class PracticeExamRestController {
 
     @ApiOperation(value = "获取当前练习的试卷大题结构信息接口")
     @RequestMapping(value = "/exam/record/paper/struct/list", method = {RequestMethod.POST})
-    public Result getExamRecordPaperStructList(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @RequestParam String examRecordId) throws Exception {
-        return oeService.getExamRecordPaperStructList(key, token, examRecordId);
+    public Result getExamRecordPaperStructList(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @RequestParam String examRecordId,@RequestParam(required = false) String fromCache) throws Exception {
+        return oeService.getExamRecordPaperStructList(key, token, examRecordId,fromCache);
     }
 
     @ApiOperation(value = "获取当前练习的考试基本信息接口")
@@ -111,8 +111,8 @@ public class PracticeExamRestController {
 
     @ApiOperation(value = "获取成绩报告的答题情况统计接口")
     @RequestMapping(value = "/exam/record/total", method = {RequestMethod.POST})
-    public Result getExamRecordTotalInfo(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @RequestParam String examRecordId) throws Exception {
-        return oeService.getExamRecordTotalInfo(key, token, examRecordId);
+    public Result getExamRecordTotalInfo(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @RequestParam String examRecordId,@RequestParam(required = false) String fromCache) throws Exception {
+        return oeService.getExamRecordTotalInfo(key, token, examRecordId,fromCache);
     }
 
     @ApiOperation(value = "获取作答的题列表接口")
@@ -141,14 +141,14 @@ public class PracticeExamRestController {
 
     @ApiOperation(value = "查询练习记录配置信息")
     @RequestMapping(value = "/exam/practice/end/findExamRecordDataEntity/{examRecordDataId}", method = {RequestMethod.POST})
-    public Result findExamRecordDataEntity(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @PathVariable Long examRecordDataId) throws Exception {
-        return oeService.findExamRecordDataEntity(key, token, examRecordDataId);
+    public Result findExamRecordDataEntity(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @PathVariable Long examRecordDataId,@RequestParam(required = false) String fromCache) throws Exception {
+        return oeService.findExamRecordDataEntity(key, token, examRecordDataId, fromCache);
     }
 
     @ApiOperation(value = "查询练习记录试题列表")
     @RequestMapping(value = "/exam/practice/end/getExamRecordQuestions/{examRecordDataId}", method = {RequestMethod.POST})
-    public Result getExamRecordQuestions(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @PathVariable Long examRecordDataId) throws Exception {
-        return oeService.getExamRecordQuestions(key, token, examRecordDataId);
+    public Result getExamRecordQuestions(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @PathVariable Long examRecordDataId,@RequestParam(required = false) String fromCache) throws Exception {
+        return oeService.getExamRecordQuestions(key, token, examRecordDataId,fromCache);
     }
 
     @ApiOperation(value = "查询某个试题内容")

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

@@ -103,7 +103,7 @@ public interface CoreOeService {
      * @return
      * @throws Exception
      */
-    Result getExamRecordPaperStructList(String key, String token, String examRecordId) throws Exception;
+    Result getExamRecordPaperStructList(String key, String token, String examRecordId,String fromCache) throws Exception;
 
     /**
      * 获取当前练习的试卷试题列表
@@ -177,7 +177,7 @@ public interface CoreOeService {
      * @return
      * @throws Exception
      */
-    Result getExamRecordTotalInfo(String key, String token, String examRecordId) throws Exception;
+    Result getExamRecordTotalInfo(String key, String token, String examRecordId,String fromCache) throws Exception;
 
     /**
      * 获取作答的题列表
@@ -222,7 +222,7 @@ public interface CoreOeService {
      * @return
      * @throws Exception
      */
-    Result findExamRecordDataEntity(String key, String token, Long examRecordDataId) throws Exception;
+    Result findExamRecordDataEntity(String key, String token, Long examRecordDataId,String fromCache) throws Exception;
 
     /**
      * 练习记录试题列表
@@ -233,7 +233,7 @@ public interface CoreOeService {
      * @return
      * @throws Exception
      */
-    Result getExamRecordQuestions(String key, String token, Long examRecordDataId) throws Exception;
+    Result getExamRecordQuestions(String key, String token, Long examRecordDataId,String fromCache) throws Exception;
 
     /**查询考生的考试批次属性集
      * @param key

+ 28 - 8
src/main/java/cn/com/qmth/examcloud/app/service/impl/CoreOeServiceImpl.java

@@ -115,9 +115,14 @@ public class CoreOeServiceImpl implements CoreOeService {
     }
 
     @Override
-    public Result getExamRecordPaperStructList(String key, String token, String examRecordId) throws Exception {
+    public Result getExamRecordPaperStructList(String key, String token, String examRecordId,String fromCache) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=%s", sysProperty.getCoreOeStudentUrl(), examRecordId);
+        String requestUrl=null;
+        if("1".equals(fromCache)) {
+            requestUrl = String.format("%s/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?fromCache=1&examRecordDataId=%s", sysProperty.getCoreOeStudentUrl(), examRecordId);
+        }else {
+            requestUrl = String.format("%s/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=%s", sysProperty.getCoreOeStudentUrl(), examRecordId);
+        }
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
@@ -171,9 +176,14 @@ public class CoreOeServiceImpl implements CoreOeService {
     }
 
     @Override
-    public Result getExamRecordTotalInfo(String key, String token, String examRecordId) throws Exception {
+    public Result getExamRecordTotalInfo(String key, String token, String examRecordId,String fromCache) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/ecs_oe_admin/practice/getPracticeDetailInfo?fromCache=1&examRecordDataId=%s", sysProperty.getCoreOeAdminUrl(), examRecordId);
+        String requestUrl=null;
+        if("1".equals(fromCache)) {
+            requestUrl = String.format("%s/api/ecs_oe_admin/practice/getPracticeDetailInfo?fromCache=1&examRecordDataId=%s", sysProperty.getCoreOeAdminUrl(), examRecordId);
+        }else {
+            requestUrl = String.format("%s/api/ecs_oe_admin/practice/getPracticeDetailInfo?examRecordDataId=%s", sysProperty.getCoreOeAdminUrl(), examRecordId);
+        }
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
@@ -203,9 +213,14 @@ public class CoreOeServiceImpl implements CoreOeService {
     }
 
     @Override
-    public Result findExamRecordDataEntity(String key, String token, Long examRecordDataId) throws Exception {
+    public Result findExamRecordDataEntity(String key, String token, Long examRecordDataId,String fromCache) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/ecs_oe_admin/exam/record/data/findExamRecordDataEntity?examRecordDataId=%s", sysProperty.getCoreOeAdminUrl(), examRecordDataId);
+        String requestUrl=null;
+        if("1".equals(fromCache)) {
+            requestUrl = String.format("%s/api/ecs_oe_admin/exam/record/data/findExamRecordDataEntity?fromCache=1&examRecordDataId=%s", sysProperty.getCoreOeAdminUrl(), examRecordDataId);
+        }else {
+            requestUrl = String.format("%s/api/ecs_oe_admin/exam/record/data/findExamRecordDataEntity?examRecordDataId=%s", sysProperty.getCoreOeAdminUrl(), examRecordDataId);
+        }
         Result<String> result = HttpUtils.doGet(requestUrl, key, token);
         if (result.isSuccess()) {
             //过滤掉为空的属性
@@ -215,9 +230,14 @@ public class CoreOeServiceImpl implements CoreOeService {
     }
 
     @Override
-    public Result getExamRecordQuestions(String key, String token, Long examRecordDataId) throws Exception {
+    public Result getExamRecordQuestions(String key, String token, Long examRecordDataId,String fromCache) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/ecs_oe_admin/examRecordQuestions/getExamRecordQuestions?examRecordDataId=%s", sysProperty.getCoreOeAdminUrl(), examRecordDataId);
+        String requestUrl=null;
+        if("1".equals(fromCache)) {
+            requestUrl = String.format("%s/api/ecs_oe_admin/examRecordQuestions/getExamRecordQuestions?fromCache=1&examRecordDataId=%s", sysProperty.getCoreOeAdminUrl(), examRecordDataId);
+        }else {
+            requestUrl = String.format("%s/api/ecs_oe_admin/examRecordQuestions/getExamRecordQuestions?examRecordDataId=%s", sysProperty.getCoreOeAdminUrl(), examRecordDataId);
+        }
         Result<String> result = HttpUtils.doGet(requestUrl, key, token);
         if (result.isSuccess()) {
             //过滤掉为空的属性