lyhzzz 2 dní pred
commit
a68bd6a9a8
47 zmenil súbory, kde vykonal 2523 pridanie a 0 odobranie
  1. 30 0
      .gitignore
  2. 0 0
      README.md
  3. 102 0
      pom.xml
  4. 35 0
      src/main/java/com/fdkankan/rmnas/ToolsApplication.java
  5. 6 0
      src/main/java/com/fdkankan/rmnas/common/CacheUtil.java
  6. 76 0
      src/main/java/com/fdkankan/rmnas/common/DataSourcePath.java
  7. 46 0
      src/main/java/com/fdkankan/rmnas/common/DateUtils.java
  8. 48 0
      src/main/java/com/fdkankan/rmnas/common/FileUtils.java
  9. 15 0
      src/main/java/com/fdkankan/rmnas/common/RequestBase.java
  10. 150 0
      src/main/java/com/fdkankan/rmnas/common/UploadToOssUtil.java
  11. 22 0
      src/main/java/com/fdkankan/rmnas/config/MybatisPlusPageConfig.java
  12. 55 0
      src/main/java/com/fdkankan/rmnas/entity/TbOssCloud.java
  13. 55 0
      src/main/java/com/fdkankan/rmnas/entity/TbRmNasLog.java
  14. 220 0
      src/main/java/com/fdkankan/rmnas/entity/TbScene.java
  15. 220 0
      src/main/java/com/fdkankan/rmnas/entity/TbSceneDelete.java
  16. 249 0
      src/main/java/com/fdkankan/rmnas/entity/TbScenePro.java
  17. 81 0
      src/main/java/com/fdkankan/rmnas/generate/AutoGenerate.java
  18. 81 0
      src/main/java/com/fdkankan/rmnas/generate/AutoGenerate2.java
  19. 18 0
      src/main/java/com/fdkankan/rmnas/mapper/ITbOssCloudMapper.java
  20. 18 0
      src/main/java/com/fdkankan/rmnas/mapper/ITbRmNasLogMapper.java
  21. 18 0
      src/main/java/com/fdkankan/rmnas/mapper/ITbSceneDeleteMapper.java
  22. 25 0
      src/main/java/com/fdkankan/rmnas/mapper/ITbSceneMapper.java
  23. 24 0
      src/main/java/com/fdkankan/rmnas/mapper/ITbSceneProMapper.java
  24. 16 0
      src/main/java/com/fdkankan/rmnas/service/ITbOssCloudService.java
  25. 21 0
      src/main/java/com/fdkankan/rmnas/service/ITbRmNasLogService.java
  26. 16 0
      src/main/java/com/fdkankan/rmnas/service/ITbSceneDeleteService.java
  27. 22 0
      src/main/java/com/fdkankan/rmnas/service/ITbSceneProService.java
  28. 24 0
      src/main/java/com/fdkankan/rmnas/service/ITbSceneService.java
  29. 20 0
      src/main/java/com/fdkankan/rmnas/service/impl/TbOssCloudServiceImpl.java
  30. 41 0
      src/main/java/com/fdkankan/rmnas/service/impl/TbRmNasLogServiceImpl.java
  31. 20 0
      src/main/java/com/fdkankan/rmnas/service/impl/TbSceneDeleteServiceImpl.java
  32. 32 0
      src/main/java/com/fdkankan/rmnas/service/impl/TbSceneProServiceImpl.java
  33. 37 0
      src/main/java/com/fdkankan/rmnas/service/impl/TbSceneServiceImpl.java
  34. 47 0
      src/main/java/com/fdkankan/rmnas/task/TaskController.java
  35. 145 0
      src/main/java/com/fdkankan/rmnas/task/TaskService.java
  36. 9 0
      src/main/java/com/fdkankan/rmnas/vo/CommonScene.java
  37. 42 0
      src/main/resources/application-test-v3.yaml
  38. 38 0
      src/main/resources/application-v2.yaml
  39. 38 0
      src/main/resources/application-v2oss.yaml
  40. 42 0
      src/main/resources/application-v3.yaml
  41. 14 0
      src/main/resources/application.yaml
  42. 255 0
      src/main/resources/logback-spring.xml
  43. 5 0
      src/main/resources/mapper/rmnas/TbOssCloudMapper.xml
  44. 5 0
      src/main/resources/mapper/rmnas/TbRmNasLogMapper.xml
  45. 5 0
      src/main/resources/mapper/rmnas/TbSceneDeleteMapper.xml
  46. 18 0
      src/main/resources/mapper/rmnas/TbSceneMapper.xml
  47. 17 0
      src/main/resources/mapper/rmnas/TbSceneProMapper.xml

+ 30 - 0
.gitignore

@@ -0,0 +1,30 @@
+ HELP.md
+/target/
+!.mvn/wrapper/maven-wrapper.jar
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+*.log
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+/build/
+
+### VS Code ###
+.vscode/

+ 0 - 0
README.md


+ 102 - 0
pom.xml

@@ -0,0 +1,102 @@
+<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.fdkankan</groupId>
+    <artifactId>fdkankan-rm-nas</artifactId>
+    <version>1.0.0</version>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.3.12.RELEASE</version>
+        <relativePath/>
+    </parent>
+
+    <dependencies>
+
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>8.0.25</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <scope>compile</scope>
+            <version>3.4.3.4</version>
+        </dependency>
+
+        <!--mybatis-plus代码生成器-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <scope>compile</scope>
+            <version>3.5.1</version>
+        </dependency>
+
+        <!--velocity模板-->
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity-engine-core</artifactId>
+            <version>2.3</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.7.17</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+            <version>3.15.1</version>
+        </dependency>
+
+    </dependencies>
+
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <testFailureIgnore>true</testFailureIgnore>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>8</source>
+                    <target>8</target>
+                </configuration>
+            </plugin>
+        </plugins>
+
+    </build>
+</project>

+ 35 - 0
src/main/java/com/fdkankan/rmnas/ToolsApplication.java

@@ -0,0 +1,35 @@
+package com.fdkankan.rmnas;
+
+import com.fdkankan.rmnas.common.CacheUtil;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+@SpringBootApplication
+@MapperScan("com.fdkankan.**.mapper")
+@EnableAsync
+@EnableScheduling
+public class ToolsApplication implements CommandLineRunner {
+
+    @Value("${spring.profiles.active:v2}")
+    private String runVersion;
+
+    public static void main(String[] args) {
+        SpringApplication.run(ToolsApplication.class, args);
+    }
+
+    @Override
+    public void run(String... args) throws Exception {
+        CacheUtil.runVersion = runVersion;
+
+    }
+
+}

+ 6 - 0
src/main/java/com/fdkankan/rmnas/common/CacheUtil.java

@@ -0,0 +1,6 @@
+package com.fdkankan.rmnas.common;
+
+public class CacheUtil {
+
+    public static String runVersion ="v2";
+}

+ 76 - 0
src/main/java/com/fdkankan/rmnas/common/DataSourcePath.java

@@ -0,0 +1,76 @@
+package com.fdkankan.rmnas.common;
+
+import org.apache.commons.lang3.StringUtils;
+
+public class DataSourcePath {
+
+    public static String v2Path = "/home/ubuntu/data/";
+
+    public static String getV2DataSource(String ossPath){
+        if(StringUtils.isBlank(ossPath)){
+            return null;
+        }
+        //http://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/5603e0f0c45b45be99850bd5a577b0a3_2019032011090494/zip.Zip
+        ossPath = ossPath.replace("http://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/","");
+        ossPath = ossPath.replace("https://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/","");
+        ossPath = ossPath.replace("/zip.Zip","");
+        return v2Path + ossPath;
+    }
+
+
+    public static String getV3DataSource(String dataSource) {
+        if(StringUtils.isBlank(dataSource)){
+            return null;
+        }
+        String[] split = dataSource.split("/");
+        if(split.length <=3){
+            return null;
+        }
+        if(!dataSource.contains("/mnt/data/") && !dataSource.contains("/home/ubuntu/data/")){
+            return null;
+        }
+        return dataSource;
+    }
+
+    public static String getOssPath(String ossPath) {
+        if(StringUtils.isBlank(ossPath)){
+            return null;
+        }
+        if(CacheUtil.runVersion.contains("v2")){
+            ossPath = ossPath.replace("http://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/","");
+            ossPath = ossPath.replace("https://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/","");
+            ossPath = ossPath.replace("/zip.Zip","");
+            return ossPath;
+        }
+
+        String[] split = ossPath.split("/");
+        if(split.length <=3){
+            return null;
+        }
+        if(ossPath.contains("/mnt/data/")){
+            if(split.length == 4){
+                ossPath = ossPath.replace("/mnt/data/","appData/");
+                return ossPath;
+            }
+            if(split.length == 6){
+                ossPath = ossPath.replace("/mnt/data/","home/");
+                return ossPath;
+            }
+
+        }
+        if(split.length == 5){
+            ossPath = ossPath.replace("/home/ubuntu/data/","appData/");
+            return ossPath;
+        }
+        if(split.length == 7){
+            ossPath = ossPath.replace("/home/ubuntu/data/","home/");
+            return ossPath;
+        }
+        return null;
+    }
+
+    public static void main(String[] args) {
+        System.out.println("/mnt/data/THETAYJ11102451.OSC_20220527112143".split("/").length);
+    }
+
+}

