|
@@ -1311,17 +1311,14 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
String paperPath = dirPath.toString() + "试卷" + "-" + name + attachment.getType();
|
|
String paperPath = dirPath.toString() + "试卷" + "-" + name + attachment.getType();
|
|
UploadFileEnum uploadFileEnum = UploadFileEnum.valueOf((String) jsonObject.get(SystemConstant.UPLOAD_TYPE));
|
|
UploadFileEnum uploadFileEnum = UploadFileEnum.valueOf((String) jsonObject.get(SystemConstant.UPLOAD_TYPE));
|
|
File file = null;
|
|
File file = null;
|
|
- StringJoiner stringJoinerPdf = new StringJoiner("")
|
|
|
|
- .add(dictionaryConfig.fssLocalFileDomain().getConfig()).add(File.separator)
|
|
|
|
- .add(paperPath);
|
|
|
|
|
|
+ file = new File(paperPath);
|
|
|
|
+ if (!file.exists()) {
|
|
|
|
+ file.getParentFile().mkdirs(); //目标文件目录不存在的话需要创建目录
|
|
|
|
+// file.createNewFile();
|
|
|
|
+ }
|
|
if (oss) {
|
|
if (oss) {
|
|
- file = fileStoreUtil.ossDownload((String) jsonObject.get(SystemConstant.PATH), stringJoinerPdf.toString(), uploadFileEnum.getFssType());
|
|
|
|
|
|
+ file = fileStoreUtil.ossDownload((String) jsonObject.get(SystemConstant.PATH), paperPath.toString(), uploadFileEnum.getFssType());
|
|
} else {
|
|
} else {
|
|
- file = new File(paperPath);
|
|
|
|
- if (!file.exists()) {
|
|
|
|
- file.getParentFile().mkdirs(); //目标文件目录不存在的话需要创建目录
|
|
|
|
- file.createNewFile();
|
|
|
|
- }
|
|
|
|
IOUtils.copy(new FileInputStream((String) jsonObject.get(SystemConstant.PATH)), new FileOutputStream(file));
|
|
IOUtils.copy(new FileInputStream((String) jsonObject.get(SystemConstant.PATH)), new FileOutputStream(file));
|
|
}
|
|
}
|
|
}
|
|
}
|