|
@@ -18,7 +18,7 @@ import cn.com.qmth.examcloud.core.questions.service.PaperDetailService;
|
|
|
import cn.com.qmth.examcloud.core.questions.service.PaperService;
|
|
|
import cn.com.qmth.examcloud.core.questions.service.QuestionAudioService;
|
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.dto.*;
|
|
|
-import cn.com.qmth.examcloud.core.questions.service.config.UpYunProperty;
|
|
|
+import cn.com.qmth.examcloud.core.questions.service.config.SysProperty;
|
|
|
import com.google.gson.Gson;
|
|
|
import freemarker.template.Configuration;
|
|
|
import freemarker.template.Template;
|
|
@@ -94,7 +94,7 @@ public abstract class ExportPaperAbstractService {
|
|
|
protected QuesPkgPathRepo quesPkgPathRepo;
|
|
|
|
|
|
@Autowired
|
|
|
- private UpYunProperty upYunProperty;
|
|
|
+ private SysProperty sysProperty;
|
|
|
|
|
|
public static final String FILL_BLANK_QUESTION_FLAG = "###";
|
|
|
|
|
@@ -882,8 +882,8 @@ public abstract class ExportPaperAbstractService {
|
|
|
FileDisposeUtil.fileToZip(jsonDirectoryPath, "docxExport", jsonDirectoryName);
|
|
|
//上传zip压缩包到又拍云
|
|
|
File zipFile = new File(TEMP_FILE_EXP + jsonDirectoryName + ZIP_SUFFIX);
|
|
|
- String zipUpyunFilePath = upYunProperty.getUploadPath() + extractConfig.getOrgId() + "/" + jsonDirectoryName + ZIP_SUFFIX;
|
|
|
- UpYun upyun = new UpYun(upYunProperty.getBucketName(), upYunProperty.getUserName(), upYunProperty.getPassword());
|
|
|
+ String zipUpyunFilePath = sysProperty.getUploadPath() + extractConfig.getOrgId() + "/" + jsonDirectoryName + ZIP_SUFFIX;
|
|
|
+ UpYun upyun = new UpYun(sysProperty.getBucketName(), sysProperty.getUserName(), sysProperty.getPassword());
|
|
|
upyun.writeFile(zipUpyunFilePath, zipFile, true);
|
|
|
//保存数据库记录
|
|
|
ExamFile examFile = new ExamFile(computerTestPaper, extractConfig, zipUpyunFilePath, ExamFileType.COMPUTERTEST_PACKAGE, ZIP_SUFFIX);
|
|
@@ -984,7 +984,7 @@ public abstract class ExportPaperAbstractService {
|
|
|
+ "_2_" + option.getNumber() + oNum + "." + audio.getFileSuffixes();
|
|
|
oNum++;
|
|
|
}
|
|
|
- FileDisposeUtil.saveUrlAs(upYunProperty.getDomain() + audio.getFileUrl(), jsonDirectoryPath + File.separator + audioFileName);
|
|
|
+ FileDisposeUtil.saveUrlAs(sysProperty.getDomain() + audio.getFileUrl(), jsonDirectoryPath + File.separator + audioFileName);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1001,8 +1001,8 @@ public abstract class ExportPaperAbstractService {
|
|
|
DocxProcessUtil.exportWord(paperExp, paperFileName, template);
|
|
|
DocxProcessUtil.processImage(paperFileName, getPkgList(paperExp.getId()));
|
|
|
File file = new File(TEMP_FILE_EXP + paperFileName);
|
|
|
- String paperFilePath = upYunProperty.getUploadPath() + extractConfig.getOrgId() + "/" + paperFileName;
|
|
|
- UpYun upyun = new UpYun(upYunProperty.getBucketName(), upYunProperty.getUserName(), upYunProperty.getPassword());
|
|
|
+ String paperFilePath = sysProperty.getUploadPath() + extractConfig.getOrgId() + "/" + paperFileName;
|
|
|
+ UpYun upyun = new UpYun(sysProperty.getBucketName(), sysProperty.getUserName(), sysProperty.getPassword());
|
|
|
upyun.writeFile(paperFilePath, file, true);
|
|
|
ExamFile examFile = new ExamFile(paperExp.getId(), extractConfig, paperFilePath, examFileType, DOCX_SUFFIX);
|
|
|
examFile.setGroupCode(examPaper.getGroupCode());
|
|
@@ -1052,8 +1052,8 @@ public abstract class ExportPaperAbstractService {
|
|
|
File file = new File(TEMP_FILE_EXP + objectiveFilename);
|
|
|
FileOutputStream out = new FileOutputStream(file);
|
|
|
objectiveExcelExporter.write(objectiveFilename, objectiveQuestionStructureList, out);
|
|
|
- String objectiveFilePath = upYunProperty.getUploadPath() + extractConfig.getOrgId() + "/" + objectiveFilename;
|
|
|
- UpYun upyun = new UpYun(upYunProperty.getBucketName(), upYunProperty.getUserName(), upYunProperty.getPassword());
|
|
|
+ String objectiveFilePath = sysProperty.getUploadPath() + extractConfig.getOrgId() + "/" + objectiveFilename;
|
|
|
+ UpYun upyun = new UpYun(sysProperty.getBucketName(), sysProperty.getUserName(), sysProperty.getPassword());
|
|
|
upyun.writeFile(objectiveFilePath, file, true);
|
|
|
ExamFile examFile = new ExamFile(paperExp.getId(), extractConfig, objectiveFilePath, ExamFileType.PAPER_STRUCTURE_OBJECTIVE, EXCEL_SUFFIX);
|
|
|
examFile.setGroupCode(examPaper.getGroupCode());
|
|
@@ -1090,8 +1090,8 @@ public abstract class ExportPaperAbstractService {
|
|
|
File file = new File(TEMP_FILE_EXP + subjectiveFileName);
|
|
|
FileOutputStream out = new FileOutputStream(file);
|
|
|
subjectiveExcelExporter.write(subjectiveFileName, subjectiveQuestionStructureList, out);
|
|
|
- String subjectiveFilePath = upYunProperty.getUploadPath() + extractConfig.getOrgId() + "/" + subjectiveFileName;
|
|
|
- UpYun upyun = new UpYun(upYunProperty.getBucketName(), upYunProperty.getUserName(), upYunProperty.getPassword());
|
|
|
+ String subjectiveFilePath = sysProperty.getUploadPath() + extractConfig.getOrgId() + "/" + subjectiveFileName;
|
|
|
+ UpYun upyun = new UpYun(sysProperty.getBucketName(), sysProperty.getUserName(), sysProperty.getPassword());
|
|
|
upyun.writeFile(subjectiveFilePath, file, true);
|
|
|
ExamFile examFile = new ExamFile(paperExp.getId(), extractConfig, subjectiveFilePath, ExamFileType.PAPER_STRUCTURE_SUBJECTIVE, EXCEL_SUFFIX);
|
|
|
examFile.setGroupCode(examPaper.getGroupCode());
|
|
@@ -1373,7 +1373,7 @@ public abstract class ExportPaperAbstractService {
|
|
|
public void downloadAudio(PaperExp paperExp, String zipFileName) {
|
|
|
//先判断是否是音频试卷
|
|
|
if (paperExp.getHasAudio() != null && paperExp.getHasAudio() == true) {
|
|
|
- UpYun upyun = new UpYun(upYunProperty.getBucketName(), upYunProperty.getUserName(), upYunProperty.getPassword());
|
|
|
+ UpYun upyun = new UpYun(sysProperty.getBucketName(), sysProperty.getUserName(), sysProperty.getPassword());
|
|
|
//取到所有大题
|
|
|
List<PaperDetailExp> paperDetailExps = paperExp.getPaperDetails();
|
|
|
if (paperDetailExps != null && paperDetailExps.size() > 0) {
|