+ 46 - 0
src/main/java/com/fdkankan/rmnas/common/DateUtils.java

@@ -0,0 +1,46 @@
+package com.fdkankan.rmnas.common;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+public class DateUtils {
+
+
+    /**
+     * 获取当前时间
+     */
+    public static String getMonthStr(Date date){
+        SimpleDateFormat formatter = new SimpleDateFormat("yyy-MM-dd");
+        return  formatter.format(date);
+    }
+
+
+    /**
+     * 获取一年前的日期
+     */
+    public static String getYearAgo(){
+        Calendar calendar = Calendar.getInstance();
+        calendar.add(Calendar.YEAR, -1);
+        Date time = calendar.getTime();
+        return getMonthStr(time);
+    }
+    /**
+     * 获取一年前的日期
+     */
+    public static String getMonthAgo(){
+        Calendar calendar = Calendar.getInstance();
+        calendar.add(Calendar.MONTH, -1);
+        Date time = calendar.getTime();
+        return getMonthStr(time);
+    }
+
+    public static  String  timeFrmatStr = "yyyyMMddHHmmssSSSS";
+
+    public static void main(String[] args) {
+        System.out.println(getMonthAgo());
+    }
+}
+
+//202401261655490830
+//202401261507486130

+ 48 - 0
src/main/java/com/fdkankan/rmnas/common/FileUtils.java

@@ -0,0 +1,48 @@
+package com.fdkankan.rmnas.common;
+
+import cn.hutool.core.io.FileUtil;
+
+import java.io.File;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.*;
+
+public class FileUtils {
+
+    public static Double getFileSize(String path) {
+        Double total =0.00;
+        try {
+            File[] ls = FileUtil.ls(path);
+
+            Map<Long,String> maps=new TreeMap<Long,String>();
+            for (int i = 0; i < ls.length; i++) {
+                File file = ls[i];
+                String name = file.getName();
+                long size = FileUtil.size(file);
+                maps.put(size,name);
+            }
+
+            Set<Map.Entry<Long, String>> entries = maps.entrySet();
+            Iterator<Map.Entry<Long, String>> iterator = entries.iterator();
+            TreeSet<Long> ts = new TreeSet<>();
+            while (iterator.hasNext()) {
+                Map.Entry<Long, String> next = iterator.next();
+                Long size = next.getKey();
+                ts.add(size);
+            }
+            Iterator<Long> descendingIterator = ts.descendingIterator();
+
+            while (descendingIterator.hasNext()) {
+                //获取到的size值
+                Long size = descendingIterator.next();
+                total += size;
+
+            }
+            return total/1024/1024/1024;
+        }catch (Exception e){
+            //e.printStackTrace();
+        }
+      return total;
+    }
+
+}

+ 15 - 0
src/main/java/com/fdkankan/rmnas/common/RequestBase.java

@@ -0,0 +1,15 @@
+package com.fdkankan.rmnas.common;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+public class RequestBase {
+    private Integer pageNum = 1;
+    private Integer pageSize = 10;
+
+    private String yearTime;
+}

+ 150 - 0
src/main/java/com/fdkankan/rmnas/common/UploadToOssUtil.java

@@ -0,0 +1,150 @@
+package com.fdkankan.rmnas.common;
+
+import cn.hutool.core.collection.CollUtil;
+import com.aliyun.oss.OSS;
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.OSSClientBuilder;
+import com.aliyun.oss.model.*;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.ObjectUtils;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Component
+public class UploadToOssUtil {
+
+
+	@Value("${fyun.key}")
+	private String key;
+
+	@Value("${fyun.secret}")
+	private String secret;
+
+	@Value("${fyun.bucket}")
+	private String bucket;
+
+	@Value("${fyun.freeze-bucket:4dkk-bak}")
+	private String freezeBucket;
+
+	@Value("${fyun.endPoint}")
+	private String endPoint;
+
+	@Value("${fyun.type}")
+	private String fyunType;
+
+	@Value("${fyun.host}")
+	private String host;
+
+	@Value("${fyun.region:#{null}}")
+	private String region;
+
+
+	OSS ossClient ;
+
+	@Bean
+	public OSS getOssClient(){
+		log.info("获取--------------------ossClient");
+		ossClient = new OSSClientBuilder().build(endPoint, key, secret);
+		return ossClient;
+	}
+
+	public boolean fileExist( String path) {
+		return fileExist(bucket,path);
+	}
+
+	public boolean fileExist(String bucket, String path) {
+		try {
+			return ossClient.doesObjectExist(bucket, path);
+		} catch (Exception e) {
+			log.error("判断文件是否存在失败,key:"+path, e);
+		}
+		return false;
+	}
+
+	public void copyFileBetweenBucket(String sourceBucketName, String sourcePath, String targetBucketName, String targetPath) {
+		try {
+			List<String> files = listRemoteFiles(sourceBucketName, sourcePath);
+			if (ObjectUtils.isEmpty(files)) {
+				return;
+			}
+			files.parallelStream().forEach(file -> {
+				ossClient.copyObject(sourceBucketName, file, targetBucketName, file.replace(sourcePath, targetPath));
+			});
+		} catch (Exception e) {
+			log.error("列举文件目录失败,key:" + sourcePath, e);
+		}
+	}
+
+
+
+	public List<String> listRemoteFiles(String bucket, String sourcePath) {
+		List<String> keyList = new ArrayList<>();
+		try {
+			boolean flag = true;
+			String nextMaker = null;
+			ListObjectsRequest listObjectsRequest = new ListObjectsRequest(bucket);
+			//指定下一级文件
+			listObjectsRequest.setPrefix(sourcePath);
+			//设置分页的页容量
+			listObjectsRequest.setMaxKeys(200);
+			do {
+				//获取下一页的起始点,它的下一项
+				listObjectsRequest.setMarker(nextMaker);
+				ObjectListing objectListing = ossClient.listObjects(listObjectsRequest);
+				List<String> collect = objectListing.getObjectSummaries().parallelStream()
+						.map(OSSObjectSummary::getKey).collect(Collectors.toList());
+				if (!CollectionUtils.isEmpty(collect)) {
+					keyList.addAll(collect);
+				}
+				nextMaker = objectListing.getNextMarker();
+				//全部执行完后,为false
+				flag = objectListing.isTruncated();
+			} while (flag);
+		} catch (Exception e) {
+			log.error("获取文件列表失败,path:" + sourcePath, e);
+		}
+		return keyList;
+	}
+
+
+	public void deleteFolder(String bucket, String remoteFolderPath) {
+
+		try {
+			if (!remoteFolderPath.endsWith("/")) {
+				remoteFolderPath = remoteFolderPath + "/";
+			}
+			//log.info("开始删除文件夹:{}", remoteFolderPath);
+			boolean flag = true;
+			String nextMaker = null;
+			ListObjectsRequest listObjectsRequest = new ListObjectsRequest(bucket).withPrefix(remoteFolderPath).withMaxKeys(1000);
+
+			DeleteObjectsRequest request = new DeleteObjectsRequest(bucket);
+			do {
+				//获取下一页的起始点,它的下一项
+				listObjectsRequest.setMarker(nextMaker);
+				ObjectListing objectListing = ossClient.listObjects(listObjectsRequest);
+				List<String> keys = objectListing.getObjectSummaries().parallelStream()
+						.map(OSSObjectSummary::getKey).collect(Collectors.toList());
+				if (!CollectionUtils.isEmpty(keys)) {
+					request.setKeys(keys);
+					ossClient.deleteObjects(request);
+				}
+				nextMaker = objectListing.getNextMarker();
+				//全部执行完后,为false
+				flag = objectListing.isTruncated();
+			} while (flag);
+		} catch (Exception e) {
+			log.error("OSS删除文件失败,key:" + remoteFolderPath, e);
+		}
+	}
+
+}

