|
@@ -2,6 +2,7 @@ package com.qmth.themis.business.service.impl;
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
|
+import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.UUID;
|
|
import java.util.UUID;
|
|
@@ -135,15 +136,13 @@ public class TEExamPaperServiceImpl extends ServiceImpl<TEExamPaperMapper, TEExa
|
|
@Cacheable(value = "objective_answer", key = "#paperId", unless = "#result == null")
|
|
@Cacheable(value = "objective_answer", key = "#paperId", unless = "#result == null")
|
|
@Override
|
|
@Override
|
|
public Map<String, ObjectiveAnswerCacheBean> getObjectiveAnswerCacheBean(Long paperId) {
|
|
public Map<String, ObjectiveAnswerCacheBean> getObjectiveAnswerCacheBean(Long paperId) {
|
|
- Map<String, ObjectiveAnswerCacheBean> ret = null;
|
|
|
|
ExamPaperCacheBean ep = getExamPaperCacheBean(paperId);
|
|
ExamPaperCacheBean ep = getExamPaperCacheBean(paperId);
|
|
if (ep == null) {
|
|
if (ep == null) {
|
|
- return ret;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
if(StringUtils.isBlank(ep.getAnswerPath())) {//没有答案文件
|
|
if(StringUtils.isBlank(ep.getAnswerPath())) {//没有答案文件
|
|
- return ret;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
- ret = new HashMap<String, ObjectiveAnswerCacheBean>();
|
|
|
|
String structUrl = OssUtil.getUrlForPrivateBucket(systemConfig.getOssEnv(3), ep.getStructPath());
|
|
String structUrl = OssUtil.getUrlForPrivateBucket(systemConfig.getOssEnv(3), ep.getStructPath());
|
|
String answerUrl = OssUtil.getUrlForPrivateBucket(systemConfig.getOssEnv(3), ep.getAnswerPath());
|
|
String answerUrl = OssUtil.getUrlForPrivateBucket(systemConfig.getOssEnv(3), ep.getAnswerPath());
|
|
String tempDir = SystemConstant.TEMP_FILES_DIR;
|
|
String tempDir = SystemConstant.TEMP_FILES_DIR;
|
|
@@ -268,15 +267,13 @@ public class TEExamPaperServiceImpl extends ServiceImpl<TEExamPaperMapper, TEExa
|
|
@Cacheable(value = "paper_struct", key = "#paperId", unless = "#result == null")
|
|
@Cacheable(value = "paper_struct", key = "#paperId", unless = "#result == null")
|
|
@Override
|
|
@Override
|
|
public Map<String, Integer> getPaperStructCacheBean(Long paperId) {
|
|
public Map<String, Integer> getPaperStructCacheBean(Long paperId) {
|
|
- Map<String, Integer> ret = null;
|
|
|
|
ExamPaperCacheBean ep = getExamPaperCacheBean(paperId);
|
|
ExamPaperCacheBean ep = getExamPaperCacheBean(paperId);
|
|
if (ep == null) {
|
|
if (ep == null) {
|
|
- return ret;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
if(StringUtils.isBlank(ep.getStructPath())) {//没有试卷结构文件
|
|
if(StringUtils.isBlank(ep.getStructPath())) {//没有试卷结构文件
|
|
- return ret;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
- ret = new HashMap<String, Integer>();
|
|
|
|
String structUrl = OssUtil.getUrlForPrivateBucket(systemConfig.getOssEnv(3), ep.getStructPath());
|
|
String structUrl = OssUtil.getUrlForPrivateBucket(systemConfig.getOssEnv(3), ep.getStructPath());
|
|
String tempDir = SystemConstant.TEMP_FILES_DIR;
|
|
String tempDir = SystemConstant.TEMP_FILES_DIR;
|
|
String dir = tempDir + "/" + uuid() + "/";
|
|
String dir = tempDir + "/" + uuid() + "/";
|
|
@@ -293,7 +290,7 @@ public class TEExamPaperServiceImpl extends ServiceImpl<TEExamPaperMapper, TEExa
|
|
}
|
|
}
|
|
|
|
|
|
private Map<String, Integer> buildPaperStructCache(String structStr) {
|
|
private Map<String, Integer> buildPaperStructCache(String structStr) {
|
|
- Map<String, Integer> map = new HashMap<String, Integer>();
|
|
|
|
|
|
+ Map<String, Integer> map = new LinkedHashMap<String, Integer>();
|
|
JSONObject structJson = JSONObject.parseObject(structStr);
|
|
JSONObject structJson = JSONObject.parseObject(structStr);
|
|
JSONArray structdetails = structJson.getJSONArray("details");
|
|
JSONArray structdetails = structJson.getJSONArray("details");
|
|
for (int i = 0; i < structdetails.size(); i++) {
|
|
for (int i = 0; i < structdetails.size(); i++) {
|