|
@@ -11,6 +11,10 @@ import cn.com.qmth.examcloud.app.core.exception.ApiException;
|
|
import cn.com.qmth.examcloud.app.core.utils.DateUtils;
|
|
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.HttpUtils;
|
|
import cn.com.qmth.examcloud.commons.util.JsonMapper;
|
|
import cn.com.qmth.examcloud.commons.util.JsonMapper;
|
|
|
|
+import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
|
|
+import cn.com.qmth.examcloud.support.cache.bean.ExamPropertyCacheBean;
|
|
|
|
+import cn.com.qmth.examcloud.support.cache.bean.ExamSettingsCacheBean;
|
|
|
|
+import cn.com.qmth.examcloud.support.enums.ExamProperties;
|
|
import cn.com.qmth.examcloud.app.model.Constants;
|
|
import cn.com.qmth.examcloud.app.model.Constants;
|
|
import cn.com.qmth.examcloud.app.model.GetYunSignatureReq;
|
|
import cn.com.qmth.examcloud.app.model.GetYunSignatureReq;
|
|
import cn.com.qmth.examcloud.app.model.Result;
|
|
import cn.com.qmth.examcloud.app.model.Result;
|
|
@@ -30,6 +34,8 @@ import org.springframework.stereotype.Service;
|
|
import org.springframework.util.Assert;
|
|
import org.springframework.util.Assert;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -175,7 +181,24 @@ public class CoreOeServiceImpl implements CoreOeService {
|
|
public Result checkOnlineExamRecord(String key, String token) throws Exception {
|
|
public Result checkOnlineExamRecord(String key, String token) throws Exception {
|
|
//封装请求参数
|
|
//封装请求参数
|
|
final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/checkExamInProgress", sysProperty.getCoreOeStudentUrl());
|
|
final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/checkExamInProgress", sysProperty.getCoreOeStudentUrl());
|
|
- return HttpUtils.doGet(requestUrl, key, token);
|
|
|
|
|
|
+ Result<String> ret=HttpUtils.doGet(requestUrl, key, token);
|
|
|
|
+ if(Constants.CODE_200.equals(ret.getCode())&&StringUtils.isNotBlank(ret.getData())) {
|
|
|
|
+ JSONObject data=JSONObject.parseObject(ret.getData());
|
|
|
|
+ if(Constants.COMMON_SUCCESS_CODE.equals(data.getString("code"))) {
|
|
|
|
+ JSONObject bdata=data.getJSONObject("data");
|
|
|
|
+ if(bdata!=null) {
|
|
|
|
+ Long examId=bdata.getLong("examId");
|
|
|
|
+ if(examId!=null) {
|
|
|
|
+ ExamPropertyCacheBean es=CacheHelper.getExamProperty(examId, ExamProperties.APP_EXAM_ENABLED.name());
|
|
|
|
+ if(!"true".equals(es.getValue())) {
|
|
|
|
+ ret.setCode(Constants.CODE_409);
|
|
|
|
+ ret.setDesc(Constants.DESC_409);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|