+ 22 - 0
src/main/java/com/fdkankan/rmnas/config/MybatisPlusPageConfig.java

@@ -0,0 +1,22 @@
+package com.fdkankan.rmnas.config;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+
+@Configuration
+public class MybatisPlusPageConfig {
+
+    /**
+     * mybatisPlus配置分页插件
+     */
+    @Bean
+    public MybatisPlusInterceptor mybatisPlusInterceptor() {
+        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
+        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
+        return interceptor;
+    }
+}

+ 55 - 0
src/main/java/com/fdkankan/rmnas/entity/TbOssCloud.java

@@ -0,0 +1,55 @@
+package com.fdkankan.rmnas.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2024-04-10
+ */
+@Getter
+@Setter
+@TableName("tb_oss_cloud")
+public class TbOssCloud implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 场景码
+     */
+    @TableField("num")
+    private String num;
+
+    @TableField("bucket")
+    private String bucket;
+
+    @TableField("cloud_bucket")
+    private String cloudBucket;
+
+    @TableField("oss_path")
+    private String ossPath;
+
+    @TableField("cloud_oss_path")
+    private String cloudOssPath;
+
+    @TableField("create_time")
+    private Date createTime;
+
+    @TableField("update_time")
+    private Date updateTime;
+
+
+}

+ 55 - 0
src/main/java/com/fdkankan/rmnas/entity/TbRmNasLog.java

@@ -0,0 +1,55 @@
+package com.fdkankan.rmnas.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-16
+ */
+@Getter
+@Setter
+@TableName("tb_rm_nas_log")
+public class TbRmNasLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 删除nas资源记录
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 场景码
+     */
+    @TableField("num")
+    private String num;
+
+    /**
+     * 删除的目录
+     */
+    @TableField("nas_path")
+    private String nasPath;
+
+    /**
+     * 原资源路径
+     */
+    @TableField("data_source")
+    private String dataSource;
+
+    @TableField("create_time")
+    private Date createTime;
+
+
+}

+ 220 - 0
src/main/java/com/fdkankan/rmnas/entity/TbScene.java

@@ -0,0 +1,220 @@
+package com.fdkankan.rmnas.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-15
+ */
+@Getter
+@Setter
+@TableName("tb_scene")
+public class TbScene implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 场景名称
+     */
+    @TableField("scene_name")
+    private String sceneName;
+
+    /**
+     * 场景描述
+     */
+    @TableField("scene_dec")
+    private String sceneDec;
+
+    /**
+     * 公元管道需要的编码
+     */
+    @TableField("work_number")
+    private String workNumber;
+
+    /**
+     * 场景的链接地址
+     */
+    @TableField("website")
+    private String website;
+
+    /**
+     * 场景缩略图
+     */
+    @TableField("homepic")
+    private String homepic;
+
+    /**
+     * 生成场景的时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 0表示未建好,1表示建好,-1表示出错,-2表示私密不要显示
+     */
+    @TableField("status")
+    private Integer status;
+
+    /**
+     * 原始的大场景数据(七牛)
+     */
+    @TableField("datasource")
+    private String datasource;
+
+    /**
+     * 用户id
+     */
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 房源id
+     */
+    @TableField("house_id")
+    private Long houseId;
+
+    /**
+     * 0表示未付款,1表示付款了,-1表示欠费
+     */
+    @TableField("pay")
+    private Integer pay;
+
+    /**
+     * 相机的用户名
+     */
+    @TableField("child_name")
+    private String childName;
+
+    /**
+     * 手机id
+     */
+    @TableField("phone_id")
+    private String phoneId;
+
+    /**
+     * 大场景序号
+     */
+    @TableField("num")
+    private String num;
+
+    /**
+     * 大场景的密钥
+     */
+    @TableField("scenekey")
+    private String scenekey;
+
+    /**
+     * 0表示其他,1表示文博,2表示地产,3表示电商,4表示餐饮,5表示家居
+     */
+    @TableField("scene_type")
+    private Integer sceneType;
+
+    /**
+     * 1表示推荐,0表示正常
+     */
+    @TableField("recommend")
+    private Integer recommend;
+
+    /**
+     * 浏览次数
+     */
+    @TableField("view_count")
+    private Integer viewCount;
+
+    /**
+     * 版本
+     */
+    @TableField("version")
+    private Integer version;
+
+    /**
+     * 表示缩略图是否存在
+     */
+    @TableField("thumb_img")
+    private Integer thumbImg;
+
+    /**
+     * 0表示默认,1表示自己上传
+     */
+    @TableField("floor_logo")
+    private String floorLogo;
+
+    /**
+     * 标记大小
+     */
+    @TableField("floor_logo_size")
+    private Integer floorLogoSize;
+
+    /**
+     * 要上传的热点的id集合,用逗号隔开
+     */
+    @TableField("hotsids")
+    private String hotsids;
+
+    /**
+     * 表示初始点信息
+     */
+    @TableField("entry")
+    private String entry;
+
+    /**
+     * 拍摄数量
+     */
+    @TableField("shoot_count")
+    private Integer shootCount;
+
+    /**
+     * 风格
+     */
+    @TableField("style")
+    private Integer style;
+
+    /**
+     * 要gps定位
+     */
+    @TableField("gps")
+    private String gps;
+
+    /**
+     * 方案:1是双目,2是转台,3是六目
+     */
+    @TableField("scene_scheme")
+    private Integer sceneScheme;
+
+    /**
+     * 背景音乐名称
+     */
+    @TableField("bg_music")
+    private String bgMusic;
+
+    @TableField("screencap_music")
+    private String screencapMusic;
+
+    /**
+     * 录屏文件个数
+     */
+    @TableField("screencap_len")
+    private Integer screencapLen;
+
+    /**
+     * 算法类型
+     */
+    @TableField("algorithm")
+    private String algorithm;
+
+
+}

+ 220 - 0
src/main/java/com/fdkankan/rmnas/entity/TbSceneDelete.java

