|
@@ -19,11 +19,6 @@ import cn.com.qmth.examcloud.web.config.SystemProperties;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.mysql.cj.util.StringUtils;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
-import org.apache.http.HttpStatus;
|
|
|
-import org.apache.http.client.methods.CloseableHttpResponse;
|
|
|
-import org.apache.http.client.methods.HttpGet;
|
|
|
-import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
-import org.apache.http.util.EntityUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -35,7 +30,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.io.File;
|
|
|
-import java.io.IOException;
|
|
|
import java.nio.charset.Charset;
|
|
|
import java.util.*;
|
|
|
import java.util.regex.Matcher;
|
|
@@ -51,6 +45,8 @@ import java.util.regex.Pattern;
|
|
|
@RestController
|
|
|
@RequestMapping("cmcClient")
|
|
|
public class CloudMarkingClientController {
|
|
|
+ private static final Logger LOG = LoggerFactory.getLogger(CloudMarkingClientController.class);
|
|
|
+
|
|
|
@Autowired
|
|
|
ExamRecordQuestionsCloudService examRecordQuestionsCloudService;
|
|
|
|
|
@@ -63,8 +59,6 @@ public class CloudMarkingClientController {
|
|
|
@Autowired
|
|
|
OeExamStudentCloudService oeExamStudentCloudService;
|
|
|
|
|
|
- Logger logger = LoggerFactory.getLogger(CloudMarkingClientController.class);
|
|
|
-
|
|
|
/**
|
|
|
* 批量生成主观题答案,以压缩文件方式返回
|
|
|
*/
|
|
@@ -83,9 +77,9 @@ public class CloudMarkingClientController {
|
|
|
throw new StatusException("101002", "该考试批次下无待阅考生数据");
|
|
|
}
|
|
|
|
|
|
- if (logger.isDebugEnabled()) {
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
// logger.debug("[BATCH_GET_ANSWER-" + examId + "],获取考试批次下所有考生:" + JsonUtil.toJson(examStudentList));
|
|
|
- logger.debug("[001.BATCH_GET_ANSWER-" + examId + "],获取考试批次下所有考生数量:" + examStudentList.size());
|
|
|
+ LOG.debug("[001.BATCH_GET_ANSWER-" + examId + "],获取考试批次下所有考生数量:" + examStudentList.size());
|
|
|
}
|
|
|
|
|
|
for (ToBeMarkExamStudentBean stu : examStudentList) {
|
|
@@ -150,8 +144,8 @@ public class CloudMarkingClientController {
|
|
|
final String tempAnswerDir =
|
|
|
systemConfig.getTempDataDir() + "/exam-" + rb.getExamId() + "/" + rb.getCourseCode() + "-" + rb.getPaperType();
|
|
|
|
|
|
- if (logger.isDebugEnabled()) {
|
|
|
- logger.debug("[BATCH_GET_ANSWER-" + examId + "],临时文件目录:" + JsonUtil.toJson(tempAnswerDir));
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("[BATCH_GET_ANSWER-" + examId + "],临时文件目录:" + JsonUtil.toJson(tempAnswerDir));
|
|
|
}
|
|
|
|
|
|
List<Map<String, Object>> resultMapList = new ArrayList<>();
|
|
@@ -179,11 +173,11 @@ public class CloudMarkingClientController {
|
|
|
String answerJson = JsonUtil.toJson(resultMapList);
|
|
|
String jsonFilePath = tempAnswerDir + "/" + rb.getExamRecordDataId() + ".json";
|
|
|
|
|
|
- if (logger.isDebugEnabled()) {
|
|
|
- logger.debug("[BATCH_GET_ANSWER-" + examId + "],最终作答结果路径:jsonFilePath=" + jsonFilePath);
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("[BATCH_GET_ANSWER-" + examId + "],最终作答结果路径:jsonFilePath=" + jsonFilePath);
|
|
|
}
|
|
|
- if (logger.isDebugEnabled()) {
|
|
|
- logger.debug("[BATCH_GET_ANSWER-" + examId + "],最终作答结果:answerJson=" + answerJson);
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("[BATCH_GET_ANSWER-" + examId + "],最终作答结果:answerJson=" + answerJson);
|
|
|
}
|
|
|
|
|
|
IOUtil.toFile(answerJson.getBytes(Charset.forName("UTF-8")), jsonFilePath);
|
|
@@ -196,8 +190,8 @@ public class CloudMarkingClientController {
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- if (logger.isDebugEnabled()) {
|
|
|
- logger.debug("[006.BATCH_GET_ANSWER-" + examId + "],enter saveDataToLocal-----GetToBeMarkExamRecordResp 空数据");
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
+ LOG.debug("[006.BATCH_GET_ANSWER-" + examId + "],enter saveDataToLocal-----GetToBeMarkExamRecordResp 空数据");
|
|
|
}
|
|
|
}
|
|
|
}
|