|
@@ -17,10 +17,11 @@ import cn.com.qmth.examcloud.examwork.api.bean.ExamPaperTypeRelation;
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.CountExamStudentReq;
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetExamCoursePaperTypeListReq;
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetExamOrgListReq;
|
|
|
+import cn.com.qmth.examcloud.examwork.api.request.GetExamStudentPropertyValueListReq;
|
|
|
import cn.com.qmth.examcloud.examwork.api.response.CountExamStudentResp;
|
|
|
import cn.com.qmth.examcloud.examwork.api.response.GetExamCoursePaperTypeListResp;
|
|
|
import cn.com.qmth.examcloud.examwork.api.response.GetExamOrgListResp;
|
|
|
-import com.google.common.collect.Lists;
|
|
|
+import cn.com.qmth.examcloud.examwork.api.response.GetExamStudentPropertyValueListResp;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -126,31 +127,18 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
|
|
|
@Override
|
|
|
public List<String> findExamPackageCodes(Long orgId, Long examId) {
|
|
|
- //todo
|
|
|
- return Lists.newArrayList("abc");
|
|
|
+ GetExamStudentPropertyValueListReq req = new GetExamStudentPropertyValueListReq();
|
|
|
+ req.setExamId(examId);
|
|
|
+ req.setPropertyName("ext1");//试卷袋编号字段
|
|
|
+ return this.findExamStudentProperties(req);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<String> findExamSites(Long examId) {
|
|
|
- List<String> sites = new ArrayList<>();
|
|
|
- GetExamOrgListReq req = new GetExamOrgListReq();
|
|
|
+ GetExamStudentPropertyValueListReq req = new GetExamStudentPropertyValueListReq();
|
|
|
req.setExamId(examId);
|
|
|
- Long start = 0L;
|
|
|
- while (true) {
|
|
|
- req.setStart(start);
|
|
|
- GetExamOrgListResp resp = examCloudService.getExamOrgList(req);
|
|
|
- List<Long> list = resp.getOrgIdList();
|
|
|
- if (list == null || list.isEmpty()) {
|
|
|
- break;
|
|
|
- }
|
|
|
- //sites.addAll(list);
|
|
|
- if (start.equals(resp.getNext())) {
|
|
|
- break;
|
|
|
- } else {
|
|
|
- start = resp.getNext();
|
|
|
- }
|
|
|
- }
|
|
|
- return sites;
|
|
|
+ req.setPropertyName("examSite");//考点字段
|
|
|
+ return this.findExamStudentProperties(req);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -187,7 +175,7 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
public int countExamTotalStudentByPackageCode(Long examId, String packageCode) {
|
|
|
CountExamStudentReq req = new CountExamStudentReq();
|
|
|
req.setExamId(examId);
|
|
|
- //todo
|
|
|
+ req.setExt1(packageCode);//试卷袋编号
|
|
|
return this.countExamTotalStudent(req);
|
|
|
}
|
|
|
|
|
@@ -195,7 +183,7 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
public int countExamTotalStudentByLearnCenter(Long examId, Long learnCenterId) {
|
|
|
CountExamStudentReq req = new CountExamStudentReq();
|
|
|
req.setExamId(examId);
|
|
|
- req.setOrgId(learnCenterId);
|
|
|
+ req.setOrgId(learnCenterId);//学习中心
|
|
|
return this.countExamTotalStudent(req);
|
|
|
}
|
|
|
|
|
@@ -203,7 +191,7 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
public int countExamTotalStudentBySite(Long examId, String site) {
|
|
|
CountExamStudentReq req = new CountExamStudentReq();
|
|
|
req.setExamId(examId);
|
|
|
- req.setExamSite(site);
|
|
|
+ req.setExamSite(site);//考点
|
|
|
return this.countExamTotalStudent(req);
|
|
|
}
|
|
|
|
|
@@ -212,4 +200,25 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
return resp.getCount().intValue();
|
|
|
}
|
|
|
|
|
|
+ private List<String> findExamStudentProperties(GetExamStudentPropertyValueListReq req) {
|
|
|
+ List<String> properties = new ArrayList<>();
|
|
|
+ String start = "";
|
|
|
+ while (true) {
|
|
|
+ req.setStart(start);
|
|
|
+ GetExamStudentPropertyValueListResp resp = examCloudService.getExamStudentPropertyValueList(req);
|
|
|
+ List<String> list = resp.getValueList();
|
|
|
+ if (list == null || list.isEmpty()) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ properties.addAll(list);
|
|
|
+ String last = list.get(list.size() - 1);
|
|
|
+ if (start.equals(last)) {
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ start = last;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return properties;
|
|
|
+ }
|
|
|
+
|
|
|
}
|