xiewj 1 jaar geleden
bovenliggende
commit
268145ba51

+ 1 - 0
.gitignore

@@ -28,6 +28,7 @@ hs_err_pid*
 
 # IntelliJ project files
 ../.idea
+../.fleet
 *.iml
 out
 gen

+ 12 - 19
pom.xml

@@ -27,6 +27,7 @@
         <pagehelper.boot.version>1.3.1</pagehelper.boot.version>
         <sdk-version>1.4.53</sdk-version>
         <selenium.version>4.5.0</selenium.version>
+        <commons.fileupload.version>1.4</commons.fileupload.version>
 
     </properties>
     <dependencies>
@@ -83,26 +84,8 @@
         </dependency>
         <dependency>
             <groupId>com.fdkankan</groupId>
-            <artifactId>4dkankan-utils-fyun-oss</artifactId>
+            <artifactId>4dkankan-utils-filestorage</artifactId>
             <version>3.0.0-SNAPSHOT</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.redisson</groupId>
-                    <artifactId>redisson</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.bytedeco</groupId>
-                    <artifactId>javacpp</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.bytedeco</groupId>
-                    <artifactId>javacv</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.bytedeco</groupId>
-                    <artifactId>javacv-platform</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
         <dependency>
             <groupId>com.fdkankan</groupId>
@@ -150,6 +133,16 @@
             <artifactId>tlog-all-spring-boot-starter</artifactId>
             <version>${tlog-all-spring-boot-starter.version}</version>
         </dependency>
+        <dependency>
+            <groupId>com.github.ulisesbocchio</groupId>
+            <artifactId>jasypt-spring-boot-starter</artifactId>
+            <version>3.0.5</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>${commons.fileupload.version}</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 2 - 2
src/main/java/com/fdkk/bim/service/impl/BimFaceServiceImpl.java

@@ -6,7 +6,7 @@ import cn.hutool.http.HttpUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.filestorage.FileStorageTemplate;
 import com.fdkk.bim.bimEntity.dto.OfflineDatabagDTO;
 import com.fdkk.bim.bimEntity.dto.ProjectDTO;
 import com.fdkk.bim.bimEntity.dto.SourceDTO;
@@ -49,7 +49,7 @@ public class BimFaceServiceImpl extends ServiceImpl<BimFaceMapper, BimFaceEntity
     BimFaceClient bimFaceClient;
 
     @Resource
-    FYunFileServiceInterface ossFileService;
+    FileStorageTemplate fileStorageTemplate;
 
     @Resource
     BimCallBackClient bimCallBackClient;

+ 1 - 1
src/main/java/com/fdkk/bim/task/BizTask.java

@@ -120,7 +120,7 @@ public class BizTask {
    }
 
 