@@ -0,0 +1,220 @@
+package com.fdkankan.rmnas.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-15
+ */
+@Getter
+@Setter
+@TableName("tb_scene_delete")
+public class TbSceneDelete implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 场景名称
+     */
+    @TableField("scene_name")
+    private String sceneName;
+
+    /**
+     * 场景描述
+     */
+    @TableField("scene_dec")
+    private String sceneDec;
+
+    /**
+     * 公元管道需要的编码
+     */
+    @TableField("work_number")
+    private String workNumber;
+
+    /**
+     * 场景的链接地址
+     */
+    @TableField("website")
+    private String website;
+
+    /**
+     * 场景缩略图
+     */
+    @TableField("homepic")
+    private String homepic;
+
+    /**
+     * 生成场景的时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 0表示未建好,1表示建好,-1表示出错,-2表示私密不要显示
+     */
+    @TableField("status")
+    private Integer status;
+
+    /**
+     * 原始的大场景数据(七牛)
+     */
+    @TableField("datasource")
+    private String datasource;
+
+    /**
+     * 用户id
+     */
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 房源id
+     */
+    @TableField("house_id")
+    private Long houseId;
+
+    /**
+     * 0表示未付款,1表示付款了,-1表示欠费
+     */
+    @TableField("pay")
+    private Integer pay;
+
+    /**
+     * 相机的用户名
+     */
+    @TableField("child_name")
+    private String childName;
+
+    /**
+     * 手机id
+     */
+    @TableField("phone_id")
+    private String phoneId;
+
+    /**
+     * 大场景序号
+     */
+    @TableField("num")
+    private String num;
+
+    /**
+     * 大场景的密钥
+     */
+    @TableField("scenekey")
+    private String scenekey;
+
+    /**
+     * 0表示其他,1表示文博,2表示地产,3表示电商,4表示餐饮,5表示家居
+     */
+    @TableField("scene_type")
+    private Integer sceneType;
+
+    /**
+     * 1表示推荐,0表示正常
+     */
+    @TableField("recommend")
+    private Integer recommend;
+
+    /**
+     * 浏览次数
+     */
+    @TableField("view_count")
+    private Integer viewCount;
+
+    /**
+     * 版本
+     */
+    @TableField("version")
+    private Integer version;
+
+    /**
+     * 表示缩略图是否存在
+     */
+    @TableField("thumb_img")
+    private Integer thumbImg;
+
+    /**
+     * 0表示默认,1表示自己上传
+     */
+    @TableField("floor_logo")
+    private String floorLogo;
+
+    /**
+     * 标记大小
+     */
+    @TableField("floor_logo_size")
+    private Integer floorLogoSize;
+
+    /**
+     * 要上传的热点的id集合,用逗号隔开
+     */
+    @TableField("hotsids")
+    private String hotsids;
+
+    /**
+     * 表示初始点信息
+     */
+    @TableField("entry")
+    private String entry;
+
+    /**
+     * 拍摄数量
+     */
+    @TableField("shoot_count")
+    private Integer shootCount;
+
+    /**
+     * 风格
+     */
+    @TableField("style")
+    private Integer style;
+
+    /**
+     * 要gps定位
+     */
+    @TableField("gps")
+    private String gps;
+
+    /**
+     * 方案:1是双目,2是转台,3是六目
+     */
+    @TableField("scene_scheme")
+    private Integer sceneScheme;
+
+    /**
+     * 背景音乐名称
+     */
+    @TableField("bg_music")
+    private String bgMusic;
+
+    @TableField("screencap_music")
+    private String screencapMusic;
+
+    /**
+     * 录屏文件个数
+     */
+    @TableField("screencap_len")
+    private Integer screencapLen;
+
+    /**
+     * 算法类型
+     */
+    @TableField("algorithm")
+    private String algorithm;
+
+
+}

+ 249 - 0
src/main/java/com/fdkankan/rmnas/entity/TbScenePro.java

@@ -0,0 +1,249 @@
+package com.fdkankan.rmnas.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * pro场景表
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-23
+ */
+@Getter
+@Setter
+@TableName("tb_scene_pro")
+public class TbScenePro implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 场景名称
+     */
+    @TableField("scene_name")
+    private String sceneName;
+
+    /**
+     * 场景描述
+     */
+    @TableField("scene_dec")
+    private String sceneDec;
+
+    /**
+     * 场景的链接地址
+     */
+    @TableField("web_site")
+    private String webSite;
+
+    /**
+     * 场景缩略图
+     */
+    @TableField("thumb")
+    private String thumb;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 0表示未建好,1表示建好,-1表示出错,-2表示不要在官网上显示
+     */
+    @TableField("status")
+    private Integer status;
+
+    /**
+     * 原始的大场景数据(七牛)
+     */
+    @TableField("data_source")
+    private String dataSource;
+
+    /**
+     * 用户表t_user的id
+     */
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 0表示未付款,1表示付款了,-1表示欠费,-2表示容量不足
+     */
+    @TableField("pay_status")
+    private Integer payStatus;
+
+    /**
+     * 相机主表t_camera的id
+     */
+    @TableField("camera_id")
+    private Long cameraId;
+
+    /**
+     * 手机id
+     */
+    @TableField("phone_id")
+    private String phoneId;
+
+    /**
+     * 场景logo
+     */
+    @TableField("scene_logo")
+    private String sceneLogo;
+
+    /**
+     * 大场景序号
+     */
+    @TableField("num")
+    private String num;
+
+    /**
+     * 0表示其他,1表示文博,2表示地产,3表示电商,4表示餐饮,5表示家居,99一件换装虚拟房源
+     */
+    @TableField("scene_type")
+    private Integer sceneType;
+
+    /**
+     * 1表示推荐,0表示正常
+     */
+    @TableField("recommend")
+    private Integer recommend;
+
+    /**
+     * 浏览次数
+     */
+    @TableField("view_count")
+    private Integer viewCount;
+
+    /**
+     * 拍摄数量
+     */
+    @TableField("shoot_count")
+    private Integer shootCount;
+
+    /**
+     * 所有资源文件名
+     */
+    @TableField("files_name")
+    private String filesName;
+
+    /**
+     * 点位视频
+     */
+    @TableField("videos")
+    private String videos;
+
+    /**
+     * 要gps定位
+     */
+    @TableField("gps")
+    private String gps;
+
+    /**
+     * 方案:1是双目,2是转台,3是六目,4是八目,10获取4k图,11获取2k,12获取1k
+     */
+    @TableField("scene_scheme")
+    private Integer sceneScheme;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    private String recStatus;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 算法类型
+     */
+    @TableField("algorithm")
+    private String algorithm;
+
+    /**
+     * 服务器的服务商
+     */
+    @TableField("ecs")
+    private String ecs;
+
+    /**
+     * 使用容量
+     */
+    @TableField("space")
+    private Long space;
+
+    /**
+     * 固件版本
+     */
+    @TableField("firmware_version")
+    private String firmwareVersion;
+
+    /**
+     * 调用V2还是V3的算法
+     */
+    @TableField("build_type")
+    private String buildType;
+
+    /**
+     * 计算时间(秒为单位)
+     */
+    @TableField("compute_time")
+    private Long computeTime;
+
+    /**
+     * 场景来源,相机拍摄10以内表示,1表示八目,2双目,3转台,其他来源10以上,11:一键换装,12:123看房,13文通虚拟场景
+     */
+    @TableField("scene_source")
+    private Integer sceneSource;
+
+    /**
+     * 房屋ID
+     */
+    @TableField("house_id")
+    private Long houseId;
+
+    /**
+     * 公元管道需要的编码
+     */
+    @TableField("work_number")
+    private String workNumber;
+
+    /**
+     * 小程序首页封面图
+     */
+    @TableField("app_list_pic_url")
+    private String appListPicUrl;
+
+    /**
+     * '小程序是否显示'
+     */
+    @TableField("is_show")
+    private Boolean isShow;
+
+    /**
+     * 是否生成了直播间
+     */
+    @TableField("lived")
+    private Boolean lived;
+
+    @TableField("contact_id")
+    private Long contactId;
+
+    @TableField("phone_num")
+    private String phoneNum;
+
+    @TableField("del_build_result")
+    private Integer delBuildResult;
+}

+ 81 - 0
src/main/java/com/fdkankan/rmnas/generate/AutoGenerate.java

@@ -0,0 +1,81 @@
+package com.fdkankan.rmnas.generate;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.generator.FastAutoGenerator;
+import com.baomidou.mybatisplus.generator.config.OutputFile;
+import com.baomidou.mybatisplus.generator.config.rules.DateType;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+public class AutoGenerate {
+
+
+    public static void main(String[] args) {
+
+        String path =System.getProperty("user.dir");
+
+        generate(path,"rmnas", getTables(new String[]{
+                "tb_oss_cloud"
+        }));
+
+    }
+
+    public static List<String> getTables(String [] tableNames){
+        return new ArrayList<>(Arrays.asList(tableNames));
+    }
+
+
+    public static void  generate(String path,String moduleName,  List<String> tables){
+        FastAutoGenerator.create("jdbc:mysql://47.112.166.173:3306/zhi_house",
+                "root","4dkankan4dage")
+                .globalConfig(builder -> {
+                    builder.author("")               //作者
+                            .outputDir(path+"\\src\\main\\java")    //输出路径(写到java目录)
+                            //.enableSwagger()           //开启swagger
+                            .commentDate("yyyy-MM-dd")
+                            .dateType(DateType.ONLY_DATE)
+                            .fileOverride();            //开启覆盖之前生成的文件
+
+                })
+                .packageConfig(builder -> {
+                    builder.parent("com.fdkankan")
+                            .moduleName(moduleName)
+                            .entity("entity")
+                            .service("service")
+                            .serviceImpl("service.impl")
+                            .controller("controller")
+                            .mapper("mapper")
+                            .xml("test.mapper")
+                            .pathInfo(Collections.singletonMap(OutputFile.mapperXml,path+"\\src\\main\\resources\\mapper\\"+moduleName));
+                })
+                .strategyConfig(builder -> {
+                    builder.addInclude(tables)
+                            .addTablePrefix("t_")
+
+                            .serviceBuilder()
+                            .formatServiceFileName("I%sService")
+                            .formatServiceImplFileName("%sServiceImpl")
+
+                            .entityBuilder()
+                            .enableLombok()
+                            .logicDeleteColumnName("rec_status")
+                            .enableTableFieldAnnotation()
+                            //.superClass(BaseEntity.class)
+
+                            .controllerBuilder()
+                            .formatFileName("%sController")
+                            .enableRestStyle()
+
+                            .mapperBuilder()
+                            .superClass(BaseMapper.class)
+                            .formatMapperFileName("I%sMapper")
+                            .enableMapperAnnotation()
+                            .formatXmlFileName("%sMapper");
+                })
+                // .templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板
+                .execute();
+    }
+}

