Prechádzať zdrojové kódy

代码优化及bug修复

lideyin 5 rokov pred
rodič
commit
cac7e7d781
13 zmenil súbory, kde vykonal 91 pridanie a 138 odobranie
  1. 2 2
      examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/controller/ExamAuditController.java
  2. 2 2
      examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/controller/IllegallyTypeController.java
  3. 15 15
      examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/controller/OfflineExamController.java
  4. 2 2
      examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/provider/ExamStudentDataCloudServiceProvider.java
  5. 0 68
      examcloud-core-oe-admin-dao/src/main/java/cn/com/qmth/examcloud/core/oe/admin/dao/enums/ExamProperties.java
  6. 35 24
      examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/bean/OnHandExamInfo.java
  7. 1 1
      examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamScoreObtainQueueServiceImpl.java
  8. 1 1
      examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamScorePushQueueServiceImpl.java
  9. 4 4
      examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamScoreServiceImpl.java
  10. 1 2
      examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamStudentFinalScoreServiceImpl.java
  11. 25 14
      examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamStudentServiceImpl.java
  12. 1 1
      examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/OfflineExamServiceImpl.java
  13. 2 2
      examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/others/ExamCacheTransferHelper.java

+ 2 - 2
examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/controller/ExamAuditController.java

@@ -17,12 +17,12 @@ import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordDataRepo;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
 import cn.com.qmth.examcloud.core.oe.admin.dao.enums.AuditStatus;
 import cn.com.qmth.examcloud.core.oe.admin.dao.enums.DisciplineType;
-import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamProperties;
 import cn.com.qmth.examcloud.core.oe.admin.dao.enums.SelectType;
 import cn.com.qmth.examcloud.core.oe.admin.service.ExamAuditService;
 import cn.com.qmth.examcloud.core.oe.admin.service.GainBaseDataService;
 import cn.com.qmth.examcloud.core.oe.admin.service.bean.examaudit.*;
 import cn.com.qmth.examcloud.core.oe.admin.service.others.ExamCacheTransferHelper;
+import cn.com.qmth.examcloud.support.enums.ExamProperties;
 import cn.com.qmth.examcloud.support.helper.IdentityNumberHelper;
 import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
 import cn.com.qmth.examcloud.web.support.ControllerSupport;
@@ -165,4 +165,4 @@ public class ExamAuditController extends ControllerSupport {
         examAuditService.redoAudit(redoAuditInfo, user);
     }
 
-}
+}

+ 2 - 2
examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/controller/IllegallyTypeController.java

@@ -105,7 +105,7 @@ public class IllegallyTypeController extends ControllerSupport {
         };
 
         PageRequest pageRequest = PageRequest.of(curPage, pageSize,
-                new Sort(Direction.DESC, "updateTime", "id"));
+                new Sort(Direction.DESC, "id"));
 
 
         Page<IllegallyTypeEntity> page = illegallyTypeRepo.findAll(specification, pageRequest);