-    @Scheduled(initialDelay=10*1000, fixedDelay=1000*30)
+//    @Scheduled(initialDelay=10*1000, fixedDelay=1000*30)
     public void checkIntegral() throws InterruptedException {
         long allCount = bimFaceService.getAllCount();
         if (cache.hasKey("bim:count")){

+ 3 - 6
src/main/java/com/fdkk/bim/util/BimZipUtil.java

@@ -4,8 +4,7 @@ import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.ZipUtil;
 import cn.hutool.extra.spring.SpringUtil;
-import com.fdkankan.fyun.config.FYunFileConfig;
-import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.filestorage.FileStorageTemplate;
 import com.fdkk.bim.entity.entity.BimFaceEntity;
 import lombok.extern.slf4j.Slf4j;
 import com.fdkk.bim.config.BimConfig;
@@ -23,9 +22,8 @@ import java.util.Map;
 public class BimZipUtil {
 
     public static String UploadDataZip(String path,String projectId)  {
-        FYunFileServiceInterface ossFileService = SpringUtil.getBean(FYunFileServiceInterface.class);
+        FileStorageTemplate ossFileService = SpringUtil.getBean(FileStorageTemplate.class);
         BimConfig bimConfig = SpringUtil.getBean(BimConfig.class);
-        FYunFileConfig fYunFileConfig = SpringUtil.getBean(FYunFileConfig.class);
         File unzip = ZipUtil.unzip(path);
         String[] ossUrl = {""};
         FileUtil.walkFiles(unzip, file -> {
@@ -48,8 +46,7 @@ public class BimZipUtil {
                 ossUrl[0] =remoteFilePath.replace("viewToken.json","");
             }
         });
-
-        return fYunFileConfig.getHost().concat(ossUrl[0]);
+        return ossFileService.calculateUrl(ossUrl[0]);
     }
 
 //   public  static String handDataZip(String path) throws IOException, InterruptedException {

+ 91 - 0
src/main/resources/application-jp-prod.yml

@@ -0,0 +1,91 @@
+server:
+  port: 8787
+  servlet:
+    context-path: /bim
+
+spring:
+  resources:
+    chain:
+      strategy:
+        content:
+          enabled: true
+          paths: /**
+  servlet:
+    multipart:
+      enabled: true
+      max-request-size: 1024MB
+      max-file-size: 1024MB
+  # redis 配置
+  redis:
+    host: r-wz9owsphxqwi4ztqlf.redis.rds.aliyuncs.com
+    port: 6379
+    timeout: 6000ms
+    # 数据库索引
+    database: 3
+    password: 3oo19bgh0cae2406&
+    # cluster:
+    #   max-redirects: 3  # 获取失败 最大重定向次数
+    #   nodes:
+    #     - 120.25.146.52:6379
+    jedis:
+      pool:
+        max-active: 10  #连接池最大连接数(使用负值表示没有限制)
+        max-idle: 10 # 连接池中的最大空闲连接
+        min-idle: 5 # 连接池中的最小空闲连接
+        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
+    lettuce:
+      shutdown-timeout: 0ms
+  # 数据源配置
+  datasource:
+    type: com.zaxxer.hikari.HikariDataSource
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://rm-wz90w10465iiwwv09.mysql.rds.aliyuncs.com:3306/fdkk_bim?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    username: root
+    password: D2719bd0cae1a005
+    hikari:
+      minimum-idle: 5
+      idle-timeout: 600000
+      maximum-pool-size: 10
+      auto-commit: true
+      pool-name: MyHikariCP
+      max-lifetime: 1800000
+      connection-timeout: 30000
+      connection-test-query: SELECT 1
+
+tlog:
+  enable-invoke-time-print: true
+# 阿里云基本配置
+forest:
+  max-connections: 1000        # 连接池最大连接数
+  connect-timeout: 3000        # 连接超时时间,单位为毫秒
+  read-timeout: 3000           # 数据读取超时时间,单位为毫秒
+logging:
+  config: classpath:logback-spring.xml
+  maxHistory: 1
+  fdkk:
+    level: INFO
+  file:
+    path: /mnt/fdkk_bim/logs
+bimface:
+  appKey: 'uOaJWvZKlvGfQkqL6jlntMRC0RifHC8P'
+  appSecret: 'Fe8vmVqKdtfBT9E7v2vNYw7taIX9fClU'
+bim:
+  uploadPath: /mnt/fdkk_bim/uploadPath
+  defaultFolder: bim
+  webSite : https://bim.4dkankan.com
+  chromeDriver: /usr/local/bin/chromedriver
+  chromeBin: /usr/local/bin/google-chrome
+  mixIntegral : 200
+
+#    type: oss      阿里云 oss
+#    type: aws      亚马逊
+#    type: local    本地化
+upload:
+  type: oss
+fyun:
+  type: oss
+  key: LTAIUrvuHqj8pvry
+  secret: JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
+  bucket: 4dkankan
+  endPoint: http://oss-cn-shenzhen-internal.aliyuncs.com
+  host: https://4dkk.4dage.com/

+ 92 - 0
src/main/resources/application-jp-uat.yml

@@ -0,0 +1,92 @@
+server:
+  port: 8787
+  servlet:
+    context-path: /bim
+
+spring:
+  resources:
+    chain:
+      strategy:
+        content:
+          enabled: true
+          paths: /**
+  servlet:
+    multipart:
+      enabled: true
+      max-request-size: 1024MB
+      max-file-size: 1024MB
+  # redis 配置
+  redis:
+    host: 127.0.0.1
+    port: 6379
+    timeout: 6000ms
+    # 数据库索引
+    database: 3
+    password: '4dage7y4s0h'
+    # cluster:
+    #   max-redirects: 3  # 获取失败 最大重定向次数
+    #   nodes:
+    #     - 120.25.146.52:6379
+    jedis:
+      pool:
+        max-active: 10  #连接池最大连接数(使用负值表示没有限制)
+        max-idle: 10 # 连接池中的最大空闲连接
+        min-idle: 5 # 连接池中的最小空闲连接
+        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
+    lettuce:
+      shutdown-timeout: 0ms
+  # 数据源配置
+  datasource:
+    type: com.zaxxer.hikari.HikariDataSource
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://localhost:13306/fdkk_bim?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
+    username: root
+    password: Geosign@20211115%
+    hikari:
+      minimum-idle: 5
+      idle-timeout: 600000
+      maximum-pool-size: 10
+      auto-commit: true
+      pool-name: MyHikariCP
+      max-lifetime: 1800000
+      connection-timeout: 30000
+      connection-test-query: SELECT 1
+
+tlog:
+  enable-invoke-time-print: true
+# 阿里云基本配置
+forest:
+  max-connections: 1000        # 连接池最大连接数
+  connect-timeout: 3000        # 连接超时时间,单位为毫秒
+  read-timeout: 3000           # 数据读取超时时间,单位为毫秒
+logging:
+  config: classpath:logback-spring.xml
+  maxHistory: 1
+  fdkk:
+    level: INFO
+  file:
+    path: /mnt/fdkk_bim/logs
+bimface:
+  appKey: 'uOaJWvZKlvGfQkqL6jlntMRC0RifHC8P'
+  appSecret: 'Fe8vmVqKdtfBT9E7v2vNYw7taIX9fClU'
+bim:
+  uploadPath: /mnt/fdkk_bim/uploadPath
+  defaultFolder: bim
+  webSite : https://uat-bim.4dkankan.com
+  chromeDriver: /usr/local/bin/chromedriver
+  chromeBin: /usr/local/bin/google-chrome
+  mixIntegral : 200
+
+#    type: oss      阿里云 oss
+#    type: aws      亚马逊
+#    type: local    本地化
+filestorage:
+  active: oss
+  oss:
+    endpoint: http://oss-ap-northeast-1.aliyuncs.com
+    internal-endpoint: http://oss-ap-northeast-1.aliyuncs.com
+    access-key: ENC(U8UeO6r+PVmJ1Vj33SZxlyo7G53Bza8BBgKfoS+MqM1xrtYWW1Fv2g==)
+    access-key-secret: ENC(/VkyDP4a7U7KBUKT3mJ1KME2JUtsxEtucMmM7wavfLq9WztylWgSWQ==)
+    bucket: geosign-4dkk
+    bucket-custom-domain:
+      geosign-4dkk: https://oss.4dkankan.jp

+ 6 - 2
startJar.sh

@@ -20,11 +20,15 @@ checkEnv(){
                         echo "prod config"
                         APP_NAME=fdkk-bim-prod.jar
                         APP_DEBUG=5527
-          elif  [[ $1 = 'uat' ]] ; then
+            elif  [[ $1 = 'uat' ]] ; then
                         echo "uat config"
                         APP_NAME=fdkk-bim-uat.jar
                         APP_DEBUG=5522
-                      else
+            elif  [[ $1 = 'jp-uat' ]] ; then
+                        echo "jp-uat config"
+                        APP_NAME=fdkk-bim-jp-uat.jar
+                        APP_DEBUG=5522
+            else
                         echo "没有设置环境"
             fi
      # else