|
@@ -1,5 +1,6 @@
|
|
|
package com.qmth.cqb.paper.service.impl;
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
@@ -714,15 +715,15 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
|
|
|
List<ExamFile> examFiles = examFileService.findExamFileListByExportPaperInfoModel(exportModel);
|
|
|
if(examFiles!=null&&examFiles.size()>0){
|
|
|
for(ExamFile examFile:examFiles){
|
|
|
- FileDisposeUtil.saveUrlAs(downloadUrl+examFile.getFilePath(),downloadDirectory+"\\"+examFile.getFileName());
|
|
|
+ FileDisposeUtil.saveUrlAs(downloadUrl+examFile.getFilePath(),downloadDirectory+File.separator+examFile.getFileName());
|
|
|
}
|
|
|
+ //创建压缩文件名称
|
|
|
+ String zipFileName = CommonUtils.getCurNum();
|
|
|
+ //将downloadDirectory文件夹压缩成zip文件,存放到zipDirectory文件夹中
|
|
|
+ FileDisposeUtil.fileToZip(downloadDirectory,zipDirectory,zipFileName);
|
|
|
+ //下载zip文件到客户端
|
|
|
+ FileDisposeUtil.downloadFile(zipFileName+".zip",zipDirectory+File.separator+zipFileName+".zip",response);
|
|
|
}
|
|
|
- //创建压缩文件名称
|
|
|
- String zipFileName = exportStructure.getExamName()+"_"+exportStructure.getExamType().name()+"_"+CommonUtils.getCurNum();
|
|
|
- //将downloadDirectory文件夹压缩成zip文件,存放到zipDirectory文件夹中
|
|
|
- FileDisposeUtil.fileToZip(downloadDirectory,zipDirectory,zipFileName);
|
|
|
- //下载zip文件到客户端
|
|
|
- FileDisposeUtil.downloadFile(zipFileName+".zip",zipDirectory+"\\"+zipFileName+".zip",response);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -752,14 +753,6 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
|
|
|
return paperIdList;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public List<ExamFile> findPaperStructure(String examId, String courseId) {
|
|
|
- ExamFile examFile = new ExamFile();
|
|
|
- examFile.setExamId(examId);
|
|
|
- examFile.setCourseId(courseId);
|
|
|
- return examFileService.findExamFileListByExamFile(examFile);
|
|
|
- }
|
|
|
-
|
|
|
private void makePaperStructure(String examName,List<String> paperIds,ExportStructure exportStructure) throws Exception{
|
|
|
List<QuestionTypeNum> questionTypeNums = exportStructure.getQuestionTypeNums();
|
|
|
|