@@ -175,7 +175,7 @@ public class IllegallyTypeController extends ControllerSupport {
 
         List<Sort.Order> orderList=new ArrayList<>();
         orderList.add(new Sort.Order(Direction.DESC,"dataCategory"));
-        orderList.add(new Sort.Order(Direction.ASC,"sortNo"));
+        orderList.add(new Sort.Order(Direction.ASC,"id"));
 
         List<IllegallyTypeEntity> list = illegallyTypeRepo.findAll(specification,
                 new Sort(orderList));

+ 15 - 15
examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/controller/OfflineExamController.java

@@ -8,6 +8,7 @@ import java.io.OutputStream;
 import java.util.List;
 
 import cn.com.qmth.examcloud.api.commons.enums.ExamType;
+import cn.com.qmth.examcloud.support.enums.ExamProperties;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,7 +24,6 @@ import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.core.oe.admin.base.utils.Check;
 import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordDataRepo;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
-import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamProperties;
 import cn.com.qmth.examcloud.core.oe.admin.service.OfflineExamService;
 import cn.com.qmth.examcloud.core.oe.admin.service.bean.OfflineExamCourseInfo;
 import cn.com.qmth.examcloud.core.oe.admin.service.others.ExamCacheTransferHelper;
@@ -34,7 +34,7 @@ import io.swagger.annotations.ApiOperation;
 
 
 /**
- * 
+ *
  * @author  	chenken
  * @date    	2018年9月5日 下午3:33:26
  * @company 	QMTH
@@ -55,11 +55,11 @@ public class OfflineExamController extends ControllerSupport{
 	 * 单位:M
 	 */
 	private static int answerMaxsize = 30;
-	
-	
+
+
 	public static final String TEMP_FILE_EXP = "offlineExam/";
-	
-	
+
+
 	/**
 	 * 获取离线考试列表
 	 * @return
@@ -71,7 +71,7 @@ public class OfflineExamController extends ControllerSupport{
 		List<OfflineExamCourseInfo> offlineExamCourseInfos = offlineExamService.getOfflineCourse(user.getUserId());
 		return offlineExamCourseInfos;
 	}
-	
+
 	/**
 	 * 开始考试
 	 * @param examStudentId
@@ -82,7 +82,7 @@ public class OfflineExamController extends ControllerSupport{
 		Check.isNull(examStudentId, "examStudentId不能为空");
 		offlineExamService.startOfflineExam(examStudentId);
 	}
-	
+
 	/**
 	 * 交卷
 	 */
@@ -96,30 +96,30 @@ public class OfflineExamController extends ControllerSupport{
 		int index = fileName.lastIndexOf(".");
 		String fileSuffix = fileName.substring(index+1, fileName.length()).toUpperCase();
 		if(!"PDF".equals(fileSuffix) && !"ZIP".equals(fileSuffix)){
-			throw new StatusException("OfflineExamController-submitPaper-001","文件格式不正确"); 
+			throw new StatusException("OfflineExamController-submitPaper-001","文件格式不正确");
 		}
-		
+
 		ExamRecordDataEntity examRecordData = GlobalHelper.getEntity(examRecordDataRepo,examRecordDataId,ExamRecordDataEntity.class);
 		if(examRecordData.getExamType() != ExamType.OFFLINE){
-			throw new StatusException("OfflineExamController-submitPaper-002","非离线考试"); 
+			throw new StatusException("OfflineExamController-submitPaper-002","非离线考试");
 		}
 		String offlineUploadFileType = ExamCacheTransferHelper.getCachedExamProperty(examRecordData.getExamId(),
 				examRecordData.getStudentId(),
 				ExamProperties.OFFLINE_UPLOAD_FILE_TYPE.name()).getValue();
 		if(StringUtils.isBlank(offlineUploadFileType) || "[]".equals(offlineUploadFileType)){
-			throw new StatusException("OfflineExamController-submitPaper-003","当前考试设置不允许上传附件"); 
+			throw new StatusException("OfflineExamController-submitPaper-003","当前考试设置不允许上传附件");
 		}
 		if(offlineUploadFileType.indexOf(fileSuffix)<0){
-			throw new StatusException("OfflineExamController-submitPaper-004","当前考试允许上传文件格式为:" + offlineUploadFileType); 
+			throw new StatusException("OfflineExamController-submitPaper-004","当前考试允许上传文件格式为:" + offlineUploadFileType);
 		}
 		//判断文件大小
 		long fileSize = file.getSize();
 		if(fileSize > answerMaxsize * 1048576){
-			throw new StatusException("OfflineExamController-submitPaper-005","文件大小不能超过"+answerMaxsize+"M"); 
+			throw new StatusException("OfflineExamController-submitPaper-005","文件大小不能超过"+answerMaxsize+"M");
 		}
 		offlineExamService.submitPaper(examRecordDataId,getUploadFile(file));
 	}
-	
+
 	private File getUploadFile(MultipartFile file){
         //建临时文件夹
 		File dirFile = new File(TEMP_FILE_EXP);

+ 2 - 2
examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/provider/ExamStudentDataCloudServiceProvider.java

@@ -5,6 +5,7 @@ import java.util.DoubleSummaryStatistics;
 import java.util.List;
 import java.util.stream.Collectors;
 
+import cn.com.qmth.examcloud.support.enums.ExamProperties;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -20,7 +21,6 @@ import cn.com.qmth.examcloud.core.oe.admin.api.response.GetExamStudentDataResp;
 import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordQuestionsRepo;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamQuestionEntity;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordQuestionsEntity;
-import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamProperties;
 import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordService;
 import cn.com.qmth.examcloud.core.oe.admin.service.ExamStudentService;
 import cn.com.qmth.examcloud.core.oe.admin.service.GainBaseDataService;
@@ -43,7 +43,7 @@ import io.swagger.annotations.ApiOperation;
 @RequestMapping("${$rmp.cloud.oe}/examStudentData")
 public class ExamStudentDataCloudServiceProvider extends ControllerSupport implements ExamStudentDataCloudService {
     /**
-     * 
+     *
      */
     private static final long serialVersionUID = 4538819077863159166L;
     @Autowired

+ 0 - 68
examcloud-core-oe-admin-dao/src/main/java/cn/com/qmth/examcloud/core/oe/admin/dao/enums/ExamProperties.java

@@ -1,68 +0,0 @@
-package cn.com.qmth.examcloud.core.oe.admin.dao.enums;
-
-/**
- * 
- * @author  	chenken
- * @date    	2018年11月15日 下午5:37:35
- * @company 	QMTH
- * @description 考试属性
- */
-public enum ExamProperties {
-
-	SCORE_PUBLISHING("发布成绩"),
-	IS_ENTRANCE_EXAM("是否入学考试"),
-	FREEZE_TIME("交卷冻结时间"),
-	EXAM_RECONNECT_TIME("断点续考时间"),
-	BEFORE_EXAM_REMARK("考前说明"),
-	AFTER_EXAM_REMARK("考后说明"),
-	SHOW_CHEATING_REMARK("是否展示作弊"),
-	CHEATING_REMARK("作弊说明"),
-	PRACTICE_TYPE("练习模式"),
-	SINGLE_EDIT("单选题补充说明是否可填"),
-	MUTIPLE_EDIT("多选题补充说明是否可填"),
-	BOOL_EDIT("判断题补充说明是否可填"),
-	FILL_BLANK_EDIT("填空题补充说明是否可填"),
-	SINGLE_ANSWER_REMARK("单选题补充说明"),
-	MUTIPLE_ANSWER_REMARK("多选题补充说明"),
-	BOOL_ANSWER_REMARK("判断题补充说明"),
-	FILL_BLANK_REMARK("填空题补充说明"),
-	TEXT_ANSWER_REMARK("问答题补充说明"),
-	nestedAnswerRemark("套题补充说明"),
-	IS_FACE_ENABLE("是否启用人脸识别"),
-	IS_FACE_CHECK("进入考试是否验证人脸识别"),
-	WARN_THRESHOLD("人脸检测预警阈值"),
-	MARKING_TYPE("阅卷方式"),
-	IS_FACE_VERIFY("是否开启人脸活体检测"),
-	FACE_VERIFY_START_MINUTE("活体检测开始分钟数"),
-	FACE_VERIFY_END_MINUTE("活体检测结束分钟数"),
-	ADD_FACE_VERIFY_OUT_FREEZE_TIME("冻结时间外新加人脸活体检测"),
-	OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE("冻结时间外活体检测开始分钟数"),
-	OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE("冻结时间外活体检测结束分钟数"),
-	IP_LIMIT("是否IP限制"),
-	IP_ADDRESSES("IP白名单"),
-	IS_OBJ_SCORE_VIEW("是否显示客观题成绩"),
-	CAN_UPLOAD_ATTACHMENT("是否允许上传附件(离线考试)"),
-	LIVING_WARN_THRESHOLD("人脸真实性阈值"),
-	MARKING_TASK_BUILDED("阅卷是否生成评卷任务"),
-	OFFLINE_UPLOAD_FILE_TYPE("离线考试上传文件类型"),
-	PUSH_SCORE("是否推送分数"),
-	MAX_INTERRUPT_NUM("最大断点续考次数"),
-	IS_STRANGER_ENABLE("是否启用陌生人检测"),
-	LIMITED_IF_NO_SPECIAL_SETTINGS("无特殊设置时禁止考试"),
-	WEIXIN_ANSWER_ENABLED("是否开放微信小程序作答");
-	
-	private ExamProperties(String desc){
-		this.desc = desc;
-	}
-	
-	private String desc;
-
-	public String getDesc() {
-		return desc;
-	}
-
-	public void setDesc(String desc) {
-		this.desc = desc;
-	}
-	
-}

+ 35 - 24
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/bean/OnHandExamInfo.java

@@ -12,47 +12,47 @@ public class OnHandExamInfo implements JsonSerializable{
     private static final long serialVersionUID = 6364550318267288565L;
 
     private Long examStudentId;//考试报考ID
-    
+
     private Long examId;//网考批次ID
-    
+
     private String examName;//批次名称
-    
+
     private String studentName;//考生名称
-    
+
     private String studentCode;//考生学号
-    
+
     private String identityNumber;//身份证号码
-    
+
     private String specialtyName;//专业名称
-    
+
     private String specialtyLevel;//层次
-    
+
     private Long courseId;//课程ID
-    
+
     private String courseName;//课程名称
-    
+
     private String courseCode;//课程代码
-    
+
     private String courseLevel;//课程层次
-    
+
     private Long orgId;//学校中心ID
-    
+
     private String orgName;//学习中心名称
-    
+
     private String isPhotoUpload;//是否上传照片
-    
+
     private int paperMins;//考试时长
-    
+
     private int allowExamCount;//允许考试次数
-    
+
     private Date startTime;//考试时间范围开始时间
-    
+
     private Date endTime; //考试时间范围结束时间
-    
+
     private Long rootOrgId;//机构ID
-    
+
     private String isFinished;//是否缺考
-    
+
     /**
      * 考试状态
      */
@@ -70,12 +70,16 @@ public class OnHandExamInfo implements JsonSerializable{
      * 进入考试是否验证人脸识别(强制、非强制)
      */
     private Boolean faceCheck;
-    
+
     /**
      * 是否显示客观分
      */
     private Boolean isObjScoreView;
 
+    /**
+     * 是否允许app考试
+     */
+    private Boolean appExamEnabled;
 
     public String getStudentName() {
         return studentName;
@@ -84,7 +88,7 @@ public class OnHandExamInfo implements JsonSerializable{
     public void setStudentName(String studentName) {
         this.studentName = studentName;
     }
-    
+
     public String getStudentCode() {
         return studentCode;
     }
@@ -285,5 +289,12 @@ public class OnHandExamInfo implements JsonSerializable{
     public void setIsObjScoreView(Boolean isObjScoreView) {
         this.isObjScoreView = isObjScoreView;
     }
-    
+
+    public Boolean getAppExamEnabled() {
+        return appExamEnabled;
+    }
+
+    public void setAppExamEnabled(Boolean appExamEnabled) {
+        this.appExamEnabled = appExamEnabled;
+    }
 }

+ 1 - 1
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamScoreObtainQueueServiceImpl.java

@@ -7,12 +7,12 @@ import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordDataRepo;
 import cn.com.qmth.examcloud.core.oe.admin.dao.ExamScoreObtainQueueRepo;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamScoreObtainQueueEntity;
-import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamProperties;
 import cn.com.qmth.examcloud.core.oe.admin.service.ExamScoreObtainQueueService;
 import cn.com.qmth.examcloud.core.oe.admin.service.bean.NotifyUrlInfo;
 import cn.com.qmth.examcloud.core.oe.admin.service.others.ExamCacheTransferHelper;
 import cn.com.qmth.examcloud.support.cache.CacheHelper;
 import cn.com.qmth.examcloud.support.cache.bean.SysPropertyCacheBean;
+import cn.com.qmth.examcloud.support.enums.ExamProperties;
 import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;

+ 1 - 1
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamScorePushQueueServiceImpl.java

@@ -3,6 +3,7 @@ package cn.com.qmth.examcloud.core.oe.admin.service.impl;
 import java.util.Date;
 
 import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordDataRepo;
+import cn.com.qmth.examcloud.support.enums.ExamProperties;
 import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,7 +15,6 @@ import cn.com.qmth.examcloud.core.oe.admin.dao.OrgScoreHandleRepo;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamScorePushQueue;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.OrgScoreHandleEntity;
-import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamProperties;
 import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamScoreQueueStatus;
 import cn.com.qmth.examcloud.core.oe.admin.service.ExamScorePushQueueService;
 import cn.com.qmth.examcloud.core.oe.admin.service.others.ExamCacheTransferHelper;

+ 4 - 4
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamScoreServiceImpl.java

@@ -14,6 +14,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
+import cn.com.qmth.examcloud.support.enums.ExamProperties;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -36,7 +37,6 @@ import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamScoreEntity;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentEntity;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentFinalScoreEntity;
 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.service.ExamRecordService;
 import cn.com.qmth.examcloud.core.oe.admin.service.ExamScoreService;
@@ -393,7 +393,7 @@ public class ExamScoreServiceImpl implements ExamScoreService {
         examStudentEntity.setGrade(rs.getString("grade"));
         return examStudentEntity;
     }
-    
+
     @Override
     public void createExamScoreWithOffline(Long examRecordDataId) {
         ExamScoreEntity examScoreEntity = new ExamScoreEntity();
@@ -448,7 +448,7 @@ public class ExamScoreServiceImpl implements ExamScoreService {
         }
         return objectiveScoreInfoList;
     }
-    
+
     private boolean isExamRecordEnded(ExamRecordDataEntity examRecordData) {
         //如果考试记录状态为已处理,则直接返回true.
         if (examRecordData.getExamRecordStatus() == ExamRecordStatus.EXAM_END ||
@@ -458,4 +458,4 @@ public class ExamScoreServiceImpl implements ExamScoreService {
         }
         return false;
     }
-}
+}

+ 1 - 2
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamStudentFinalScoreServiceImpl.java

@@ -11,13 +11,12 @@ import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamScoreEntity;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentEntity;
 import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentFinalScoreEntity;
-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.MarkingType;
 import cn.com.qmth.examcloud.core.oe.admin.service.ExamStudentFinalScoreService;
 import cn.com.qmth.examcloud.core.oe.admin.service.others.ExamCacheTransferHelper;
 
-import com.mysql.cj.log.LogFactory;
+import cn.com.qmth.examcloud.support.enums.ExamProperties;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 

+ 25 - 14
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamStudentServiceImpl.java

@@ -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.response.GetExamStudentResp;
 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 org.apache.commons.lang3.StringUtils;
 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.ExamStudentEntity;
 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.FinishStatus;
 import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordService;
@@ -228,7 +228,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
         }else {
             sql.append(",finished");
         }
-        
+
         sql.append(",student_id,student_code,student_name,identity_number"
                 + ",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 ");
@@ -290,7 +290,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
         }else {
             sql.append(",finished");
         }
-        
+
         sql.append(",student_id,student_code,student_name,identity_number"
                 + ",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 ");
@@ -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(" and exam_id = " + examId);
             Integer total=jdbcTemplate.queryForObject(totalsql.toString(), Integer.class);
-            
+
             StringBuffer finishsql = new StringBuffer();
             finishsql.append("select count(t1.id) from ec_oe_exam_student t1 where 1=1 ");
             finishsql.append(" and exam_id = " + examId);
@@ -637,7 +637,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
             }
             totalsql.append(" group by t1.org_id ");
             List<ExamStudentOrgStatistic> totalList=jdbcTemplate.query(totalsql.toString(), new BeanPropertyRowMapper<ExamStudentOrgStatistic>(ExamStudentOrgStatistic.class));
-            
+
             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(" 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(" group by t1.org_id ");
-            
+
             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));
-            
+
             for(ExamStudentOrgStatistic statistic:totalList) {
                 ExamStudentOrgStatistic finish=finishMap.get(statistic.getOrgId());
                 statistic.setFinishedCount(finish==null?0:finish.getFinishedCount());
@@ -753,7 +753,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
             }
             totalsql.append(" group by t1.course_id ");
             List<CourseProgressInfo> totalList=jdbcTemplate.query(totalsql.toString(), new BeanPropertyRowMapper<CourseProgressInfo>(CourseProgressInfo.class));
-            
+
             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(" 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(" group by t1.course_id ");
-            
+
             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));
-            
+
             for(CourseProgressInfo statistic:totalList) {
                 CourseProgressInfo finish=finishMap.get(statistic.getCourseId());
                 statistic.setCompletedNum(finish==null?0:finish.getCompletedNum());
@@ -796,7 +796,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
                 sql += " and course_id = " + courseId;
             }
             sql += " group by course_id ) tb ORDER BY " + orderColumn + " desc";
-    
+
             return jdbcTemplate.query(sql, new RowMapper<CourseProgressInfo>() {
                 @Override
                 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.setFaceCheck(FaceBiopsyHelper.isFaceCheck(examId, studentId));
+
         //是否显示客观分
         String isObjScoreView = ExamCacheTransferHelper.getCachedExamProperty(examId,
                 studentId, ExamProperties.IS_OBJ_SCORE_VIEW.name()).getValue();
@@ -949,6 +950,16 @@ public class ExamStudentServiceImpl implements ExamStudentService {
         } else {
             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;
     }
 
@@ -1009,4 +1020,4 @@ public class ExamStudentServiceImpl implements ExamStudentService {
         GetExamStudentResp resp = examStudentCloudService.getExamStudent(req);
         return resp.getExamStudentBean();
     }
-}
+}

+ 1 - 1
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/OfflineExamServiceImpl.java

@@ -7,6 +7,7 @@ import java.util.List;
 
 import javax.transaction.Transactional;
 
+import cn.com.qmth.examcloud.support.enums.ExamProperties;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -21,7 +22,6 @@ import cn.com.qmth.examcloud.core.oe.admin.dao.ExamStudentRepo;
 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.ExamStudentEntity;
-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.service.ExamRecordDataService;
 import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordForMarkingService;

+ 2 - 2
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/others/ExamCacheTransferHelper.java

@@ -10,13 +10,13 @@ package cn.com.qmth.examcloud.core.oe.admin.service.others;
 import cn.com.qmth.examcloud.api.commons.enums.ExamSpecialSettingsType;
 import cn.com.qmth.examcloud.commons.util.StringUtil;
 import cn.com.qmth.examcloud.core.basic.api.bean.CourseBean;
-import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamProperties;
 import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
 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.ExamPropertyCacheBean;
 import cn.com.qmth.examcloud.support.cache.bean.ExamSettingsCacheBean;
 import cn.com.qmth.examcloud.support.cache.bean.OrgPropertyCacheBean;
+import cn.com.qmth.examcloud.support.enums.ExamProperties;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -251,4 +251,4 @@ public class ExamCacheTransferHelper {
 
         return resultBean;
     }
-}
+}