dsx 1 year ago
commit
37ae30d674
52 changed files with 2978 additions and 0 deletions
  1. 35 0
      .gitignore
  2. 1 0
      mybatis-flex.config
  3. 316 0
      pom.xml
  4. 20 0
      src/main/java/com/fdkankan/external/Application.java
  5. 39 0
      src/main/java/com/fdkankan/external/callback/ErrorCallback.java
  6. 25 0
      src/main/java/com/fdkankan/external/callback/SuccessCallback.java
  7. 49 0
      src/main/java/com/fdkankan/external/callback/SuccessCondition.java
  8. 31 0
      src/main/java/com/fdkankan/external/config/MyConfiguration.java
  9. 15 0
      src/main/java/com/fdkankan/external/config/MyConfigurationCustomizer.java
  10. 26 0
      src/main/java/com/fdkankan/external/controller/TestController.java
  11. 77 0
      src/main/java/com/fdkankan/external/entity/Camera.java
  12. 63 0
      src/main/java/com/fdkankan/external/entity/Department.java
  13. 47 0
      src/main/java/com/fdkankan/external/entity/DepartmentCamera.java
  14. 249 0
      src/main/java/com/fdkankan/external/entity/Scene.java
  15. 172 0
      src/main/java/com/fdkankan/external/entity/SceneEditInfo.java
  16. 88 0
      src/main/java/com/fdkankan/external/entity/SceneOfflinePackagePush.java
  17. 106 0
      src/main/java/com/fdkankan/external/entity/ScenePlus.java
  18. 166 0
      src/main/java/com/fdkankan/external/entity/ScenePlusExt.java
  19. 144 0
      src/main/java/com/fdkankan/external/generate/Codegen.java
  20. 45 0
      src/main/java/com/fdkankan/external/httpclient/HttpClient.java
  21. 14 0
      src/main/java/com/fdkankan/external/mapper/CameraMapper.java
  22. 14 0
      src/main/java/com/fdkankan/external/mapper/DepartmentCameraMapper.java
  23. 15 0
      src/main/java/com/fdkankan/external/mapper/DepartmentMapper.java
  24. 14 0
      src/main/java/com/fdkankan/external/mapper/SceneEditInfoMapper.java
  25. 14 0
      src/main/java/com/fdkankan/external/mapper/SceneMapper.java
  26. 14 0
      src/main/java/com/fdkankan/external/mapper/SceneOfflinePackagePushMapper.java
  27. 14 0
      src/main/java/com/fdkankan/external/mapper/ScenePlusExtMapper.java
  28. 14 0
      src/main/java/com/fdkankan/external/mapper/ScenePlusMapper.java
  29. 29 0
      src/main/java/com/fdkankan/external/schedule/ScheduleJob.java
  30. 19 0
      src/main/java/com/fdkankan/external/service/ICameraService.java
  31. 19 0
      src/main/java/com/fdkankan/external/service/IDepartmentCameraService.java
  32. 16 0
      src/main/java/com/fdkankan/external/service/IDepartmentService.java
  33. 14 0
      src/main/java/com/fdkankan/external/service/ISceneEditInfoService.java
  34. 22 0
      src/main/java/com/fdkankan/external/service/ISceneOfflinePackagePushService.java
  35. 18 0
      src/main/java/com/fdkankan/external/service/IScenePlusExtService.java
  36. 18 0
      src/main/java/com/fdkankan/external/service/IScenePlusService.java
  37. 16 0
      src/main/java/com/fdkankan/external/service/ISceneService.java
  38. 7 0
      src/main/java/com/fdkankan/external/service/ISsoService.java
  39. 27 0
      src/main/java/com/fdkankan/external/service/impl/CameraServiceImpl.java
  40. 26 0
      src/main/java/com/fdkankan/external/service/impl/DepartmentCameraServiceImpl.java
  41. 24 0
      src/main/java/com/fdkankan/external/service/impl/DepartmentServiceImpl.java
  42. 18 0
      src/main/java/com/fdkankan/external/service/impl/SceneEditInfoServiceImpl.java
  43. 269 0
      src/main/java/com/fdkankan/external/service/impl/SceneOfflinePackagePushServiceImpl.java
  44. 29 0
      src/main/java/com/fdkankan/external/service/impl/ScenePlusExtServiceImpl.java
  45. 35 0
      src/main/java/com/fdkankan/external/service/impl/ScenePlusServiceImpl.java
  46. 23 0
      src/main/java/com/fdkankan/external/service/impl/SceneServiceImpl.java
  47. 42 0
      src/main/java/com/fdkankan/external/service/impl/SsoServiceImpl.java
  48. 90 0
      src/main/java/com/fdkankan/external/util/Base64Converter.java
  49. 43 0
      src/main/resources/application-prod-eur.yml
  50. 43 0
      src/main/resources/application-prod.yml
  51. 68 0
      src/main/resources/application.yml
  52. 236 0
      src/main/resources/logback-spring.xml

+ 35 - 0
.gitignore

@@ -0,0 +1,35 @@
+# Created by .ignore support plugin (hsz.mobi)
+### Java template
+# Compiled class file
+*.class
+
+# Log file
+*.log
+
+# BlueJ files
+*.ctxt
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.nar
+*.ear
+*.zip
+*.tar.gz
+*.rar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+### Example user template template
+### Example user template
+
+# IntelliJ project files
+.idea
+*.iml
+out
+gen
+/**/target/

+ 1 - 0
mybatis-flex.config

@@ -0,0 +1 @@
+processor.enable=false

+ 316 - 0
pom.xml

