|
@@ -12,17 +12,14 @@ import cn.com.qmth.examcloud.app.core.utils.DateUtils;
|
|
|
import cn.com.qmth.examcloud.app.core.utils.HttpUtils;
|
|
|
import cn.com.qmth.examcloud.app.core.utils.JsonMapper;
|
|
|
import cn.com.qmth.examcloud.app.model.Constants;
|
|
|
-import cn.com.qmth.examcloud.app.model.GetYunSignatureReq;
|
|
|
import cn.com.qmth.examcloud.app.model.Result;
|
|
|
import cn.com.qmth.examcloud.app.service.CoreOeService;
|
|
|
import cn.com.qmth.examcloud.app.core.SysProperty;
|
|
|
import okhttp3.FormBody;
|
|
|
-import okhttp3.FormBody.Builder;
|
|
|
import okhttp3.MediaType;
|
|
|
import okhttp3.MultipartBody;
|
|
|
import okhttp3.RequestBody;
|
|
|
import org.apache.commons.io.FilenameUtils;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -64,14 +61,14 @@ public class CoreOeServiceImpl implements CoreOeService {
|
|
|
@Override
|
|
|
public Result getOfflineExamCourseList(String key, String token) throws Exception {
|
|
|
//封装请求参数
|
|
|
- final String requestUrl = String.format("%s/api/ecs_oe_admin/offlineExam/getOfflineCourse", sysProperty.getCoreOeAdminUrl());
|
|
|
+ final String requestUrl = String.format("%s/api/ecs_oe_student/offlineExam/getOfflineCourse", sysProperty.getCoreOeStudentUrl());
|
|
|
return HttpUtils.doGet(requestUrl, key, token);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Result startOfflineExamRecord(String key, String token, String examStudentId) throws Exception {
|
|
|
//封装请求参数
|
|
|
- final String requestUrl = String.format("%s/api/ecs_oe_admin/offlineExam/startOfflineExam?examStudentId=%s", sysProperty.getCoreOeAdminUrl(), examStudentId);
|
|
|
+ final String requestUrl = String.format("%s/api/ecs_oe_student/offlineExam/startOfflineExam?examStudentId=%s", sysProperty.getCoreOeStudentUrl(), examStudentId);
|
|
|
return HttpUtils.doGet(requestUrl, key, token);
|
|
|
}
|
|
|
|
|
@@ -87,7 +84,7 @@ public class CoreOeServiceImpl implements CoreOeService {
|
|
|
throw new ApiException("File must be not empty.");
|
|
|
}
|
|
|
//封装请求参数
|
|
|
- final String requestUrl = String.format("%s/api/ecs_oe_admin/offlineExam/submitPaper?examRecordDataId=%s", sysProperty.getCoreOeAdminUrl(), examRecordId);
|
|
|
+ final String requestUrl = String.format("%s/api/ecs_oe_student/offlineExam/submitPaper?examRecordDataId=%s", sysProperty.getCoreOeStudentUrl(), examRecordId);
|
|
|
MultipartBody.Builder form = new MultipartBody.Builder().setType(MultipartBody.FORM);
|
|
|
RequestBody body = RequestBody.create(MediaType.parse("application/octet-stream"), fileBytes);
|
|
|
form.addFormDataPart("file", fileName, body);
|
|
@@ -99,7 +96,7 @@ public class CoreOeServiceImpl implements CoreOeService {
|
|
|
@Override
|
|
|
public Result getPracticeExamCourseList(String key, String token, String examId) throws Exception {
|
|
|
//封装请求参数
|
|
|
- final String requestUrl = String.format("%s/api/ecs_oe_admin/practice/queryPracticeCourseList?examId=%s", sysProperty.getCoreOeAdminUrl(), examId);
|
|
|
+ final String requestUrl = String.format("%s/api/ecs_oe_student/practice/queryPracticeCourseList?examId=%s", sysProperty.getCoreOeStudentUrl(), examId);
|
|
|
return HttpUtils.doGet(requestUrl, key, token);
|
|
|
}
|
|
|
|
|
@@ -118,20 +115,9 @@ public class CoreOeServiceImpl implements CoreOeService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result getAdminExamPaperStructList(String key, String token, String examRecordId,String fromCache) throws Exception {
|
|
|
+ public Result getExamRecordPaperStructList(String key, String token, String examRecordId) throws Exception {
|
|
|
//封装请求参数
|
|
|
- String requestUrl=null;
|
|
|
- if("1".equals(fromCache)) {
|
|
|
- requestUrl = String.format("%s/api/ecs_oe_admin/examRecordPaperStruct/getExamRecordPaperStruct?fromCache=1&examRecordDataId=%s", sysProperty.getCoreOeAdminUrl(), examRecordId);
|
|
|
- }else {
|
|
|
- requestUrl = String.format("%s/api/ecs_oe_admin/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=%s", sysProperty.getCoreOeAdminUrl(), examRecordId);
|
|
|
- }
|
|
|
- return HttpUtils.doGet(requestUrl, key, token);
|
|
|
- }
|
|
|
- @Override
|
|
|
- public Result getStudentExamPaperStructList(String key, String token, String examRecordId) throws Exception {
|
|
|
- //封装请求参数
|
|
|
- String requestUrl = String.format("%s/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?fromCache=1&examRecordDataId=%s", sysProperty.getCoreOeStudentUrl(), examRecordId);
|
|
|
+ final String requestUrl = String.format("%s/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=%s", sysProperty.getCoreOeStudentUrl(), examRecordId);
|
|
|
return HttpUtils.doGet(requestUrl, key, token);
|
|
|
}
|
|
|
|
|
@@ -180,19 +166,14 @@ public class CoreOeServiceImpl implements CoreOeService {
|
|
|
@Override
|
|
|
public Result getExamRecordPracticeHistoryList(String key, String token, String examStudentId) throws Exception {
|
|
|
//封装请求参数
|
|
|
- final String requestUrl = String.format("%s/api/ecs_oe_admin/practice/queryPracticeRecordList?examStudentId=%s", sysProperty.getCoreOeAdminUrl(), examStudentId);
|
|
|
+ final String requestUrl = String.format("%s/api/ecs_oe_student/practice/queryPracticeRecordList?examStudentId=%s", sysProperty.getCoreOeStudentUrl(), examStudentId);
|
|
|
return HttpUtils.doGet(requestUrl, key, token);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result getExamRecordTotalInfo(String key, String token, String examRecordId,String fromCache) throws Exception {
|
|
|
+ public Result getExamRecordTotalInfo(String key, String token, String examRecordId) throws Exception {
|
|
|
//封装请求参数
|
|
|
- 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);
|
|
|
- }
|
|
|
+ final String requestUrl = String.format("%s/api/ecs_oe_student/practice/getPracticeDetailInfo?examRecordDataId=%s", sysProperty.getCoreOeStudentUrl(), examRecordId);
|
|
|
return HttpUtils.doGet(requestUrl, key, token);
|
|
|
}
|
|
|
|
|
@@ -222,14 +203,9 @@ public class CoreOeServiceImpl implements CoreOeService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result findExamRecordDataEntity(String key, String token, Long examRecordDataId,String fromCache) throws Exception {
|
|
|
+ public Result findExamRecordDataEntity(String key, String token, Long examRecordDataId) throws Exception {
|
|
|
//封装请求参数
|
|
|
- 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);
|
|
|
- }
|
|
|
+ final String 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()) {
|
|
|
//过滤掉为空的属性
|
|
@@ -239,14 +215,9 @@ public class CoreOeServiceImpl implements CoreOeService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result getExamRecordQuestions(String key, String token, Long examRecordDataId,String fromCache) throws Exception {
|
|
|
+ public Result getExamRecordQuestions(String key, String token, Long examRecordDataId) throws Exception {
|
|
|
//封装请求参数
|
|
|
- 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);
|
|
|
- }
|
|
|
+ final String 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()) {
|
|
|
//过滤掉为空的属性
|
|
@@ -255,54 +226,4 @@ 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);
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Result getPaperById(String key, String token, String paperId) throws Exception {
|
|
|
- final String requestUrl = String.format("%s/api/ecs_ques/paper/"+paperId, sysProperty.getCoreQuestionUrl());
|
|
|
- Result<String> result = HttpUtils.doGet(requestUrl, key, token);
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Result getYunSignature(String key, String token, GetYunSignatureReq req) throws Exception {
|
|
|
- //封装请求参数
|
|
|
- final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/yunSignature", sysProperty.getCoreOeStudentUrl());
|
|
|
- Builder b= new FormBody.Builder()
|
|
|
- .add("examRecordDataId", req.getExamRecordDataId())
|
|
|
- .add("order", req.getOrder())
|
|
|
- .add("fileMd5", req.getFileMd5())
|
|
|
- .add("fileSuffix", req.getFileSuffix());
|
|
|
- if(StringUtils.isNotBlank(req.getExt())) {
|
|
|
- b.add("ext", req.getExt());
|
|
|
- }
|
|
|
- RequestBody formBody =b.build();
|
|
|
-
|
|
|
- return HttpUtils.doPost(requestUrl, formBody, key, token);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Result queryExamList(String key, String token) throws Exception {
|
|
|
- final String requestUrl = String.format("%s/api/ecs_oe_admin/examControl/queryExamList", sysProperty.getCoreOeAdminUrl());
|
|
|
- return HttpUtils.doGet(requestUrl, key, token);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Result getEndExamInfo(String key, String token, Long examRecordDataId) throws Exception {
|
|
|
- final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/getEndExamInfo?examRecordDataId="+examRecordDataId, sysProperty.getCoreOeStudentUrl());
|
|
|
- return HttpUtils.doGet(requestUrl, key, token);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public Result queryObjectiveScoreList(String key, String token, Long examStudentId) throws Exception {
|
|
|
- final String requestUrl = String.format("%s/api/ecs_oe_admin/exam/score/queryObjectiveScoreList?examStudentId="+examStudentId, sysProperty.getCoreOeAdminUrl());
|
|
|
- return HttpUtils.doGet(requestUrl, key, token);
|
|
|
- }
|
|
|
-
|
|
|
}
|