+ 81 - 0
src/main/java/com/fdkankan/rmnas/generate/AutoGenerate2.java

@@ -0,0 +1,81 @@
+package com.fdkankan.rmnas.generate;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.generator.FastAutoGenerator;
+import com.baomidou.mybatisplus.generator.config.OutputFile;
+import com.baomidou.mybatisplus.generator.config.rules.DateType;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+public class AutoGenerate2 {
+
+
+    public static void main(String[] args) {
+
+        String path =System.getProperty("user.dir");
+
+        generate(path,"rmnas", getTables(new String[]{
+                "tb_scene_pro"
+        }));
+
+    }
+
+    public static List<String> getTables(String [] tableNames){
+        return new ArrayList<>(Arrays.asList(tableNames));
+    }
+
+
+    public static void  generate(String path,String moduleName,  List<String> tables){
+        FastAutoGenerator.create("jdbc:mysql://120.24.202.7:3306/zhi_house",
+                "root","zfb@20210727%")
+                .globalConfig(builder -> {
+                    builder.author("")               //作者
+                            .outputDir(path+"\\src\\main\\java")    //输出路径(写到java目录)
+                            //.enableSwagger()           //开启swagger
+                            .commentDate("yyyy-MM-dd")
+                            .dateType(DateType.ONLY_DATE)
+                            .fileOverride();            //开启覆盖之前生成的文件
+
+                })
+                .packageConfig(builder -> {
+                    builder.parent("com.fdkankan")
+                            .moduleName(moduleName)
+                            .entity("entity")
+                            .service("service")
+                            .serviceImpl("service.impl")
+                            .controller("controller")
+                            .mapper("mapper")
+                            .xml("test.mapper")
+                            .pathInfo(Collections.singletonMap(OutputFile.mapperXml,path+"\\src\\main\\resources\\mapper\\"+moduleName));
+                })
+                .strategyConfig(builder -> {
+                    builder.addInclude(tables)
+                            .addTablePrefix("t_")
+
+                            .serviceBuilder()
+                            .formatServiceFileName("I%sService")
+                            .formatServiceImplFileName("%sServiceImpl")
+
+                            .entityBuilder()
+                            .enableLombok()
+                            .logicDeleteColumnName("rec_status")
+                            .enableTableFieldAnnotation()
+                            //.superClass(BaseEntity.class)
+
+                            .controllerBuilder()
+                            .formatFileName("%sController")
+                            .enableRestStyle()
+
+                            .mapperBuilder()
+                            .superClass(BaseMapper.class)
+                            .formatMapperFileName("I%sMapper")
+                            .enableMapperAnnotation()
+                            .formatXmlFileName("%sMapper");
+                })
+                // .templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板
+                .execute();
+    }
+}

+ 18 - 0
src/main/java/com/fdkankan/rmnas/mapper/ITbOssCloudMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.rmnas.mapper;
+
+import com.fdkankan.rmnas.entity.TbOssCloud;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-04-10
+ */
+@Mapper
+public interface ITbOssCloudMapper extends BaseMapper<TbOssCloud> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/rmnas/mapper/ITbRmNasLogMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.rmnas.mapper;
+
+import com.fdkankan.rmnas.entity.TbRmNasLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-16
+ */
+@Mapper
+public interface ITbRmNasLogMapper extends BaseMapper<TbRmNasLog> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/rmnas/mapper/ITbSceneDeleteMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.rmnas.mapper;
+
+import com.fdkankan.rmnas.entity.TbSceneDelete;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-15
+ */
+@Mapper
+public interface ITbSceneDeleteMapper extends BaseMapper<TbSceneDelete> {
+
+}

+ 25 - 0
src/main/java/com/fdkankan/rmnas/mapper/ITbSceneMapper.java

@@ -0,0 +1,25 @@
+package com.fdkankan.rmnas.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.rmnas.common.RequestBase;
+import com.fdkankan.rmnas.entity.TbScene;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fdkankan.rmnas.vo.CommonScene;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-15
+ */
+@Mapper
+public interface ITbSceneMapper extends BaseMapper<TbScene> {
+
+    Page<TbScene> getLastYear(Page<TbScene> page, RequestBase param);
+
+    Page<CommonScene> getLastYearOss(Page<CommonScene> objectPage, RequestBase param);
+}

+ 24 - 0
src/main/java/com/fdkankan/rmnas/mapper/ITbSceneProMapper.java

@@ -0,0 +1,24 @@
+package com.fdkankan.rmnas.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.rmnas.common.RequestBase;
+import com.fdkankan.rmnas.entity.TbScenePro;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fdkankan.rmnas.vo.CommonScene;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * pro场景表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-23
+ */
+@Mapper
+public interface ITbSceneProMapper extends BaseMapper<TbScenePro> {
+
+    Page<TbScenePro> getLastYear(Page<Object> objectPage, RequestBase param);
+
+    Page<CommonScene> getLastYearOss(Page<CommonScene> objectPage, RequestBase param);
+}

+ 16 - 0
src/main/java/com/fdkankan/rmnas/service/ITbOssCloudService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.rmnas.service;
+
+import com.fdkankan.rmnas.entity.TbOssCloud;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-04-10
+ */
+public interface ITbOssCloudService extends IService<TbOssCloud> {
+
+}

+ 21 - 0
src/main/java/com/fdkankan/rmnas/service/ITbRmNasLogService.java

@@ -0,0 +1,21 @@
+package com.fdkankan.rmnas.service;
+
+import com.fdkankan.rmnas.entity.TbRmNasLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-16
+ */
+public interface ITbRmNasLogService extends IService<TbRmNasLog> {
+
+    TbRmNasLog getByNum(String num);
+
+    List<TbRmNasLog> getByNumList(List<String> numList);
+}

+ 16 - 0
src/main/java/com/fdkankan/rmnas/service/ITbSceneDeleteService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.rmnas.service;
+
+import com.fdkankan.rmnas.entity.TbSceneDelete;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-15
+ */
+public interface ITbSceneDeleteService extends IService<TbSceneDelete> {
+
+}

+ 22 - 0
src/main/java/com/fdkankan/rmnas/service/ITbSceneProService.java

@@ -0,0 +1,22 @@
+package com.fdkankan.rmnas.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.rmnas.common.RequestBase;
+import com.fdkankan.rmnas.entity.TbScenePro;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.rmnas.vo.CommonScene;
+
+/**
+ * <p>
+ * pro场景表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-23
+ */
+public interface ITbSceneProService extends IService<TbScenePro> {
+
+    Page<TbScenePro> getLastYear(RequestBase param);
+
+    Page<CommonScene> getLastYearOss(RequestBase param);
+}

+ 24 - 0
src/main/java/com/fdkankan/rmnas/service/ITbSceneService.java

@@ -0,0 +1,24 @@
+package com.fdkankan.rmnas.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.rmnas.common.RequestBase;
+import com.fdkankan.rmnas.entity.TbScene;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.rmnas.vo.CommonScene;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-15
+ */
+public interface ITbSceneService extends IService<TbScene> {
+
+    Page<TbScene> getLastYear(RequestBase param);
+
+    Page<CommonScene> getLastYearOss(RequestBase param);
+}

