|
@@ -307,12 +307,15 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
|
try {
|
|
|
dfile.mkdirs();
|
|
|
String structFilePath = sdf.format(new Date()) + "/" + uuid() + ".json";
|
|
|
-
|
|
|
+ ExamStudentPaperStructCacheBean struct = (ExamStudentPaperStructCacheBean) redisUtil.get(RedisKeyHelper.studentPaperStructKey(recordId));
|
|
|
+
|
|
|
//保存考试记录
|
|
|
Map<String, Object> record = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
|
|
|
TOeExamRecord er = SimpleBeanUtil.mapToObject(record, TOeExamRecord.class);
|
|
|
er.setStatus(ExamRecordStatusEnum.PERSISTED);
|
|
|
- er.setPaperStructPath(structFilePath);
|
|
|
+ if (struct != null) {
|
|
|
+ er.setPaperStructPath(structFilePath);
|
|
|
+ }
|
|
|
er.setPaperStructUpload(1);
|
|
|
saveOrUpdate(er);
|
|
|
//保存作答
|
|
@@ -330,7 +333,6 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
|
|
|
// BeanUtils.copyProperties(examStudentCache, examStudent);
|
|
|
// examStudentService.saveOrUpdate(examStudent);
|
|
|
//上传个人试卷结构
|
|
|
- ExamStudentPaperStructCacheBean struct = (ExamStudentPaperStructCacheBean) redisUtil.get(RedisKeyHelper.studentPaperStructKey(recordId));
|
|
|
if (struct != null) {
|
|
|
File structFile = new File(dir + "struct.json");
|
|
|
FileUtil.saveAsFile(structFile.getAbsolutePath(), struct.getContent());
|