@@ -0,0 +1,316 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.3.12.RELEASE</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>com.fdkankan</groupId>
+    <artifactId>4dkankan-center-external</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+
+    <repositories>
+        <repository>
+            <id>releases</id>
+            <url>http://192.168.0.115:8081/nexus-2.14.2-01/content/repositories/releases/</url>
+        </repository>
+        <repository>
+            <id>snapshots</id>
+            <url>http://192.168.0.115:8081/nexus-2.14.2-01/content/repositories/snapshots/</url>
+        </repository>
+        <repository>
+            <id>nexus-aliyun</id>
+            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
+        </repository>
+    </repositories>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <hutool-version>5.7.17</hutool-version>
+        <spring.cloud-version>Hoxton.SR8</spring.cloud-version>
+        <fdkankan.common-version>2.0.0-SNAPSHOT</fdkankan.common-version>
+        <fastjson-version>1.2.83</fastjson-version>
+        <servlet-api-version>2.4</servlet-api-version>
+        <spring.boot-mybatis-version>1.3.2</spring.boot-mybatis-version>
+        <spring.plugin.metadata-version>1.2.0.RELEASE</spring.plugin.metadata-version>
+        <jwt-version>3.10.3</jwt-version>
+        <ant-version>1.8.2</ant-version>
+        <shiro.version>1.7.1</shiro.version>
+        <version>0.6.0</version>
+        <jjwt.version>0.6.0</jjwt.version>
+        <protobuf-java.version>3.2.0</protobuf-java.version>
+        <commons-pool2.version>2.5.0</commons-pool2.version>
+        <zxing.version>2.1</zxing.version>
+    </properties>
+
+    <dependencies>
+
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.boot</groupId>-->
+<!--            <artifactId>spring-boot-starter-web</artifactId>-->
+<!--        </dependency>-->
+
+        <dependency>
+            <groupId>com.fdkankan</groupId>
+            <artifactId>4dkankan-common-web</artifactId>
+            <version>3.0.0-SNAPSHOT</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.bytedeco</groupId>
+                    <artifactId>javacv</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.bytedeco</groupId>
+                    <artifactId>javacpp</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.bytedeco</groupId>
+                    <artifactId>javacv-platform</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>joinery</groupId>
+                    <artifactId>jave</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.aliyun</groupId>
+                    <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.aliyun</groupId>
+                    <artifactId>aliyun-java-sdk-core</artifactId>
+                </exclusion>
+<!--                <exclusion>-->
+<!--                    <groupId>org.springframework</groupId>-->
+<!--                    <artifactId>spring-web</artifactId>-->
+<!--                </exclusion>-->
+                <exclusion>
+                    <groupId>com.alibaba.cloud</groupId>
+                    <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.alibaba.cloud</groupId>
+                    <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>${hutool-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${fastjson-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.yomahub</groupId>
+            <artifactId>tlog-web-spring-boot-starter</artifactId>
+            <version>1.3.6</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.yomahub</groupId>
+            <artifactId>tlog-feign-spring-boot-starter</artifactId>
+            <version>1.3.6</version>
+        </dependency>
+
+        <!--        htt请求工具-->
+        <dependency>
+            <groupId>com.dtflys.forest</groupId>
+            <artifactId>forest-spring-boot-starter</artifactId>
+            <version>1.5.19</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.firebase</groupId>
+            <artifactId>firebase-admin</artifactId>
+            <version>6.8.1</version>
+        </dependency>
+
+<!--        <dependency>-->
+<!--            <groupId>com.fdkankan</groupId>-->
+<!--            <artifactId>4dkankan-utils-db</artifactId>-->
+<!--            <version>3.0.0-SNAPSHOT</version>-->
+<!--        </dependency>-->
+
+        <dependency>
+            <groupId>com.mybatis-flex</groupId>
+            <artifactId>mybatis-flex-spring-boot-starter</artifactId>
+            <version>1.7.5</version>
+        </dependency>
+        <dependency>
+            <groupId>com.mybatis-flex</groupId>
+            <artifactId>mybatis-flex-processor</artifactId>
+            <version>1.7.5</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.mybatis-flex</groupId>
+            <artifactId>mybatis-flex-codegen</artifactId>
+            <version>1.7.5</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.zaxxer</groupId>
+            <artifactId>HikariCP</artifactId>
+            <version>4.0.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
+            <version>8.0.32</version>
+        </dependency>
+
+    </dependencies>
+
+    <dependencyManagement>
+
+        <dependencies>
+
+            <dependency>
+                <groupId>com.alibaba.cloud</groupId>
+                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
+                <version>2.2.7.RELEASE</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>${spring.cloud-version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+
+            <dependency>
+                <groupId>cn.hutool</groupId>
+                <artifactId>hutool-all</artifactId>
+                <version>${hutool-version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>fastjson</artifactId>
+                <version>${fastjson-version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>javax.servlet</groupId>
+                <artifactId>servlet-api</artifactId>
+                <version>${servlet-api-version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.mybatis.spring.boot</groupId>
+                <artifactId>mybatis-spring-boot-starter</artifactId>
+                <version>${spring.boot-mybatis-version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.springframework.plugin</groupId>
+                <artifactId>spring-plugin-metadata</artifactId>
+                <version>${spring.plugin.metadata-version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.auth0</groupId>
+                <artifactId>java-jwt</artifactId>
+                <version>${jwt-version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.ant</groupId>
+                <artifactId>ant</artifactId>
+                <version>${ant-version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.shiro</groupId>
+                <artifactId>shiro-spring</artifactId>
+                <version>${shiro.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>io.jsonwebtoken</groupId>
+                <artifactId>jjwt</artifactId>
+                <version>${jjwt.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.google.protobuf</groupId>
+                <artifactId>protobuf-java</artifactId>
+                <version>${protobuf-java.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-lang3</artifactId>
+                <version>${commons-lang3.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-pool2</artifactId>
+                <version>${commons-pool2.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-api</artifactId>
+                <version>2.17.0</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-to-slf4j</artifactId>
+                <version>2.17.0</version>
+            </dependency>
+
+        </dependencies>
+    </dependencyManagement>
+
+
+    <build>
+        <finalName>${artifactId}</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+    <distributionManagement>
+        <repository>
+            <id>releases</id>
+            <url>http://192.168.0.115:8081/nexus-2.14.2-01/content/repositories/releases/</url>
+        </repository>
+
+        <snapshotRepository>
+            <id>snapshots</id>
+            <url>http://192.168.0.115:8081/nexus-2.14.2-01/content/repositories/snapshots/</url>
+        </snapshotRepository>
+    </distributionManagement>
+
+</project>

+ 20 - 0
src/main/java/com/fdkankan/external/Application.java

@@ -0,0 +1,20 @@
+package com.fdkankan.external;
+
+import com.dtflys.forest.springboot.annotation.ForestScan;
+import com.mybatisflex.core.FlexGlobalConfig;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+@SpringBootApplication
+@MapperScan("com.fdkankan.external.mapper")
+@ForestScan(basePackages = "com.fdkankan.external.httpclient")
+@EnableScheduling
+public class Application {
+    public static void main(String[] args) {
+        SpringApplication.run(Application.class, args);
+    }
+}

+ 39 - 0
src/main/java/com/fdkankan/external/callback/ErrorCallback.java

@@ -0,0 +1,39 @@
+package com.fdkankan.external.callback;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.dtflys.forest.callback.OnError;
+import com.dtflys.forest.exceptions.ForestRuntimeException;
+import com.dtflys.forest.http.ForestRequest;
+import com.dtflys.forest.http.ForestResponse;
+import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.web.response.ResultData;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/4/25
+ **/
+@Slf4j
+public class ErrorCallback implements OnError {
+
+    @Override
+    public void onError(ForestRuntimeException e, ForestRequest forestRequest,
+        ForestResponse forestResponse) {
+        JSONObject jsonObject = JSON.parseObject(forestResponse.getContent());
+        Integer status = jsonObject.getInteger("status");
+        if(status != null && status == 500){
+            log.error("接口报错,url:{},status:{},error:{}", forestRequest.getUrl(), status, jsonObject.getString("error"));
+            throw e;
+        }
+        ResultData result = JSON.parseObject(forestResponse.getContent(), ResultData.class);
+        if(result.getCode() != 0){
+            throw new BusinessException(result.getCode(), result.getMessage());
+        }
+        throw new BusinessException(-1, "未知异常");
+    }
+}

+ 25 - 0
src/main/java/com/fdkankan/external/callback/SuccessCallback.java

@@ -0,0 +1,25 @@
+package com.fdkankan.external.callback;
+
+import com.dtflys.forest.callback.OnSuccess;
+import com.dtflys.forest.http.ForestRequest;
+import com.dtflys.forest.http.ForestResponse;
+import com.fdkankan.web.response.ResultData;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/4/25
+ **/
+@Slf4j
+public class SuccessCallback implements OnSuccess<ResultData> {
+
+    @Override
+    public void onSuccess(ResultData result, ForestRequest forestRequest,
+        ForestResponse forestResponse) {
+        log.info("请求成功,url:{},result:{}", forestRequest.getUrl(), forestResponse.getContent());
+    }
+}

+ 49 - 0
src/main/java/com/fdkankan/external/callback/SuccessCondition.java

@@ -0,0 +1,49 @@
+package com.fdkankan.external.callback;
+
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
+import com.dtflys.forest.callback.SuccessWhen;
+import com.dtflys.forest.http.ForestRequest;
+import com.dtflys.forest.http.ForestResponse;
+import com.fdkankan.web.response.ResultData;
+
+/**
+ * <p>
+ *  自定义成功/失败条件实现类
+ *  需要实现 SuccessWhen 接口
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/4/25
+ **/
+
+public class SuccessCondition implements SuccessWhen {
+
+    /**
+     * 请求成功条件
+     * @param req Forest请求对象
+     * @param res Forest响应对象
+     * @return 是否成功,true: 请求成功,false: 请求失败
+     */
+    @Override
+    public boolean successWhen(ForestRequest req, ForestResponse res) {
+        boolean reqStatus = res.noException() &&   // 请求过程没有异常
+            res.statusOk() &&     // 并且状态码在 100 ~ 399 范围内
+            res.statusIsNot(203);
+        if(!reqStatus){
+            return reqStatus;
+        }
+
+        String content = res.getContent();
+        if(StrUtil.isEmpty(content)){
+            reqStatus = false;
+            return reqStatus;
+        }
+        ResultData result = JSON.parseObject(content, ResultData.class);
+        if(result.getCode() != 0){
+            reqStatus = false;
+            return reqStatus;
+        }
+        return true;
+    }
+}

+ 31 - 0
src/main/java/com/fdkankan/external/config/MyConfiguration.java

@@ -0,0 +1,31 @@
+package com.fdkankan.external.config;
+
+import com.mybatisflex.core.FlexGlobalConfig;
+import com.mybatisflex.core.logicdelete.LogicDeleteProcessor;
+import com.mybatisflex.core.logicdelete.impl.DefaultLogicDeleteProcessor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+
+@Configuration
+public class MyConfiguration {
+
+    @Bean
+    @Order()
+    public FlexGlobalConfig logicDeleteProcessor(){
+
+        FlexGlobalConfig globalConfig = FlexGlobalConfig.getDefaultConfig();
+
+        globalConfig.setLogicDeleteColumn("recStatus");
+
+        //设置数据库正常时的值
+        globalConfig.setNormalValueOfLogicDelete("A");
+
+        //设置数据已被删除时的值
+        globalConfig.setDeletedValueOfLogicDelete("I");
+
+
+        return globalConfig;
+    }
+
+}

+ 15 - 0
src/main/java/com/fdkankan/external/config/MyConfigurationCustomizer.java

@@ -0,0 +1,15 @@
+package com.fdkankan.external.config;
+
+import com.mybatisflex.core.mybatis.FlexConfiguration;
+import com.mybatisflex.spring.boot.ConfigurationCustomizer;
+import org.apache.ibatis.logging.stdout.StdOutImpl;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class MyConfigurationCustomizer implements ConfigurationCustomizer {
+
+    @Override
+    public void customize(FlexConfiguration configuration) {
+        configuration.setLogImpl(StdOutImpl.class);
+    }
+}

+ 26 - 0
src/main/java/com/fdkankan/external/controller/TestController.java

@@ -0,0 +1,26 @@
+package com.fdkankan.external.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.dtflys.forest.annotation.Post;
+import com.fdkankan.external.entity.Department;
+import com.fdkankan.external.service.IDepartmentService;
+import com.fdkankan.web.response.ResultData;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/test")
+public class TestController {
+
+    @Autowired
+    private IDepartmentService departmentService;
+
+    @PostMapping
+    public ResultData test(@RequestBody Map<String, Object> param){
+        return ResultData.ok(JSON.toJSONString(param));
+    }
+
+}

+ 77 - 0
src/main/java/com/fdkankan/external/entity/Camera.java

@@ -0,0 +1,77 @@
+package com.fdkankan.external.entity;
+
+import com.mybatisflex.annotation.Column;
+import com.mybatisflex.annotation.Id;
+import com.mybatisflex.annotation.KeyType;
+import com.mybatisflex.annotation.Table;
+import java.io.Serializable;
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 相机主表 实体类。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(value = "t_camera")
+public class Camera implements Serializable {
+
+    @Id(keyType = KeyType.Auto)
+    private Long id;
+
+    /**
+     * 相机的Mac地址
+     */
+    private String childName;
+
+    /**
+     * 激活时间
+     */
+    private LocalDateTime activatedTime;
+
+    /**
+     * 相机密码
+     */
+    private String childPassword;
+
+    /**
+     * sn码
+     */
+    private String snCode;
+
+    /**
+     * wifi名称
+     */
+    private String wifiName;
+
+    /**
+     * wifi密码
+     */
+    private String wifiPassword;
+
+    /**
+     * 创建时间
+     */
+    private Timestamp createTime;
+
+    /**
+     * 更新时间
+     */
+    private Timestamp updateTime;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @Column(isLogicDelete = true)
+    private String recStatus;
+
+}

+ 63 - 0
src/main/java/com/fdkankan/external/entity/Department.java

@@ -0,0 +1,63 @@
+package com.fdkankan.external.entity;
+
+import com.mybatisflex.annotation.Column;
+import com.mybatisflex.annotation.Id;
+import com.mybatisflex.annotation.KeyType;
+import com.mybatisflex.annotation.Table;
+import java.io.Serializable;
+import java.math.BigInteger;
+import java.sql.Timestamp;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 单位表 实体类。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(value = "t_department")
+public class Department implements Serializable {
+
+    @Id(keyType = KeyType.Auto)
+    private BigInteger id;
+
+    /**
+     * 单位名称
+     */
+    private String name;
+
+    /**
+     * 单位编号
+     */
+    private String code;
+
+    /**
+     * 管理后台账号
+     */
+    private String manageUserName;
+
+    /**
+     * 管理后台密码
+     */
+    private String managePassword;
+
+    /**
+     * 压缩包推送地址
+     */
+    private String destUrl;
+
+    private Timestamp createTime;
+
+    private Timestamp updateTime;
+
+    @Column(isLogicDelete = true)
+    private String recStatus;
+
+}

+ 47 - 0
src/main/java/com/fdkankan/external/entity/DepartmentCamera.java

@@ -0,0 +1,47 @@
+package com.fdkankan.external.entity;
+
+import com.mybatisflex.annotation.Column;
+import com.mybatisflex.annotation.Id;
+import com.mybatisflex.annotation.KeyType;
+import com.mybatisflex.annotation.Table;
+import java.io.Serializable;
+import java.sql.Timestamp;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 单位相机表 实体类。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(value = "t_department_camera")
+public class DepartmentCamera implements Serializable {
+
+    @Id(keyType = KeyType.Auto)
+    private Long id;
+
+    /**
+     * 单位id
+     */
+    private Long departmentId;
+
+    /**
+     * 相机编码
+     */
+    private String snCode;
+
+    private Timestamp createTime;
+
+    private Timestamp updateTime;
+
+    @Column(isLogicDelete = true)
+    private String recStatus;
+
+}

+ 249 - 0
src/main/java/com/fdkankan/external/entity/Scene.java

@@ -0,0 +1,249 @@
+package com.fdkankan.external.entity;
+
+import com.mybatisflex.annotation.Id;
+import com.mybatisflex.annotation.KeyType;
+import com.mybatisflex.annotation.Table;
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ *  实体类。
+ *
+ * @author dsx
+ * @since 2023-12-11
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(value = "t_scene")
+public class Scene implements Serializable {
+
+    /**
+     * 主键
+     */
+    @Id(keyType = KeyType.Auto)
+    private Long id;
+
+    /**
+     * 创建者
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新者
+     */
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 逻辑未删除值0,逻辑已删除值1
+     */
+    private String deleted;
+
+    /**
+     * 场景码
+     */
+    private String sceneCode;
+
+    /**
+     * 文件基础路径
+     */
+    private String path;
+
+    /**
+     * 状态, -1:场景被删;0:计算中;1:计算失败;2:计算成功;3:封存(目前未使用此状态);4:重算中
+     */
+    private Integer status;
+
+    /**
+     * 重算次数
+     */
+    private Integer recount;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    private String childName;
+
+    /**
+     * sn码
+     */
+    private String snCode;
+
+    /**
+     * 拍摄时间
+     */
+    private LocalDateTime shootTime;
+
+    /**
+     * 展示链接
+     */
+    private String webSite;
+
+    /**
+     * 用户id
+     */
+    private Integer userId;
+
+    /**
+     * (用户名)手机号
+     */
+    private String userName;
+
+    /**
+     * 封面图地址
+     */
+    private String initPic;
+
+    /**
+     * 访问密码
+     */
+    private String password;
+
+    /**
+     * 是否公开,默认公开
+     */
+    private Integer isOpen;
+
+    /**
+     * 是否要禁止显示平面图 默认false
+     */
+    private Integer disableFloorPan;
+
+    /**
+     * 平面图类型,默认default
+     */
+    private String floorPanType;
+
+    /**
+     * 默认las文件地址
+     */
+    private String lasUrl;
+
+    /**
+     * 0表示全景图 1表示点云
+     */
+    private Integer showMode;
+
+    /**
+     * 浏览次数
+     */
+    private Integer viewCount;
+
+    /**
+     * 协作人id
+     */
+    private Integer cooperationUserId;
+
+    /**
+     * 协作人手机号
+     */
+    private String cooperationUserName;
+
+    /**
+     * 数据集ID
+     */
+    private String datasetId;
+
+    /**
+     * 上传次数
+     */
+    private Integer uploadCount;
+
+    /**
+     * 默认ply文件地址
+     */
+    private String plyUrl;
+
+    /**
+     * 默认obj文件地址
+     */
+    private String objUrl;
+
+    /**
+     * 生成OBJ状态,0,未生成 1完成,2计算中
+     */
+    private Integer buildObjStatus;
+
+    /**
+     * 是否复制,默认否
+     */
+    private Integer isCopy;
+
+    /**
+     * 复制时间
+     */
+    private LocalDateTime copyTime;
+
+    /**
+     * 场景版本
+     */
+    private String sceneVersion;
+
+    /**
+     * 离线包版本,和重算次数对比
+     */
+    private Integer offlineVer;
+
+    /**
+     * 离线包地址
+     */
+    private String offlineUrl;
+
+    /**
+     * 离线包状态是否需要重新生成 1 不需要 2需要
+     */
+    private Integer offlineStatus;
+
+    /**
+     * 场景来源:相机拍摄10以内表示,1表示八目,2双目,3转台,4 激光 5深光  其他来源10以上,11:一键换装,12:123看房,13文通虚拟场景
+     */
+    private Integer sceneSource;
+
+    /**
+     * 计算完成时间
+     */
+    private LocalDateTime algorithmTime;
+
+    /**
+     * 判断是否为slam场景,深光和深时 以前的场景都是4
+     */
+    private Integer location;
+
+    /**
+     * 拍摄点位数量
+     */
+    private Integer shootCount;
+
+    /**
+     * 使用容量
+     */
+    private Long space;
+
+    /**
+     * 离线包版本-提供自动推送
+     */
+    private Integer offlineVerForPush;
+
+}

+ 172 - 0
src/main/java/com/fdkankan/external/entity/SceneEditInfo.java

@@ -0,0 +1,172 @@
+package com.fdkankan.external.entity;
+
+import com.mybatisflex.annotation.Id;
+import com.mybatisflex.annotation.KeyType;
+import com.mybatisflex.annotation.Table;
+import java.io.Serializable;
+import java.math.BigInteger;
+import java.sql.Timestamp;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ *  实体类。
+ *
+ * @author dsx
+ * @since 2023-12-12
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(value = "t_scene_edit_info")
+public class SceneEditInfo implements Serializable {
+
+    /**
+     * 主键
+     */
+    @Id(keyType = KeyType.Auto)
+    private BigInteger id;
+
+    private Long sceneProId;
+
+    private Long scenePlusId;
+
+    /**
+     * 地面logo名称
+     */
+    private String floorLogo;
+
+    /**
+     * 地面logo大小
+     */
+    private Integer floorLogoSize;
+
+    /**
+     * 地面logo文件名称
+     */
+    private String floorLogoFile;
+
+    /**
+     * 背景音乐名称
+     */
+    private String music;
+
+    /**
+     * 背景音乐文件名称
+     */
+    private String musicFile;
+
+    /**
+     * 浏览密码
+     */
+    private String scenePassword;
+
+    /**
+     * 场景标题
+     */
+    private String title;
+
+    /**
+     * 场景描述
+     */
+    private String description;
+
+    /**
+     * 用户是否上传户型图(0-否,1-是)
+     */
+    private Integer floorPlanUser;
+
+    /**
+     * 是否有热点数据(0-否,1-是)
+     */
+    private Integer tags;
+
+    /**
+     * 版本
+     */
+    private Integer version;
+
+    /**
+     * 图片版本
+     */
+    private Integer imgVersion;
+
+    /**
+     * 场景关联版本
+     */
+    private Integer linkVersion;
+
+    /**
+     * 是否上传模型
+     */
+    private Integer isUploadObj;
+
+    /**
+     * 重新建模的版本
+     */
+    private Integer floorEditVer;
+
+    /**
+     * 正式发布重新建模的版本
+     */
+    private Integer floorPublishVer;
+
+    /**
+     * 空间视频数据
+     */
+    private String boxVideos;
+
+    /**
+     * 空间贴图数据
+     */
+    private String boxPhotos;
+
+    /**
+     * 空间模型数据
+     */
+    private String boxModels;
+
+    /**
+     * 是否需要处理球幕视频
+     */
+    private Integer buildVideoStatus;
+
+    /**
+     * 初始点信息
+     */
+    private String entry;
+
+    /**
+     * 加载logo名
+     */
+    private String loadingLogo;
+
+    /**
+     * 加载logo文件名
+     */
+    private String loadingLogoFile;
+
+    /**
+     * 用户上传自定义平面图数据
+     */
+    private String floorPlanUpload;
+
+    /**
+     * 创建时间
+     */
+    private Timestamp createTime;
+
+    /**
+     * 修改时间
+     */
+    private Timestamp updateTime;
+
+    /**
+     * A-有效,I-无效
+     */
+    private String recStatus;
+
+}

+ 88 - 0
src/main/java/com/fdkankan/external/entity/SceneOfflinePackagePush.java

@@ -0,0 +1,88 @@
+package com.fdkankan.external.entity;
+
+import com.mybatisflex.annotation.Column;
+import com.mybatisflex.annotation.Id;
+import com.mybatisflex.annotation.KeyType;
+import com.mybatisflex.annotation.Table;
+import java.io.Serializable;
+import java.math.BigInteger;
+import java.sql.Timestamp;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 场景离线包推送表 实体类。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(value = "t_scene_offline_package_push")
+public class SceneOfflinePackagePush implements Serializable {
+
+    @Id(keyType = KeyType.Auto)
+    private BigInteger id;
+
+    /**
+     * 单位id
+     */
+    private BigInteger departmentId;
+
+    /**
+     * 推送url
+     */
+    private String destUrl;
+
+    /**
+     * 压缩包存储地址
+     */
+    private String zipPath;
+
+    /**
+     * 存储类型
+     */
+    private String storageType;
+
+    /**
+     * 相机编码
+     */
+    private String snCode;
+
+    /**
+     * 场景码
+     */
+    private String num;
+
+    /**
+     * 1-kankan,2-laser
+     */
+    private String zipType;
+
+    /**
+     * 打包时场景版本号
+     */
+    private Integer version;
+
+    /**
+     * 推送状态(-1-失败,0-推送中,1-成功)
+     */
+    private Integer pushStatus;
+
+    /**
+     * 压缩包删除状态(0-未删除,1-已删除)
+     */
+    private Integer zipDelStatus;
+
+    private Timestamp createTime;
+
+    private Timestamp updateTime;
+
+    @Column(isLogicDelete = true)
+    private String recStatus;
+
+}

+ 106 - 0
src/main/java/com/fdkankan/external/entity/ScenePlus.java

@@ -0,0 +1,106 @@
+package com.fdkankan.external.entity;
+
+import com.mybatisflex.annotation.Column;
+import com.mybatisflex.annotation.Id;
+import com.mybatisflex.annotation.KeyType;
+import com.mybatisflex.annotation.Table;
+import java.io.Serializable;
+import java.sql.Timestamp;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 场景主表 实体类。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(value = "t_scene_plus")
+public class ScenePlus implements Serializable {
+
+    @Id(keyType = KeyType.Auto)
+    private Long id;
+
+    /**
+     * 场景码
+     */
+    private String num;
+
+    /**
+     * 用户id
+     */
+    private Long userId;
+
+    /**
+     * 相机id
+     */
+    private Long cameraId;
+
+    /**
+     * 手机id
+     */
+    private String phoneId;
+
+    /**
+     * 场景名称
+     */
+    private String title;
+
+    /**
+     * 场景描述
+     */
+    private String description;
+
+    /**
+     * 场景状态:0-未建好,1--已建好,-1-计算出错,-2--不在官网显示
+     */
+    private Integer sceneStatus;
+
+    /**
+     * 场景来源:相机拍摄10以内表示,1表示八目,2双目,3转台,4 激光  其他来源10以上,11:一键换装,12:123看房,13文通虚拟场景
+     */
+    private Integer sceneSource;
+
+    /**
+     * 支付状态:0表示未付款,1表示付款了,-1表示欠费,-2表示容量不足
+     */
+    private Integer payStatus;
+
+    /**
+     * 场景类型  0-其他,1-文博,2-地产,3-电商,4-餐饮,5-家居,99-一件换装虚拟房源
+     */
+    private Integer sceneType;
+
+    /**
+     * 是否推荐:0-否,1-是
+     */
+    private Integer recommend;
+
+    /**
+     * 是否有housetype文件(0-否,1-是)
+     */
+    private Integer houseType;
+
+    /**
+     * 创建时间
+     */
+    private Timestamp createTime;
+
+    /**
+     * 更新时间
+     */
+    private Timestamp updateTime;
+
+    /**
+     * A-有效,I-无效
+     */
+    @Column(isLogicDelete = true)
+    private String recStatus;
+
+}

+ 166 - 0
src/main/java/com/fdkankan/external/entity/ScenePlusExt.java

@@ -0,0 +1,166 @@
+package com.fdkankan.external.entity;
+
+import com.mybatisflex.annotation.Column;
+import com.mybatisflex.annotation.Id;
+import com.mybatisflex.annotation.KeyType;
+import com.mybatisflex.annotation.Table;
+import java.io.Serializable;
+import java.sql.Timestamp;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ *  实体类。
+ *
+ * @author dsx
+ * @since 2023-12-11
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(value = "t_scene_plus_ext")
+public class ScenePlusExt implements Serializable {
+
+    @Id(keyType = KeyType.Auto)
+    private Long id;
+
+    /**
+     * t_scene_plus主键
+     */
+    private Long plusId;
+
+    /**
+     * 场景数据目录
+     */
+    private String dataSource;
+
+    /**
+     * 场景链接
+     */
+    private String webSite;
+
+    /**
+     * 缩略图链接
+     */
+    private String thumb;
+
+    /**
+     * 方案:1-双目,2-转台,3-六目,4-八目,10-获取4k图,11-获取2k,12-获取1k
+     */
+    private Integer sceneScheme;
+
+    /**
+     * 使用用量
+     */
+    private Long space;
+
+    /**
+     * 原始文件容量
+     */
+    private Long origSpace;
+
+    /**
+     * 云服务器类型
+     */
+    private String ecs;
+
+    /**
+     * 点位数量
+     */
+    private Long shootCount;
+
+    /**
+     * 浏览次数
+     */
+    private Integer viewCount;
+
+    /**
+     * gps定位
+     */
+    private String gps;
+
+    /**
+     * 算法类型(slam、sfm)
+     */
+    private String algorithm;
+
+    /**
+     * 固件版本
+     */
+    private String firmwareVersion;
+
+    /**
+     * 算法类型(V2,V3)
+     */
+    private String buildType;
+
+    /**
+     * 分辨率(2k,4k)
+     */
+    private String sceneResolution;
+
+    /**
+     * 场景来源,lite:双目lite相机,pro:八目相机,minion:双面转台相机,laser:激光相机,virtual:虚拟场景,sketch:图片建模场景
+     */
+    private String sceneFrom;
+
+    /**
+     * 切图方式(tiles:瓦片图,face:切片图,pano:全景图 ,local:本地切片,cube:立体图)
+     */
+    private String sceneKind;
+
+    /**
+     * 算法生成模型类型(dam,3dtiles)
+     */
+    private String modelKind;
+
+    /**
+     * 点位视频
+     */
+    private String videos;
+
+    /**
+     * oss桶名
+     */
+    private String yunFileBucket;
+
+    /**
+     * 算法计算完成时间
+     */
+    private Timestamp algorithmTime;
+
+    /**
+     * 计算耗时
+     */
+    private Long computeTime;
+
+    /**
+     * 拍摄模式:3(SFM架站式-看看场景), 
+        4(SFM架站式-看见/深时/深光场景),
+        5(SLAM移动定位模式) ,
+        6(SLAM移动定位模式-有点位)
+     */
+    private Integer location;
+
+    /**
+     * 创建时间
+     */
+    private Timestamp createTime;
+
+    /**
+     * 更新时间
+     */
+    private Timestamp updateTime;
+
+    /**
+     * A-有效,I-无效
+     */
+    @Column(isLogicDelete = true)
+    private String recStatus;
+
+    private Integer isObj;
+
+}

+ 144 - 0
src/main/java/com/fdkankan/external/generate/Codegen.java

@@ -0,0 +1,144 @@
+package com.fdkankan.external.generate;
+
+import com.mybatisflex.codegen.Generator;
+import com.mybatisflex.codegen.config.ColumnConfig;
+import com.mybatisflex.codegen.config.GlobalConfig;
+import com.zaxxer.hikari.HikariDataSource;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class Codegen {
+
+    public static void main(String[] args) {
+        //配置数据源
+        HikariDataSource dataSource = new HikariDataSource();
+        dataSource.setJdbcUrl("jdbc:mysql://120.24.144.164:3306/4dkankan_v4");
+        dataSource.setUsername("root");
+        dataSource.setPassword("4Dage@4Dage#@168");
+
+        String[] tables = new String[]{"t_scene_edit_info"};//,"t_scene_offline_package_push","t_department_camera"
+
+                //创建配置内容,两种风格都可以。
+        GlobalConfig globalConfig = createGlobalConfigUseStyle1(tables);
+//        GlobalConfig globalConfig = createGlobalConfigUseStyle4Laser(tables);
+
+        //通过 datasource 和 globalConfig 创建代码生成器
+        Generator generator = new Generator(dataSource, globalConfig);
+
+        //生成代码
+        generator.generate();
+    }
+
+    public static GlobalConfig createGlobalConfigUseStyle1(String[] tables) {
+        //创建配置内容
+        GlobalConfig globalConfig = new GlobalConfig();
+
+        globalConfig.setEntityOverwriteEnable(true);
+
+        //设置根包
+        globalConfig.setBasePackage("com.fdkankan.external");
+
+        //设置表前缀和只生成哪些表
+        globalConfig.setTablePrefix("t_");
+        globalConfig.setGenerateTable(tables);
+
+
+        //设置生成 entity 并启用 Lombok
+        globalConfig.setEntityGenerateEnable(true);
+        globalConfig.setEntityWithLombok(true);
+
+        //设置生成 mapper
+        globalConfig.setMapperGenerateEnable(true);
+
+        globalConfig.setServiceGenerateEnable(true);
+        globalConfig.setServiceClassPrefix("I");
+
+        globalConfig.setServiceImplGenerateEnable(true);
+
+        Map<String, ColumnConfig> columnConfigMap = new HashMap<>();
+
+        //主键设置
+        ColumnConfig primaryKey = new ColumnConfig();
+        primaryKey.setPrimaryKey(true);
+        columnConfigMap.put("id", primaryKey);
+
+        globalConfig.setColumnConfigMap(columnConfigMap);
+
+        return globalConfig;
+    }
+
+    public static GlobalConfig createGlobalConfigUseStyle4Laser(String[] tables) {
+        //创建配置内容
+        GlobalConfig globalConfig = new GlobalConfig();
+
+        globalConfig.setEntityOverwriteEnable(true);
+
+        //设置根包
+        globalConfig.setBasePackage("com.fdkankan.external");
+
+        //设置表前缀和只生成哪些表
+        globalConfig.setTablePrefix("t_");
+        globalConfig.setGenerateTable(tables);
+
+
+        //设置生成 entity 并启用 Lombok
+        globalConfig.setEntityGenerateEnable(true);
+        globalConfig.setEntityWithLombok(true);
+
+        //设置生成 mapper
+        globalConfig.setMapperGenerateEnable(true);
+
+        globalConfig.setServiceGenerateEnable(true);
+        globalConfig.setServiceClassPrefix("I");
+
+        globalConfig.setServiceImplGenerateEnable(true);
+
+        Map<String, ColumnConfig> columnConfigMap = new HashMap<>();
+
+        //主键设置
+        ColumnConfig primaryKey = new ColumnConfig();
+        primaryKey.setPrimaryKey(true);
+        columnConfigMap.put("id", primaryKey);
+
+        //逻辑删除字段设置
+        ColumnConfig logicDelete = new ColumnConfig();
+        logicDelete.setLogicDelete(true);
+        columnConfigMap.put("rec_status", logicDelete);
+
+        globalConfig.setColumnConfigMap(columnConfigMap);
+
+        return globalConfig;
+    }
+
+    public static GlobalConfig createGlobalConfigUseStyle2() {
+        //创建配置内容
+        GlobalConfig globalConfig = new GlobalConfig();
+
+        //设置根包
+        globalConfig.getPackageConfig()
+                .setBasePackage("com.test");
+
+        //设置表前缀和只生成哪些表,setGenerateTable 未配置时,生成所有表
+        globalConfig.getStrategyConfig()
+                .setTablePrefix("tb_")
+                .setGenerateTable("tb_account", "tb_account_session");
+
+        //设置生成 entity 并启用 Lombok
+        globalConfig.enableEntity()
+                .setWithLombok(true);
+
+        //设置生成 mapper
+        globalConfig.enableMapper();
+
+        //可以单独配置某个列
+        ColumnConfig columnConfig = new ColumnConfig();
+        columnConfig.setColumnName("tenant_id");
+        columnConfig.setLarge(true);
+        columnConfig.setVersion(true);
+        globalConfig.getStrategyConfig()
+                .setColumnConfig("tb_account", columnConfig);
+
+        return globalConfig;
+    }
+}

+ 45 - 0
src/main/java/com/fdkankan/external/httpclient/HttpClient.java

@@ -0,0 +1,45 @@
+package com.fdkankan.external.httpclient;
+
+import com.dtflys.forest.annotation.*;
+import com.dtflys.forest.callback.OnError;
+import com.dtflys.forest.callback.OnSuccess;
+import com.fdkankan.external.callback.SuccessCondition;
+import com.fdkankan.web.response.ResultData;
+import com.yomahub.tlog.forest.TLogForestInterceptor;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/4/24
+ **/
+@Success(condition = SuccessCondition.class)
+public interface HttpClient {
+
+    @Get(
+        url="{url}",
+        interceptor = TLogForestInterceptor.class    //加这个拦截器,打印的tlog日志会详细一些,包括头信息等等
+    )
+    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
+    ResultData<Map<String, Object>> get(@Var("url") String url, @Header Map<String, Object> headerMap, OnSuccess<ResultData> onSuccess, OnError onError);
+
+    @Post(
+            url="{url}",
+            interceptor = TLogForestInterceptor.class    //加这个拦截器,打印的tlog日志会详细一些,包括头信息等等
+    )
+    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
+    ResultData<Map<String, Object>> post(@Var("url") String url, @Header Map<String, Object> headerMap, @JSONBody Object param, OnSuccess<ResultData> onSuccess, OnError onError);
+
+    @Post(
+            url="{url}", timeout = 5 * 1000//
+//            ,
+//            interceptor = TLogForestInterceptor.class    //加这个拦截器,打印的tlog日志会详细一些,包括头信息等等
+    )
+    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
+    ResultData post2(@Var("url") String url, @JSONBody Object param, OnSuccess<ResultData> onSuccess, OnError onError);
+
+}

+ 14 - 0
src/main/java/com/fdkankan/external/mapper/CameraMapper.java

@@ -0,0 +1,14 @@
+package com.fdkankan.external.mapper;
+
+import com.mybatisflex.core.BaseMapper;
+import com.fdkankan.external.entity.Camera;
+
+/**
+ * 相机主表 映射层。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+public interface CameraMapper extends BaseMapper<Camera> {
+
+}

+ 14 - 0
src/main/java/com/fdkankan/external/mapper/DepartmentCameraMapper.java

@@ -0,0 +1,14 @@
+package com.fdkankan.external.mapper;
+
+import com.mybatisflex.core.BaseMapper;
+import com.fdkankan.external.entity.DepartmentCamera;
+
+/**
+ * 单位相机表 映射层。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+public interface DepartmentCameraMapper extends BaseMapper<DepartmentCamera> {
+
+}

+ 15 - 0
src/main/java/com/fdkankan/external/mapper/DepartmentMapper.java

@@ -0,0 +1,15 @@
+package com.fdkankan.external.mapper;
+
+import com.mybatisflex.core.BaseMapper;
+import com.fdkankan.external.entity.Department;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 单位表 映射层。
+ *
+ * @author dsx
+ * @since 2023-12-07
+ */
+public interface DepartmentMapper extends BaseMapper<Department> {
+
+}

+ 14 - 0
src/main/java/com/fdkankan/external/mapper/SceneEditInfoMapper.java

@@ -0,0 +1,14 @@
+package com.fdkankan.external.mapper;
+
+import com.mybatisflex.core.BaseMapper;
+import com.fdkankan.external.entity.SceneEditInfo;
+
+/**
+ *  映射层。
+ *
+ * @author dsx
+ * @since 2023-12-12
+ */
+public interface SceneEditInfoMapper extends BaseMapper<SceneEditInfo> {
+
+}

+ 14 - 0
src/main/java/com/fdkankan/external/mapper/SceneMapper.java

@@ -0,0 +1,14 @@
+package com.fdkankan.external.mapper;
+
+import com.mybatisflex.core.BaseMapper;
+import com.fdkankan.external.entity.Scene;
+
+/**
+ *  映射层。
+ *
+ * @author dsx
+ * @since 2023-12-11
+ */
+public interface SceneMapper extends BaseMapper<Scene> {
+
+}

+ 14 - 0
src/main/java/com/fdkankan/external/mapper/SceneOfflinePackagePushMapper.java

@@ -0,0 +1,14 @@
+package com.fdkankan.external.mapper;
+
+import com.mybatisflex.core.BaseMapper;
+import com.fdkankan.external.entity.SceneOfflinePackagePush;
+
+/**
+ * 场景离线包推送表 映射层。
+ *
+ * @author dsx
+ * @since 2023-12-07
+ */
+public interface SceneOfflinePackagePushMapper extends BaseMapper<SceneOfflinePackagePush> {
+
+}

+ 14 - 0
src/main/java/com/fdkankan/external/mapper/ScenePlusExtMapper.java

@@ -0,0 +1,14 @@
+package com.fdkankan.external.mapper;
+
+import com.mybatisflex.core.BaseMapper;
+import com.fdkankan.external.entity.ScenePlusExt;
+
+/**
+ *  映射层。
+ *
+ * @author dsx
+ * @since 2023-12-11
+ */
+public interface ScenePlusExtMapper extends BaseMapper<ScenePlusExt> {
+
+}

+ 14 - 0
src/main/java/com/fdkankan/external/mapper/ScenePlusMapper.java

@@ -0,0 +1,14 @@
+package com.fdkankan.external.mapper;
+
+import com.mybatisflex.core.BaseMapper;
+import com.fdkankan.external.entity.ScenePlus;
+
+/**
+ * 场景主表 映射层。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+public interface ScenePlusMapper extends BaseMapper<ScenePlus> {
+
+}

+ 29 - 0
src/main/java/com/fdkankan/external/schedule/ScheduleJob.java

@@ -0,0 +1,29 @@
+package com.fdkankan.external.schedule;
+
+import com.fdkankan.external.service.ISceneOfflinePackagePushService;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+
+@Log4j2
+@Component
+public class ScheduleJob {
+
+    @Autowired
+    private ISceneOfflinePackagePushService sceneOfflinePackagePushService;
+
+
+    /**
+     * 中国文物信息中心场景推送任务
+     * 每隔十分钟推送一次
+     */
+    @Scheduled(fixedRate = 10*60*1000)
+    public void scenePush4Zgwwxxzx() {
+        log.info("中国文物信息中心场景推送任务开始");
+        sceneOfflinePackagePushService.scenePushScheduleHandler("aaa");
+        log.info("中国文物信息中心场景推送任务结束");
+    }
+}

+ 19 - 0
src/main/java/com/fdkankan/external/service/ICameraService.java

@@ -0,0 +1,19 @@
+package com.fdkankan.external.service;
+
+import com.mybatisflex.core.service.IService;
+import com.fdkankan.external.entity.Camera;
+
+import java.util.List;
+
+/**
+ * 相机主表 服务层。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+public interface ICameraService extends IService<Camera> {
+
+    List<Camera> listBySnCodeList(List<String> snCodeList);
+
+
+}

+ 19 - 0
src/main/java/com/fdkankan/external/service/IDepartmentCameraService.java

@@ -0,0 +1,19 @@
+package com.fdkankan.external.service;
+
+import com.mybatisflex.core.service.IService;
+import com.fdkankan.external.entity.DepartmentCamera;
+
+import java.math.BigInteger;
+import java.util.List;
+
+/**
+ * 单位相机表 服务层。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+public interface IDepartmentCameraService extends IService<DepartmentCamera> {
+
+    List<DepartmentCamera> listByDepartmentId(BigInteger DepartmentId);
+
+}

+ 16 - 0
src/main/java/com/fdkankan/external/service/IDepartmentService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.external.service;
+
+import com.mybatisflex.core.service.IService;
+import com.fdkankan.external.entity.Department;
+
+/**
+ * 单位表 服务层。
+ *
+ * @author dsx
+ * @since 2023-12-07
+ */
+public interface IDepartmentService extends IService<Department> {
+
+    Department getByCode(String code);
+
+}

+ 14 - 0
src/main/java/com/fdkankan/external/service/ISceneEditInfoService.java

@@ -0,0 +1,14 @@
+package com.fdkankan.external.service;
+
+import com.mybatisflex.core.service.IService;
+import com.fdkankan.external.entity.SceneEditInfo;
+
+/**
+ *  服务层。
+ *
+ * @author dsx
+ * @since 2023-12-12
+ */
+public interface ISceneEditInfoService extends IService<SceneEditInfo> {
+
+}

+ 22 - 0
src/main/java/com/fdkankan/external/service/ISceneOfflinePackagePushService.java

@@ -0,0 +1,22 @@
+package com.fdkankan.external.service;
+
+import com.mybatisflex.core.service.IService;
+import com.fdkankan.external.entity.SceneOfflinePackagePush;
+
+import java.util.Map;
+
+/**
+ * 场景离线包推送表 服务层。
+ *
+ * @author dsx
+ * @since 2023-12-07
+ */
+public interface ISceneOfflinePackagePushService extends IService<SceneOfflinePackagePush> {
+
+    void scenePushScheduleHandler(String departmentCode);
+
+    SceneOfflinePackagePush getLastByCondition(SceneOfflinePackagePush condition);
+
+    void scenePushHandler(SceneOfflinePackagePush push, Map<String, Object> headers);
+
+}

+ 18 - 0
src/main/java/com/fdkankan/external/service/IScenePlusExtService.java

@@ -0,0 +1,18 @@
+package com.fdkankan.external.service;
+
+import com.mybatisflex.core.service.IService;
+import com.fdkankan.external.entity.ScenePlusExt;
+
+import java.math.BigInteger;
+
+/**
+ *  服务层。
+ *
+ * @author dsx
+ * @since 2023-12-11
+ */
+public interface IScenePlusExtService extends IService<ScenePlusExt> {
+
+    ScenePlusExt getByPlusId(Long plusId);
+
+}

+ 18 - 0
src/main/java/com/fdkankan/external/service/IScenePlusService.java

@@ -0,0 +1,18 @@
+package com.fdkankan.external.service;
+
+import com.mybatisflex.core.service.IService;
+import com.fdkankan.external.entity.ScenePlus;
+
+import java.util.List;
+
+/**
+ * 场景主表 服务层。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+public interface IScenePlusService extends IService<ScenePlus> {
+
+    List<ScenePlus> listByCameraIdList(List<Long> cameraIdList);
+
+}

+ 16 - 0
src/main/java/com/fdkankan/external/service/ISceneService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.external.service;
+
+import com.mybatisflex.core.service.IService;
+import com.fdkankan.external.entity.Scene;
+
+/**
+ *  服务层。
+ *
+ * @author dsx
+ * @since 2023-12-11
+ */
+public interface ISceneService extends IService<Scene> {
+
+    Scene getBySceneCode(String sceneCode);
+
+}

+ 7 - 0
src/main/java/com/fdkankan/external/service/ISsoService.java

@@ -0,0 +1,7 @@
+package com.fdkankan.external.service;
+
+public interface ISsoService {
+
+    public String manageLogin(String userName, String password);
+
+}

+ 27 - 0
src/main/java/com/fdkankan/external/service/impl/CameraServiceImpl.java

@@ -0,0 +1,27 @@
+package com.fdkankan.external.service.impl;
+
+import com.mybatisflex.annotation.UseDataSource;
+import com.mybatisflex.core.query.QueryWrapper;
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+import com.fdkankan.external.entity.Camera;
+import com.fdkankan.external.mapper.CameraMapper;
+import com.fdkankan.external.service.ICameraService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 相机主表 服务层实现。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+@UseDataSource("www")
+@Service
+public class CameraServiceImpl extends ServiceImpl<CameraMapper, Camera> implements ICameraService {
+
+    @Override
+    public List<Camera> listBySnCodeList(List<String> snCodeList) {
+        return this.list(new QueryWrapper().in(Camera::getSnCode, snCodeList));
+    }
+}

+ 26 - 0
src/main/java/com/fdkankan/external/service/impl/DepartmentCameraServiceImpl.java

@@ -0,0 +1,26 @@
+package com.fdkankan.external.service.impl;
+
+import com.mybatisflex.core.query.QueryWrapper;
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+import com.fdkankan.external.entity.DepartmentCamera;
+import com.fdkankan.external.mapper.DepartmentCameraMapper;
+import com.fdkankan.external.service.IDepartmentCameraService;
+import org.springframework.stereotype.Service;
+
+import java.math.BigInteger;
+import java.util.List;
+
+/**
+ * 单位相机表 服务层实现。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+@Service
+public class DepartmentCameraServiceImpl extends ServiceImpl<DepartmentCameraMapper, DepartmentCamera> implements IDepartmentCameraService {
+
+    @Override
+    public List<DepartmentCamera> listByDepartmentId(BigInteger DepartmentId) {
+        return this.list(new QueryWrapper().eq(DepartmentCamera::getDepartmentId, DepartmentId));
+    }
+}

+ 24 - 0
src/main/java/com/fdkankan/external/service/impl/DepartmentServiceImpl.java

@@ -0,0 +1,24 @@
+package com.fdkankan.external.service.impl;
+
+import com.mybatisflex.annotation.UseDataSource;
+import com.mybatisflex.core.query.QueryWrapper;
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+import com.fdkankan.external.entity.Department;
+import com.fdkankan.external.mapper.DepartmentMapper;
+import com.fdkankan.external.service.IDepartmentService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 单位表 服务层实现。
+ *
+ * @author dsx
+ * @since 2023-12-07
+ */
+@Service
+public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements IDepartmentService {
+
+    @Override
+    public Department getByCode(String code) {
+        return this.getOne(new QueryWrapper().eq(Department::getCode, code));
+    }
+}

+ 18 - 0
src/main/java/com/fdkankan/external/service/impl/SceneEditInfoServiceImpl.java

@@ -0,0 +1,18 @@
+package com.fdkankan.external.service.impl;
+
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+import com.fdkankan.external.entity.SceneEditInfo;
+import com.fdkankan.external.mapper.SceneEditInfoMapper;
+import com.fdkankan.external.service.ISceneEditInfoService;
+import org.springframework.stereotype.Service;
+
+/**
+ *  服务层实现。
+ *
+ * @author dsx
+ * @since 2023-12-12
+ */
+@Service
+public class SceneEditInfoServiceImpl extends ServiceImpl<SceneEditInfoMapper, SceneEditInfo> implements ISceneEditInfoService {
+
+}

+ 269 - 0
src/main/java/com/fdkankan/external/service/impl/SceneOfflinePackagePushServiceImpl.java

@@ -0,0 +1,269 @@
+package com.fdkankan.external.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.date.TimeInterval;
+import cn.hutool.core.thread.ExecutorBuilder;
+import cn.hutool.core.thread.ThreadUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.common.constant.CommonStatus;
+import com.fdkankan.common.constant.CommonSuccessStatus;
+import com.fdkankan.common.constant.SceneSource;
+import com.fdkankan.external.callback.ErrorCallback;
+import com.fdkankan.external.callback.SuccessCallback;
+import com.fdkankan.external.entity.*;
+import com.fdkankan.external.httpclient.HttpClient;
+import com.fdkankan.external.service.*;
+import com.fdkankan.web.response.ResultData;
+import com.mybatisflex.annotation.UseDataSource;
+import com.mybatisflex.core.query.QueryWrapper;
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+import com.fdkankan.external.mapper.SceneOfflinePackagePushMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.math.BigInteger;
+import java.util.*;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.stream.Collectors;
+
+/**
+ * 场景离线包推送表 服务层实现。
+ *
+ * @author dsx
+ * @since 2023-12-07
+ */
+@Slf4j
+@Service
+public class SceneOfflinePackagePushServiceImpl extends ServiceImpl<SceneOfflinePackagePushMapper, SceneOfflinePackagePush> implements ISceneOfflinePackagePushService {
+
+    @Value("${host.4dkk.manage}")
+    private String fdkkManageHost;
+    @Value("${host.4dkk.scene}")
+    private String fdkkSceneHost;
+
+    @Value("${api.4dkk.manage.checkDownLoad}")
+    private String checkDownLoadUrl;
+    @Value("${api.4dkk.manage.downScene}")
+    private String downSceneUrl;
+    @Value("${api.4dkk.manage.downloadProcess}")
+    private String downloadProcessUrl;
+    @Value("${api.4dkk.scene.getInfo}")
+    private String getInfoUrl;
+
+    private final static ThreadPoolExecutor threadPoolExecutor = ExecutorBuilder.create().setCorePoolSize(1).setMaxPoolSize(3).build();
+
+    @Autowired
+    private IDepartmentService departmentService;
+    @Autowired
+    private IDepartmentCameraService departmentCameraService;
+    @Autowired
+    private IScenePlusService scenePlusService;
+    @Autowired
+    private ISsoService ssoService;
+    @Autowired
+    private IScenePlusExtService scenePlusExtService;
+    @Autowired
+    private ISceneOfflinePackagePushService sceneOfflinePackagePushService;
+    @Autowired
+    private ISceneService sceneService;
+    @Autowired
+    private HttpClient httpClient;
+    @Autowired
+    private ICameraService cameraService;
+
+
+
+    @Override
+    public void scenePushScheduleHandler(String departmentCode) {
+
+        Department department = departmentService.getByCode(departmentCode);
+        if(Objects.isNull(department)){
+            return;
+        }
+        List<DepartmentCamera> departmentCameraList = departmentCameraService.listByDepartmentId(department.getId());
+        if(CollUtil.isEmpty(departmentCameraList)){
+            return;
+        }
+        List<String> snCodeList = departmentCameraList.stream().map(DepartmentCamera::getSnCode).collect(Collectors.toList());
+
+        List<Camera> cameras = cameraService.listBySnCodeList(snCodeList);
+        if(CollUtil.isEmpty(cameras)){
+            return;
+        }
+        Map<Long, String> snCodeMap = cameras.stream().collect(Collectors.toMap(Camera::getId, Camera::getSnCode));
+        List<Long> cameraIdList = cameras.stream().map(Camera::getId).collect(Collectors.toList());
+
+        List<ScenePlus> scenePlusList = scenePlusService.listByCameraIdList(cameraIdList);
+        if(CollUtil.isEmpty(scenePlusList)){
+            return;
+        }
+
+        //模拟管理后台登录
+        String token = ssoService.manageLogin(department.getManageUserName(), department.getManagePassword());
+        Map<String, Object> headers = new HashMap<>();
+        headers.put("token", token);
+
+        SceneOfflinePackagePush condition =
+                SceneOfflinePackagePush.builder()
+                        .departmentId(department.getId())
+                        .pushStatus(CommonSuccessStatus.SUCCESS.code())
+                        .build();
+        for (ScenePlus scenePlus : scenePlusList) {
+            try {
+                condition.setNum(scenePlus.getNum());
+
+                SceneOfflinePackagePush commonPush =
+                        SceneOfflinePackagePush.builder()
+                                .departmentId(department.getId())
+                                .destUrl(department.getDestUrl())
+                                .storageType("oss")
+                                .snCode(snCodeMap.get(scenePlus.getCameraId()))
+                                .num(scenePlus.getNum()).build();
+                ScenePlusExt scenePlusExt = null;
+
+                //点云场景推送
+                int isObj = CommonStatus.NO.code();
+                if(scenePlus.getSceneSource() == SceneSource.JG.code() || scenePlus.getSceneSource() == SceneSource.SG.code()){
+                    condition.setZipType("laser");
+                    SceneOfflinePackagePush lastPush = sceneOfflinePackagePushService.getLastByCondition(condition);
+                    Scene scene = sceneService.getBySceneCode(scenePlus.getNum());
+                    if(Objects.isNull(scene)){
+                        throw new RuntimeException("未查询到激光系统场景信息,场景码:" + scenePlus.getNum());
+                    }
+                    //如果没有推送过或者推送过但是版本号不一致,就需要推送
+                    if(Objects.isNull(lastPush) || lastPush.getVersion() != scene.getOfflineVerForPush()){
+                        threadPoolExecutor.submit(()->{
+                            SceneOfflinePackagePush push = BeanUtil.copyProperties(commonPush, SceneOfflinePackagePush.class);
+                            push.setZipType("laser");
+                            push.setVersion(scene.getOfflineVerForPush());
+                            try {
+                                sceneOfflinePackagePushService.scenePushHandler(push, headers);
+                            }catch (Exception e){
+                                log.error("场景推送失败,num:{}",scenePlus.getNum(), e);
+                            }
+                        });
+                    }
+                    scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
+                    isObj = scenePlusExt.getIsObj();
+                }
+
+                //看看场景推送
+                if(scenePlus.getSceneSource() == SceneSource.BM.code()
+                        || scenePlus.getSceneSource() == SceneSource.ZT.code()
+                        || isObj == CommonStatus.YES.code()){
+
+                    condition.setZipType("kankan");
+                    SceneOfflinePackagePush lastPush = sceneOfflinePackagePushService.getLastByCondition(condition);
+
+                    //查询版本号
+                    String getInfo = fdkkSceneHost.concat(String.format(getInfoUrl, scenePlus.getNum()));
+                    ResultData<Map<String, Object>> mapResultData = httpClient.get(getInfo, new HashMap<>(), new SuccessCallback(), new ErrorCallback());
+                    int version =  (int)mapResultData.getData().get("version");
+
+                    //如果没有推送过或者推送过但是版本号不一致,就需要推送
+                    if(Objects.isNull(lastPush) || lastPush.getVersion() != version){
+                        threadPoolExecutor.submit(()->{
+                            SceneOfflinePackagePush push = BeanUtil.copyProperties(commonPush, SceneOfflinePackagePush.class);
+                            push.setZipType("kankan");
+                            push.setVersion(version);
+                            try {
+                                sceneOfflinePackagePushService.scenePushHandler(push, headers);
+                            }catch (Exception e){
+                                log.error("场景推送失败,num:{}",scenePlus.getNum(), e);
+                            }
+                        });
+                    }
+                }
+            }catch (Exception e){
+                log.error("场景推送失败,num:{}",scenePlus.getNum(), e);
+            }
+        }
+    }
+
+    @Override
+    public SceneOfflinePackagePush getLastByCondition(SceneOfflinePackagePush condition) {
+
+        QueryWrapper wrapper = new QueryWrapper();
+        wrapper.eq(SceneOfflinePackagePush::getDepartmentId, condition.getDepartmentId());
+        wrapper.eq(SceneOfflinePackagePush::getNum, condition.getNum());
+        wrapper.orderBy(SceneOfflinePackagePush::getId, false);
+        wrapper.limit(1);
+        if(StrUtil.isNotEmpty(condition.getZipType())){
+            wrapper.eq(SceneOfflinePackagePush::getZipType, condition.getZipType());
+        }
+        if(Objects.nonNull(condition.getPushStatus())){
+            wrapper.eq(SceneOfflinePackagePush::getPushStatus, condition.getPushStatus());
+        }
+
+        return this.getOne(wrapper);
+    }
+
+    @Override
+    public void scenePushHandler(SceneOfflinePackagePush push, Map<String, Object> headers){
+        String num = push.getNum();
+        String zipType = push.getZipType();
+        String downloadUrl = null;
+
+        try {
+            //校验场景下载
+            String url = fdkkManageHost.concat(String.format(checkDownLoadUrl, num));
+            ResultData<Map<String, Object>> resultData = httpClient.get(url, headers, new SuccessCallback(), new ErrorCallback());
+            Map<String, Object> data = resultData.getData();
+            int downloadStatus = (int) data.get("downloadStatus");
+            if (downloadStatus == 3) {
+                downloadUrl = (String) data.get("downloadUrl");
+            } else {
+                if (downloadStatus == 0 || downloadStatus == 2) {
+                    url = this.fdkkManageHost.concat(String.format(downSceneUrl, num));
+                    httpClient.get(url, headers, new SuccessCallback(), new ErrorCallback());
+                }
+
+                //计时
+                TimeInterval timer = DateUtil.timer();
+                url = this.fdkkManageHost.concat(String.format(this.downloadProcessUrl, num));
+                boolean exit = false;
+                do {
+                    ResultData<Map<String, Object>> mapResultData = httpClient.get(url, headers, new SuccessCallback(), new ErrorCallback());
+                    data = mapResultData.getData();
+                    int status = (int) data.get("status");
+                    if (status == 1002) {
+                        downloadUrl = (String) data.get("url");
+                        exit = true;
+                    }
+                    if (status == 1003) {
+                        exit = true;
+                        log.error("下载失败,num:{}", num);
+                        throw new RuntimeException("下载失败,num:" + num);
+                    }
+                    if (timer.intervalMinute() > 8 * 60) {
+                        exit = true;
+                        log.error("下载超时,num:{}", num);
+                        throw new RuntimeException("下载超时,num:" + num);
+                    }
+                } while (!exit);
+            }
+
+            //开始推送到第三方服务
+            if(StrUtil.isNotEmpty(downloadUrl)){
+                Map<String, Object> params = new HashMap<>();
+                params.put("num", num);
+                params.put("zipType", zipType);
+                params.put("downloadUrl", downloadUrl);
+                ResultData pushRes = httpClient.post2(push.getDestUrl(), params, new SuccessCallback(), new ErrorCallback());
+            }
+            push.setPushStatus(CommonSuccessStatus.SUCCESS.code());
+            push.setZipPath(downloadUrl);
+        }catch (Exception e){
+            log.error("场景推送失败,num:{}", num, e);
+            push.setPushStatus(CommonSuccessStatus.FAIL.code());
+        }
+
+        this.saveOrUpdate(push);
+    }
+}

+ 29 - 0
src/main/java/com/fdkankan/external/service/impl/ScenePlusExtServiceImpl.java

@@ -0,0 +1,29 @@
+package com.fdkankan.external.service.impl;
+
+import com.mybatisflex.annotation.UseDataSource;
+import com.mybatisflex.core.query.QueryWrapper;
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+import com.fdkankan.external.entity.ScenePlusExt;
+import com.fdkankan.external.mapper.ScenePlusExtMapper;
+import com.fdkankan.external.service.IScenePlusExtService;
+import org.springframework.stereotype.Service;
+
+import java.math.BigInteger;
+import java.sql.Wrapper;
+
+/**
+ *  服务层实现。
+ *
+ * @author dsx
+ * @since 2023-12-11
+ */
+@UseDataSource("www")
+@Service
+public class ScenePlusExtServiceImpl extends ServiceImpl<ScenePlusExtMapper, ScenePlusExt> implements IScenePlusExtService {
+
+
+    @Override
+    public ScenePlusExt getByPlusId(Long plusId) {
+        return this.getOne(QueryWrapper.create().eq(ScenePlusExt::getPlusId, plusId));
+    }
+}

+ 35 - 0
src/main/java/com/fdkankan/external/service/impl/ScenePlusServiceImpl.java

@@ -0,0 +1,35 @@
+package com.fdkankan.external.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import com.fdkankan.external.entity.Camera;
+import com.fdkankan.external.service.ICameraService;
+import com.mybatisflex.annotation.UseDataSource;
+import com.mybatisflex.core.query.QueryWrapper;
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+import com.fdkankan.external.entity.ScenePlus;
+import com.fdkankan.external.mapper.ScenePlusMapper;
+import com.fdkankan.external.service.IScenePlusService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 场景主表 服务层实现。
+ *
+ * @author dsx
+ * @since 2023-12-08
+ */
+@UseDataSource("www")
+@Service
+public class ScenePlusServiceImpl extends ServiceImpl<ScenePlusMapper, ScenePlus> implements IScenePlusService {
+
+    @Override
+    public List<ScenePlus> listByCameraIdList(List<Long> cameraIdList) {
+        if(CollUtil.isEmpty(cameraIdList)){
+            return null;
+        }
+        return this.list(new QueryWrapper().in(ScenePlus::getCameraId, cameraIdList).in(ScenePlus::getSceneStatus, -2, 1).eq(ScenePlus::getPayStatus, 1));
+    }
+}

+ 23 - 0
src/main/java/com/fdkankan/external/service/impl/SceneServiceImpl.java

@@ -0,0 +1,23 @@
+package com.fdkankan.external.service.impl;
+
+import com.mybatisflex.core.query.QueryWrapper;
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+import com.fdkankan.external.entity.Scene;
+import com.fdkankan.external.mapper.SceneMapper;
+import com.fdkankan.external.service.ISceneService;
+import org.springframework.stereotype.Service;
+
+/**
+ *  服务层实现。
+ *
+ * @author dsx
+ * @since 2023-12-11
+ */
+@Service
+public class SceneServiceImpl extends ServiceImpl<SceneMapper, Scene> implements ISceneService {
+
+    @Override
+    public Scene getBySceneCode(String sceneCode) {
+        return this.getOne(QueryWrapper.create().eq(Scene::getSceneCode, sceneCode).ne(Scene::getDeleted, 1).eq(Scene::getStatus, 2));
+    }
+}

+ 42 - 0
src/main/java/com/fdkankan/external/service/impl/SsoServiceImpl.java

@@ -0,0 +1,42 @@
+package com.fdkankan.external.service.impl;
+
+import cn.hutool.core.util.StrUtil;
+import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.external.callback.ErrorCallback;
+import com.fdkankan.external.callback.SuccessCallback;
+import com.fdkankan.external.httpclient.HttpClient;
+import com.fdkankan.external.service.ISsoService;
+import com.fdkankan.external.util.Base64Converter;
+import com.fdkankan.web.response.ResultData;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+public class SsoServiceImpl implements ISsoService {
+
+    @Value("${host.4dkk.manage}")
+    private String manageHost;
+    @Value("${api.4dkk.manage.login}")
+    private String manageLoginApi;
+    @Autowired
+    private HttpClient httpClient;
+
+    @Override
+    public String manageLogin(String userName, String password) {
+        String passwordEncode = Base64Converter.getEncode(Base64Converter.encode(password));
+        Map<String, String> loginParams = new HashMap<>();
+        loginParams.put("userName", userName);
+        loginParams.put("password", passwordEncode);
+        ResultData<Map<String, Object>> loginResult = httpClient.post(this.manageHost.concat(manageLoginApi), new HashMap<>(), loginParams, new SuccessCallback(), new ErrorCallback());
+        String token = (String) loginResult.getData().get("token");
+        if (StrUtil.isEmpty(token)) {
+            throw new BusinessException(ErrorCode.AUTH_FAIL);
+        }
+        return token;
+    }
+}

+ 90 - 0
src/main/java/com/fdkankan/external/util/Base64Converter.java

@@ -0,0 +1,90 @@
+package com.fdkankan.external.util;
+
+import java.io.UnsupportedEncodingException;
+import java.util.Base64;
+
+public class Base64Converter {
+
+    public final static Base64.Encoder encoder = Base64.getEncoder();
+    final static Base64.Decoder decoder = Base64.getDecoder();
+    static char[] arr = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
+
+    /**
+     * 给字符串加密
+     * @param text
+     * @return
+     */
+    public static String encode(String text) {
+        byte[] textByte = new byte[0];
+        try {
+            textByte = text.getBytes("UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        String encodedText = encoder.encodeToString(textByte);
+        return encodedText;
+    }
+
+    /**
+     * 给字符串加密
+     * @param textByte
+     * @return
+     */
+    public static String encode(byte[] textByte) {
+        return encoder.encodeToString(textByte);
+    }
+
+    /**
+     * 将加密后的字符串进行解密
+     * @param encodedText
+     * @return
+     */
+    public static String decode(String encodedText) {
+        String text = null;
+        try {
+            text = new String(decoder.decode(encodedText), "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        return text;
+    }
+
+    /**
+     * 根据逻辑截取加密后的密碼
+     * @param text
+     * @return
+     */
+    public static String subText(String text){
+        //去掉前8位字符串
+        text = text.substring(8);
+        //去掉后8位字符串
+        text = text.substring(0, text.length() - 8);
+        //最后两个字符串换到前面,并且去掉剩下的后8位字符串
+        String result = text.substring(text.length() - 2) + text.substring(0, text.length() - 10);
+        return result;
+    }
+
+
+    public static  String getEncode(String str){
+        int num = 2;
+        String front = randomWord(8);
+        String middle = randomWord(8);
+        String end = randomWord(8);
+
+        String str1 = str.substring(0, num);
+        String str2 = str.substring(num);
+
+        return front + str2 + middle + str1 + end ;
+    }
+
+    public static String randomWord ( Integer min) {
+        String str = "";
+        Integer range = min;
+        // 随机产生
+        for (int i = 0; i < range; i++) {
+            int pos = (int) Math.round(Math.random() * (arr.length - 1));
+            str += arr[pos];
+        }
+        return str;
+    }
+}

+ 43 - 0
src/main/resources/application-prod-eur.yml

@@ -0,0 +1,43 @@
+server:
+  port: 10002
+spring:
+  application:
+    name: 4dkankan-center-external
+account:
+  username: super-admin
+  password: 4Dagemanage
+host: https://eur.4dkankan.com
+api:
+  login: /service/manage/login
+  checkDownLoad: /service/manage/scene/checkDownLoad?num=%s
+  downScene: /service/manage/scene/downScene?num=%s
+  downloadProcess: /service/manage/scene/downloadProcess?num=%s
+
+download:
+  dir: /mnt/scene_download/
+  task: ${download.dir}task.txt
+  id: ${download.dir}id.txt
+
+forest:
+  ## 日志总开关,打开/关闭Forest请求/响应日志(默认为 true)
+  log-enabled: true
+  ## 打开/关闭Forest请求日志(默认为 true)
+  log-request: true
+  ## 打开/关闭Forest响应状态日志(默认为 true)
+  log-response-status: true
+  ## 打开/关闭Forest响应内容日志(默认为 false)
+  log-response-content: true
+  ## 请求超时时间,单位为毫秒, 默认值为3000
+  timeout: 10000
+  ## 连接超时时间,单位为毫秒, 默认值为2000
+  connect-timeout: 10000
+
+logging:
+  path: /home/backend/4dkankan_v4
+
+
+
+
+
+
+

+ 43 - 0
src/main/resources/application-prod.yml

@@ -0,0 +1,43 @@
+server:
+  port: 10002
+spring:
+  application:
+    name: 4dkankan-scene-download-tool
+account:
+  username: super-admin
+  password: 4Dagemanage
+host: https://www.4dkankan.com
+api:
+  login: /service/manage/login
+  checkDownLoad: /service/manage/scene/checkDownLoad?num=%s
+  downScene: /service/manage/scene/downScene?num=%s
+  downloadProcess: /service/manage/scene/downloadProcess?num=%s
+
+download:
+  dir: /mnt/scene_download/
+  task: ${download.dir}task.txt
+  id: ${download.dir}id.txt
+
+forest:
+  ## 日志总开关,打开/关闭Forest请求/响应日志(默认为 true)
+  log-enabled: true
+  ## 打开/关闭Forest请求日志(默认为 true)
+  log-request: true
+  ## 打开/关闭Forest响应状态日志(默认为 true)
+  log-response-status: true
+  ## 打开/关闭Forest响应内容日志(默认为 false)
+  log-response-content: true
+  ## 请求超时时间,单位为毫秒, 默认值为3000
+  timeout: 10000
+  ## 连接超时时间,单位为毫秒, 默认值为2000
+  connect-timeout: 10000
+
+logging:
+  path: /home/backend/4dkankan_v4
+
+
+
+
+
+
+

+ 68 - 0
src/main/resources/application.yml

@@ -0,0 +1,68 @@
+server:
+  port: 10002
+spring:
+  application:
+    name: 4dkankan-scene-download-tool
+    # DataSource Config
+#  datasource:
+#    url: jdbc:mysql://120.24.144.164:3306/4dkankan_center_external
+#    username: root
+#    password: 4Dage@4Dage#@168
+account:
+  username: super-admin
+  password: Aa123456
+host:
+  4dkk:
+    manage: https://v4-uat.4dkankan.com
+    scene: https://test.4dkankan.com
+api:
+  4dkk:
+    manage:
+      login: /service/manage/login
+      checkDownLoad: /service/manage/scene/checkDownLoad?num=%s
+      downScene: /service/manage/scene/downScene?num=%s
+      downloadProcess: /service/manage/scene/downloadProcess?num=%s
+    scene:
+      getInfo: /service/scene/getInfo?num=%s
+
+download:
+  dir: D:\test2\
+  task: ${download.dir}task.txt
+  id: ${download.dir}id.txt
+
+forest:
+  ## 日志总开关,打开/关闭Forest请求/响应日志(默认为 true)
+  log-enabled: true
+  ## 打开/关闭Forest请求日志(默认为 true)
+  log-request: true
+  ## 打开/关闭Forest响应状态日志(默认为 true)
+  log-response-status: true
+  ## 打开/关闭Forest响应内容日志(默认为 false)
+  log-response-content: true
+  ## 请求超时时间,单位为毫秒, 默认值为3000
+  timeout: 10000
+  ## 连接超时时间,单位为毫秒, 默认值为2000
+  connect-timeout: 10000
+
+logging:
+  path: /home/backend/4dkankan_v4
+
+mybatis-flex:
+  datasource:
+    primary:
+      url: jdbc:mysql://120.24.144.164:3306/4dkankan_center_external
+      username: root
+      password: 4Dage@4Dage#@168
+    www:
+      url: jdbc:mysql://120.24.144.164:3306/4dkankan_v4
+      username: root
+      password: 4Dage@4Dage#@168
+    laser:
+      url: jdbc:mysql://120.25.146.52:13306/fdkk_laser
+      username: root
+      password: JK123456%JIK
+
+
+
+
+

+ 236 - 0
src/main/resources/logback-spring.xml

@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
+<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
+<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
+<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
+<configuration scan="true" scanPeriod="10 seconds">
+
+	<springProperty scope="context" name="LOG_PATH" source="logging.path"/>
+
+	<contextName>logback</contextName>
+	<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
+	<property name="log.path" value="${LOG_PATH}/scene_download/logs" />
+
+	<!-- 彩色日志 -->
+	<!-- 彩色日志依赖的渲染类 -->
+	<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
+	<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
+	<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
+	<!-- 彩色日志格式 -->
+	<property name="CONSOLE_LOG_PATTERN"
+		value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
+
+	<!--输出到控制台 -->
+	<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+		<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息 -->
+		<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+			<level>info</level>
+		</filter>
+		<encoder>
+			<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
+			<!-- 设置字符集 -->
+			<charset>UTF-8</charset>
+		</encoder>
+	</appender>
+	<!--输出到文件 -->
+
+	<!-- 时间滚动输出 level为 DEBUG 日志 -->
+	<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!-- 正在记录的日志文件的路径及文件名 -->
+		<file>${log.path}/log_debug.log</file>
+		<!--日志文件输出格式 -->
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<charset>UTF-8</charset> <!-- 设置字符集 -->
+		</encoder>
+		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<!-- 日志归档 -->
+			<fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log
+			</fileNamePattern>
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<maxFileSize>100MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+			<!--日志文件保留天数 -->
+			<maxHistory>15</maxHistory>
+		</rollingPolicy>
+		<!-- 此日志文件只记录debug级别的 -->
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+			<level>debug</level>
+			<onMatch>ACCEPT</onMatch>
+			<onMismatch>DENY</onMismatch>
+		</filter>
+	</appender>
+
+	<appender name="ASYNC_DEBUG_FILE" class="com.yomahub.tlog.core.enhance.logback.async.AspectLogbackAsyncAppender">
+		<!--默认情况下,当BlockingQueue还有20%容量,他将丢弃TRACE、DEBUG和INFO级别的event,只保留WARN和ERROR级别的event。为了保持所有的events,设置该值为0。-->
+		<discardingThreshold>0</discardingThreshold>
+		<!--queue配置最大容量为256个events。如果队列被填满,应用程序线程被阻止记录新的events,直到工作线程有机会来转发一个或多个events。
+		因此队列深度需要根据业务场景进行相应的测试,做出相应的更改,以达到较好的性能。-->
+		<queueSize>2048</queueSize>
+		<includeCallerData>false</includeCallerData>
+		<appender-ref ref="DEBUG_FILE"/>
+	</appender>
+
+	<!-- 时间滚动输出 level为 INFO 日志 -->
+	<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!-- 正在记录的日志文件的路径及文件名 -->
+		<file>${log.path}/log_info.log</file>
+		<!--日志文件输出格式 -->
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<charset>UTF-8</charset>
+		</encoder>
+		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<!-- 每天日志归档路径以及格式 -->
+			<fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log
+			</fileNamePattern>
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<maxFileSize>100MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+			<!--日志文件保留天数 -->
+			<maxHistory>15</maxHistory>
+		</rollingPolicy>
+		<!-- 此日志文件只记录info级别的 -->
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+			<level>info</level>
+			<onMatch>ACCEPT</onMatch>
+			<onMismatch>DENY</onMismatch>
+		</filter>
+	</appender>
+
+	<appender name="ASYNC_INFO_FILE" class="com.yomahub.tlog.core.enhance.logback.async.AspectLogbackAsyncAppender">
+		<!--默认情况下,当BlockingQueue还有20%容量,他将丢弃TRACE、DEBUG和INFO级别的event,只保留WARN和ERROR级别的event。为了保持所有的events,设置该值为0。-->
+		<discardingThreshold>0</discardingThreshold>
+		<!--queue配置最大容量为256个events。如果队列被填满,应用程序线程被阻止记录新的events,直到工作线程有机会来转发一个或多个events。
+		因此队列深度需要根据业务场景进行相应的测试,做出相应的更改,以达到较好的性能。-->
+		<queueSize>2048</queueSize>
+		<includeCallerData>false</includeCallerData>
+		<appender-ref ref="INFO_FILE"/>
+	</appender>
+
+	<!-- 时间滚动输出 level为 WARN 日志 -->
+	<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!-- 正在记录的日志文件的路径及文件名 -->
+		<file>${log.path}/log_warn.log</file>
+		<!--日志文件输出格式 -->
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
+		</encoder>
+		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log
+			</fileNamePattern>
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<maxFileSize>100MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+			<!--日志文件保留天数 -->
+			<maxHistory>15</maxHistory>
+		</rollingPolicy>
+		<!-- 此日志文件只记录warn级别的 -->
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+			<level>warn</level>
+			<onMatch>ACCEPT</onMatch>
+			<onMismatch>DENY</onMismatch>
+		</filter>
+	</appender>
+
+	<appender name="ASYNC_WARN_FILE" class="com.yomahub.tlog.core.enhance.logback.async.AspectLogbackAsyncAppender">
+		<!--默认情况下,当BlockingQueue还有20%容量,他将丢弃TRACE、DEBUG和INFO级别的event,只保留WARN和ERROR级别的event。为了保持所有的events,设置该值为0。-->
+		<discardingThreshold>0</discardingThreshold>
+		<!--queue配置最大容量为256个events。如果队列被填满,应用程序线程被阻止记录新的events,直到工作线程有机会来转发一个或多个events。
+		因此队列深度需要根据业务场景进行相应的测试,做出相应的更改,以达到较好的性能。-->
+		<queueSize>2048</queueSize>
+		<includeCallerData>false</includeCallerData>
+		<appender-ref ref="WARN_FILE"/>
+	</appender>
+
+
+	<!-- 时间滚动输出 level为 ERROR 日志 -->
+	<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!-- 正在记录的日志文件的路径及文件名 -->
+		<file>${log.path}/log_error.log</file>
+		<!--日志文件输出格式 -->
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
+		</encoder>
+		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log
+			</fileNamePattern>
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<maxFileSize>100MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+			<!--日志文件保留天数 -->
+			<maxHistory>15</maxHistory>
+		</rollingPolicy>
+		<!-- 此日志文件只记录ERROR级别的 -->
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+			<level>ERROR</level>
+			<onMatch>ACCEPT</onMatch>
+			<onMismatch>DENY</onMismatch>
+		</filter>
+	</appender>
+
+	<appender name="ASYNC_ERROR_FILE" class="com.yomahub.tlog.core.enhance.logback.async.AspectLogbackAsyncAppender">
+		<!--默认情况下,当BlockingQueue还有20%容量,他将丢弃TRACE、DEBUG和INFO级别的event,只保留WARN和ERROR级别的event。为了保持所有的events,设置该值为0。-->
+		<discardingThreshold>0</discardingThreshold>
+		<!--queue配置最大容量为256个events。如果队列被填满,应用程序线程被阻止记录新的events,直到工作线程有机会来转发一个或多个events。
+		因此队列深度需要根据业务场景进行相应的测试,做出相应的更改,以达到较好的性能。-->
+		<queueSize>2048</queueSize>
+		<includeCallerData>false</includeCallerData>
+		<appender-ref ref="ERROR_FILE"/>
+	</appender>
+
+
+	<!-- <logger>用来设置某一个包或者具体的某一个类的日志打印级别、 以及指定<appender>。<logger>仅有一个name属性, 一个可选的level和一个可选的addtivity属性。 name:用来指定受此logger约束的某一个包或者具体的某一个类。 level:用来设置打印级别,大小写无关:TRACE,
+		DEBUG, INFO, WARN, ERROR, ALL 和 OFF, 还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。 如果未设置此属性,那么当前logger将会继承上级的级别。 addtivity:是否向上级logger传递打印信息。默认是true。 -->
+	<!--<logger name="org.springframework.web" level="info"/> -->
+	<!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/> -->
+	<!-- 使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作: 第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息 第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别: -->
+	<!-- root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性 level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, 不能设置为INHERITED或者同义词NULL。默认是DEBUG 可以包含零个或多个元素,标识这个appender将会添加到这个logger。 -->
+
+	<root level="info">
+		<appender-ref ref="CONSOLE" />
+		<appender-ref ref="ASYNC_DEBUG_FILE" />
+		<appender-ref ref="ASYNC_INFO_FILE" />
+		<appender-ref ref="ASYNC_WARN_FILE" />
+		<appender-ref ref="ASYNC_ERROR_FILE" />
+	</root>
+
+	<springProfile name="dev">
+		<root level="info">
+			<appender-ref ref="CONSOLE" />
+			<appender-ref ref="ASYNC_DEBUG_FILE" />
+			<appender-ref ref="ASYNC_INFO_FILE" />
+			<appender-ref ref="ASYNC_WARN_FILE" />
+			<appender-ref ref="ASYNC_ERROR_FILE" />
+		</root>
+	</springProfile>
+
+	<springProfile name="test">
+		<root level="info">
+			<appender-ref ref="CONSOLE" />
+			<appender-ref ref="ASYNC_DEBUG_FILE" />
+			<appender-ref ref="ASYNC_INFO_FILE" />
+			<appender-ref ref="ASYNC_WARN_FILE" />
+			<appender-ref ref="ASYNC_ERROR_FILE" />
+		</root>
+	</springProfile>
+
+	<springProfile name="pro">
+		<root level="info">
+			<appender-ref ref="CONSOLE" />
+			<appender-ref ref="ASYNC_DEBUG_FILE" />
+			<appender-ref ref="ASYNC_INFO_FILE" />
+			<appender-ref ref="ASYNC_WARN_FILE" />
+			<appender-ref ref="ASYNC_ERROR_FILE" />
+		</root>
+	</springProfile>
+
+</configuration>
+
+