|
@@ -47,6 +47,7 @@ import com.google.common.collect.Lists;
|
|
|
|
|
|
import cn.com.qmth.examcloud.api.commons.enums.ExamSpecialSettingsType;
|
|
import cn.com.qmth.examcloud.api.commons.enums.ExamSpecialSettingsType;
|
|
import cn.com.qmth.examcloud.api.commons.enums.ExamType;
|
|
import cn.com.qmth.examcloud.api.commons.enums.ExamType;
|
|
|
|
+import cn.com.qmth.examcloud.api.commons.security.bean.UserDataRule;
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.util.StringUtil;
|
|
import cn.com.qmth.examcloud.commons.util.StringUtil;
|
|
import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
|
|
import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
|
|
@@ -74,6 +75,7 @@ import cn.com.qmth.examcloud.core.oe.admin.service.ExamStudentService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.GainBaseDataService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.GainBaseDataService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.LocalCacheService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.LocalCacheService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.OnHandExamInfo;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.OnHandExamInfo;
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.bean.UserDataRules;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examrecord.ExamRecordFileAnswerInfo;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examrecord.ExamRecordFileAnswerInfo;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent.CourseProgressInfo;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent.CourseProgressInfo;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent.ExamStudentEntityConvert;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent.ExamStudentEntityConvert;
|
|
@@ -86,10 +88,7 @@ import cn.com.qmth.examcloud.core.oe.admin.service.cache.ExamStudentCache;
|
|
import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
|
|
import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
|
|
import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
|
|
import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamSpecialSettingsBean;
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamSpecialSettingsBean;
|
|
-import cn.com.qmth.examcloud.examwork.api.bean.ExamStudentBean;
|
|
|
|
-import cn.com.qmth.examcloud.examwork.api.request.GetExamStudentReq;
|
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetOngoingExamListReq;
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetOngoingExamListReq;
|
|
-import cn.com.qmth.examcloud.examwork.api.response.GetExamStudentResp;
|
|
|
|
import cn.com.qmth.examcloud.examwork.api.response.GetOngoingExamListResp;
|
|
import cn.com.qmth.examcloud.examwork.api.response.GetOngoingExamListResp;
|
|
import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
import cn.com.qmth.examcloud.support.cache.bean.CourseCacheBean;
|
|
import cn.com.qmth.examcloud.support.cache.bean.CourseCacheBean;
|
|
@@ -255,7 +254,10 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Page<ExamStudentInfo> getExamStudentListPage(ExamStudentQuery query) {
|
|
|
|
|
|
+ public Page<ExamStudentInfo> getExamStudentListPage(UserDataRules uds,ExamStudentQuery query) {
|
|
|
|
+ if(uds.getCourseRule().assertEmptyQueryResult()||uds.getOrgRule().assertEmptyQueryResult()) {
|
|
|
|
+ return Page.empty();
|
|
|
|
+ }
|
|
Check.isNull(query, "查询参数不能为空!");
|
|
Check.isNull(query, "查询参数不能为空!");
|
|
|
|
|
|
ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(query.getExamId());
|
|
ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(query.getExamId());
|
|
@@ -272,7 +274,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
sql.append(",student_id,student_code,student_name,identity_number"
|
|
sql.append(",student_id,student_code,student_name,identity_number"
|
|
+ ",info_collector,root_org_id,org_id,paper_type,used_num,extra_num"
|
|
+ ",info_collector,root_org_id,org_id,paper_type,used_num,extra_num"
|
|
+ ",specialty_code,specialty_name,grade,t1.exam_stage_id from ec_oe_exam_student t1 where 1=1 ");
|
|
+ ",specialty_code,specialty_name,grade,t1.exam_stage_id from ec_oe_exam_student t1 where 1=1 ");
|
|
- sql.append(selectExamStudentConfitionSql(query, examBean.getExamType()));
|
|
|
|
|
|
+ sql.append(selectExamStudentConfitionSql(uds,query, examBean.getExamType()));
|
|
sql.append(" order by id desc");
|
|
sql.append(" order by id desc");
|
|
int currentNum = (query.getPageNo() - 1) * query.getPageSize();
|
|
int currentNum = (query.getPageNo() - 1) * query.getPageSize();
|
|
sql.append(" limit " + currentNum + "," + query.getPageSize());
|
|
sql.append(" limit " + currentNum + "," + query.getPageSize());
|
|
@@ -305,7 +307,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}
|
|
}
|
|
cahcheMap.clear();
|
|
cahcheMap.clear();
|
|
Pageable pageable = SpecUtils.buildPageable(query.getPageNo(), query.getPageSize());
|
|
Pageable pageable = SpecUtils.buildPageable(query.getPageNo(), query.getPageSize());
|
|
- long totalSize = countExamStudent(query, examBean.getExamType());
|
|
|
|
|
|
+ long totalSize = countExamStudent(uds,query, examBean.getExamType());
|
|
fillStage(examStudentInfoList);
|
|
fillStage(examStudentInfoList);
|
|
return new PageImpl<>(examStudentInfoList, pageable, totalSize);
|
|
return new PageImpl<>(examStudentInfoList, pageable, totalSize);
|
|
}
|
|
}
|
|
@@ -324,16 +326,16 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private long countExamStudent(ExamStudentQuery query, String examType) {
|
|
|
|
|
|
+ private long countExamStudent(UserDataRules uds,ExamStudentQuery query, String examType) {
|
|
//查询条件
|
|
//查询条件
|
|
StringBuffer sql = new StringBuffer();
|
|
StringBuffer sql = new StringBuffer();
|
|
sql.append("select count(t1.id) from ec_oe_exam_student t1 where 1=1 ");
|
|
sql.append("select count(t1.id) from ec_oe_exam_student t1 where 1=1 ");
|
|
- sql.append(selectExamStudentConfitionSql(query, examType));
|
|
|
|
|
|
+ sql.append(selectExamStudentConfitionSql(uds,query, examType));
|
|
return jdbcTemplate.queryForObject(sql.toString(), Long.class);
|
|
return jdbcTemplate.queryForObject(sql.toString(), Long.class);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<ExamStudentInfo> getExamStudentInfoListForAsync(ExamStudentQuery query) {
|
|
|
|
|
|
+ public List<ExamStudentInfo> getExamStudentInfoListForAsync(UserDataRules uds,ExamStudentQuery query) {
|
|
Check.isNull(query, "查询参数不能为空!");
|
|
Check.isNull(query, "查询参数不能为空!");
|
|
ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(query.getExamId());
|
|
ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(query.getExamId());
|
|
|
|
|
|
@@ -341,7 +343,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
int pageNo = 1;
|
|
int pageNo = 1;
|
|
int pageSize = 500;
|
|
int pageSize = 500;
|
|
for (; ; ) {
|
|
for (; ; ) {
|
|
- List<ExamStudentEntity> tem = getExamStudentInfoListByPage(query, examBean, pageNo, pageSize);
|
|
|
|
|
|
+ List<ExamStudentEntity> tem = getExamStudentInfoListByPage(uds,query, examBean, pageNo, pageSize);
|
|
if (tem == null || tem.size() == 0) {
|
|
if (tem == null || tem.size() == 0) {
|
|
break;
|
|
break;
|
|
} else {
|
|
} else {
|
|
@@ -426,7 +428,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
tool.setDataForBatch(dataList, 100);
|
|
tool.setDataForBatch(dataList, 100);
|
|
}
|
|
}
|
|
|
|
|
|
- private List<ExamStudentEntity> getExamStudentInfoListByPage(ExamStudentQuery query, ExamSettingsCacheBean examBean, int pageNo, int pageSize) {
|
|
|
|
|
|
+ private List<ExamStudentEntity> getExamStudentInfoListByPage(UserDataRules uds,ExamStudentQuery query, ExamSettingsCacheBean examBean, int pageNo, int pageSize) {
|
|
//查询条件
|
|
//查询条件
|
|
StringBuffer sql = new StringBuffer();
|
|
StringBuffer sql = new StringBuffer();
|
|
sql.append("select id,exam_student_id,exam_id,course_id,course_code,course_level");
|
|
sql.append("select id,exam_student_id,exam_id,course_id,course_code,course_level");
|
|
@@ -439,7 +441,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
sql.append(",student_id,student_code,student_name,identity_number"
|
|
sql.append(",student_id,student_code,student_name,identity_number"
|
|
+ ",info_collector,root_org_id,org_id,paper_type,used_num,extra_num"
|
|
+ ",info_collector,root_org_id,org_id,paper_type,used_num,extra_num"
|
|
+ ",specialty_code,specialty_name,grade,exam_stage_id from ec_oe_exam_student t1 where 1=1 ");
|
|
+ ",specialty_code,specialty_name,grade,exam_stage_id from ec_oe_exam_student t1 where 1=1 ");
|
|
- sql.append(selectExamStudentConfitionSql(query, examBean.getExamType()));
|
|
|
|
|
|
+ sql.append(selectExamStudentConfitionSql(uds,query, examBean.getExamType()));
|
|
int currentNum = (pageNo - 1) * pageSize;
|
|
int currentNum = (pageNo - 1) * pageSize;
|
|
sql.append(" order by id limit " + currentNum + "," + pageSize);
|
|
sql.append(" order by id limit " + currentNum + "," + pageSize);
|
|
|
|
|
|
@@ -454,7 +456,10 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<ExamStudentInfo> getExamStudentInfoList(ExamStudentQuery query) {
|
|
|
|
|
|
+ public List<ExamStudentInfo> getExamStudentInfoList(UserDataRules uds,ExamStudentQuery query) {
|
|
|
|
+ if(uds.getCourseRule().assertEmptyQueryResult()||uds.getOrgRule().assertEmptyQueryResult()) {
|
|
|
|
+ return Lists.newArrayList();
|
|
|
|
+ }
|
|
Check.isNull(query, "查询参数不能为空!");
|
|
Check.isNull(query, "查询参数不能为空!");
|
|
ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(query.getExamId());
|
|
ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(query.getExamId());
|
|
|
|
|
|
@@ -470,7 +475,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
sql.append(",student_id,student_code,student_name,identity_number"
|
|
sql.append(",student_id,student_code,student_name,identity_number"
|
|
+ ",info_collector,root_org_id,org_id,paper_type,used_num,extra_num"
|
|
+ ",info_collector,root_org_id,org_id,paper_type,used_num,extra_num"
|
|
+ ",specialty_code,specialty_name,grade,t1.exam_stage_id from ec_oe_exam_student t1 where 1=1 ");
|
|
+ ",specialty_code,specialty_name,grade,t1.exam_stage_id from ec_oe_exam_student t1 where 1=1 ");
|
|
- sql.append(selectExamStudentConfitionSql(query, examBean.getExamType()));
|
|
|
|
|
|
+ sql.append(selectExamStudentConfitionSql(uds,query, examBean.getExamType()));
|
|
sql.append(" order by id desc");
|
|
sql.append(" order by id desc");
|
|
|
|
|
|
List<ExamStudentEntity> examStudentList = jdbcTemplate.query(sql.toString(), new RowMapper<ExamStudentEntity>() {
|
|
List<ExamStudentEntity> examStudentList = jdbcTemplate.query(sql.toString(), new RowMapper<ExamStudentEntity>() {
|
|
@@ -504,7 +509,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
return examStudentInfoList;
|
|
return examStudentInfoList;
|
|
}
|
|
}
|
|
|
|
|
|
- private StringBuffer selectExamStudentConfitionSql(ExamStudentQuery query, String examType) {
|
|
|
|
|
|
+ private StringBuffer selectExamStudentConfitionSql(UserDataRules uds,ExamStudentQuery query, String examType) {
|
|
StringBuffer sql = new StringBuffer();
|
|
StringBuffer sql = new StringBuffer();
|
|
if (query.getOrgId() != null) {
|
|
if (query.getOrgId() != null) {
|
|
sql.append(" and org_id=" + query.getOrgId());
|
|
sql.append(" and org_id=" + query.getOrgId());
|
|
@@ -558,6 +563,12 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(uds.getOrgRule().assertNeedQueryRefIds()) {
|
|
|
|
+ sql.append(" and org_id in (" + StringUtils.join(uds.getOrgRule().getRefIds(), ",")+") ");
|
|
|
|
+ }
|
|
|
|
+ if(uds.getCourseRule().assertNeedQueryRefIds()) {
|
|
|
|
+ sql.append(" and course_id in (" + StringUtils.join(uds.getCourseRule().getRefIds(), ",")+") ");
|
|
|
|
+ }
|
|
return sql;
|
|
return sql;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -667,7 +678,10 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Page<ExamStudentInfo> getReExamineStudentList(ExamStudentQuery query) {
|
|
|
|
|
|
+ public Page<ExamStudentInfo> getReExamineStudentList(UserDataRules uds,ExamStudentQuery query) {
|
|
|
|
+ if(uds.getCourseRule().assertEmptyQueryResult()||uds.getOrgRule().assertEmptyQueryResult()) {
|
|
|
|
+ return Page.empty();
|
|
|
|
+ }
|
|
//获取考试的默认次数
|
|
//获取考试的默认次数
|
|
ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(query.getExamId());
|
|
ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(query.getExamId());
|
|
|
|
|
|
@@ -727,6 +741,12 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
if (StringUtils.isNotBlank(query.getCourseLevel())) {
|
|
if (StringUtils.isNotBlank(query.getCourseLevel())) {
|
|
sql.append(" and t.course_level= '" + query.getCourseLevel() + "'");
|
|
sql.append(" and t.course_level= '" + query.getCourseLevel() + "'");
|
|
}
|
|
}
|
|
|
|
+ if(uds.getOrgRule().assertNeedQueryRefIds()) {
|
|
|
|
+ sql.append(" and t.org_id in (" + StringUtils.join(uds.getOrgRule().getRefIds(), ",")+") ");
|
|
|
|
+ }
|
|
|
|
+ if(uds.getCourseRule().assertNeedQueryRefIds()) {
|
|
|
|
+ sql.append(" and t.course_id in (" + StringUtils.join(uds.getCourseRule().getRefIds(), ",")+") ");
|
|
|
|
+ }
|
|
int currentNum = (query.getPageNo() - 1) * query.getPageSize();
|
|
int currentNum = (query.getPageNo() - 1) * query.getPageSize();
|
|
sql.append(" limit " + currentNum + "," + query.getPageSize());
|
|
sql.append(" limit " + currentNum + "," + query.getPageSize());
|
|
|
|
|
|
@@ -754,7 +774,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
return examStudentEntity;
|
|
return examStudentEntity;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- long totalSize = countReExamine(query, examBean);
|
|
|
|
|
|
+ long totalSize = countReExamine(uds,query, examBean);
|
|
List<ExamStudentInfo> list = new ArrayList<ExamStudentInfo>();
|
|
List<ExamStudentInfo> list = new ArrayList<ExamStudentInfo>();
|
|
for (ExamStudentEntity examStudentEntity : examStudentList) {
|
|
for (ExamStudentEntity examStudentEntity : examStudentList) {
|
|
ExamStudentInfo examStudentInfo = ExamStudentEntityConvert.of(examStudentEntity);
|
|
ExamStudentInfo examStudentInfo = ExamStudentEntityConvert.of(examStudentEntity);
|
|
@@ -768,7 +788,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
return new PageImpl<>(list, pageable, totalSize);
|
|
return new PageImpl<>(list, pageable, totalSize);
|
|
}
|
|
}
|
|
|
|
|
|
- private Long countReExamine(ExamStudentQuery query, ExamSettingsCacheBean examBean) {
|
|
|
|
|
|
+ private Long countReExamine(UserDataRules uds,ExamStudentQuery query, ExamSettingsCacheBean examBean) {
|
|
StringBuffer sql = new StringBuffer();
|
|
StringBuffer sql = new StringBuffer();
|
|
sql.append("SELECT count(*)" +
|
|
sql.append("SELECT count(*)" +
|
|
" FROM " +
|
|
" FROM " +
|
|
@@ -800,6 +820,12 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
if (StringUtils.isNotBlank(query.getCourseLevel())) {
|
|
if (StringUtils.isNotBlank(query.getCourseLevel())) {
|
|
sql.append(" and student.course_level= '" + query.getCourseLevel() + "'");
|
|
sql.append(" and student.course_level= '" + query.getCourseLevel() + "'");
|
|
}
|
|
}
|
|
|
|
+ if(uds.getOrgRule().assertNeedQueryRefIds()) {
|
|
|
|
+ sql.append(" and student.org_id in (" + StringUtils.join(uds.getOrgRule().getRefIds(), ",")+") ");
|
|
|
|
+ }
|
|
|
|
+ if(uds.getCourseRule().assertNeedQueryRefIds()) {
|
|
|
|
+ sql.append(" and student.course_id in (" + StringUtils.join(uds.getCourseRule().getRefIds(), ",")+") ");
|
|
|
|
+ }
|
|
return jdbcTemplate.queryForObject(sql.toString(), Long.class);
|
|
return jdbcTemplate.queryForObject(sql.toString(), Long.class);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -858,8 +884,11 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<ExamStudentOrgStatistic> getExamStudentStatisticByOrg(Long examId, Long examStageId, Long orgId) {
|
|
|
|
- ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(examId);
|
|
|
|
|
|
+ public List<ExamStudentOrgStatistic> getExamStudentStatisticByOrg(UserDataRule ud,Long examId, Long examStageId, Long orgId) {
|
|
|
|
+ if(ud.assertEmptyQueryResult()) {
|
|
|
|
+ return Lists.newArrayList();
|
|
|
|
+ }
|
|
|
|
+ ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(examId);
|
|
if (ExamType.ONLINE.name().equals(examBean.getExamType()) ||
|
|
if (ExamType.ONLINE.name().equals(examBean.getExamType()) ||
|
|
ExamType.ONLINE_HOMEWORK.name().equals(examBean.getExamType())) {
|
|
ExamType.ONLINE_HOMEWORK.name().equals(examBean.getExamType())) {
|
|
StringBuffer totalsql = new StringBuffer();
|
|
StringBuffer totalsql = new StringBuffer();
|
|
@@ -903,7 +932,13 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
statistic.setFinishedPercent(new DecimalFormat("#.00").format(percent * 100));
|
|
statistic.setFinishedPercent(new DecimalFormat("#.00").format(percent * 100));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return totalList;
|
|
|
|
|
|
+ List<ExamStudentOrgStatistic> ret=Lists.newArrayList();
|
|
|
|
+ for (ExamStudentOrgStatistic statistic : totalList) {
|
|
|
|
+ if(!ud.assertNeedQueryRefIds()||ud.getRefIds().contains(statistic.getOrgId())) {
|
|
|
|
+ ret.add(statistic);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return ret;
|
|
} else {
|
|
} else {
|
|
SqlWrapper wrapper = new SqlWrapper()
|
|
SqlWrapper wrapper = new SqlWrapper()
|
|
.select(statisticOrgColumns())
|
|
.select(statisticOrgColumns())
|
|
@@ -926,7 +961,13 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
statistic.setOrgCode(orgBean.getCode());
|
|
statistic.setOrgCode(orgBean.getCode());
|
|
statistic.setOrgName(orgBean.getName());
|
|
statistic.setOrgName(orgBean.getName());
|
|
}
|
|
}
|
|
- return examStudentOrgStatisticList;
|
|
|
|
|
|
+ List<ExamStudentOrgStatistic> ret=Lists.newArrayList();
|
|
|
|
+ for (ExamStudentOrgStatistic statistic : examStudentOrgStatisticList) {
|
|
|
|
+ if(!ud.assertNeedQueryRefIds()||ud.getRefIds().contains(statistic.getOrgId())) {
|
|
|
|
+ ret.add(statistic);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1001,8 +1042,11 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<CourseProgressInfo> queryCourseProgressInfos(Long examId, Long examStageId,
|
|
|
|
|
|
+ public List<CourseProgressInfo> queryCourseProgressInfos(UserDataRule ud,Long examId, Long examStageId,
|
|
Long courseId, String orderColumn) {
|
|
Long courseId, String orderColumn) {
|
|
|
|
+ if(ud.assertEmptyQueryResult()) {
|
|
|
|
+ return Lists.newArrayList();
|
|
|
|
+ }
|
|
if (examId == null) {
|
|
if (examId == null) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -1051,7 +1095,13 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
statistic.setCompletedProportion(Double.valueOf(new DecimalFormat("#.00").format(percent * 100)));
|
|
statistic.setCompletedProportion(Double.valueOf(new DecimalFormat("#.00").format(percent * 100)));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return totalList;
|
|
|
|
|
|
+ List<CourseProgressInfo> ret=Lists.newArrayList();
|
|
|
|
+ for (CourseProgressInfo statistic : totalList) {
|
|
|
|
+ if(!ud.assertNeedQueryRefIds()||ud.getRefIds().contains(statistic.getCourseId())) {
|
|
|
|
+ ret.add(statistic);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return ret;
|
|
} else {
|
|
} else {
|
|
if (StringUtils.isBlank(orderColumn)) {
|
|
if (StringUtils.isBlank(orderColumn)) {
|
|
orderColumn = "all_num";
|
|
orderColumn = "all_num";
|
|
@@ -1073,7 +1123,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}
|
|
}
|
|
sql += " group by course_id ) tb ORDER BY " + orderColumn + " desc";
|
|
sql += " group by course_id ) tb ORDER BY " + orderColumn + " desc";
|
|
|
|
|
|
- return jdbcTemplate.query(sql, new RowMapper<CourseProgressInfo>() {
|
|
|
|
|
|
+ List<CourseProgressInfo> totalList= jdbcTemplate.query(sql, new RowMapper<CourseProgressInfo>() {
|
|
@Override
|
|
@Override
|
|
public CourseProgressInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
|
|
public CourseProgressInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
|
|
CourseProgressInfo courseProgressInfo = new CourseProgressInfo();
|
|
CourseProgressInfo courseProgressInfo = new CourseProgressInfo();
|
|
@@ -1085,6 +1135,13 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
return courseProgressInfo;
|
|
return courseProgressInfo;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ List<CourseProgressInfo> ret=Lists.newArrayList();
|
|
|
|
+ for (CourseProgressInfo statistic : totalList) {
|
|
|
|
+ if(!ud.assertNeedQueryRefIds()||ud.getRefIds().contains(statistic.getCourseId())) {
|
|
|
|
+ ret.add(statistic);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1325,13 +1382,13 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
examStudentInfo.setUsedNum(ret);
|
|
examStudentInfo.setUsedNum(ret);
|
|
}
|
|
}
|
|
|
|
|
|
- //获取考试的考生信息
|
|
|
|
- private ExamStudentBean getRemoteExamStudent(Long rootOrgId, Long examStudentId) {
|
|
|
|
- GetExamStudentReq req = new GetExamStudentReq();
|
|
|
|
- req.setExamStudentId(examStudentId);
|
|
|
|
- req.setRootOrgId(rootOrgId);
|
|
|
|
- GetExamStudentResp resp = examStudentCloudService.getExamStudent(req);
|
|
|
|
- return resp.getExamStudentBean();
|
|
|
|
- }
|
|
|
|
|
|
+// //获取考试的考生信息
|
|
|
|
+// private ExamStudentBean getRemoteExamStudent(Long rootOrgId, Long examStudentId) {
|
|
|
|
+// GetExamStudentReq req = new GetExamStudentReq();
|
|
|
|
+// req.setExamStudentId(examStudentId);
|
|
|
|
+// req.setRootOrgId(rootOrgId);
|
|
|
|
+// GetExamStudentResp resp = examStudentCloudService.getExamStudent(req);
|
|
|
|
+// return resp.getExamStudentBean();
|
|
|
|
+// }
|
|
|
|
|
|
}
|
|
}
|