소스 검색

fix some bugs

allen 1 년 전
부모
커밋
877c8121e6

+ 0 - 4
fidms-admin/src/main/java/com/fidms/FidmsApplication.java

@@ -1,12 +1,8 @@
 package com.fidms;
 
-import javafx.application.Application;
-import org.springframework.beans.factory.annotation.Configurable;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.context.ConfigurableApplicationContext;
 
 /**
  * 启动程序

+ 1 - 2
fidms-admin/src/main/java/com/fidms/web/controller/InfraredOutputController.java

@@ -135,7 +135,6 @@ public class InfraredOutputController extends BaseController
     @PreAuthorize("@ss.hasPermi('data:infraredOut:openFolder')")
     @PostMapping("/folder")
     public void getFolder(@RequestParam String path) throws IOException {
-        FolderUtils Folder = new FolderUtils();
         FileUploadUtils file = new FileUploadUtils();
         String dir="";
 
@@ -149,7 +148,7 @@ public class InfraredOutputController extends BaseController
         {
             dir = path;
         }
-        Folder.openFolder(dir);
+        FolderUtils.openFolderAndSelectFile(dir);
     }
 
 }

+ 0 - 2
fidms-admin/src/main/java/com/fidms/web/domain/FlowFieldInput.java

@@ -4,8 +4,6 @@ import com.fidms.common.annotation.Excel;
 import com.fidms.common.core.domain.BaseEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
-import org.omg.CORBA.PUBLIC_MEMBER;
-import org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor;
 
 import java.math.BigDecimal;
 

+ 5 - 5
fidms-admin/src/main/resources/application-druid.yml

@@ -6,16 +6,16 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://124.71.193.202:3306/fidms_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://47.108.150.237:3306/fidms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
-                password: '*R~1jBvy*8EKUFK6i'
+                password: w.cf123321
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭
                 enabled: false
-                url: 
-                username: 
-                password: 
+                url:
+                username:
+                password:
             # 初始连接数
             initialSize: 5
             # 最小连接池数量

+ 4 - 4
fidms-admin/src/main/resources/application.yml

@@ -9,7 +9,7 @@ fidms:
   # 实例演示开关
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/fidms/uploadPath,Linux配置 /home/fidms/uploadPath)
-  profile: C:/fidms/uploadPath
+  profile: d:/fidms/uploadPath
   # 获取ip地址开关
   addressEnabled: false
   # 验证码类型 math 数组计算 char 字符验证
@@ -70,13 +70,13 @@ spring:
   # redis 配置
   redis:
     # 地址
-    host: 47.108.150.237
+    host: localhost
     # 端口,默认为6379
-    port: 4406
+    port: 6379
     # 数据库索引
     database: 0
     # 密码
-    password: w.cf123321
+    password:
     # 连接超时时间
     timeout: 10s
     lettuce:

+ 35 - 2
fidms-common/src/main/java/com/fidms/common/utils/FolderUtils.java

@@ -9,9 +9,9 @@ import java.io.IOException;
 
 public class FolderUtils {
 
-    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
+    protected static Logger logger = LoggerFactory.getLogger(FolderUtils.class);
 
-    public String openFolder(String path) throws IOException {
+    public static String openFolder(String path) throws IOException {
         String errorMsg = "";
         // 指定要打开的文件夹路径
         File folder = new File(path);
@@ -33,4 +33,37 @@ public class FolderUtils {
         }
         return errorMsg;
     }
+
+    public static String openFolderAndSelectFile(String path) {
+        String errorMsg = "";
+        String osName = System.getProperty("os.name").toLowerCase();
+        System.out.println("Operating system: " + osName);
+        if (osName.contains("win")) {
+            try {
+                Runtime.getRuntime().exec("explorer.exe /select," + path);
+            } catch (IOException e) {
+                logger.warn("explorer error, path:{}", path, e);
+                errorMsg = "打开异常";
+            }
+        } else if (osName.contains("nux") || osName.contains("nix")) {
+            try {
+                Runtime.getRuntime().exec("nautilus " + path);
+                errorMsg = "打开异常";
+            } catch (IOException e) {
+                logger.warn("nautilus error, path:{}", path, e);
+                errorMsg = "打开异常";
+            }
+            try {
+                Runtime.getRuntime().exec("dolphin --select " + path);
+            } catch (IOException e) {
+                logger.warn("dolphin error, path:{}", path, e);
+                errorMsg = "打开异常";
+            }
+        } else if (osName.contains("mac")) {
+            errorMsg = "IOS操作系统不支持";
+        } else {
+            errorMsg = "未识别到操作系统";
+        }
+        return errorMsg;
+    }
 }