|
@@ -23,6 +23,7 @@ import cn.com.qmth.examcloud.core.questions.service.export.ExportPaperAbstractSe
|
|
import cn.com.qmth.examcloud.core.questions.service.export.InitPaperExpService;
|
|
import cn.com.qmth.examcloud.core.questions.service.export.InitPaperExpService;
|
|
import cn.com.qmth.examcloud.core.questions.service.rpc.ExamCourseClient;
|
|
import cn.com.qmth.examcloud.core.questions.service.rpc.ExamCourseClient;
|
|
import main.java.com.UpYun;
|
|
import main.java.com.UpYun;
|
|
|
|
+
|
|
import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.docx4j.Docx4J;
|
|
import org.docx4j.Docx4J;
|
|
@@ -34,6 +35,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
+
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.io.FileOutputStream;
|
|
import java.io.FileOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
@@ -117,8 +119,21 @@ public class ExtractConfigFileServiceImpl implements ExtractConfigFileService {
|
|
exportStructure = exportStructureService.findStructureByExamId(extractConfig.getExamId() + "");
|
|
exportStructure = exportStructureService.findStructureByExamId(extractConfig.getExamId() + "");
|
|
}
|
|
}
|
|
//生成试卷
|
|
//生成试卷
|
|
- Map<String, String> finishedPaperIdMap = extractConfigService.saveExtractConfig(extractConfig, user);
|
|
|
|
- if (isbuildFile == 1) {
|
|
|
|
|
|
+ List<ExamPaper> examPaperList = extractConfigService.saveExtractConfig(extractConfig, user);
|
|
|
|
+ if(isbuildFile == 1) {
|
|
|
|
+ //删除原有试卷文件
|
|
|
|
+ ExamFile examFile = new ExamFile();
|
|
|
|
+ examFile.setExamId(extractConfig.getExamId() + "");
|
|
|
|
+ examFile.setCourseId(extractConfig.getCourseCode());
|
|
|
|
+ examFile.setOrgId(extractConfig.getOrgId());
|
|
|
|
+ examFileService.deleteExamFile(examFile);
|
|
|
|
+ //上传抽取试卷对象集合
|
|
|
|
+ for(ExamPaper examPaper:examPaperList){
|
|
|
|
+ String paperId = examPaper.getPaper().getId();
|
|
|
|
+ uploadPaperFile(extractConfig, paperId, exportStructure, user);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /*if (isbuildFile == 1) {
|
|
//删除原有试卷文件
|
|
//删除原有试卷文件
|
|
ExamFile examFile = new ExamFile();
|
|
ExamFile examFile = new ExamFile();
|
|
examFile.setExamId(extractConfig.getExamId() + "");
|
|
examFile.setExamId(extractConfig.getExamId() + "");
|
|
@@ -133,7 +148,7 @@ public class ExtractConfigFileServiceImpl implements ExtractConfigFileService {
|
|
String paperId = entry.getValue();
|
|
String paperId = entry.getValue();
|
|
uploadPaperFile(extractConfig, paperId, exportStructure, user);
|
|
uploadPaperFile(extractConfig, paperId, exportStructure, user);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|