|
@@ -35,6 +35,7 @@ import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetExamStudentReq;
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetExamStudentReq;
|
|
import cn.com.qmth.examcloud.examwork.api.response.GetExamStudentResp;
|
|
import cn.com.qmth.examcloud.examwork.api.response.GetExamStudentResp;
|
|
import cn.com.qmth.examcloud.support.cache.bean.SysPropertyCacheBean;
|
|
import cn.com.qmth.examcloud.support.cache.bean.SysPropertyCacheBean;
|
|
|
|
+import cn.com.qmth.examcloud.support.enums.ExamProperties;
|
|
import cn.com.qmth.examcloud.support.filestorage.FileStorageUtil;
|
|
import cn.com.qmth.examcloud.support.filestorage.FileStorageUtil;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.hibernate.query.NativeQuery;
|
|
import org.hibernate.query.NativeQuery;
|
|
@@ -64,7 +65,6 @@ import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordForMarkingEntity;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordForMarkingEntity;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentEntity;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentEntity;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.enums.CourseLevel;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.enums.CourseLevel;
|
|
-import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamProperties;
|
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamRecordStatus;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamRecordStatus;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.enums.FinishStatus;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.enums.FinishStatus;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordService;
|
|
@@ -228,7 +228,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}else {
|
|
}else {
|
|
sql.append(",finished");
|
|
sql.append(",finished");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
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 from ec_oe_exam_student t1 where 1=1 ");
|
|
+ ",specialty_code,specialty_name,grade from ec_oe_exam_student t1 where 1=1 ");
|
|
@@ -290,7 +290,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}else {
|
|
}else {
|
|
sql.append(",finished");
|
|
sql.append(",finished");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
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 from ec_oe_exam_student t1 where 1=1 ");
|
|
+ ",specialty_code,specialty_name,grade from ec_oe_exam_student t1 where 1=1 ");
|
|
@@ -591,7 +591,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
totalsql.append("select count(t1.id) from ec_oe_exam_student t1 where 1=1 ");
|
|
totalsql.append("select count(t1.id) from ec_oe_exam_student t1 where 1=1 ");
|
|
totalsql.append(" and exam_id = " + examId);
|
|
totalsql.append(" and exam_id = " + examId);
|
|
Integer total=jdbcTemplate.queryForObject(totalsql.toString(), Integer.class);
|
|
Integer total=jdbcTemplate.queryForObject(totalsql.toString(), Integer.class);
|
|
-
|
|
|
|
|
|
+
|
|
StringBuffer finishsql = new StringBuffer();
|
|
StringBuffer finishsql = new StringBuffer();
|
|
finishsql.append("select count(t1.id) from ec_oe_exam_student t1 where 1=1 ");
|
|
finishsql.append("select count(t1.id) from ec_oe_exam_student t1 where 1=1 ");
|
|
finishsql.append(" and exam_id = " + examId);
|
|
finishsql.append(" and exam_id = " + examId);
|
|
@@ -637,7 +637,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}
|
|
}
|
|
totalsql.append(" group by t1.org_id ");
|
|
totalsql.append(" group by t1.org_id ");
|
|
List<ExamStudentOrgStatistic> totalList=jdbcTemplate.query(totalsql.toString(), new BeanPropertyRowMapper<ExamStudentOrgStatistic>(ExamStudentOrgStatistic.class));
|
|
List<ExamStudentOrgStatistic> totalList=jdbcTemplate.query(totalsql.toString(), new BeanPropertyRowMapper<ExamStudentOrgStatistic>(ExamStudentOrgStatistic.class));
|
|
-
|
|
|
|
|
|
+
|
|
StringBuffer finishsql = new StringBuffer();
|
|
StringBuffer finishsql = new StringBuffer();
|
|
finishsql.append("select t1.org_id orgId,count(t1.id) finishedCount from ec_oe_exam_student t1 where 1=1 ");
|
|
finishsql.append("select t1.org_id orgId,count(t1.id) finishedCount from ec_oe_exam_student t1 where 1=1 ");
|
|
finishsql.append(" and exam_id = " + examId);
|
|
finishsql.append(" and exam_id = " + examId);
|
|
@@ -646,11 +646,11 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}
|
|
}
|
|
finishsql.append(" AND ( finished = 1 OR t1.exam_student_id in ( SELECT t2.exam_student_id FROM ec_oes_exam_record_data t2 WHERE t2.exam_id="+examId+" ) )");
|
|
finishsql.append(" AND ( finished = 1 OR t1.exam_student_id in ( SELECT t2.exam_student_id FROM ec_oes_exam_record_data t2 WHERE t2.exam_id="+examId+" ) )");
|
|
finishsql.append(" group by t1.org_id ");
|
|
finishsql.append(" group by t1.org_id ");
|
|
-
|
|
|
|
|
|
+
|
|
List<ExamStudentOrgStatistic> finishList=jdbcTemplate.query(finishsql.toString(), new BeanPropertyRowMapper<ExamStudentOrgStatistic>(ExamStudentOrgStatistic.class));
|
|
List<ExamStudentOrgStatistic> finishList=jdbcTemplate.query(finishsql.toString(), new BeanPropertyRowMapper<ExamStudentOrgStatistic>(ExamStudentOrgStatistic.class));
|
|
-
|
|
|
|
|
|
+
|
|
Map<Long,ExamStudentOrgStatistic> finishMap=finishList.stream().collect(Collectors.toMap(ExamStudentOrgStatistic::getOrgId, account -> account));
|
|
Map<Long,ExamStudentOrgStatistic> finishMap=finishList.stream().collect(Collectors.toMap(ExamStudentOrgStatistic::getOrgId, account -> account));
|
|
-
|
|
|
|
|
|
+
|
|
for(ExamStudentOrgStatistic statistic:totalList) {
|
|
for(ExamStudentOrgStatistic statistic:totalList) {
|
|
ExamStudentOrgStatistic finish=finishMap.get(statistic.getOrgId());
|
|
ExamStudentOrgStatistic finish=finishMap.get(statistic.getOrgId());
|
|
statistic.setFinishedCount(finish==null?0:finish.getFinishedCount());
|
|
statistic.setFinishedCount(finish==null?0:finish.getFinishedCount());
|
|
@@ -753,7 +753,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}
|
|
}
|
|
totalsql.append(" group by t1.course_id ");
|
|
totalsql.append(" group by t1.course_id ");
|
|
List<CourseProgressInfo> totalList=jdbcTemplate.query(totalsql.toString(), new BeanPropertyRowMapper<CourseProgressInfo>(CourseProgressInfo.class));
|
|
List<CourseProgressInfo> totalList=jdbcTemplate.query(totalsql.toString(), new BeanPropertyRowMapper<CourseProgressInfo>(CourseProgressInfo.class));
|
|
-
|
|
|
|
|
|
+
|
|
StringBuffer finishsql = new StringBuffer();
|
|
StringBuffer finishsql = new StringBuffer();
|
|
finishsql.append("select t1.course_id courseId,count(t1.id) completedNum from ec_oe_exam_student t1 where 1=1 ");
|
|
finishsql.append("select t1.course_id courseId,count(t1.id) completedNum from ec_oe_exam_student t1 where 1=1 ");
|
|
finishsql.append(" and exam_id = " + examId);
|
|
finishsql.append(" and exam_id = " + examId);
|
|
@@ -762,11 +762,11 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
}
|
|
}
|
|
finishsql.append(" AND ( finished = 1 OR t1.exam_student_id in ( SELECT t2.exam_student_id FROM ec_oes_exam_record_data t2 WHERE t2.exam_id="+examId+" ))");
|
|
finishsql.append(" AND ( finished = 1 OR t1.exam_student_id in ( SELECT t2.exam_student_id FROM ec_oes_exam_record_data t2 WHERE t2.exam_id="+examId+" ))");
|
|
finishsql.append(" group by t1.course_id ");
|
|
finishsql.append(" group by t1.course_id ");
|
|
-
|
|
|
|
|
|
+
|
|
List<CourseProgressInfo> finishList=jdbcTemplate.query(finishsql.toString(), new BeanPropertyRowMapper<CourseProgressInfo>(CourseProgressInfo.class));
|
|
List<CourseProgressInfo> finishList=jdbcTemplate.query(finishsql.toString(), new BeanPropertyRowMapper<CourseProgressInfo>(CourseProgressInfo.class));
|
|
-
|
|
|
|
|
|
+
|
|
Map<Long,CourseProgressInfo> finishMap=finishList.stream().collect(Collectors.toMap(CourseProgressInfo::getCourseId, account -> account));
|
|
Map<Long,CourseProgressInfo> finishMap=finishList.stream().collect(Collectors.toMap(CourseProgressInfo::getCourseId, account -> account));
|
|
-
|
|
|
|
|
|
+
|
|
for(CourseProgressInfo statistic:totalList) {
|
|
for(CourseProgressInfo statistic:totalList) {
|
|
CourseProgressInfo finish=finishMap.get(statistic.getCourseId());
|
|
CourseProgressInfo finish=finishMap.get(statistic.getCourseId());
|
|
statistic.setCompletedNum(finish==null?0:finish.getCompletedNum());
|
|
statistic.setCompletedNum(finish==null?0:finish.getCompletedNum());
|
|
@@ -796,7 +796,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
sql += " and course_id = " + courseId;
|
|
sql += " and course_id = " + courseId;
|
|
}
|
|
}
|
|
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>() {
|
|
return 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 {
|
|
@@ -941,6 +941,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
examStudentInfo.setFaceEnable(FaceBiopsyHelper.isFaceEnable(rootOrgId, examId, studentId));
|
|
examStudentInfo.setFaceEnable(FaceBiopsyHelper.isFaceEnable(rootOrgId, examId, studentId));
|
|
//进入考试是否验证人脸识别(强制、非强制)
|
|
//进入考试是否验证人脸识别(强制、非强制)
|
|
examStudentInfo.setFaceCheck(FaceBiopsyHelper.isFaceCheck(examId, studentId));
|
|
examStudentInfo.setFaceCheck(FaceBiopsyHelper.isFaceCheck(examId, studentId));
|
|
|
|
+
|
|
//是否显示客观分
|
|
//是否显示客观分
|
|
String isObjScoreView = ExamCacheTransferHelper.getCachedExamProperty(examId,
|
|
String isObjScoreView = ExamCacheTransferHelper.getCachedExamProperty(examId,
|
|
studentId, ExamProperties.IS_OBJ_SCORE_VIEW.name()).getValue();
|
|
studentId, ExamProperties.IS_OBJ_SCORE_VIEW.name()).getValue();
|
|
@@ -949,6 +950,16 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
} else {
|
|
} else {
|
|
examStudentInfo.setIsObjScoreView(Boolean.valueOf(isObjScoreView));
|
|
examStudentInfo.setIsObjScoreView(Boolean.valueOf(isObjScoreView));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //是否开放app考试
|
|
|
|
+ String appExamEnabled = ExamCacheTransferHelper.getCachedExamProperty(examId,
|
|
|
|
+ studentId, ExamProperties.APP_EXAM_ENABLED.name()).getValue();
|
|
|
|
+ if (StringUtils.isBlank(isObjScoreView)) {
|
|
|
|
+ examStudentInfo.setAppExamEnabled(false);
|
|
|
|
+ } else {
|
|
|
|
+ examStudentInfo.setAppExamEnabled(Boolean.valueOf(appExamEnabled));
|
|
|
|
+ }
|
|
|
|
+
|
|
return examStudentInfo;
|
|
return examStudentInfo;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1009,4 +1020,4 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
GetExamStudentResp resp = examStudentCloudService.getExamStudent(req);
|
|
GetExamStudentResp resp = examStudentCloudService.getExamStudent(req);
|
|
return resp.getExamStudentBean();
|
|
return resp.getExamStudentBean();
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|