+ 20 - 0
src/main/java/com/fdkankan/rmnas/service/impl/TbOssCloudServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fdkankan.rmnas.service.impl;
+
+import com.fdkankan.rmnas.entity.TbOssCloud;
+import com.fdkankan.rmnas.mapper.ITbOssCloudMapper;
+import com.fdkankan.rmnas.service.ITbOssCloudService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-04-10
+ */
+@Service
+public class TbOssCloudServiceImpl extends ServiceImpl<ITbOssCloudMapper, TbOssCloud> implements ITbOssCloudService {
+
+}

+ 41 - 0
src/main/java/com/fdkankan/rmnas/service/impl/TbRmNasLogServiceImpl.java

@@ -0,0 +1,41 @@
+package com.fdkankan.rmnas.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.rmnas.entity.TbRmNasLog;
+import com.fdkankan.rmnas.mapper.ITbRmNasLogMapper;
+import com.fdkankan.rmnas.service.ITbRmNasLogService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.WeakHashMap;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-16
+ */
+@Service
+public class TbRmNasLogServiceImpl extends ServiceImpl<ITbRmNasLogMapper, TbRmNasLog> implements ITbRmNasLogService {
+
+    @Override
+    public TbRmNasLog getByNum(String num) {
+        LambdaQueryWrapper<TbRmNasLog> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(TbRmNasLog::getNum,num);
+        return this.getOne(wrapper);
+    }
+
+    @Override
+    public List<TbRmNasLog> getByNumList(List<String> numList) {
+        if(numList == null || numList.isEmpty()){
+            return new ArrayList<>();
+        }
+        LambdaQueryWrapper<TbRmNasLog> wrapper = new LambdaQueryWrapper<>();
+        wrapper.in(TbRmNasLog::getNum,numList);
+        return this.list(wrapper);
+    }
+}

+ 20 - 0
src/main/java/com/fdkankan/rmnas/service/impl/TbSceneDeleteServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fdkankan.rmnas.service.impl;
+
+import com.fdkankan.rmnas.entity.TbSceneDelete;
+import com.fdkankan.rmnas.mapper.ITbSceneDeleteMapper;
+import com.fdkankan.rmnas.service.ITbSceneDeleteService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-15
+ */
+@Service
+public class TbSceneDeleteServiceImpl extends ServiceImpl<ITbSceneDeleteMapper, TbSceneDelete> implements ITbSceneDeleteService {
+
+}

+ 32 - 0
src/main/java/com/fdkankan/rmnas/service/impl/TbSceneProServiceImpl.java

@@ -0,0 +1,32 @@
+package com.fdkankan.rmnas.service.impl;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.rmnas.common.RequestBase;
+import com.fdkankan.rmnas.entity.TbScenePro;
+import com.fdkankan.rmnas.mapper.ITbSceneProMapper;
+import com.fdkankan.rmnas.service.ITbSceneProService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.rmnas.vo.CommonScene;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * pro场景表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-23
+ */
+@Service
+public class TbSceneProServiceImpl extends ServiceImpl<ITbSceneProMapper, TbScenePro> implements ITbSceneProService {
+
+    @Override
+    public Page<TbScenePro> getLastYear(RequestBase param) {
+        return this.getBaseMapper().getLastYear(new Page<>(param.getPageNum(),param.getPageSize()),param);
+    }
+
+    @Override
+    public Page<CommonScene> getLastYearOss(RequestBase param) {
+        return this.getBaseMapper().getLastYearOss(new Page<>(param.getPageNum(),param.getPageSize()),param);
+    }
+}

+ 37 - 0
src/main/java/com/fdkankan/rmnas/service/impl/TbSceneServiceImpl.java

@@ -0,0 +1,37 @@
+package com.fdkankan.rmnas.service.impl;
+
+import cn.hutool.core.date.DateUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.rmnas.common.DateUtils;
+import com.fdkankan.rmnas.common.RequestBase;
+import com.fdkankan.rmnas.entity.TbScene;
+import com.fdkankan.rmnas.mapper.ITbSceneMapper;
+import com.fdkankan.rmnas.service.ITbSceneService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.rmnas.vo.CommonScene;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-01-15
+ */
+@Service
+public class TbSceneServiceImpl extends ServiceImpl<ITbSceneMapper, TbScene> implements ITbSceneService {
+
+    @Override
+    public Page<TbScene> getLastYear(RequestBase param) {
+        return this.getBaseMapper().getLastYear(new Page<>(param.getPageNum(),param.getPageSize()),param);
+    }
+
+    @Override
+    public Page<CommonScene> getLastYearOss(RequestBase param) {
+        return this.getBaseMapper().getLastYearOss(new Page<>(param.getPageNum(),param.getPageSize()),param);
+    }
+}

+ 47 - 0
src/main/java/com/fdkankan/rmnas/task/TaskController.java

@@ -0,0 +1,47 @@
+package com.fdkankan.rmnas.task;
+
+import cn.hutool.core.io.FileUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.rmnas.common.*;
+import com.fdkankan.rmnas.entity.TbRmNasLog;
+import com.fdkankan.rmnas.entity.TbScene;
+import com.fdkankan.rmnas.entity.TbScenePro;
+import com.fdkankan.rmnas.service.ITbRmNasLogService;
+import com.fdkankan.rmnas.service.ITbSceneProService;
+import com.fdkankan.rmnas.service.ITbSceneService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+@Slf4j
+public class TaskController {
+
+    @Autowired
+    TaskService taskService;
+
+    //@Scheduled(cron = "0 0 0 * * ?")
+    @Scheduled(initialDelay = 2000,fixedDelay = 1000 * 60 * 60 *24)
+    public void start() throws InterruptedException {
+        Long start = System.currentTimeMillis();
+        log.info("项目启动执行开始删除nas资源命令:{}",CacheUtil.runVersion);
+        if(CacheUtil.runVersion.contains("v2")){
+            taskService.rmNas();
+        }else {
+            taskService.rmOss();
+            taskService.rmNasV3();
+        }
+        log.info("项目启动执行完毕删除nas资源命令:{},{}",CacheUtil.runVersion,System.currentTimeMillis()-start);
+    }
+
+
+
+
+
+
+}

+ 145 - 0
src/main/java/com/fdkankan/rmnas/task/TaskService.java

