Răsfoiți Sursa

Merge branch 'dev' into release
1233

wangliang 4 ani în urmă
părinte
comite
2f77559d01

+ 7 - 5
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamController.java

@@ -33,6 +33,8 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
@@ -67,7 +69,7 @@ public class TEExamController {
 
     @Resource
     RedisUtil redisUtil;
-    
+
     @Resource
     TBTaskHistoryService taskHistoryService;
 
@@ -139,7 +141,7 @@ public class TEExamController {
                     teExamActivityList.forEach(s -> {
                         s.setPrepareSeconds(finalTeExam.getPrepareSeconds());
                         s.setMaxDurationSeconds(finalTeExam.getMaxDurationSeconds());
-                        s.setOpeningSeconds(finalTeExam.getOpeningSeconds());
+                        s.setOpeningSeconds((int) ((finalTeExam.getEndTime().getTime() - finalTeExam.getStartTime().getTime()) / 1000));
                         s.setStartTime(finalTeExam.getStartTime());
                         s.setFinishTime(finalTeExam.getEndTime());
                         s.setUpdateId(tbUser.getId());
@@ -156,7 +158,7 @@ public class TEExamController {
                         teExamActivityService.updateExamActivityCacheBean(s.getId());
                     });
                 } else {
-                    TEExamActivity teExamActivity = new TEExamActivity(teExam.getId(), teExam.getPrepareSeconds(), teExam.getMaxDurationSeconds(), teExam.getOpeningSeconds(), teExam.getStartTime(), teExam.getEndTime(), tbUser.getId());
+                    TEExamActivity teExamActivity = new TEExamActivity(teExam.getId(), teExam.getPrepareSeconds(), teExam.getMaxDurationSeconds(), (int) ((teExam.getEndTime().getTime() - teExam.getStartTime().getTime()) / 1000), teExam.getStartTime(), teExam.getEndTime(), tbUser.getId());
                     teExamActivity.setCode(String.valueOf(redisUtil.getRedisActivityCodeSequence(teExam.getId())));
                     activityCode = teExamActivity.getCode();
                     teExamActivity.setEnable(1);
@@ -444,13 +446,13 @@ public class TEExamController {
         ExamPropCountDto examPropCountDto = new ExamPropCountDto(examId, allCount, prepareCount.get(), examCount.get(), clientWebsocketStatusCount.get(), monitorStatusSourceCount.get(), alreadyComplete.get(), notComplete, completionRate);
         return ResultUtil.ok(examPropCountDto);
     }
-    
+
     @ApiOperation(value = "考试重新算分")
     @RequestMapping(value = "/score/calculate", method = RequestMethod.POST)
     @Transactional
     @ApiResponses({@ApiResponse(code = 200, message = "{\"taskId\":0}", response = Result.class)})
     public Result scoreCalculate(@ApiParam(value = "批次ID", required = true) @RequestParam Long examId) {
-    	//先查询考试相关信息
+        //先查询考试相关信息
         TEExam teExam = teExamService.getById(examId);
         if (Objects.isNull(teExam)) {
             throw new BusinessException(ExceptionResultEnum.EXAM_NO);

+ 2 - 0
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -249,5 +249,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
 	public Long getCountByExamId(@Param("examId") Long examId);
 	
 	public List<TOeExamRecord> getListByExamIdAndStartId(@Param("examId")Long examId,@Param("startId") Long startId);
+
+	public void updateObjectiveScore(@Param("recordId") Long recordId,@Param("score") Double score);
 	
 }

+ 4 - 3
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamPaperServiceImpl.java

@@ -138,10 +138,11 @@ public class TEExamPaperServiceImpl extends ServiceImpl<TEExamPaperMapper, TEExa
             dfile.mkdirs();
             File structFile = new File(dir + "struct.json");
             FileUtil.saveUrlAsFile(structUrl, structFile);
-            File answerEncryptFile = new File(dir + "answer_encrypt_file.json");
-            FileUtil.saveUrlAsFile(answerUrl, answerEncryptFile);
+//            File answerEncryptFile = new File(dir + "answer_encrypt_file.json");
+//            FileUtil.saveUrlAsFile(answerUrl, answerEncryptFile);
             File answerFile = new File(dir + "answer_file.json");
-            FileUtil.decryptFile(answerEncryptFile, answerFile, ep.getDecryptSecret(), ep.getDecryptVector());
+            FileUtil.saveUrlAsFile(answerUrl, answerFile);
+//            FileUtil.decryptFile(answerEncryptFile, answerFile, ep.getDecryptSecret(), ep.getDecryptVector());
             String structJson = FileUtil.readFileContent(structFile);
             String answerjson = FileUtil.readFileContent(answerFile);
             return buildCache(structJson, answerjson);

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java

@@ -974,6 +974,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
 	    			for(TOeExamRecord rc:list) {
 	    				index++;
 	    				if(ExamRecordStatusEnum.PERSISTED.equals(rc.getStatus())) {
+	    					recordId=rc.getId();
 	    					toeExamRecordService.calculateScore(rc.getId());
 	    				}
 	    			}
@@ -981,7 +982,6 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
 	    			tbTaskHistoryService.saveOrUpdate(task);
     			}
     		}
-			toeExamRecordService.calculateScore(recordId);
 			task.setSummary("处理成功");
 			task.setProgress(100.0);
 			task.setStatus(TaskStatusEnum.FINISH);

+ 79 - 1
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.themis.business.bean.backend.InvigilateListBean;
@@ -596,7 +597,84 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
     @Transactional
     @Override
     public void calculateScore(Long recordId) {
-    	//TODO
+    	
+    	TOeExamRecord rec=this.getById(recordId);
+    	
+        Map<String, ObjectiveAnswerCacheBean> map = examPaperService.getObjectiveAnswerCacheBean(rec.getPaperId());
+        if (map == null || map.size() == 0) {
+            log.debug("no ObjectiveAnswerCacheBean for calculateObjectiveScore recordId:"+recordId);
+            return;
+        }
+        QueryWrapper<TOeExamAnswer> wp = new QueryWrapper<>();
+		wp.lambda().eq(TOeExamAnswer::getExamRecordId, recordId);
+		List<TOeExamAnswer> answers=examAnswerService.list(wp);
+		if(answers==null||answers.size()==0) {
+			log.debug("no ObjectiveAnswer for calculateObjectiveScore recordId:"+recordId);
+			return;
+		}
+		BigDecimal tatolscore = new BigDecimal(0.0);
+		for(TOeExamAnswer answer:answers) {
+			Double score=calculateScoreForQuestion(answer, map);
+			if(score!=null) {
+				tatolscore=tatolscore.add(new BigDecimal(score));
+			}
+		}
+
+        // 设置客观分总分
+		tOeExamRecordMapper.updateObjectiveScore(recordId, tatolscore.doubleValue());
+    }
+    
+    private Double calculateScoreForQuestion(TOeExamAnswer answer,Map<String, ObjectiveAnswerCacheBean> map) {
+    	Long recordId=answer.getExamRecordId();
+    	Integer mainNumber=answer.getMainNumber();
+    	Integer subNumber=answer.getSubNumber();
+    	Integer subIndex=answer.getSubIndex();
+    	String key = RedisKeyHelper.examAnswerHashKey(mainNumber, subNumber, subIndex);
+        ObjectiveAnswerCacheBean cb = map.get(key);
+        if (cb == null) {
+        	log.debug("not a objective question  recordId:"+answer.getExamRecordId()+" key:"+key);
+            return null;
+        }
+
+        if (cb.getStructType().intValue() == 1) {
+            if (checkSingleChoice(answer.getAnswer(), cb.getChoiceAnswer())) {
+                answer.setScore(cb.getScore());
+            } else {
+                answer.setScore(0.0);
+            }
+        }
+        if (cb.getStructType().intValue() == 2) {
+            ExamCacheBean ec = examService.getExamCacheBean(ExamRecordCacheUtil.getExamId(recordId));
+            int r = checkMultipleChoice(answer.getAnswer(), cb.getChoiceAnswer());
+            if (ec.getObjectiveScorePolicy().equals(ObjectiveScorePolicyEnum.EQUAL)) {// 全对给分
+                if (r == 1) {
+                    answer.setScore(cb.getScore());
+                } else {
+                    answer.setScore(0.0);
+                }
+            }
+            if (ec.getObjectiveScorePolicy().equals(ObjectiveScorePolicyEnum.PARTIAL)) {// 漏选半分
+                if (r == 1) {
+                    answer.setScore(cb.getScore());
+                } else if (r == 0) {
+                    BigDecimal b = new BigDecimal(cb.getScore()).divide(new BigDecimal("2"), 1, BigDecimal.ROUND_UP);
+                    answer.setScore(b.doubleValue());
+                } else {
+                    answer.setScore(0.0);
+                }
+            }
+        }
+        if (cb.getStructType().intValue() == 3) {
+            if (Boolean.parseBoolean(answer.getAnswer()) == cb.getBoolAnswer().booleanValue()) {
+                answer.setScore(cb.getScore());
+            } else {
+                answer.setScore(0.0);
+            }
+        }
+
+        examAnswerService.saveOrUpdate(answer);
+        
+        return answer.getScore();
     }
     
     /**获取考试记录数

+ 3 - 3
themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskExamPaperImportTemplete.java

@@ -289,12 +289,12 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
         if (answerFile == null) {
             return;
         }
-        File encryptFile = new File(rootDir + uuid() + ".json");
-        FileUtil.encryptFile(answerFile, encryptFile, paper.getDecryptSecret(), paper.getDecryptVector());
+//        File encryptFile = new File(rootDir + uuid() + ".json");
+//        FileUtil.encryptFile(answerFile, encryptFile, paper.getDecryptSecret(), paper.getDecryptVector());
         String filePath = sdf.format(new Date()) + "/" + uuid() + ".json";
         paper.setAnswerPath(filePath);
         SystemConfig systemConfig = SpringContextHolder.getBean(SystemConfig.class);
-        OssUtil.ossUpload(systemConfig.getOssEnv(3), filePath, encryptFile);
+        OssUtil.ossUpload(systemConfig.getOssEnv(3), filePath, answerFile);
     }
 
     private void addResult(StringBuilder result, String msg) {

+ 79 - 73
themis-business/src/main/resources/db/init.sql

@@ -250,9 +250,9 @@ CREATE TABLE `t_b_app` (
   `name` varchar(100) NOT NULL COMMENT '应用名',
   `access_key` varchar(100) NOT NULL COMMENT '访问凭证',
   `access_secret` varchar(100) NOT NULL COMMENT '访问密钥',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
-  `last_access_time` datetime DEFAULT NULL COMMENT '最近访问时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
+  `last_access_time` timestamp DEFAULT NULL COMMENT '最近访问时间',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
   `update_id` bigint DEFAULT NULL COMMENT '更新人id',
   PRIMARY KEY (`id`)
@@ -270,7 +270,7 @@ CREATE TABLE `t_b_attachment` (
   `size` double NOT NULL COMMENT '大小',
   `md5` varchar(255) NOT NULL COMMENT 'MD5',
   `remark` varchar(500) DEFAULT NULL COMMENT '备注',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='附件表';
@@ -286,8 +286,8 @@ CREATE TABLE `t_b_client_version` (
   `url` varchar(100) NOT NULL COMMENT '版本详情链接',
   `description` varchar(200) DEFAULT NULL COMMENT '版本描述',
   `enable` tinyint DEFAULT '1' COMMENT '是否启用,0:停用,1:启用',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
   `update_id` bigint DEFAULT NULL COMMENT '更新人id',
   PRIMARY KEY (`id`)
@@ -335,8 +335,8 @@ CREATE TABLE `t_b_org` (
   `simulate_paper_id` bigint DEFAULT NULL COMMENT '模考试卷id',
   `access_key` varchar(50) DEFAULT NULL COMMENT '外部访问凭证',
   `access_secret` varchar(50) DEFAULT NULL COMMENT '外部访问密钥',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   `contact_name` varchar(50) DEFAULT NULL COMMENT '联系人',
   `contact_phone` varchar(30) DEFAULT NULL COMMENT '联系人电话',
   `enable_liveness` tinyint DEFAULT NULL COMMENT '是否允许使用活体',
@@ -366,7 +366,7 @@ CREATE TABLE `t_b_privilege` (
   `parent_id` bigint(20) DEFAULT NULL COMMENT '父id',
   `sequence` int(11) DEFAULT NULL COMMENT '序号',
   `remark` varchar(100) DEFAULT NULL COMMENT '备注',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='菜单和权限';
 
@@ -510,6 +510,8 @@ INSERT INTO `t_b_privilege` VALUES (143, '监考监控通话提醒接口', '/api
 INSERT INTO `t_b_privilege` VALUES (144, '监考监控通话查询', '/api/admin/monitor/call/list', 'LINK', 60, 30, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (145, '监考监控通话查询来源', '/api/admin/monitor/call/query', 'LINK', 60, 31, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (146, '重考待审提醒', '/api/admin/invigilate/reexam/list_not_done_notify', 'LINK', 60, 32, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (147, '预警消息', '/api/admin/invigilate/warn/message', 'LINK', 60, 33, NULL, '2020-08-01 12:08:31');
+INSERT INTO `t_b_privilege` VALUES (148, '预警修改阅读状态', '/api/admin/invigilate/warn/save/status', 'LINK', 60, 34, NULL, '2020-08-01 12:08:31');
 COMMIT;
 
 -- ----------------------------
@@ -520,7 +522,7 @@ CREATE TABLE `t_b_role` (
   `id` bigint NOT NULL COMMENT '主键',
   `role_code` varchar(30) NOT NULL COMMENT '角色编码',
   `role_name` varchar(50) NOT NULL COMMENT '角色名称',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
   PRIMARY KEY (`id`),
   UNIQUE KEY `t_b_role_role_code_Idx` (`role_code`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色';
@@ -719,6 +721,10 @@ INSERT INTO `t_b_role_privilege` VALUES (171, 'INSPECTION', 145);
 INSERT INTO `t_b_role_privilege` VALUES (172, 'INVIGILATE', 107);
 INSERT INTO `t_b_role_privilege` VALUES (173, 'ADMIN', 146);
 INSERT INTO `t_b_role_privilege` VALUES (174, 'ADMIN', 135);
+INSERT INTO `t_b_role_privilege` VALUES (175, 'ADMIN', 147);
+INSERT INTO `t_b_role_privilege` VALUES (176, 'ADMIN', 148);
+INSERT INTO `t_b_role_privilege` VALUES (177, 'INVIGILATE', 147);
+INSERT INTO `t_b_role_privilege` VALUES (178, 'INVIGILATE', 148);
 COMMIT;
 
 -- ----------------------------
@@ -734,10 +740,10 @@ CREATE TABLE `t_b_session` (
   `device_id` varchar(100) NOT NULL COMMENT '设备标识',
   `address` varchar(100) NOT NULL COMMENT '登录IP地址',
   `access_token` varchar(50) NOT NULL COMMENT '访问令牌',
-  `last_access_time` datetime DEFAULT NULL COMMENT '最近访问时间',
+  `last_access_time` timestamp DEFAULT NULL COMMENT '最近访问时间',
   `last_access_ip` varchar(100) DEFAULT NULL COMMENT '最近访问IP地址',
-  `update_time` datetime DEFAULT NULL COMMENT '令牌更新时间',
-  `expire_time` datetime DEFAULT NULL COMMENT '令牌强制失效时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '令牌更新时间',
+  `expire_time` timestamp DEFAULT NULL COMMENT '令牌强制失效时间',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会话信息';
 
@@ -757,9 +763,9 @@ CREATE TABLE `t_b_task_history` (
   `result_file_path` varchar(500) DEFAULT NULL COMMENT '导出文件路径',
   `report_file_path` varchar(500) DEFAULT NULL COMMENT '报告路径',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `start_time` datetime DEFAULT NULL COMMENT '开始时间',
-  `finish_time` datetime DEFAULT NULL COMMENT '结束时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `start_time` timestamp DEFAULT NULL COMMENT '开始时间',
+  `finish_time` timestamp DEFAULT NULL COMMENT '结束时间',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='异步任务';
 
@@ -774,8 +780,8 @@ CREATE TABLE `t_b_user` (
   `mobile_number` varchar(30) DEFAULT NULL COMMENT '手机号',
   `enable` tinyint DEFAULT '1' COMMENT '是否启用,0:停用,1:启用',
   `org_id` bigint DEFAULT NULL COMMENT '机构id',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   `remark` varchar(100) DEFAULT NULL COMMENT '备注',
   `name` varchar(50) NOT NULL COMMENT '姓名',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
@@ -866,8 +872,8 @@ CREATE TABLE `t_e_exam` (
   `code` varchar(50) NOT NULL COMMENT '批次编码,机构唯一',
   `name` varchar(100) NOT NULL COMMENT '批次名称',
   `tag` varchar(50) DEFAULT NULL COMMENT '批次标注,可用于多个考试批次归类',
-  `start_time` datetime NOT NULL COMMENT '批次开始时间',
-  `end_time` datetime NOT NULL COMMENT '批次结束时间',
+  `start_time` timestamp NOT NULL COMMENT '批次开始时间',
+  `end_time` timestamp NOT NULL COMMENT '批次结束时间',
   `short_code` varchar(50) DEFAULT NULL COMMENT '考试口令',
   `prepare_seconds` int DEFAULT NULL COMMENT '提前多长时间开始候考(分钟)',
   `min_duration_seconds` int DEFAULT NULL COMMENT '最短考试时长,相当于考试冻结时间(分钟)',
@@ -880,8 +886,8 @@ CREATE TABLE `t_e_exam` (
   `camera_photo_upload` tinyint DEFAULT NULL COMMENT '是否允许使用摄像头拍照答题,0:不允许,1:允许',
   `reexam_auditing` tinyint DEFAULT NULL COMMENT '重考是否审批,0:不审批,1:审批',
   `show_objective_score` tinyint DEFAULT NULL COMMENT '交卷后是否显示客观得分,0:不显示,1:显示',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   `mode` varchar(30) DEFAULT NULL COMMENT '模式,together:集中统一,anytime:随到随考',
   `enable` tinyint DEFAULT '1' COMMENT '是否启用,0:停用,1:启用',
   `archived` tinyint DEFAULT NULL COMMENT '是否归档,0:不归档,1:归档',
@@ -932,10 +938,10 @@ CREATE TABLE `t_e_exam_activity` (
   `max_duration_seconds` int DEFAULT NULL COMMENT '最大考试时长',
   `enable` tinyint DEFAULT '1' COMMENT '是否启用,0:停用,1:启用',
   `opening_seconds` int DEFAULT NULL COMMENT '允许开考时长(分钟)',
-  `start_time` datetime DEFAULT NULL COMMENT '开考时间',
-  `finish_time` datetime DEFAULT NULL COMMENT '结束时间',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `start_time` timestamp DEFAULT NULL COMMENT '开考时间',
+  `finish_time` timestamp DEFAULT NULL COMMENT '结束时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
   `update_id` bigint DEFAULT NULL COMMENT '更新人id',
   PRIMARY KEY (`id`),
@@ -965,9 +971,9 @@ CREATE TABLE `t_e_exam_breach_log` (
   `description` mediumtext COMMENT '描述',
   `status` tinyint DEFAULT NULL COMMENT '状态,0:处理,1:撤销',
   `remark` mediumtext COMMENT '备注',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
   `create_id` bigint DEFAULT NULL COMMENT '创建人',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   `update_id` bigint DEFAULT NULL COMMENT '更新人',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='考生违纪处理';
@@ -995,9 +1001,9 @@ CREATE TABLE `t_e_exam_course` (
   `audio_play_count` int DEFAULT NULL COMMENT '音频播放次数',
   `has_audio` varchar(30) DEFAULT NULL COMMENT '是否包含音频题目,0:不包含,1:包含',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
   `update_id` bigint DEFAULT NULL COMMENT '更新人id',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   PRIMARY KEY (`id`),
   UNIQUE KEY `t_e_exam_course_examId_courseCode_Idx` (`exam_id`,`course_code`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='考试科目';
@@ -1024,8 +1030,8 @@ CREATE TABLE `t_e_exam_paper` (
   `decrypt_secret` varchar(50) DEFAULT NULL COMMENT '解密密钥',
   `encrypt_mode` varchar(30) DEFAULT NULL COMMENT 'auto:自动,hand:手动',
   `need_voice_answer` tinyint DEFAULT NULL COMMENT '是否需要语音作答,0:不需要,1:需要',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   `exam_id` bigint DEFAULT NULL COMMENT '考试批次id',
   `code` varchar(50) DEFAULT NULL COMMENT '试卷编码',
   `answer_path` varchar(100) DEFAULT NULL COMMENT '标答路径',
@@ -1072,12 +1078,12 @@ CREATE TABLE `t_e_exam_reexam` (
   `status` tinyint DEFAULT NULL COMMENT '状态,0:无需审核,1:待审核,2:已审核',
   `auditing_id` bigint DEFAULT NULL COMMENT '待审核人id',
   `auditing_status` tinyint DEFAULT NULL COMMENT '审核状态,0:通过,1:不通过',
-  `auditing_time` datetime DEFAULT NULL COMMENT '审核时间',
+  `auditing_time` timestamp DEFAULT NULL COMMENT '审核时间',
   `auditing_suggest` varchar(1000) DEFAULT NULL COMMENT '审批意见',
   `remark` varchar(1000) DEFAULT NULL COMMENT '备注',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='考生重考处理';
 
@@ -1111,8 +1117,8 @@ CREATE TABLE `t_e_exam_student` (
   `select_record_id` bigint DEFAULT NULL COMMENT '最终生效的记录ID',
   `room_name` varchar(100) DEFAULT NULL COMMENT '考场名称',
   `enable` tinyint DEFAULT '1' COMMENT '是否启用,0:停用,1:启用',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
   `update_id` bigint DEFAULT NULL COMMENT '更新人id',
   `grade` varchar(50) DEFAULT NULL COMMENT '年级',
@@ -1148,7 +1154,7 @@ CREATE TABLE `t_e_exam_student_log` (
   `type` varchar(30) DEFAULT NULL COMMENT '类型',
   `info` varchar(1000) DEFAULT NULL COMMENT '描述',
   `remark` mediumtext COMMENT '备注',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='考生轨迹';
 
@@ -1162,8 +1168,8 @@ CREATE TABLE `t_e_simulate_paper` (
   `name` varchar(100) NOT NULL COMMENT '试卷名称',
   `total_score` double NOT NULL COMMENT '总分',
   `paper_path` varchar(100) DEFAULT NULL COMMENT '题干路径',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '修改时间',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
   `update_id` bigint DEFAULT NULL COMMENT '修改人id',
   PRIMARY KEY (`id`)
@@ -1183,8 +1189,8 @@ CREATE TABLE `t_e_student` (
   `name` varchar(30) NOT NULL COMMENT '姓名',
   `gender` varchar(20) DEFAULT NULL COMMENT '性别,man:男,woman:女',
   `base_photo_path` varchar(100) DEFAULT NULL COMMENT '底照保存地址',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
   `update_id` bigint DEFAULT NULL COMMENT '更新人id',
   `enable` tinyint DEFAULT '1' COMMENT '是否启用,0:停用,1:启用',
@@ -1214,7 +1220,7 @@ CREATE TABLE `t_e_user_log` (
   `type` varchar(30) NOT NULL COMMENT '类型',
   `info` varchar(1000) DEFAULT NULL COMMENT '描述',
   `remark` mediumtext COMMENT '备注',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户轨迹';
 
@@ -1232,9 +1238,9 @@ CREATE TABLE `t_ie_exam_invigilate_call` (
   `live_url` varchar(200) DEFAULT NULL COMMENT '观看地址',
   `status` varchar(30) DEFAULT NULL COMMENT '状态',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
   `update_id` bigint DEFAULT NULL COMMENT '更新人id',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   `type` varchar(100) DEFAULT NULL COMMENT '异常类型',
   `call_status` varchar(30) DEFAULT NULL COMMENT '通话状态',
   `monitor_key` varchar(50) DEFAULT NULL COMMENT '房间号',
@@ -1256,9 +1262,9 @@ CREATE TABLE `t_ie_exam_invigilate_call_log` (
   `live_url` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '观看地址',
   `status` varchar(30) DEFAULT NULL COMMENT '状态',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
   `update_id` bigint DEFAULT NULL COMMENT '修改人id',
-  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '修改时间',
   `remark` mediumtext COMMENT '备注',
   `type` varchar(100) DEFAULT NULL COMMENT '异常类型',
   `call_status` varchar(30) DEFAULT NULL COMMENT '通话状态',
@@ -1279,8 +1285,8 @@ CREATE TABLE `t_ie_exam_invigilate_notice` (
   `receive_user_id` bigint NOT NULL COMMENT '接收人id',
   `type` varchar(30) NOT NULL COMMENT '消息类型',
   `content` varchar(1000) NOT NULL COMMENT '消息内容',
-  `send_time` datetime DEFAULT NULL COMMENT '发送时间',
-  `receive_time` datetime DEFAULT NULL COMMENT '接收时间',
+  `send_time` timestamp DEFAULT NULL COMMENT '发送时间',
+  `receive_time` timestamp DEFAULT NULL COMMENT '接收时间',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='监考通知消息记录';
 
@@ -1297,8 +1303,8 @@ CREATE TABLE `t_ie_invigilate_exception_info` (
   `info` mediumtext COMMENT '异常信息',
   `type` varchar(30) DEFAULT NULL COMMENT '类别',
   `remark` mediumtext COMMENT '备注',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   `difference` int(11) DEFAULT NULL COMMENT '处理时差,单位秒',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='监考异常信息';
@@ -1318,8 +1324,8 @@ CREATE TABLE `t_ie_invigilate_warn_info` (
   `type` varchar(30) DEFAULT NULL COMMENT '类别',
   `remark` mediumtext COMMENT '备注',
   `approve_status` tinyint DEFAULT NULL COMMENT '审阅状态,0:未阅,1:已阅',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='监考预警信息';
 
@@ -1338,7 +1344,7 @@ CREATE TABLE `t_m_rocket_message` (
   `ack` tinyint NOT NULL COMMENT '消息ack',
   `sequence` int DEFAULT NULL COMMENT '消息序号',
   `properties` varchar(1000) DEFAULT NULL COMMENT '扩展类型',
-  `create_time` datetime NOT NULL COMMENT '创建时间',
+  `create_time` timestamp NOT NULL COMMENT '创建时间',
   `timestamp` bigint NOT NULL COMMENT '时间戳',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='rocketmq消息';
@@ -1401,11 +1407,11 @@ DROP TABLE IF EXISTS `t_oe_exam_break_history`;
 CREATE TABLE `t_oe_exam_break_history` (
   `id` bigint NOT NULL COMMENT '主键',
   `exam_record_id` bigint NOT NULL COMMENT '考试记录ID',
-  `break_time` datetime DEFAULT NULL COMMENT '断点发生时间',
+  `break_time` timestamp DEFAULT NULL COMMENT '断点发生时间',
   `break_reason` varchar(30) DEFAULT NULL COMMENT '断点判定原因',
   `resume_reason` varchar(300) DEFAULT NULL COMMENT '提交异常原因',
-  `prepare_time` datetime DEFAULT NULL COMMENT '恢复候考时间',
-  `start_time` datetime DEFAULT NULL COMMENT '恢复开考时间',
+  `prepare_time` timestamp DEFAULT NULL COMMENT '恢复候考时间',
+  `start_time` timestamp DEFAULT NULL COMMENT '恢复开考时间',
   `entry_authentication_result` varchar(30) DEFAULT NULL COMMENT '恢复开考身份验证结果',
   `entry_authentication_id` bigint DEFAULT NULL COMMENT '恢复开考身份验证记录ID',
   PRIMARY KEY (`id`)
@@ -1430,7 +1436,7 @@ CREATE TABLE `t_oe_exam_monitor_exception_history` (
   `exam_record_id` bigint NOT NULL COMMENT '考试记录id',
   `source` varchar(300) NOT NULL COMMENT '开启监控的视频源',
   `type` varchar(30) DEFAULT NULL COMMENT '异常类型',
-  `time` datetime DEFAULT NULL COMMENT '异常时间'
+  `time` timestamp DEFAULT NULL COMMENT '异常时间'
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='监控异常记录';
 
 -- ----------------------------
@@ -1444,19 +1450,19 @@ CREATE TABLE `t_oe_exam_record` (
   `exam_student_id` bigint NOT NULL COMMENT '考生ID',
   `paper_id` bigint NOT NULL COMMENT '实际使用的试卷ID',
   `status` varchar(30) DEFAULT NULL COMMENT '考试状态,first_prepare:首次候考,answering:正在答题,break_off:已中断,resume_prepare:断点恢复候考,finished:已结束考试,persisted:数据已保存',
-  `first_prepare_time` datetime DEFAULT NULL COMMENT '首次进入候考时间',
-  `first_start_time` datetime DEFAULT NULL COMMENT '首次开考时间',
-  `last_break_time` datetime DEFAULT NULL COMMENT '最近断点时间',
-  `last_prepare_time` datetime DEFAULT NULL COMMENT '最近恢复候考时间',
-  `last_start_time` datetime DEFAULT NULL COMMENT '最近恢复开考时间',
+  `first_prepare_time` timestamp DEFAULT NULL COMMENT '首次进入候考时间',
+  `first_start_time` timestamp DEFAULT NULL COMMENT '首次开考时间',
+  `last_break_time` timestamp DEFAULT NULL COMMENT '最近断点时间',
+  `last_prepare_time` timestamp DEFAULT NULL COMMENT '最近恢复候考时间',
+  `last_start_time` timestamp DEFAULT NULL COMMENT '最近恢复开考时间',
   `left_break_resume_count` int DEFAULT NULL COMMENT '剩余断点续考次数',
   `client_current_ip` varchar(30) DEFAULT NULL COMMENT '客户端当前IP地址',
   `client_websocket_status` varchar(30) DEFAULT NULL COMMENT '客户端websocket状态',
   `client_websocket_id` varchar(50) DEFAULT NULL COMMENT '客户端websocket连接标识',
-  `client_last_sync_time` datetime DEFAULT NULL COMMENT '客户端最近同步时间',
+  `client_last_sync_time` timestamp DEFAULT NULL COMMENT '客户端最近同步时间',
   `answer_progress` double DEFAULT NULL COMMENT '答题进度',
   `duration_seconds` int DEFAULT NULL COMMENT '累计考试用时',
-  `finish_time` datetime DEFAULT NULL COMMENT '交卷时间',
+  `finish_time` timestamp DEFAULT NULL COMMENT '交卷时间',
   `finish_type` varchar(30) DEFAULT NULL COMMENT '交卷原因,hand:手动交卷,auto:系统交卷,breach:违纪交卷',
   `warning_count` int DEFAULT NULL COMMENT '预警次数',
   `review_result` varchar(30) DEFAULT NULL COMMENT '审核结果,pass:通过,no_pass:不通过',
@@ -1499,7 +1505,7 @@ CREATE TABLE `t_oe_exam_simulate_history` (
   `id` bigint NOT NULL COMMENT '主键',
   `student_id` bigint NOT NULL COMMENT '个人ID',
   `paper_id` bigint NOT NULL COMMENT '模拟试卷ID',
-  `finish_time` datetime DEFAULT NULL COMMENT '最近完成时间',
+  `finish_time` timestamp DEFAULT NULL COMMENT '最近完成时间',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='模拟考试记录  ';
 
@@ -1513,8 +1519,8 @@ CREATE TABLE `t_oe_face_verify_history` (
   `face_count` int DEFAULT NULL COMMENT '人脸数量',
   `similarity` double DEFAULT NULL COMMENT '相似度分数',
   `realness` double DEFAULT NULL COMMENT '真实性验证结果',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   `type` varchar(30) DEFAULT NULL COMMENT 'first:初次开考,recover:恢复开考,process:过程中',
   `exception` varchar(30) DEFAULT NULL COMMENT '异常类型',
   `photo_url` varchar(100) DEFAULT NULL COMMENT '图片保存路径',
@@ -1533,8 +1539,8 @@ CREATE TABLE `t_oe_liveness_verify_history` (
   `actions` varchar(2000) DEFAULT NULL COMMENT '随机动作与结果',
   `retry` int DEFAULT NULL COMMENT '重试次数',
   `pass` tinyint DEFAULT NULL COMMENT '本地验证是否通过,0:不通过,1:通过',
-  `start_time` datetime DEFAULT NULL COMMENT '开始时间',
-  `finish_time` datetime DEFAULT NULL COMMENT '完成时间',
+  `start_time` timestamp DEFAULT NULL COMMENT '开始时间',
+  `finish_time` timestamp DEFAULT NULL COMMENT '完成时间',
   `exception` varchar(30) DEFAULT NULL COMMENT '异常类型',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='活体验证记录';
@@ -1549,11 +1555,11 @@ CREATE TABLE `t_oe_simulate_paper` (
   `name` varchar(50) NOT NULL COMMENT '试卷名称',
   `total_score` double DEFAULT NULL COMMENT '总分',
   `paper_path` varchar(100) DEFAULT NULL COMMENT '题干路径',
-  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
-  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `create_time` timestamp DEFAULT NULL COMMENT '创建时间',
+  `update_time` timestamp DEFAULT NULL COMMENT '更新时间',
   `create_id` bigint DEFAULT NULL COMMENT '创建人id',
   `update_id` bigint DEFAULT NULL COMMENT '更新人id',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='模拟试卷';
 
-SET FOREIGN_KEY_CHECKS = 1;
+SET FOREIGN_KEY_CHECKS = 1;

+ 4 - 0
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -441,4 +441,8 @@
 		order by f.id
 		limit 500
 	</select>
+	
+	<update id="updateObjectiveScore">
+		update t_oe_exam_record t set t.objective_score=#{score} where t.id=#{recordId}
+	</update>
 </mapper>