|
@@ -5,10 +5,12 @@ import cn.com.qmth.examcloud.tool.config.SysProperty;
|
|
import cn.com.qmth.examcloud.tool.service.batch_create_user.vo.RoleInfo;
|
|
import cn.com.qmth.examcloud.tool.service.batch_create_user.vo.RoleInfo;
|
|
import cn.com.qmth.examcloud.tool.service.batch_create_user.vo.UserInfo;
|
|
import cn.com.qmth.examcloud.tool.service.batch_create_user.vo.UserInfo;
|
|
import cn.com.qmth.examcloud.tool.service.export_student_answer_and_score_detail.vo.CourseVO;
|
|
import cn.com.qmth.examcloud.tool.service.export_student_answer_and_score_detail.vo.CourseVO;
|
|
-import cn.com.qmth.examcloud.tool.service.update_correct_answer_and_re_fix_score.vo.ExamStudentVO;
|
|
|
|
import cn.com.qmth.examcloud.tool.utils.HttpHelper;
|
|
import cn.com.qmth.examcloud.tool.utils.HttpHelper;
|
|
import cn.com.qmth.examcloud.tool.utils.JsonMapper;
|
|
import cn.com.qmth.examcloud.tool.utils.JsonMapper;
|
|
|
|
+import cn.com.qmth.examcloud.tool.vo.PageInfo;
|
|
import cn.com.qmth.examcloud.tool.vo.Pager;
|
|
import cn.com.qmth.examcloud.tool.vo.Pager;
|
|
|
|
+import cn.com.qmth.examcloud.tool.vo.examstudent.EwExamStudentVO;
|
|
|
|
+import cn.com.qmth.examcloud.tool.vo.examstudent.OeExamStudentVO;
|
|
import cn.com.qmth.examcloud.tool.vo.user.User;
|
|
import cn.com.qmth.examcloud.tool.vo.user.User;
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
@@ -233,10 +235,43 @@ public class CommonService {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取考务考生列表
|
|
|
|
+ */
|
|
|
|
+ public List<EwExamStudentVO> getExamStudentListFromEW(User loginUser, Long examId, Long courseId, String identityNumber) {
|
|
|
|
+ Map<String, String> headers = new HashMap<>();
|
|
|
|
+ headers.put("key", loginUser.getKey());
|
|
|
|
+ headers.put("token", loginUser.getToken());
|
|
|
|
+
|
|
|
|
+ JsonMapper jsonMapper = new JsonMapper();
|
|
|
|
+ int sum = 0, pageNo = 0, pageSize = 100;
|
|
|
|
+
|
|
|
|
+ String url = loginUser.getServerUrl() + "/api/ecs_exam_work/exam_student/examStudentPage/%s/%s?examId=" + examId
|
|
|
|
+ + "&courseId=" + (courseId != null ? courseId : "") + "&identityNumber=" + (StringUtils.isNotBlank(identityNumber) ? identityNumber : "");
|
|
|
|
+ List<EwExamStudentVO> all = new ArrayList<>();
|
|
|
|
+ while (true) {
|
|
|
|
+ String json = HttpHelper.get(String.format(url, pageNo, pageSize), headers, null);
|
|
|
|
+ PageInfo<EwExamStudentVO> page = jsonMapper.parseJson(json, new TypeReference<PageInfo<EwExamStudentVO>>() {
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ if (page == null || CollectionUtils.isEmpty(page.getList())) {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ all.addAll(page.getList());
|
|
|
|
+
|
|
|
|
+ pageNo++;
|
|
|
|
+ sum += page.getList().size();
|
|
|
|
+ float rate = sum * 100f / page.getTotal();
|
|
|
|
+ log.info("examId:{} courseId:{} 已获取考生数:{} 进度:{}%", examId, courseId, sum, rate);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return all;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 获取网考考生列表
|
|
* 获取网考考生列表
|
|
*/
|
|
*/
|
|
- public List<ExamStudentVO> getExamStudentList(User loginUser, Long examId, Long courseId, String identityNumber) {
|
|
|
|
|
|
+ public List<OeExamStudentVO> getExamStudentListFromOE(User loginUser, Long examId, Long courseId, String identityNumber) {
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
params.put("examId", examId);
|
|
params.put("examId", examId);
|
|
if (courseId != null) {
|
|
if (courseId != null) {
|
|
@@ -252,7 +287,7 @@ public class CommonService {
|
|
headers.put("token", loginUser.getToken());
|
|
headers.put("token", loginUser.getToken());
|
|
|
|
|
|
String url = loginUser.getServerUrl() + "/api/ecs_oe_admin/exam/student/simple/list";
|
|
String url = loginUser.getServerUrl() + "/api/ecs_oe_admin/exam/student/simple/list";
|
|
- List<ExamStudentVO> all = new ArrayList<>();
|
|
|
|
|
|
+ List<OeExamStudentVO> all = new ArrayList<>();
|
|
JsonMapper jsonMapper = new JsonMapper();
|
|
JsonMapper jsonMapper = new JsonMapper();
|
|
|
|
|
|
int sum = 0, pageNo = 0;
|
|
int sum = 0, pageNo = 0;
|
|
@@ -260,7 +295,7 @@ public class CommonService {
|
|
params.put("pageNo", ++pageNo);
|
|
params.put("pageNo", ++pageNo);
|
|
String json = HttpHelper.post(url, headers, params);
|
|
String json = HttpHelper.post(url, headers, params);
|
|
|
|
|
|
- Pager<ExamStudentVO> page = jsonMapper.parseJson(json, new TypeReference<Pager<ExamStudentVO>>() {
|
|
|
|
|
|
+ Pager<OeExamStudentVO> page = jsonMapper.parseJson(json, new TypeReference<Pager<OeExamStudentVO>>() {
|
|
|
|
|
|
});
|
|
});
|
|
if (page == null || CollectionUtils.isEmpty(page.getContent())) {
|
|
if (page == null || CollectionUtils.isEmpty(page.getContent())) {
|