|
@@ -1,6 +1,5 @@
|
|
|
package com.qmth.cqb.paper.service.impl;
|
|
|
|
|
|
-import java.io.File;
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
@@ -14,7 +13,6 @@ import java.util.Set;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
-import org.apache.commons.io.FileUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.nlpcn.commons.lang.util.StringUtil;
|
|
|
import org.slf4j.Logger;
|
|
@@ -675,6 +673,20 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
|
|
|
quesOptions = null;
|
|
|
return newQuesOptions;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void exportExamPaperInfoCheck(ExportPaperInfoModel exportModel,HttpServletResponse response) throws Exception {
|
|
|
+ Map<String, Object> exportStructureMap = exportStructureService.findStructureByExamIdAndExamType(exportModel.getExamId()+"",exportModel.getExamType());
|
|
|
+ ExportStructure exportStructure = (ExportStructure) exportStructureMap.get("exportStructure");
|
|
|
+ //如果是批量导出
|
|
|
+ if(exportModel.getExportWay()==ExportWay.BATCH){
|
|
|
+ if(exportStructure==null){
|
|
|
+ throw new RuntimeException("该考试下的试卷结构导出设置未制定,不能导出");
|
|
|
+ }
|
|
|
+ //查询该考试下是否所有课程都制定了调卷规则
|
|
|
+ checkAllCourseByExamId(exportModel.getExamId());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public void exportExamPaperInfo(ExportPaperInfoModel exportModel,HttpServletResponse response) throws Exception {
|
|
@@ -740,7 +752,6 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
|
|
|
return paperIdList;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public List<ExamFile> findPaperStructure(String examId, String courseId) {
|
|
|
ExamFile examFile = new ExamFile();
|
|
@@ -749,7 +760,6 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
|
|
|
return examFileService.findExamFileListByExamFile(examFile);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
private void makePaperStructure(String examName,List<String> paperIds,ExportStructure exportStructure) throws Exception{
|
|
|
List<QuestionTypeNum> questionTypeNums = exportStructure.getQuestionTypeNums();
|
|
|
|
|
@@ -789,5 +799,5 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
|
|
|
FileOutputStream out2 = new FileOutputStream(downloadDirectory+"\\"+examName+"_主观题.xlsx");
|
|
|
subjectiveExcelExporter.write(examName+"_主观题.xlsx",subjectiveQuestionStructureList,out2);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|