allen hai 9 meses
pai
achega
272b8132c9

+ 1 - 1
taais-admin/src/main/resources/application-dev.yml

@@ -35,7 +35,7 @@ mybatis-flex:
       #      password: Root@369
       #postgresql数据库
       driver-class-name: org.postgresql.Driver
-      url: jdbc:postgresql://localhost:5432/taais?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
+      url: jdbc:postgresql://192.168.101.34:5432/taais?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
       username: postgres
       password: P3x0LG8jzyHRX59l
 

+ 1 - 1
taais-admin/src/main/resources/application-prod.yml

@@ -37,7 +37,7 @@ mybatis-flex:
       driver-class-name: org.postgresql.Driver
       url: jdbc:postgresql://localhost:5432/taais?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
       username: postgres
-      password: postgres@369
+      password: P3x0LG8jzyHRX59l
 
 #    # 数据源-2
 #    ds2:

+ 2 - 1
taais-admin/src/main/resources/application.yml

@@ -9,7 +9,8 @@ taais:
   # 实例演示开关
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/km/uploadPath,Linux配置 /home/km/uploadPath)
-  profile: D:/taais/uploadPath
+  # profile: D:/taais/uploadPath
+  profile: /home/ObjectDetection_Web
   # 获取ip地址开关
   addressEnabled: false
 

+ 1 - 1
taais-common/taais-common-core/src/main/java/com/taais/common/core/utils/file/FileUtils.java

@@ -306,7 +306,7 @@ public class FileUtils extends FileUtil {
         return path.resolveSibling(newFileName);
     }
     public static String getTxtPathStr(String pathFileName) {
-        Path path = Paths.get(TaaisConfig.getProfile()+pathFileName);
+        Path path = Paths.get(pathFileName);
 
         // 获取文件名并替换后缀
         String newFileName = path.getFileName().toString().replaceFirst("[.][^.]+$", "") + ".txt";

+ 23 - 6
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/AlgorithmTaskServiceImpl.java

@@ -677,20 +677,37 @@ public class AlgorithmTaskServiceImpl extends BaseServiceImpl<AlgorithmTaskMappe
         int errorCount = 0;
         for (DataVo dataVo : trainDataList) {
             // 复制图片
-            String imagePath = StringUtils.substringAfter(dataVo.getUrl(), Constants.RESOURCE_PREFIX);
+            String imagePath = TaaisConfig.getProfile() + StringUtils.substringAfter(dataVo.getUrl(), Constants.RESOURCE_PREFIX);
+            String destPath = TaaisConfig.getProfile() + destinationPath+BizConstant.IMAGE;
+            String osName = System.getProperty("os.name").toLowerCase();
             try {
-                FileUtils.copyFile(TaaisConfig.getProfile() + imagePath, TaaisConfig.getProfile() + destinationPath+BizConstant.IMAGE);
+                if (osName.contains("win")) {
+                } else {
+                    // Linux/Unix 环境
+                    imagePath = imagePath.replaceAll("/", "\\\\");
+                    destPath = destPath.replaceAll("/", "\\\\");
+                }
+                FileUtils.copyFile(imagePath, destPath);
+                log.info("复制图片文件成功source:{},target:{}", imagePath, destPath);
             } catch (IOException e) {
                 errorCount++;
-                log.error("复制图片文件出错source:{},target:{}", dataVo.getDataSource(), TaaisConfig.getProfile() + destinationPath);
+                log.error("复制图片文件出错source:{},target:{}", imagePath, destPath, e);
             }
             if(dataVo.getLabeled()){
+                String txtPathStr = FileUtils.getTxtPathStr(imagePath);
+                String destLabelPath = TaaisConfig.getProfile() + destinationPath+BizConstant.LABEL;
+                if (osName.contains("win")) {
+                } else {
+                    // Linux/Unix 环境
+                    txtPathStr = txtPathStr.replaceAll("/", "\\\\");
+                    destLabelPath = destLabelPath.replaceAll("/", "\\\\");
+                }
                 try {
-                    String txtPathStr = FileUtils.getTxtPathStr(imagePath);
-                    FileUtils.copyFile(txtPathStr, TaaisConfig.getProfile() + destinationPath+BizConstant.LABEL);
+                    FileUtils.copyFile(txtPathStr, destLabelPath);
+                    log.info("复制标注文件成功source:{},target:{}", imagePath, destLabelPath);
                 } catch (IOException e) {
                     errorCount++;
-                    log.error("复制标注文件出错source:{},target:{}", dataVo.getDataSource(), TaaisConfig.getProfile() + destinationPath);
+                    log.error("复制标注文件出错source:{},target:{}", txtPathStr, destLabelPath,e);
                 }
             }