|
@@ -1091,19 +1091,17 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
int count = 0;
|
|
|
TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
|
|
|
LocalDateTime nowTime = LocalDateTime.now();
|
|
|
- StringJoiner zipJoiner = new StringJoiner("")
|
|
|
- .add(dictionaryConfig.fssLocalFileDomain().getConfig()).add(File.separator);
|
|
|
- StringJoiner dirName = new StringJoiner("")
|
|
|
- .add(UploadFileEnum.FILE.getTitle()).add(File.separator)
|
|
|
- .add(String.valueOf(nowTime.getYear())).add(File.separator)
|
|
|
- .add(String.format("%02d", nowTime.getMonthValue())).add(File.separator)
|
|
|
- .add(String.format("%02d", nowTime.getDayOfMonth()))
|
|
|
- .add(File.separator).add(SystemConstant.getUuid()).add(SystemConstant.ZIP_PREFIX);
|
|
|
- String dirNameTmp = dirName.toString().replaceAll("\\\\", "/");
|
|
|
- File zipFile = new File(zipJoiner.toString().replaceAll("\\\\", "/") + dirNameTmp);
|
|
|
+ String zipJoiner = dictionaryConfig.fssLocalFileDomain().getConfig() + File.separator;
|
|
|
+ String dirName = UploadFileEnum.FILE.getTitle() + File.separator +
|
|
|
+ nowTime.getYear() + File.separator +
|
|
|
+ String.format("%02d", nowTime.getMonthValue()) + File.separator +
|
|
|
+ String.format("%02d", nowTime.getDayOfMonth()) +
|
|
|
+ File.separator + SystemConstant.getUuid() + SystemConstant.ZIP_PREFIX;
|
|
|
+ String dirNameTmp = dirName.replaceAll("\\\\", "/");
|
|
|
+ File zipFile = new File(zipJoiner + dirNameTmp);
|
|
|
if (!zipFile.getParentFile().exists()) {
|
|
|
zipFile.getParentFile().mkdirs();
|
|
|
- zipFile.createNewFile();
|
|
|
+// zipFile.createNewFile();
|
|
|
}
|
|
|
|
|
|
boolean oss = dictionaryConfig.sysDomain().isOss();
|
|
@@ -1313,17 +1311,14 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
String paperPath = dirPath.toString() + "试卷" + "-" + name + attachment.getType();
|
|
|
UploadFileEnum uploadFileEnum = UploadFileEnum.valueOf((String) jsonObject.get(SystemConstant.UPLOAD_TYPE));
|
|
|
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) {
|
|
|
- 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 {
|
|
|
- file = new File(paperPath);
|
|
|
- if (!file.exists()) {
|
|
|
- file.getParentFile().mkdirs(); //目标文件目录不存在的话需要创建目录
|
|
|
- file.createNewFile();
|
|
|
- }
|
|
|
IOUtils.copy(new FileInputStream((String) jsonObject.get(SystemConstant.PATH)), new FileOutputStream(file));
|
|
|
}
|
|
|
}
|