@@ -0,0 +1,145 @@
+package com.fdkankan.rmnas.task;
+
+import cn.hutool.core.io.FileUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.rmnas.common.*;
+import com.fdkankan.rmnas.entity.TbOssCloud;
+import com.fdkankan.rmnas.entity.TbRmNasLog;
+import com.fdkankan.rmnas.entity.TbScene;
+import com.fdkankan.rmnas.entity.TbScenePro;
+import com.fdkankan.rmnas.service.ITbOssCloudService;
+import com.fdkankan.rmnas.service.ITbRmNasLogService;
+import com.fdkankan.rmnas.service.ITbSceneProService;
+import com.fdkankan.rmnas.service.ITbSceneService;
+import com.fdkankan.rmnas.vo.CommonScene;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+
+@Service
+@Slf4j
+public class TaskService {
+
+
+    @Autowired
+    ITbSceneService tbSceneService;
+    @Autowired
+    ITbRmNasLogService tbRmNasLogService;
+    @Autowired
+    ITbOssCloudService tbOssCloudService;
+    @Autowired
+    UploadToOssUtil fYunFileServiceInterface;
+    @Value("${fyun.bucket}")
+    private String bucket;
+    @Value("${fyun.coldBucket}")
+    private String coldBucket;
+
+    @Autowired
+    ITbSceneProService tbSceneProService;
+
+    public void rmNas() throws InterruptedException {
+        RequestBase param = new RequestBase(1,1000, DateUtils.getMonthAgo() +" 00:00:00");
+        Boolean falg = true;
+        Page<TbScene> tbSceneList  = null;
+        Integer total = 0;
+        Double totalSize = 0.00;
+        while (falg){
+            log.info("本次执行删除nas资源当前页:{},{}",param.getPageNum(),param.getPageSize());
+            tbSceneList = tbSceneService.getLastYear(param);
+            Double fileSize = rmPathV2(tbSceneList.getRecords());
+            totalSize += fileSize;
+            falg = tbSceneList.getRecords().size() >=param.getPageSize();
+            total += tbSceneList.getRecords().size();
+        }
+        log.info("本次执行删除nas资源总场景数:{},{}",total,String.format("%.2f",totalSize) +"GB");
+    }
+
+
+    private Double rmPathV2(List<TbScene> tbSceneList){
+        Double totalSize =0.00;
+        List<TbRmNasLog> newList = new ArrayList<>();
+        int i = 0;
+        for (TbScene tbScene : tbSceneList) {
+            i ++;
+            String nasPath = DataSourcePath.getV2DataSource(tbScene.getDatasource());
+            if(StringUtils.isNotBlank(nasPath) && nasPath.contains("/home/ubuntu/data/") && nasPath.contains("_")){
+                Double fileSize = FileUtils.getFileSize(nasPath);
+                totalSize += fileSize;
+                log.info("本次执行删除nas资源路径:{},{},{}",nasPath,String.format("%.2f",fileSize) +"GB",i);
+                FileUtil.del(nasPath);
+            }
+            TbRmNasLog tbRmNasLog = new TbRmNasLog();
+            tbRmNasLog.setNum(tbScene.getNum());
+            tbRmNasLog.setNasPath(nasPath);
+            tbRmNasLog.setDataSource(tbScene.getDatasource());
+            newList.add(tbRmNasLog);
+        }
+        log.info("本次执行删除nas资源大小:{}",String.format("%.2f",totalSize) +"GB");
+        tbRmNasLogService.saveBatch(newList);
+        return totalSize;
+    }
+
+
+
+    public void rmOss() {
+        RequestBase param = new RequestBase(1,1000, DateUtils.getYearAgo() +" 00:00:00");
+        Boolean falg = true;
+        Page<CommonScene> tbSceneList  = null;
+        Integer total = 0;
+        while (falg){
+            log.info("本次执行oss资源冷存储当前页:{},{}",param.getPageNum(),param.getPageSize());
+            if(CacheUtil.runVersion.contains("v2")){
+                tbSceneList = tbSceneService.getLastYearOss(param);
+            }else {
+                tbSceneList = tbSceneProService.getLastYearOss(param);
+            }
+            rmOssPath(tbSceneList.getRecords());
+            falg = tbSceneList.getRecords().size() >=param.getPageSize();
+            total += tbSceneList.getRecords().size();
+        }
+        log.info("本次执行oss资源冷存储总场景数:{}",total);
+
+    }
+
+
+    public void rmOssPath(List<CommonScene> tbSceneList) {
+        List<TbOssCloud> newList = new ArrayList<>();
+        AtomicInteger i = new AtomicInteger();
+        tbSceneList.parallelStream().forEach(tbScene ->{
+            i.getAndIncrement();
+            String ossPath = DataSourcePath.getOssPath(tbScene.getDataSource());
+            if(StringUtils.isNotBlank(ossPath) && fYunFileServiceInterface.fileExist(ossPath+"/data.fdage")){
+                log.info("将oss原始资源复制到冷存储{},{},{},{},{}",bucket,ossPath,coldBucket,bucket+"/"+ossPath,i);
+                fYunFileServiceInterface.copyFileBetweenBucket(bucket,ossPath,coldBucket,bucket+"/"+ossPath);
+                try {
+                    log.info("将oss原始资源删除:{},{},{}",bucket,ossPath,i);
+                    fYunFileServiceInterface.deleteFolder(bucket,ossPath);
+                }catch (Exception e){
+                    log.info("oss删除文件出错:{},{}",bucket,ossPath);
+                    log.info("oss删除文件出错",e);
+                }
+            }
+            TbOssCloud tbOssCloud = new TbOssCloud();
+            tbOssCloud.setNum(tbScene.getNum());
+            tbOssCloud.setBucket(bucket);
+            tbOssCloud.setCloudBucket(coldBucket);
+            tbOssCloud.setOssPath(ossPath);
+            tbOssCloud.setCloudOssPath(StringUtils.isBlank(ossPath)?null:bucket+"/"+ossPath);
+            tbOssCloudService.save(tbOssCloud);
+            newList.add(tbOssCloud);
+        });
+        log.info("本次执行oss资源冷存储数量:{}",newList.size());
+
+    }
+
+
+    public void rmNasV3() {
+        //List<TbScenePro> sceneProList = tbSceneProService.getNoDelBuildResultList();
+    }
+}

+ 9 - 0
src/main/java/com/fdkankan/rmnas/vo/CommonScene.java

@@ -0,0 +1,9 @@
+package com.fdkankan.rmnas.vo;
+
+import lombok.Data;
+
+@Data
+public class CommonScene {
+    private String num;
+    private String dataSource;
+}

+ 42 - 0
src/main/resources/application-test-v3.yaml

@@ -0,0 +1,42 @@
+server:
+  port: 7002
+  servlet:
+    context-path: /
+  tomcat:
+    max-http-form-post-size: -1
+spring:
+  datasource:
+    type: com.zaxxer.hikari.HikariDataSource          # 数据源类型:HikariCP
+    driver-class-name: com.mysql.jdbc.Driver          # mysql驱动
+    #url: jdbc:mysql://120.24.202.7:3306/zhi_house?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    url: jdbc:mysql://172.18.159.127:3306/zhi_house?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    username: root
+    password: zfb20211015G
+    hikari:
+      connection-timeout: 30000         # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 默认:30秒
+      minimum-idle: 5                   # 最小连接数
+      maximum-pool-size: 20             # 最大连接数
+      auto-commit: true                 # 事务自动提交
+      idle-timeout: 600000              # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10分钟
+      pool-name: DateSourceHikariCP     # 连接池名字
+      max-lifetime: 1800000             # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认:30分钟 1800000ms
+      connection-test-query: SELECT 1   # 连接测试语句
+
+
+logging:
+  config: classpath:logback-spring.xml
+  path : /home/data-zfb/rm-nas
+#mybatis-plus:
+#  configuration:
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #开启sql日志
+
+
+fyun:
+  type: oss
+  key: LTAI5tC5Ema4raGNCZYSNrkN
+  secret: BjqU1lSVnNUbJouGkq13JG9DmcpaDx
+  bucket: zfb-4dkankan
+  coldBucket: zfb-4dkk-bak
+  endPoint: http://oss-cn-shenzhen-internal.aliyuncs.com
+  #endPoint: http://oss-cn-shenzhen.aliyuncs.com
+  host: https://zfb.4dage.com/

+ 38 - 0
src/main/resources/application-v2.yaml

@@ -0,0 +1,38 @@
+server:
+  port: 7012
+  servlet:
+    context-path: /
+  tomcat:
+    max-http-form-post-size: -1
+spring:
+  datasource:
+    type: com.zaxxer.hikari.HikariDataSource          # 数据源类型:HikariCP
+    driver-class-name: com.mysql.jdbc.Driver          # mysql驱动
+    url: jdbc:mysql://172.18.75.64:3306/zhi_house?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    #url: jdbc:mysql://47.112.166.173:3306/zhi_house?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    username: root
+    password: 4dkankan4dage
+    hikari:
+      connection-timeout: 30000         # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 默认:30秒
+      minimum-idle: 5                   # 最小连接数
+      maximum-pool-size: 20             # 最大连接数
+      auto-commit: true                 # 事务自动提交
+      idle-timeout: 600000              # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10分钟
+      pool-name: DateSourceHikariCP     # 连接池名字
+      max-lifetime: 1800000             # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认:30分钟 1800000ms
+      connection-test-query: SELECT 1   # 连接测试语句
+
+
+logging:
+  config: classpath:logback-spring.xml
+  path : /home/ubuntu/data-bak/zhiHouse/tomcat/rm-nas
+
+fyun:
+  type: oss
+  key: LTAI5tC5Ema4raGNCZYSNrkN
+  secret: BjqU1lSVnNUbJouGkq13JG9DmcpaDx
+  bucket: zfb-zhm-test
+  coldBucket: zfb-4dkk-bak
+  endPoint: http://oss-cn-shenzhen-internal.aliyuncs.com
+  #endPoint: http://oss-cn-shenzhen.aliyuncs.com
+  host: https://zfb.4dage.com/

+ 38 - 0
src/main/resources/application-v2oss.yaml

