Răsfoiți Sursa

3.2.1-批量导出bug修复

xiaof 2 ani în urmă
părinte
comite
a495dddb36

+ 6 - 9
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java

@@ -1311,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));
                                 }
                             }