@@ -0,0 +1,38 @@
+server:
+  port: 7012
+  servlet:
+    context-path: /
+  tomcat:
+    max-http-form-post-size: -1
+spring:
+  datasource:
+    type: com.zaxxer.hikari.HikariDataSource          # 数据源类型:HikariCP
+    driver-class-name: com.mysql.jdbc.Driver          # mysql驱动
+    url: jdbc:mysql://172.18.75.64:3306/zhi_house?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    #url: jdbc:mysql://47.112.166.173:3306/zhi_house?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    username: root
+    password: 4dkankan4dage
+    hikari:
+      connection-timeout: 30000         # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 默认:30秒
+      minimum-idle: 5                   # 最小连接数
+      maximum-pool-size: 20             # 最大连接数
+      auto-commit: true                 # 事务自动提交
+      idle-timeout: 600000              # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10分钟
+      pool-name: DateSourceHikariCP     # 连接池名字
+      max-lifetime: 1800000             # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认:30分钟 1800000ms
+      connection-test-query: SELECT 1   # 连接测试语句
+
+
+logging:
+  config: classpath:logback-spring.xml
+  path : /home/data-zfb/rm-nas-v2
+
+fyun:
+  type: oss
+  key: LTAI5tC5Ema4raGNCZYSNrkN
+  secret: BjqU1lSVnNUbJouGkq13JG9DmcpaDx
+  bucket: zfb-zhm-test
+  coldBucket: zfb-4dkk-bak
+  endPoint: http://oss-cn-shenzhen-internal.aliyuncs.com
+  #endPoint: http://oss-cn-shenzhen.aliyuncs.com
+  host: https://zfb.4dage.com/

+ 42 - 0
src/main/resources/application-v3.yaml

@@ -0,0 +1,42 @@
+server:
+  port: 7002
+  servlet:
+    context-path: /
+  tomcat:
+    max-http-form-post-size: -1
+spring:
+  datasource:
+    type: com.zaxxer.hikari.HikariDataSource          # 数据源类型:HikariCP
+    driver-class-name: com.mysql.jdbc.Driver          # mysql驱动
+    #url: jdbc:mysql://120.24.202.7:3306/zhi_house?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    url: jdbc:mysql://127.0.0.1:3306/zhi_house?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    username: root
+    password: zfb@20210727%
+    hikari:
+      connection-timeout: 30000         # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 默认:30秒
+      minimum-idle: 5                   # 最小连接数
+      maximum-pool-size: 20             # 最大连接数
+      auto-commit: true                 # 事务自动提交
+      idle-timeout: 600000              # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10分钟
+      pool-name: DateSourceHikariCP     # 连接池名字
+      max-lifetime: 1800000             # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认:30分钟 1800000ms
+      connection-test-query: SELECT 1   # 连接测试语句
+
+
+logging:
+  config: classpath:logback-spring.xml
+  path : /home/data-zfb/rm-nas
+#mybatis-plus:
+#  configuration:
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #开启sql日志
+
+
+fyun:
+  type: oss
+  key: LTAI5tC5Ema4raGNCZYSNrkN
+  secret: BjqU1lSVnNUbJouGkq13JG9DmcpaDx
+  bucket: zfb-4dkankan
+  coldBucket: zfb-4dkk-bak
+  endPoint: http://oss-cn-shenzhen-internal.aliyuncs.com
+  #endPoint: http://oss-cn-shenzhen.aliyuncs.com
+  host: https://zfb.4dage.com/

+ 14 - 0
src/main/resources/application.yaml

@@ -0,0 +1,14 @@
+spring:
+  profiles:
+    active: ${activeProfile:v3}
+  servlet:
+    multipart:
+      # 设置单个文件大小
+      max-file-size: 1024MB
+      # 设置单次请求文件的总大小
+      max-request-size: 1024MB
+
+mybatis-plus:
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #开启sql日志
+

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

@@ -0,0 +1,255 @@
+<?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}/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>
+
+	<!-- 时间滚动输出 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>
+
+	<!-- 时间滚动输出 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>
+
+
+	<!-- 时间滚动输出 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="PROGRAM_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!-- 正在记录的日志文件的路径及文件名 -->
+		<file>${log.path}/program/log_program.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}/program/log-program-%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">
+			<onMatch>ACCEPT</onMatch>
+			<onMismatch>DENY</onMismatch>
+		</filter>
+	</appender>
+	<logger name="programLog" level="INFO" additivity="true">
+        <appender-ref ref="PROGRAM_FILE"/>
+    </logger>
+
+	<appender name="VISIT_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!-- 正在记录的日志文件的路径及文件名 -->
+		<file>${log.path}/visit/log_visit.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}/visit/log-visit-%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">
+			<onMatch>ACCEPT</onMatch>
+			<onMismatch>DENY</onMismatch>
+		</filter>
+	</appender>
+	<logger name="visitLog" level="INFO" additivity="true">
+        <appender-ref ref="VISIT_FILE"/>
+    </logger>
+
+
+	<!--  连接时长  -->
+	<appender name="timeLogger" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<file>${log.path}/timeLogger.log</file>
+		<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+			<level>DEBUG</level>
+		</filter>
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<fileNamePattern>${log.path}/timeLogger/timeLogger-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<maxFileSize>100MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+			<!--日志文件保留天数-->
+			<maxHistory>10</maxHistory>
+		</rollingPolicy>
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
+		</encoder>
+	</appender>
+	<logger name="timeLogger" additivity="false" level="DEBUG">
+		<appender-ref ref="timeLogger"/>
+	</logger>
+
+	<!-- <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="DEBUG_FILE" />
+		<appender-ref ref="INFO_FILE" />
+		<appender-ref ref="WARN_FILE" />
+		<appender-ref ref="ERROR_FILE" />
+	</root>
+
+	<!--生产环境:输出到文件 -->
+	<!--<springProfile name="pro"> -->
+	<!--<root level="info"> -->
+	<!--<appender-ref ref="CONSOLE" /> -->
+	<!--<appender-ref ref="DEBUG_FILE" /> -->
+	<!--<appender-ref ref="INFO_FILE" /> -->
+	<!--<appender-ref ref="ERROR_FILE" /> -->
+	<!--<appender-ref ref="WARN_FILE" /> -->
+	<!--</root> -->
+	<!--</springProfile> -->
+
+</configuration>
+
+

+ 5 - 0
src/main/resources/mapper/rmnas/TbOssCloudMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.rmnas.mapper.ITbOssCloudMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/rmnas/TbRmNasLogMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.rmnas.mapper.ITbRmNasLogMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/rmnas/TbSceneDeleteMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.rmnas.mapper.ITbSceneDeleteMapper">
+
+</mapper>

+ 18 - 0
src/main/resources/mapper/rmnas/TbSceneMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.rmnas.mapper.ITbSceneMapper">
+
+    <select id="getLastYear" resultType="com.fdkankan.rmnas.entity.TbScene">
+        select * from tb_scene s where
+         (select count(*) as num from tb_rm_nas_log l where s.num = l.num) = 0
+                                   and s.create_time  &lt;= #{param.yearTime}
+        order by s.id asc
+    </select>
+
+    <select id="getLastYearOss" resultType="com.fdkankan.rmnas.vo.CommonScene">
+        select s.num,s.datasource as dataSource from tb_scene s where
+                (select count(*) as num from tb_oss_cloud l where s.num = l.num) = 0
+                                   and s.create_time  &lt;= #{param.yearTime}
+        order by s.id asc
+    </select>
+</mapper>

+ 17 - 0
src/main/resources/mapper/rmnas/TbSceneProMapper.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.rmnas.mapper.ITbSceneProMapper">
+
+    <select id="getLastYear" resultType="com.fdkankan.rmnas.entity.TbScenePro">
+        select * from tb_scene_pro s where
+                (select count(*) as num from tb_rm_nas_log l where s.num = l.num) = 0
+                                   and s.create_time  &lt;= #{param.yearTime}
+        order by s.id asc
+    </select>
+    <select id="getLastYearOss" resultType="com.fdkankan.rmnas.vo.CommonScene">
+        select s.num,s.data_source from tb_scene_pro s where
+                (select count(*) as num from tb_oss_cloud l where s.num = l.num) = 0
+                                   and s.create_time  &lt;= #{param.yearTime}
+        order by s.id asc
+    </select>
+</mapper>