Browse Source

本地化清理无用包

lyhzzz 6 months ago
parent
commit
a708890921
57 changed files with 275 additions and 1155 deletions
  1. 1 54
      pom.xml
  2. 0 1
      src/main/java/com/fdkankan/fusion/FusionApplication.java
  3. 5 0
      src/main/java/com/fdkankan/fusion/common/util/LocalToOssUtil.java
  4. 0 2
      src/main/java/com/fdkankan/fusion/common/util/MD5Checksum.java
  5. 0 377
      src/main/java/com/fdkankan/fusion/common/util/UploadToOssUtil.java
  6. 142 0
      src/main/java/com/fdkankan/fusion/config/FdkkLaserConfig.java
  7. 2 12
      src/main/java/com/fdkankan/fusion/controller/LoginController.java
  8. 2 2
      src/main/java/com/fdkankan/fusion/controller/ModelController.java
  9. 8 8
      src/main/java/com/fdkankan/fusion/controller/SceneController.java
  10. 0 1
      src/main/java/com/fdkankan/fusion/controller/TmDepartmentController.java
  11. 1 10
      src/main/java/com/fdkankan/fusion/controller/TmRoleController.java
  12. 2 6
      src/main/java/com/fdkankan/fusion/controller/TmUserController.java
  13. 3 3
      src/main/java/com/fdkankan/fusion/down/CaseDownService.java
  14. 2 2
      src/main/java/com/fdkankan/fusion/httpClient/FdService.java
  15. 0 1
      src/main/java/com/fdkankan/fusion/httpClient/response/FdkkUserVo.java
  16. 1 14
      src/main/java/com/fdkankan/fusion/mq/consumer/LaserSceneGpsConsumer.java
  17. 0 4
      src/main/java/com/fdkankan/fusion/mq/consumer/OsgbToB3dmConsumer.java
  18. 0 2
      src/main/java/com/fdkankan/fusion/service/impl/CameraDetailServiceImpl.java
  19. 0 2
      src/main/java/com/fdkankan/fusion/service/impl/CameraServiceImpl.java
  20. 0 3
      src/main/java/com/fdkankan/fusion/service/impl/CameraVersionAppServiceImpl.java
  21. 1 4
      src/main/java/com/fdkankan/fusion/service/impl/CameraVersionServiceImpl.java
  22. 4 4
      src/main/java/com/fdkankan/fusion/service/impl/CaseFilesServiceImpl.java
  23. 0 1
      src/main/java/com/fdkankan/fusion/service/impl/CaseInquestCriminalServiceImpl.java
  24. 0 1
      src/main/java/com/fdkankan/fusion/service/impl/CaseLiveServiceImpl.java
  25. 6 11
      src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java
  26. 4 4
      src/main/java/com/fdkankan/fusion/service/impl/CaseScriptServiceImpl.java
  27. 1 1
      src/main/java/com/fdkankan/fusion/service/impl/CaseServiceImpl.java
  28. 2 2
      src/main/java/com/fdkankan/fusion/service/impl/CaseVideoFolderServiceImpl.java
  29. 8 8
      src/main/java/com/fdkankan/fusion/service/impl/CaseVideoServiceImpl.java
  30. 9 9
      src/main/java/com/fdkankan/fusion/service/impl/CommonUploadServiceImpl.java
  31. 10 10
      src/main/java/com/fdkankan/fusion/service/impl/CopyCaseService.java
  32. 1 1
      src/main/java/com/fdkankan/fusion/service/impl/DictFileServiceImpl.java
  33. 1 1
      src/main/java/com/fdkankan/fusion/service/impl/DictServiceImpl.java
  34. 1 5
      src/main/java/com/fdkankan/fusion/service/impl/DownService.java
  35. 2 2
      src/main/java/com/fdkankan/fusion/service/impl/ModelServiceImpl.java
  36. 1 2
      src/main/java/com/fdkankan/fusion/service/impl/MqSendLogServiceImpl.java
  37. 2 2
      src/main/java/com/fdkankan/fusion/service/impl/SceneEditInfoServiceImpl.java
  38. 2 2
      src/main/java/com/fdkankan/fusion/service/impl/ScenePlusExtServiceImpl.java
  39. 2 2
      src/main/java/com/fdkankan/fusion/service/impl/ScenePlusServiceImpl.java
  40. 1 15
      src/main/java/com/fdkankan/fusion/service/impl/SceneService.java
  41. 4 4
      src/main/java/com/fdkankan/fusion/service/impl/ThreadService.java
  42. 1 2
      src/main/java/com/fdkankan/fusion/service/impl/TmCameraServiceImpl.java
  43. 3 33
      src/main/java/com/fdkankan/fusion/service/impl/TmDepartmentServiceImpl.java
  44. 1 3
      src/main/java/com/fdkankan/fusion/service/impl/TmMessageServiceImpl.java
  45. 2 11
      src/main/java/com/fdkankan/fusion/service/impl/TmProjectServiceImpl.java
  46. 2 4
      src/main/java/com/fdkankan/fusion/service/impl/TmUserServiceImpl.java
  47. 8 6
      src/main/java/com/fdkankan/fusion/service/impl/UploadService.java
  48. 2 2
      src/main/java/com/fdkankan/fusion/service/impl/UserServiceImpl.java
  49. 0 99
      src/main/java/com/fdkankan/fusion/websocket/MyWebSocketServer.java
  50. 0 128
      src/main/java/com/fdkankan/fusion/websocket/SessionService.java
  51. 0 25
      src/main/java/com/fdkankan/fusion/websocket/WebSocketConfig.java
  52. 0 85
      src/main/java/com/fdkankan/fusion/websocket/WebSocketConfigurator.java
  53. 0 7
      src/main/java/com/fdkankan/fusion/websocket/enums/CommonEnum.java
  54. 0 40
      src/main/java/com/fdkankan/fusion/websocket/service/MessageService.java
  55. 0 45
      src/main/java/com/fdkankan/fusion/websocket/vo/RequestMsg.java
  56. 0 26
      src/main/java/com/fdkankan/fusion/websocket/vo/WsMessage.java
  57. 25 44
      src/main/resources/application.yml

+ 1 - 54
pom.xml

@@ -47,19 +47,6 @@
             <version>3.4.3.4</version>
         </dependency>
 
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
-            <version>3.5.0</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid-spring-boot-starter</artifactId>
-            <version>1.1.22</version>
-        </dependency>
-
-
         <!--mybatis-plus代码生成器-->
         <dependency>
             <groupId>com.baomidou</groupId>
@@ -86,24 +73,16 @@
         </dependency>
 
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-amqp</artifactId>
-            <version>2.3.12.RELEASE</version>
-        </dependency>
-
-        <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>fastjson</artifactId>
             <version>1.2.83</version>
         </dependency>
 
-
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-validation</artifactId>
         </dependency>
 
-
         <!--htt请求工具-->
         <dependency>
             <groupId>com.dtflys.forest</groupId>
@@ -130,44 +109,12 @@
             <version>1.18.20</version>
         </dependency>
 
-
-        <dependency>
-            <groupId>com.aliyun.oss</groupId>
-            <artifactId>aliyun-sdk-oss</artifactId>
-            <version>3.6.0</version>
-        </dependency>
-
-
-        <!-- Sa-Token 权限认证, 在线文档:http://sa-token.dev33.cn/ -->
-        <dependency>
-            <groupId>cn.dev33</groupId>
-            <artifactId>sa-token-spring-boot-starter</artifactId>
-            <version>1.34.0</version>
-        </dependency>
-        <!-- Sa-Token 整合 jwt -->
-        <dependency>
-            <groupId>cn.dev33</groupId>
-            <artifactId>sa-token-jwt</artifactId>
-            <version>1.34.0</version>
-        </dependency>
-
-        <!-- 添加图形验证码依赖 -->
-        <dependency>
-            <groupId>cn.hutool</groupId>
-            <artifactId>hutool-captcha</artifactId>
-            <version>5.8.6</version>
-        </dependency>
-
-        <!--websocket-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-websocket</artifactId>
-        </dependency>
         <dependency>
             <groupId>com.deepoove</groupId>
             <artifactId>poi-tl</artifactId>
             <version>1.12.2</version>
         </dependency>
+
         <dependency>
             <groupId>org.apache.poi</groupId>
             <artifactId>poi-ooxml</artifactId>

+ 0 - 1
src/main/java/com/fdkankan/fusion/FusionApplication.java

@@ -9,7 +9,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
-import org.springframework.web.socket.config.annotation.EnableWebSocket;
 
 @SpringBootApplication
 @EnableTransactionManagement//开启事务

+ 5 - 0
src/main/java/com/fdkankan/fusion/common/util/LocalToOssUtil.java

@@ -28,6 +28,11 @@ public class LocalToOssUtil {
 
     }
 
+    public String getOssPath( String filePath) {
+        return basePath.concat(bucket).concat(File.separator).concat(filePath);
+
+    }
+
     public boolean existKey(String objectName) {
         return FileUtil.exist(getOssPath(bucket, objectName));
     }

+ 0 - 2
src/main/java/com/fdkankan/fusion/common/util/MD5Checksum.java

@@ -1,8 +1,6 @@
 package com.fdkankan.fusion.common.util;
 
 import cn.hutool.core.io.FileUtil;
-import com.aliyun.oss.OSSClient;
-import com.aliyun.oss.model.GetObjectRequest;
 import com.fdkankan.fusion.response.FileInfoVo;
 
 import java.io.File;

+ 0 - 377
src/main/java/com/fdkankan/fusion/common/util/UploadToOssUtil.java

@@ -1,377 +0,0 @@
-package com.fdkankan.fusion.common.util;
-
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.io.FileUtil;
-import com.aliyun.oss.OSSClient;
-import com.aliyun.oss.common.utils.BinaryUtil;
-import com.aliyun.oss.model.*;
-import com.fdkankan.fusion.response.FileInfoVo;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-import org.springframework.util.ObjectUtils;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.commons.CommonsMultipartFile;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.util.stream.Collectors;
-
-@Slf4j
-@Component
-public class UploadToOssUtil {
-
-
-	@Value("${oss.point}")
-	private String point;
-
-	@Value("${oss.key}")
-	private String key;
-
-	@Value("${oss.secrey}")
-	private String secrey;
-
-	@Value("${oss.bucket:4dkankan}")
-	private String bucket;
-
-	@Value("${upload.type:oss}")
-	private String type;
-
-	@Value("${upload.query-path}")
-	private String queryPath;
-
-	@Autowired
-	LocalToOssUtil localToOssUtil;
-
-
-	/**
-	 * 获取文件内容-阿里云
-	 * @param objectName
-	 * @return
-	 */
-	public boolean existKey(String objectName){
-		//创建oss客户端
-		if("local".equals(type)){
-			return localToOssUtil.existKey(objectName);
-		}
-		OSSClient ossClient = new OSSClient(point, key, secrey);
-		// ossObject包含文件所在的存储空间名称、文件名称、文件元信息以及一个输入流。
-		try{
-			boolean exist = ossClient.doesObjectExist(bucket, objectName);
-			return exist;
-		}catch (Exception e){
-			log.error("s4判断是否存在key异常,key=" + objectName, e);
-		}finally {
-			if(ossClient != null){
-				ossClient.shutdown();
-			}
-		}
-		return false;
-	}
-
-	/**
-	 * 从阿里云oss下载文件到本地
-	 * @param objectName 云端文件k地址
-	 * @param localPath 本地文件地址
-	 * @return
-	 */
-	public boolean downFormAli(String objectName, String localPath){
-		if("local".equals(type)){
-			return localToOssUtil.downFormAli(objectName,localPath);
-		}
-		OSSClient ossClient = new OSSClient(point, key, secrey);
-		try {
-			com.aliyun.oss.model.GetObjectRequest request  = new com.aliyun.oss.model.GetObjectRequest(bucket,objectName);
-			File file = new File(localPath);
-			if(!file.getParentFile().exists()){
-				file.getParentFile().mkdirs();
-				file = new File(localPath);
-			}
-			ossClient.getObject(request, file);
-			return true;
-		}catch (Exception e){
-			log.error("阿里云oss文件下载失败,key=" + objectName, e);
-		}finally {
-			if(ossClient != null){
-				ossClient.shutdown();
-			}
-		}
-		return false;
-	}
-
-
-	public  void uploadOss(String filePath, String key1){
-		if("local".equals(type)){
-			localToOssUtil.uploadOss(filePath,key1);
-			return ;
-		}
-		OSSClient ossClient = new OSSClient(point, key, secrey);
-		try {
-			log.info("upload-to-oss:file-path:{},oss-path:{}",filePath,key1);
-			File file = new File(filePath);
-			if (!file.exists()) {
-				log.info("upload-to-oss:file-path:{},oss-path:{},filePath不存在!",filePath,key1);
-				return;
-			}
-			ObjectMetadata metadata = new ObjectMetadata();
-			ossClient.putObject(bucket, key1, new File(filePath), metadata);
-		} catch (Exception e) {
-			log.info("upload-to-oss:error:file-path:{},key:{}",filePath,key1);
-		} finally {
-			ossClient.shutdown();
-		}
-	}
-	public void delete(String objectName){
-		if("local".equals(type)){
-			localToOssUtil.delete(objectName);
-			return ;
-		}
-		OSSClient ossClient = new OSSClient(point, key, secrey);
-		try {
-			ossClient.deleteObject(bucket, objectName);
-		} catch (Exception e) {
-			log.error("OSS删除文件失败,key=" + objectName);
-		}finally {
-			if(ossClient != null){
-				ossClient.shutdown();
-			}
-		}
-	}
-
-	/**
-	 * 获得文件列表-阿里云
-	 * @return
-	 */
-	public List<String> listKeysFromAli(String sourcePath) {
-		if("local".equals(type)){
-			return localToOssUtil.listKeysFromAli(sourcePath);
-		}
-		List<String> keyList = new ArrayList<>();
-		OSSClient ossClient = new OSSClient(point, key, secrey);
-		try {
-			boolean flag = true;
-			String nextMaker = null;
-			ListObjectsRequest listObjectsRequest = new ListObjectsRequest(this.bucket);
-			//指定下一级文件
-			listObjectsRequest.setPrefix(sourcePath);
-			//设置分页的页容量
-			listObjectsRequest.setMaxKeys(200);
-			do
-			{
-				//获取下一页的起始点,它的下一项
-				listObjectsRequest.setMarker(nextMaker);
-				ObjectListing objectListing = ossClient.listObjects(listObjectsRequest);
-				List<OSSObjectSummary> objectSummaries = objectListing.getObjectSummaries();
-				List<String> collect = objectSummaries.stream().map(summary -> {
-					return summary.getKey();
-				}).collect(Collectors.toList());
-				if(CollUtil.isNotEmpty(collect)){
-					keyList.addAll(collect);
-				}
-				nextMaker = objectListing.getNextMarker();
-				//全部执行完后,为false
-				flag = objectListing.isTruncated();
-			} while (flag);
-		}catch (Exception e){
-			log.error("获取文件列表失败,path="+sourcePath, e);
-		}finally {
-			if(ossClient != null){
-				ossClient.shutdown();
-			}
-		}
-
-
-		ossClient.shutdown();
-
-		return keyList;
-	}
-
-	/**
-	 * 获取文件内容-阿里云
-	 * @param bucketName
-	 * @param objectName
-	 * @return
-	 */
-	public String getObjectContent(String bucketName, String objectName){
-		//创建oss客户端
-		OSSClient ossClient = new OSSClient(point, key, secrey);
-		InputStream objectContent = null;
-		StringBuilder contentJson = new StringBuilder();
-		try {
-			// ossObject包含文件所在的存储空间名称、文件名称、文件元信息以及一个输入流。
-			OSSObject ossObject = ossClient.getObject(bucketName, objectName);
-			objectContent = ossObject.getObjectContent();
-			try(BufferedReader reader = new BufferedReader(new InputStreamReader(objectContent))){
-				while (true) {
-					String line = reader.readLine();
-					if (line == null) break;
-					contentJson.append(line);
-				}
-			} catch (IOException e) {
-				log.error("读取scene.json文件流失败", e);
-			}
-		}catch (Exception e){
-			log.error("s3获取文件内容失败,key="+objectName, e);
-		}finally {
-			if(ossClient != null){
-				ossClient.shutdown();
-			}
-		}
-
-		return contentJson.toString();
-	}
-
-	public  void uploadFileOss(File file) {
-		if("local".equals(type)){
-			localToOssUtil.uploadFileOss(file);
-			return ;
-		}
-		if(file.isFile()){
-			String ossPath = file.getPath();
-			ossPath = ossPath.replace("/mnt/","");
-			ossPath =  ossPath.replace("\\","/");
-			this.uploadOss(file.getPath(),ossPath);
-		}else {
-			File[] files = file.listFiles();
-			for (File file1 : files) {
-				uploadFileOss(file1);
-			}
-		}
-	}
-
-	public void copyFile( String sourcePath, String targetPath) {
-		if("local".equals(type)){
-			 localToOssUtil.copyFile(sourcePath,targetPath);
-			return;
-		}
-
-		OSSClient ossClient = new OSSClient(point, key, secrey);
-
-		try {
-			List<String> files = listKeysFromAli( sourcePath);
-			if (ObjectUtils.isEmpty(files)) {
-				return;
-			}
-			files.stream().forEach(file -> {
-				log.info("oss-copy-file---sourcePath:{},targetPath:{}",sourcePath,targetPath);
-				ossClient.copyObject(this.bucket, file, this.bucket, file.replace(sourcePath, targetPath));
-			});
-		} catch (Exception e) {
-			log.error("列举文件目录失败,key:" + sourcePath, e);
-		}finally {
-			if(ossClient != null){
-				ossClient.shutdown();
-			}
-		}
-	}
-
-	private String getMd5(String filePath){
-		OSSClient ossClient = new OSSClient(point, key, secrey);
-		String md5 = null;
-		try {
-			InputStream inputStream = ossClient.getObject(bucket, filePath).getObjectContent();
-			md5 = MD5Checksum.getMD5(inputStream);
-			log.info("Calculated MD5 for " + filePath + " is " + md5);
-			inputStream.close();
-		}catch (Exception e){
-			log.info("oss-getMd5-error:{}",e);
-		}finally {
-			if(ossClient != null){
-				ossClient.shutdown();
-			}
-		}
-		return md5;
-	}
-
-	private String getSHA1(String filePath){
-		OSSClient ossClient = new OSSClient(point, key, secrey);
-		String md5 = null;
-		try {
-			InputStream inputStream = ossClient.getObject(bucket, filePath).getObjectContent();
-			md5 = MD5Checksum.getSHA1(inputStream);
-			log.info("Calculated MD5 for " + filePath + " is " + md5);
-			inputStream.close();
-		}catch (Exception e){
-			log.info("oss-getMd5-error:{}",e);
-		}finally {
-			if(ossClient != null){
-				ossClient.shutdown();
-			}
-		}
-		return md5;
-	}
-	private Long getLastModified(String filePath){
-		OSSClient ossClient = new OSSClient(point, key, secrey);
-		try {
-			GetObjectRequest getObjectMetadataRequest = new GetObjectRequest(bucket, filePath);
-			Date  LastMo = ossClient.getObjectMetadata(getObjectMetadataRequest).getLastModified();
-			return LastMo.getTime();
-		}catch (Exception e){
-			log.info("oss-getMd5-error:{}",e);
-		}finally {
-			if(ossClient != null){
-				ossClient.shutdown();
-			}
-		}
-		return null;
-	}
-
-	public FileInfoVo getFileInfo(String filePath){
-		if("local".equals(type)){
-			return localToOssUtil.getFileInfo(filePath);
-		}
-		OSSClient ossClient = new OSSClient(point, key, secrey);
-		try {
-			GetObjectRequest getObjectMetadataRequest = new GetObjectRequest(bucket, filePath);
-			Date LastMo = ossClient.getObjectMetadata(getObjectMetadataRequest).getLastModified();
-			String md5 = ossClient.getObjectMetadata(getObjectMetadataRequest).getETag();
-			Long size = ossClient.getObjectMetadata(getObjectMetadataRequest).getContentLength();
-
-			InputStream inputStream = ossClient.getObject(bucket, filePath).getObjectContent();
-			String sha1 = MD5Checksum.getSHA1(inputStream);
-			return new FileInfoVo(md5,sha1.toUpperCase(),LastMo.getTime(),size);
-		}catch (Exception e){
-			log.info("oss-getFileInfo-error:{}",filePath,e);
-		}finally {
-			if(ossClient != null){
-				ossClient.shutdown();
-			}
-		}
-		return null;
-	}
-
-	public Long getSize(String filePath){
-		if("local".equals(type)){
-			return localToOssUtil.getSize(filePath);
-		}
-		OSSClient ossClient = new OSSClient(point, key, secrey);
-		Long total = 0L;
-		try {
-			List<String> files = listKeysFromAli( filePath);
-			if (ObjectUtils.isEmpty(files)) {
-				return 0L;
-			}
-			for (String file : files) {
-				GetObjectRequest getObjectMetadataRequest = new GetObjectRequest(bucket, file);
-				Long size = ossClient.getObjectMetadata(getObjectMetadataRequest).getContentLength();
-				total += size;
-			}
-
-		}catch (Exception e){
-			log.info("oss-getFileInfo-error:{}",e);
-		}finally {
-			if(ossClient != null){
-				ossClient.shutdown();
-			}
-		}
-		return total;
-	}
-
-	public String getOssPath(String path) {
-		return path.replace(queryPath,"");
-	}
-}

+ 142 - 0
src/main/java/com/fdkankan/fusion/config/FdkkLaserConfig.java

@@ -0,0 +1,142 @@
+package com.fdkankan.fusion.config;
+
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.StrUtil;
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+
+/**
+ * 读取项目相关配置
+ *
+ * @author fdkk
+ */
+@Component
+@ConfigurationProperties(prefix = "fdkk")
+@Data
+public class FdkkLaserConfig {
+
+
+    /**
+     * 上传路径
+     */
+    private static String profile;
+
+
+
+    /**
+     * 是否本地化文件存储
+     */
+    private static boolean isLocalization;
+    /**
+     * 本地化化部署,是否启用软连接
+     */
+    private static boolean isLink;
+
+    /**
+     * 是否使用文件存储系统
+     */
+    private static boolean isBucket;
+
+    /**
+     * java存放路径
+     */
+    public String binPath;
+
+
+    /**
+     * OSS默认路径
+     */
+    public String defaultFolder;
+
+
+    /**
+     * 生成模型的路径
+     */
+    public String buildModelPath;
+
+    public Integer laserPort;
+
+    public Integer getLaserPort() {
+        return laserPort;
+    }
+
+    public void setLaserPort(Integer laserPort) {
+        this.laserPort = laserPort;
+    }
+
+    @PostConstruct
+    private void init() {
+        FileUtil.mkdir(FdkkLaserConfig.profile);
+    }
+
+
+    public static String getProfile(String prefix) {
+        if(StrUtil.isNotEmpty(prefix)){
+            return prefix;
+        }
+        return FdkkLaserConfig.profile;
+    }
+
+    public void setProfile(String profile) {
+        FdkkLaserConfig.profile = profile;
+    }
+
+
+
+
+    public static boolean isLocalization() {
+        return FdkkLaserConfig.isLocalization;
+    }
+
+    public void setIsLocalization(boolean isLocalization) {
+        FdkkLaserConfig.isLocalization = isLocalization;
+    }
+
+    public static boolean isIsLink() {
+        return FdkkLaserConfig.isLink;
+    }
+
+    public  void setIsLink(boolean isLink) {
+        FdkkLaserConfig.isLink = isLink;
+    }
+
+
+    public static boolean isBucket() {
+        return FdkkLaserConfig.isBucket;
+    }
+
+    public  void setIsBucket(boolean isBucket) {
+        FdkkLaserConfig.isBucket = isBucket;
+    }
+
+    /**
+     * 获取导入上传路径
+     */
+    public static String getImportPath(String prefix) {
+        return FdkkLaserConfig.getProfile(prefix) + "/import";
+    }
+
+    /**
+     * 获取头像上传路径
+     */
+    public static String getAvatarPath(String prefix) {
+        return FdkkLaserConfig.getProfile(prefix) + "/avatar";
+    }
+
+    /**
+     * 获取下载路径
+     */
+    public static String getDownloadPath(String prefix) {
+        return FdkkLaserConfig.getProfile(prefix) + "/download/";
+    }
+
+    /**
+     * 获取上传路径
+     */
+    public static String getUploadPath(String prefix) {
+        return FdkkLaserConfig.getProfile(prefix) + "/upload";
+    }
+}

+ 2 - 12
src/main/java/com/fdkankan/fusion/controller/LoginController.java

@@ -1,7 +1,7 @@
 package com.fdkankan.fusion.controller;
 
-import cn.dev33.satoken.stp.SaLoginConfig;
-import cn.dev33.satoken.stp.StpUtil;
+
+
 import cn.hutool.captcha.CaptchaUtil;
 import cn.hutool.captcha.LineCaptcha;
 import com.alibaba.excel.EasyExcel;
@@ -82,14 +82,7 @@ public class LoginController extends BaseController{
         FdkkResponse<FdkkLoginVo> fdkkLoginVo = fdKKClient.fdkkLogin(param);
         if(fdkkLoginVo.getCode() == 0){
             FdkkLoginVo data = fdkkLoginVo.getData();
-            StpUtil.login(tmUser.getId(), SaLoginConfig
-                    .setExtra("userId",tmUser.getId())
-                    //.setExtra("fdToken",data.getToken())
-                    .setExtra("userName",data.getUser().getUserName())
-                    .setExtra("deptId",tmUser.getDeptId())
-                    .setExtra("nickName",tmUser.getNickName()));
             data.setFdToken(data.getToken());
-            data.setToken(StpUtil.getTokenValue());
             tmUserService.setRoleAndPermToRedis(tmUser);
             data.setTmUser(tmUser);
             redisUtil.set(String.format(RedisKeyUtil.fusionLoginToken,data.getToken()),JSONObject.toJSONString(data),RedisKeyUtil.tokenTime);
@@ -101,11 +94,8 @@ public class LoginController extends BaseController{
 
     @PostMapping("/fdLogout")
     public ResultData fdLogout(){
-        String fusionLoginToken = String.format(RedisKeyUtil.fusionLoginToken, StpUtil.getTokenValue());
         String fdToken = String.format(RedisKey.TOKEN_V3,fdService.getFdToken());
-        redisUtil.del(fusionLoginToken);
         redisUtil.del(fdToken);
-        StpUtil.logout();
         return ResultData.ok();
     }
 }

+ 2 - 2
src/main/java/com/fdkankan/fusion/controller/ModelController.java

@@ -153,7 +153,7 @@ public class ModelController extends BaseController{
     @Value("${spring.profiles.active}")
     private String environment;
     @Autowired
-    UploadToOssUtil uploadToOssUtil;
+    LocalToOssUtil localToOssUtil;
     @Value("${upload.query-path}")
     private String queryPath;
     @GetMapping("/downMD5")
@@ -170,7 +170,7 @@ public class ModelController extends BaseController{
             }
             String sceneObjPath = model.getFileNewName().replace(queryPath,"");
 
-            FileInfoVo fileInfo = uploadToOssUtil.getFileInfo(sceneObjPath);
+            FileInfoVo fileInfo = localToOssUtil.getFileInfo(sceneObjPath);
             if(fileInfo == null){
                 throw new BusinessException(ResultCode.FILE_NOT_EXIST);
             }

+ 8 - 8
src/main/java/com/fdkankan/fusion/controller/SceneController.java

@@ -4,7 +4,7 @@ import cn.hutool.core.io.FileUtil;
 import com.fdkankan.fusion.common.FilePath;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.ResultData;
-import com.fdkankan.fusion.common.util.UploadToOssUtil;
+import com.fdkankan.fusion.common.util.LocalToOssUtil;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.httpClient.request.LaserSceneParam;
 import com.fdkankan.fusion.request.ScenePram;
@@ -66,7 +66,7 @@ public class SceneController extends BaseController{
     }
 
     @Autowired
-    UploadToOssUtil uploadToOssUtil;
+    LocalToOssUtil localToOssUtil;
 
     @Value("${spring.profiles.active}")
     private String environment;
@@ -87,20 +87,20 @@ public class SceneController extends BaseController{
 
             if(type == 2 || type == 5){  //点云
                 sceneObjPath = String.format(FilePath.LASER_OSS_PATH, num,num)+"/cloud.js" ;
-                fileInfo = uploadToOssUtil.getFileInfo(sceneObjPath);
+                fileInfo = localToOssUtil.getFileInfo(sceneObjPath);
                 String scenePath = String.format(FilePath.LASER_OSS_PATH, num,num);
-                size = uploadToOssUtil.getSize(scenePath);
+                size = localToOssUtil.getSize(scenePath);
             }else {
                 sceneObjPath = String.format(FilePath.OBJ_OSS_PATH,num) + "/images/3dtiles/tileset.json";
-                if(!uploadToOssUtil.existKey(sceneObjPath)){
+                if(!localToOssUtil.existKey(sceneObjPath)){
                     sceneObjPath = String.format(FilePath.OBJ_OSS_PATH,num) + "/data/mesh/mesh.json";
                 }
-                if(!uploadToOssUtil.existKey(sceneObjPath)){
+                if(!localToOssUtil.existKey(sceneObjPath)){
                     sceneObjPath = String.format(FilePath.OBJ_OSS_PATH,num) + "/data/mesh/mesh.obj";
                 }
-                fileInfo = uploadToOssUtil.getFileInfo(sceneObjPath);
+                fileInfo = localToOssUtil.getFileInfo(sceneObjPath);
                 String scenePath = String.format(FilePath.OBJ_OSS_PATH, num);
-                size = uploadToOssUtil.getSize(scenePath);
+                size = localToOssUtil.getSize(scenePath);
             }
             if(fileInfo == null){
                 throw new BusinessException(ResultCode.FILE_NOT_EXIST);

+ 0 - 1
src/main/java/com/fdkankan/fusion/controller/TmDepartmentController.java

@@ -1,7 +1,6 @@
 package com.fdkankan.fusion.controller;
 
 
-import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.util.ObjectUtil;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.ResultData;

+ 1 - 10
src/main/java/com/fdkankan/fusion/controller/TmRoleController.java

@@ -1,7 +1,7 @@
 package com.fdkankan.fusion.controller;
 
 
-import cn.dev33.satoken.stp.StpUtil;
+
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.common.enums.RoleKeyEnum;
@@ -35,15 +35,6 @@ public class TmRoleController {
     public ResultData getAllRoleList(){
         LambdaQueryWrapper<TmRole> wrapper = new LambdaQueryWrapper<>();
         wrapper.ne(TmRole::getRoleKey, RoleKeyEnum.ADMIN_SUPER.getKey());
-        TmRole tmRole = tmRoleService.getByUserId((String) StpUtil.getLoginId());
-        if(!tmRole.getRoleKey().equals(RoleKeyEnum.ADMIN_SUPER.getKey())
-                && !tmRole.getRoleKey().equals(RoleKeyEnum.ADMIN.getKey())){
-            wrapper.ne(TmRole::getRoleKey, RoleKeyEnum.ADMIN.getKey());
-        }
-        if(!tmRole.getRoleKey().equals(RoleKeyEnum.ADMIN_SUPER.getKey())
-                && !tmRole.getRoleKey().equals(RoleKeyEnum.ADMIN_SYSTEM.getKey())){
-            wrapper.ne(TmRole::getRoleKey, RoleKeyEnum.ADMIN_SYSTEM.getKey());
-        }
         return ResultData.ok(tmRoleService.list(wrapper));
     }
 }

+ 2 - 6
src/main/java/com/fdkankan/fusion/controller/TmUserController.java

@@ -1,9 +1,7 @@
 package com.fdkankan.fusion.controller;
 
 
-import cn.dev33.satoken.stp.StpInterface;
-import cn.dev33.satoken.stp.StpLogic;
-import cn.dev33.satoken.stp.StpUtil;
+
 import cn.hutool.jwt.JWT;
 import cn.hutool.jwt.JWTUtil;
 import com.alibaba.fastjson.JSONObject;
@@ -47,9 +45,7 @@ public class TmUserController extends BaseController{
      */
     @GetMapping("/getPerInfo")
     public ResultData getPerInfo() {
-        TmUser tmUser = tmUserService.getById(StpUtil.getLoginId().toString());
-        tmUserService.setRoleAndPermToRedis(tmUser);
-        return ResultData.ok(StpUtil.getPermissionList());
+        return ResultData.ok();
     }
 
     /**

+ 3 - 3
src/main/java/com/fdkankan/fusion/down/CaseDownService.java

@@ -8,7 +8,7 @@ import com.deepoove.poi.XWPFTemplate;
 import com.fdkankan.fusion.common.FilePath;
 import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.common.util.ShellUtil;
-import com.fdkankan.fusion.common.util.UploadToOssUtil;
+import com.fdkankan.fusion.common.util.LocalToOssUtil;
 import com.fdkankan.fusion.entity.*;
 import com.fdkankan.fusion.httpClient.LaserService;
 import com.fdkankan.fusion.httpClient.response.FdkkResponse;
@@ -365,7 +365,7 @@ public class CaseDownService {
    @Autowired
     DownService downService;
    @Autowired
-    UploadToOssUtil uploadToOssUtil;
+    LocalToOssUtil localToOssUtil;
 
    public void downSwkk(Integer caseId,String num,Integer type){
 
@@ -466,7 +466,7 @@ public class CaseDownService {
             return;
         }
         url = url.replace(queryPath, "");
-        if( !uploadToOssUtil.existKey(url)){
+        if( !localToOssUtil.existKey(url)){
             log.info("downResource文件不存在:{},{}",caseId,url);
             return;
         }

+ 2 - 2
src/main/java/com/fdkankan/fusion/httpClient/FdService.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.httpClient;
 
-import cn.dev33.satoken.stp.StpUtil;
+
 import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.fusion.common.ResultCode;
@@ -59,7 +59,7 @@ public class FdService {
 //            throw new BusinessException(ResultCode.USER_NOT_LOGIN);
 //        }
 //        return vo.getFdToken();
-        return StpUtil.getTokenValue();
+        return "";
     }
 
     public String getFdTokenByUserName(String userName) {

+ 0 - 1
src/main/java/com/fdkankan/fusion/httpClient/response/FdkkUserVo.java

@@ -5,7 +5,6 @@ import lombok.Data;
 @Data
 public class FdkkUserVo {
     private Long id ;
-    private String userName;                    //用户名
     private String head;                        //头像
     private String nickName;                    //昵称
     private String email;                       //邮箱

+ 1 - 14
src/main/java/com/fdkankan/fusion/mq/consumer/LaserSceneGpsConsumer.java

@@ -8,12 +8,8 @@ import com.fdkankan.fusion.mq.vo.LaserSceneGpsVo;
 import com.fdkankan.fusion.service.IModelService;
 import com.fdkankan.fusion.service.IScenePlusExtService;
 import com.fdkankan.fusion.service.IScenePlusService;
-import com.rabbitmq.client.Channel;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.amqp.core.Message;
-import org.springframework.amqp.rabbit.annotation.Queue;
-import org.springframework.amqp.rabbit.annotation.RabbitListener;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -32,17 +28,8 @@ public class LaserSceneGpsConsumer {
     @Autowired
     IScenePlusExtService scenePlusExtService;
 
-    @RabbitListener(
-            queuesToDeclare = @Queue("${queue.laser.update-scene.location:save-scene-location}")
-    )
-    public void consumerQueue(Channel channel, Message message)  {
+    public void consumerQueue(LaserSceneGpsVo vo)  {
         try {
-            String messageId = message.getMessageProperties().getMessageId();
-            String msg = new String(message.getBody(), StandardCharsets.UTF_8);
-            log.info("laser-update-save-scene-location-mq--messageId:{},msg:{}",messageId,msg);
-
-            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-            LaserSceneGpsVo vo = JSONObject.parseObject(msg, LaserSceneGpsVo.class);
             if(vo != null && vo.getStatus() ==1 && StringUtils.isNotBlank(vo.getNum()) && vo.getLocation() != null && vo.getLocation().length >0){
                 String lat = String.valueOf(vo.getLocation()[0]);
                 String lon = String.valueOf(vo.getLocation()[1]);

+ 0 - 4
src/main/java/com/fdkankan/fusion/mq/consumer/OsgbToB3dmConsumer.java

@@ -9,12 +9,8 @@ import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.service.ICommonUploadService;
 import com.fdkankan.geo.GeoTransformUtil;
 import com.fdkankan.redis.util.RedisUtil;
-import com.rabbitmq.client.Channel;
 import lombok.extern.slf4j.Slf4j;
 import org.locationtech.proj4j.ProjCoordinate;
-import org.springframework.amqp.core.Message;
-import org.springframework.amqp.rabbit.annotation.Queue;
-import org.springframework.amqp.rabbit.annotation.RabbitListener;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;

+ 0 - 2
src/main/java/com/fdkankan/fusion/service/impl/CameraDetailServiceImpl.java

@@ -1,6 +1,5 @@
 package com.fdkankan.fusion.service.impl;
 
-import com.baomidou.dynamic.datasource.annotation.DS;
 import com.fdkankan.fusion.entity.CameraDetail;
 import com.fdkankan.fusion.mapper.ICameraDetailMapper;
 import com.fdkankan.fusion.request.DataParam;
@@ -20,7 +19,6 @@ import java.util.List;
  * @since 2024-01-09
  */
 @Service
-@DS("db2")
 public class CameraDetailServiceImpl extends ServiceImpl<ICameraDetailMapper, CameraDetail> implements ICameraDetailService {
 
 }

+ 0 - 2
src/main/java/com/fdkankan/fusion/service/impl/CameraServiceImpl.java

@@ -1,6 +1,5 @@
 package com.fdkankan.fusion.service.impl;
 
-import com.baomidou.dynamic.datasource.annotation.DS;
 import com.fdkankan.fusion.entity.Camera;
 import com.fdkankan.fusion.mapper.ICameraMapper;
 import com.fdkankan.fusion.service.ICameraService;
@@ -16,7 +15,6 @@ import org.springframework.stereotype.Service;
  * @since 2024-01-09
  */
 @Service
-@DS("db2")
 public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implements ICameraService {
 
     @Override

+ 0 - 3
src/main/java/com/fdkankan/fusion/service/impl/CameraVersionAppServiceImpl.java

@@ -1,8 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.io.FileUtil;
-import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -45,7 +43,6 @@ import java.util.List;
  */
 @Service
 @Slf4j
-@DS("db2")
 public class CameraVersionAppServiceImpl extends ServiceImpl<ICameraVersionAppMapper, CameraVersionApp> implements ICameraVersionAppService {
 
     public static String DIR_NAME = "camera_version_app/";

+ 1 - 4
src/main/java/com/fdkankan/fusion/service/impl/CameraVersionServiceImpl.java

@@ -1,8 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.io.FileUtil;
-import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -12,7 +10,7 @@ import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.util.DateUtils;
 import com.fdkankan.fusion.common.util.FileMd5Util;
 import com.fdkankan.fusion.common.util.ShellUtil;
-import com.fdkankan.fusion.common.util.UploadToOssUtil;
+import com.fdkankan.fusion.common.util.LocalToOssUtil;
 import com.fdkankan.fusion.entity.CameraVersion;
 import com.fdkankan.fusion.entity.TmUser;
 import com.fdkankan.fusion.entity.User;
@@ -47,7 +45,6 @@ import java.util.List;
  */
 @Service
 @Slf4j
-@DS("db2")
 public class CameraVersionServiceImpl extends ServiceImpl<ICameraVersionMapper, CameraVersion> implements ICameraVersionService {
 
     public static String DIR_NAME = "camera_version/";

+ 4 - 4
src/main/java/com/fdkankan/fusion/service/impl/CaseFilesServiceImpl.java

@@ -2,7 +2,7 @@ package com.fdkankan.fusion.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.fusion.common.ResultCode;
-import com.fdkankan.fusion.common.util.UploadToOssUtil;
+import com.fdkankan.fusion.common.util.LocalToOssUtil;
 import com.fdkankan.fusion.entity.CaseInquestCriminal;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.common.ResultData;
@@ -29,7 +29,7 @@ import java.util.List;
 public class CaseFilesServiceImpl extends ServiceImpl<ICaseFilesMapper, CaseFiles> implements ICaseFilesService {
 
     @Autowired
-    UploadToOssUtil uploadToOssUtil;
+    LocalToOssUtil localToOssUtil;
     @Value("${upload.query-path}")
     private String queryPath;
 
@@ -61,8 +61,8 @@ public class CaseFilesServiceImpl extends ServiceImpl<ICaseFilesMapper, CaseFile
         for (CaseFiles files : byCaseId) {
             if(StringUtils.isNotBlank(files.getFilesUrl())){
                 String ossPath = files.getFilesUrl().replace(queryPath,"");
-                if(uploadToOssUtil.existKey(ossPath)){
-                    uploadToOssUtil.delete(ossPath);
+                if(localToOssUtil.existKey(ossPath)){
+                    localToOssUtil.delete(ossPath);
                 }
             }
             this.removeById(files.getFilesId());

+ 0 - 1
src/main/java/com/fdkankan/fusion/service/impl/CaseInquestCriminalServiceImpl.java

@@ -1,6 +1,5 @@
 package com.fdkankan.fusion.service.impl;
 
-import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.date.DatePattern;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.io.FileUtil;

+ 0 - 1
src/main/java/com/fdkankan/fusion/service/impl/CaseLiveServiceImpl.java

@@ -4,7 +4,6 @@ import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
-import cn.dev33.satoken.stp.StpUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;

+ 6 - 11
src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java

@@ -16,9 +16,6 @@ import com.fdkankan.fusion.mapper.ICaseNumMapper;
 import com.fdkankan.fusion.request.SceneNumParam;
 import com.fdkankan.fusion.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.fusion.websocket.SessionService;
-import com.fdkankan.fusion.websocket.enums.CommonEnum;
-import com.fdkankan.fusion.websocket.vo.WsMessage;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -44,7 +41,7 @@ import java.util.stream.Collectors;
 public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntity> implements ICaseNumService {
 
     @Autowired
-    UploadToOssUtil uploadToOssUtil;
+    LocalToOssUtil localToOssUtil;
     @Value("${upload.query-path}")
     private String queryPath;
     @Value("${spring.profiles.active}")
@@ -65,8 +62,6 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
     ICaseTagPointService caseTagPointService;
     @Autowired
     ThreadService threadService;
-    @Autowired
-    SessionService sessionService;
 
     @Override
     public List<CaseNumEntity> getByCaseId(Integer caseId) {
@@ -125,11 +120,11 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
                 if(type == 0 || type == 1 || type == 4 || type == 6 || type == 7){           //看看,看见
                     String mesh3DtilesPath  = String.format(FilePath.OBJ_OSS_PATH,num) + "/images/3dtiles/tileset.json";
                     String sizePath = String.format(FilePath.OBJ_OSS_PATH,num) + "/images/3dtiles";
-                    if(uploadToOssUtil.existKey(mesh3DtilesPath)){
+                    if(localToOssUtil.existKey(mesh3DtilesPath)){
                         model.setModelDateType("b3dm");
                         model.setModelType("b3dm");
                         model.setModelGlbUrl(JSONArray.toJSONString(Arrays.asList(queryPath +mesh3DtilesPath)));
-                        model.setModelSize(FileWriterUtil.setFileSize(uploadToOssUtil.getSize( sizePath)));
+                        model.setModelSize(FileWriterUtil.setFileSize(localToOssUtil.getSize( sizePath)));
                     }else {
                         model.setModelObjUrl(String.format(FilePath.OBJ_LOCAL_PATH,environment ,num) +"/mesh.obj");
                         model.setModelGlbUrl(getGlbUrl(type,num,model));
@@ -164,15 +159,15 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
             if(localGlbPaths.size() >0){
                 for (String localGlbPath : localGlbPaths) {
                     String ossGlbPath = localGlbPath.replace(FilePath.LOCAL_BASE_PATH,"fusion/");
-                    uploadToOssUtil.uploadOss(localGlbPath,ossGlbPath);
+                    localToOssUtil.uploadOss(localGlbPath,ossGlbPath);
                     if(ossGlbPath.contains("lod_")){
                         if(ossGlbPath.contains("lod_0")){
                             ossGlbPaths.add(queryPath  +ossGlbPath);
-                            modelSize +=  uploadToOssUtil.getSize(ossGlbPath);
+                            modelSize +=  localToOssUtil.getSize(ossGlbPath);
                         }
                         continue;
                     }
-                    modelSize +=  uploadToOssUtil.getSize(ossGlbPath);
+                    modelSize +=  localToOssUtil.getSize(ossGlbPath);
                     ossGlbPaths.add(queryPath +ossGlbPath);
                 }
                 model.setModelSize(FileWriterUtil.setFileSize(modelSize));

+ 4 - 4
src/main/java/com/fdkankan/fusion/service/impl/CaseScriptServiceImpl.java

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.fusion.common.FilePath;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.util.ShellUtil;
-import com.fdkankan.fusion.common.util.UploadToOssUtil;
+import com.fdkankan.fusion.common.util.LocalToOssUtil;
 import com.fdkankan.fusion.common.util.VideoUtil;
 import com.fdkankan.fusion.entity.CaseExtractDetail;
 import com.fdkankan.fusion.entity.CaseScript;
@@ -57,7 +57,7 @@ public class CaseScriptServiceImpl extends ServiceImpl<ICaseScriptMapper, CaseSc
     @Value("${upload.query-path}")
     private String queryPath;
     @Autowired
-    UploadToOssUtil uploadToOssUtil;
+    LocalToOssUtil localToOssUtil;
     @Autowired
     RedisUtil redisUtil;
     @Override
@@ -65,10 +65,10 @@ public class CaseScriptServiceImpl extends ServiceImpl<ICaseScriptMapper, CaseSc
         if(StringUtils.isBlank(videoPath) || !videoPath.contains(".")){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        if(!uploadToOssUtil.existKey(videoPath.replace(queryPath,""))){
+        if(!localToOssUtil.existKey(videoPath.replace(queryPath,""))){
             throw new BusinessException(ResultCode.FILE_NOT_EXIST);
         }
-        FileInfoVo fileInfo = uploadToOssUtil.getFileInfo(videoPath.replace(queryPath, ""));
+        FileInfoVo fileInfo = localToOssUtil.getFileInfo(videoPath.replace(queryPath, ""));
         String md5 = fileInfo.getMD5();
         String redisKey = "fusion:file:"+md5;
         if(redisUtil.hasKey(redisKey)){

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/impl/CaseServiceImpl.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import cn.dev33.satoken.stp.StpUtil;
+
 import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

+ 2 - 2
src/main/java/com/fdkankan/fusion/service/impl/CaseVideoFolderServiceImpl.java

@@ -1,7 +1,7 @@
 package com.fdkankan.fusion.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fdkankan.fusion.common.util.UploadToOssUtil;
+import com.fdkankan.fusion.common.util.LocalToOssUtil;
 import com.fdkankan.fusion.entity.CaseVideo;
 import com.fdkankan.fusion.entity.CaseVideoFolder;
 import com.fdkankan.fusion.mapper.ICaseVideoFolderMapper;
@@ -28,7 +28,7 @@ public class CaseVideoFolderServiceImpl extends ServiceImpl<ICaseVideoFolderMapp
     @Autowired
     ICaseVideoService videoService;
     @Autowired
-    UploadToOssUtil uploadToOssUtil;
+    LocalToOssUtil localToOssUtil;
     @Autowired
     UploadService uploadService;
 

+ 8 - 8
src/main/java/com/fdkankan/fusion/service/impl/CaseVideoServiceImpl.java

@@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.FilePath;
 import com.fdkankan.fusion.common.util.RedisKeyUtil;
-import com.fdkankan.fusion.common.util.UploadToOssUtil;
+import com.fdkankan.fusion.common.util.LocalToOssUtil;
 import com.fdkankan.fusion.common.util.VideoUtil;
 import com.fdkankan.fusion.entity.CaseEntity;
 import com.fdkankan.fusion.entity.CaseVideoFolder;
@@ -48,7 +48,7 @@ public class CaseVideoServiceImpl extends ServiceImpl<ICaseVideoMapper, CaseVide
 
 
     @Autowired
-    UploadToOssUtil uploadToOssUtil;
+    LocalToOssUtil localToOssUtil;
     @Autowired
     ICaseVideoFolderService videoFolderService;
     @Autowired
@@ -123,7 +123,7 @@ public class CaseVideoServiceImpl extends ServiceImpl<ICaseVideoMapper, CaseVide
                     String mergeVideoUrl = null;
                     if (StringUtils.isNotBlank(videoFolder.getVideoMergeUrl())) {
                         mergeVideoUrl = videoFolder.getVideoMergeUrl().replace(queryPath, "/home/");
-                        uploadToOssUtil.downFormAli(videoFolder.getVideoMergeUrl().replace(queryPath, ""), mergeVideoUrl);
+                        localToOssUtil.downFormAli(videoFolder.getVideoMergeUrl().replace(queryPath, ""), mergeVideoUrl);
                         ossDelList.add(videoFolder.getVideoMergeUrl());
                     }
                     caseVideoService.deleteByFolderId(videoFolder.getVideoFolderId());
@@ -135,7 +135,7 @@ public class CaseVideoServiceImpl extends ServiceImpl<ICaseVideoMapper, CaseVide
                     }
                     filePathSetAll.addAll(filePathSet);
                     Boolean newCover = true;
-                    if(StringUtils.isNotBlank(videoFolder.getVideoFolderCover()) &&  uploadToOssUtil.existKey(videoFolder.getVideoFolderCover().replace(queryPath,""))){
+                    if(StringUtils.isNotBlank(videoFolder.getVideoFolderCover()) &&  localToOssUtil.existKey(videoFolder.getVideoFolderCover().replace(queryPath,""))){
                         newCover = false;
                     }
                     String mergeLocalName = VideoUtil.mergeVideo(filePathSetAll, String.format(FilePath.VIDEO_LOCAL_PATH,environment),newCover);
@@ -147,8 +147,8 @@ public class CaseVideoServiceImpl extends ServiceImpl<ICaseVideoMapper, CaseVide
                     }
                     mergeLocalPath = String.format(FilePath.VIDEO_LOCAL_PATH,environment) + "/" + mergeLocalName;
                     String ossKey = String.format(FilePath.VIDEO_OSS_PATH,environment, videoFolder.getVideoFolderId()) + "/" + mergeLocalName;
-                    uploadToOssUtil.uploadOss(mergeLocalPath, ossKey);
-                    if (!uploadToOssUtil.existKey(ossKey)) {
+                    localToOssUtil.uploadOss(mergeLocalPath, ossKey);
+                    if (!localToOssUtil.existKey(ossKey)) {
                         updateCaseVideoStatus(videoFolder.getVideoFolderId(), -1);
                         redisUtil.set(RedisKeyUtil.mergerVideoKey + videoFolder.getVideoFolderId(), "-1");
                         return;
@@ -156,8 +156,8 @@ public class CaseVideoServiceImpl extends ServiceImpl<ICaseVideoMapper, CaseVide
                     if(newCover){
                         mergeLocalPathImg = String.format(FilePath.VIDEO_LOCAL_PATH,environment) + "/" + mergeLocalName.replace(".mp4", ".jpg");
                         String ossKeyImg = String.format(FilePath.VIDEO_OSS_PATH, environment,videoFolder.getVideoFolderId()) + "/" + mergeLocalName.replace(".mp4", ".jpg");
-                        uploadToOssUtil.uploadOss(mergeLocalPathImg, ossKeyImg);
-                        if (!uploadToOssUtil.existKey(ossKeyImg)) {
+                        localToOssUtil.uploadOss(mergeLocalPathImg, ossKeyImg);
+                        if (!localToOssUtil.existKey(ossKeyImg)) {
                             updateCaseVideoStatus(videoFolder.getVideoFolderId(), -1);
                             redisUtil.set(RedisKeyUtil.mergerVideoKey + videoFolder.getVideoFolderId(), "-1");
                             return;

+ 9 - 9
src/main/java/com/fdkankan/fusion/service/impl/CommonUploadServiceImpl.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import cn.dev33.satoken.stp.StpUtil;
+
 import cn.hutool.core.io.FileUtil;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.fdkankan.fusion.common.OssPath;
@@ -10,7 +10,7 @@ import com.fdkankan.fusion.common.enums.FileTypeEnum;
 import com.fdkankan.fusion.common.util.FileWriterUtil;
 import com.fdkankan.fusion.common.util.OBJToGLBUtil;
 import com.fdkankan.fusion.common.util.ShellUtil;
-import com.fdkankan.fusion.common.util.UploadToOssUtil;
+import com.fdkankan.fusion.common.util.LocalToOssUtil;
 import com.fdkankan.fusion.entity.CommonUpload;
 import com.fdkankan.fusion.entity.DictFile;
 import com.fdkankan.fusion.exception.BusinessException;
@@ -50,7 +50,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
     @Autowired
     IDictFileService dictFileService;
     @Autowired
-    UploadToOssUtil uploadToOssUtil;
+    LocalToOssUtil localToOssUtil;
     
     @Value("${fyun.host:https://4dkk.4dage.com/}")
     private String ossUrlPrefix;
@@ -77,7 +77,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
                 return uploadModelZip(originalFilename.replace(extName, ""),tempFile,dictId);
             }
 
-            uploadToOssUtil.uploadOss(tempFile.getPath(), ossPath);
+            localToOssUtil.uploadOss(tempFile.getPath(), ossPath);
             String url = this.ossUrlPrefix + ossPath;
 
             FileTypeEnum fileTypeEnum = FileTypeEnum.getByType(extName.replace(".", ""));
@@ -150,7 +150,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
         OBJToGLBUtil.objToGlb2(modelFile.getPath(),localGlbPath);
         String ossPath = unzipPath.replace(OssPath.localPath,"");
         ShellUtil.yunUpload(unzipPath,ossPath);
-        if(!uploadToOssUtil.existKey(localGlbPath.replace(OssPath.localPath,""))){
+        if(!localToOssUtil.existKey(localGlbPath.replace(OssPath.localPath,""))){
             throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
         FileUtil.del(unzipPath);
@@ -164,7 +164,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
         }
         String ossPath = b3dmJsonPath.replace(OssPath.localPath, "");
         uploadOss(unzipPath,modelFile);
-        if(!uploadToOssUtil.existKey(ossPath)){
+        if(!localToOssUtil.existKey(ossPath)){
             throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
         FileUtil.del(unzipPath);
@@ -182,7 +182,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
         String ossPath = unzipPath.replace(OssPath.localPath,"");
         String modelOssPath = modelFile.getPath().replace(OssPath.localPath, "");
         ShellUtil.yunUpload(unzipPath,ossPath);
-        if(!uploadToOssUtil.existKey(modelOssPath)){
+        if(!localToOssUtil.existKey(modelOssPath)){
             throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
         FileUtil.del(unzipPath);
@@ -193,7 +193,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
         String ossPath = unzipPath.replace(OssPath.localPath,"");
         String modelOssPath = modelFile.getPath().replace(OssPath.localPath, "");
         ShellUtil.yunUpload(unzipPath,ossPath);
-        if(!uploadToOssUtil.existKey(modelOssPath)){
+        if(!localToOssUtil.existKey(modelOssPath)){
             throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
         FileUtil.del(unzipPath);
@@ -204,7 +204,7 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
         File mntFile = OBJToGLBUtil.lasOrPlyToBin(modelFile);
         String ossPath = mntFile.getPath().replace(OssPath.localPath,"");
         ShellUtil.yunUpload(mntFile.getPath(),ossPath);
-        if(!uploadToOssUtil.existKey(ossPath+"/webcloud/cloud.js")){
+        if(!localToOssUtil.existKey(ossPath+"/webcloud/cloud.js")){
             throw new BusinessException(-1,"缺少cloud.js文件");
         }
         FileUtil.del(unzipPath);

+ 10 - 10
src/main/java/com/fdkankan/fusion/service/impl/CopyCaseService.java

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.enums.IdPreEnum;
 import com.fdkankan.fusion.common.util.IdUtils;
-import com.fdkankan.fusion.common.util.UploadToOssUtil;
+import com.fdkankan.fusion.common.util.LocalToOssUtil;
 import com.fdkankan.fusion.entity.*;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.service.*;
@@ -67,7 +67,7 @@ public class CopyCaseService {
 
 
     @Autowired
-    UploadToOssUtil uploadToOssUtil;
+    LocalToOssUtil localToOssUtil;
 
 
     public void copyCase(Integer oldCaseId){
@@ -335,17 +335,17 @@ public class CopyCaseService {
             String newVideoFolderCover= entity.getVideoFolderCover().replace(oldFolderId+"",newFolderId+"");
             String newVideoMergeUrl = entity.getVideoMergeUrl().replace(oldFolderId+"",newFolderId+"");
 
-            String oldVideoFolderCoverOssPath = uploadToOssUtil.getOssPath(entity.getVideoFolderCover());
-            String newVideoFolderCoverOssPath = uploadToOssUtil.getOssPath(newVideoFolderCover);
-            uploadToOssUtil.copyFile(oldVideoFolderCoverOssPath,newVideoFolderCoverOssPath);
-            if(uploadToOssUtil.existKey(newVideoFolderCoverOssPath)){
+            String oldVideoFolderCoverOssPath = localToOssUtil.getOssPath(entity.getVideoFolderCover());
+            String newVideoFolderCoverOssPath = localToOssUtil.getOssPath(newVideoFolderCover);
+            localToOssUtil.copyFile(oldVideoFolderCoverOssPath,newVideoFolderCoverOssPath);
+            if(localToOssUtil.existKey(newVideoFolderCoverOssPath)){
                 entity.setVideoFolderCover(newVideoFolderCover);
             }
 
-            String oldVideoMergeUrlOssPath = uploadToOssUtil.getOssPath(entity.getVideoMergeUrl());
-            String newVideoMergeUrlOssPath = uploadToOssUtil.getOssPath(newVideoMergeUrl);
-            uploadToOssUtil.copyFile(oldVideoMergeUrlOssPath,newVideoMergeUrlOssPath);
-            if(uploadToOssUtil.existKey(newVideoMergeUrlOssPath)){
+            String oldVideoMergeUrlOssPath = localToOssUtil.getOssPath(entity.getVideoMergeUrl());
+            String newVideoMergeUrlOssPath = localToOssUtil.getOssPath(newVideoMergeUrl);
+            localToOssUtil.copyFile(oldVideoMergeUrlOssPath,newVideoMergeUrlOssPath);
+            if(localToOssUtil.existKey(newVideoMergeUrlOssPath)){
                 entity.setVideoMergeUrl(newVideoMergeUrl);
             }
            caseVideoFolderService.updateById(entity);

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/impl/DictFileServiceImpl.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import cn.dev33.satoken.stp.StpUtil;
+
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.fusion.common.PageInfo;

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/impl/DictServiceImpl.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import cn.dev33.satoken.stp.StpUtil;
+
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.fusion.common.PageInfo;

+ 1 - 5
src/main/java/com/fdkankan/fusion/service/impl/DownService.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import cn.dev33.satoken.stp.StpUtil;
+
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.fdkankan.fusion.common.ResultCode;
@@ -143,16 +143,12 @@ public class DownService implements IDownService {
         if("offline".equals(type)){
             return;
         }
-        String userName =  (String) StpUtil.getExtra("userName");
-        String nickName =  (String) StpUtil.getExtra("nickName");
         String deptId = tmDepartmentService.getDeptId();
         TmDepartment tmDepartment = tmDepartmentService.getById(deptId);
         Camera camera = cameraService.getByCameraId(scenePlus.getCameraId());
         SceneDownLog sceneDownloadLogEntity = new SceneDownLog();
         sceneDownloadLogEntity.setSceneNum(scenePlus.getNum());
         sceneDownloadLogEntity.setSceneTitle(scenePlus.getTitle());
-        sceneDownloadLogEntity.setUserName(userName);
-        sceneDownloadLogEntity.setNickName(nickName);
         sceneDownloadLogEntity.setSnCode(camera.getSnCode());
         sceneDownloadLogEntity.setDeptName(tmDepartment.getName());
         sceneDownloadLogEntity.setDeptLevel(tmDepartment.getDeptType());

+ 2 - 2
src/main/java/com/fdkankan/fusion/service/impl/ModelServiceImpl.java

@@ -49,7 +49,7 @@ import org.springframework.web.multipart.MultipartFile;
 public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implements IModelService {
 
     @Autowired
-    UploadToOssUtil uploadToOssUtil;
+    LocalToOssUtil localToOssUtil;
     @Autowired
     UploadService uploadService;
     @Autowired
@@ -323,7 +323,7 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
             String ossUrl = (String) object;
             String oldOssPath = ossUrl.replaceAll(queryPath,"");
             String newOssPath = oldOssPath.replaceAll(oldModelId+"",newModelId+"");
-            uploadToOssUtil.copyFile(oldOssPath,newOssPath);
+            localToOssUtil.copyFile(oldOssPath,newOssPath);
         }
     }
 }

+ 1 - 2
src/main/java/com/fdkankan/fusion/service/impl/MqSendLogServiceImpl.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import com.baomidou.dynamic.datasource.annotation.DS;
+
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.fusion.entity.MqSendLog;
 import com.fdkankan.fusion.mapper.IMqSendLogMapper;
@@ -20,7 +20,6 @@ import java.util.List;
  * @since 2024-08-07
  */
 @Service
-@DS("db2")
 public class MqSendLogServiceImpl extends ServiceImpl<IMqSendLogMapper, MqSendLog> implements IMqSendLogService {
 
 

+ 2 - 2
src/main/java/com/fdkankan/fusion/service/impl/SceneEditInfoServiceImpl.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import com.baomidou.dynamic.datasource.annotation.DS;
+
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.fusion.entity.SceneEditInfo;
 import com.fdkankan.fusion.mapper.ISceneEditInfoMapper;
@@ -17,7 +17,7 @@ import org.springframework.stereotype.Service;
  * @since 2024-01-09
  */
 @Service
-@DS("db2")
+
 public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper, SceneEditInfo> implements ISceneEditInfoService {
 
     @Override

+ 2 - 2
src/main/java/com/fdkankan/fusion/service/impl/ScenePlusExtServiceImpl.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import com.baomidou.dynamic.datasource.annotation.DS;
+
 import com.fdkankan.fusion.entity.ScenePlusExt;
 import com.fdkankan.fusion.mapper.IScenePlusExtMapper;
 import com.fdkankan.fusion.service.IScenePlusExtService;
@@ -16,7 +16,7 @@ import org.springframework.stereotype.Service;
  * @since 2023-12-28
  */
 @Service
-@DS("db2")
+
 public class ScenePlusExtServiceImpl extends ServiceImpl<IScenePlusExtMapper, ScenePlusExt> implements IScenePlusExtService {
 
 }

+ 2 - 2
src/main/java/com/fdkankan/fusion/service/impl/ScenePlusServiceImpl.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import com.baomidou.dynamic.datasource.annotation.DS;
+
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.fusion.entity.ScenePlus;
 import com.fdkankan.fusion.mapper.IScenePlusMapper;
@@ -21,7 +21,7 @@ import java.util.List;
  * @since 2023-12-28
  */
 @Service
-@DS("db2")
+
 public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlus> implements IScenePlusService {
 
     @Override

+ 1 - 15
src/main/java/com/fdkankan/fusion/service/impl/SceneService.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import cn.dev33.satoken.stp.StpUtil;
+
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -87,21 +87,7 @@ public class SceneService implements ISceneService {
         if(param.getType() == null){
            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        List<TmCamera> tmCameraList = null;
-        String tokenValue = null;
-        try {
-             tokenValue = StpUtil.getTokenValue();
-        }catch (Exception e){
-
-        }
 
-        if(StringUtils.isNotBlank(tokenValue) && StringUtils.isBlank(param.getShare()) ){
-            tmCameraList = tmCameraService.getByDeptIds();
-            List<String> snCodes = tmCameraList.stream().map(TmCamera::getCameraSn).collect(Collectors.toList());
-            if(CollectionUtil.isNotEmpty(snCodes)){
-                param.setSnCodes(snCodes);
-            }
-        }
         if(StringUtils.isNotBlank(param.getDeptId())){
             List<String> deptIds = new ArrayList<>();
             if(param.getSearchType() == 0){

+ 4 - 4
src/main/java/com/fdkankan/fusion/service/impl/ThreadService.java

@@ -31,7 +31,7 @@ public class ThreadService {
     @Autowired
     IModelService modelService;
     @Autowired
-    UploadToOssUtil uploadToOssUtil;
+    LocalToOssUtil localToOssUtil;
 
     @Value("${spring.profiles.active}")
     private String environment;
@@ -98,8 +98,8 @@ public class ThreadService {
 //                OBJToGLBUtil.objToGlb2(file1.getPath(),localPath);
 //                redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"65");
 //                ShellUtil.yunUpload(objPath,objPath.replace("/mnt/",""));
-//                //uploadToOssUtil.uploadOss(localPath,localPath.replace("/mnt/",""));
-//                if(!uploadToOssUtil.existKey(localPath.replace("/mnt/",""))){
+//                //localToOssUtil.uploadOss(localPath,localPath.replace("/mnt/",""));
+//                if(!localToOssUtil.existKey(localPath.replace("/mnt/",""))){
 //                    throw new BusinessException(-1,"缺少.glb文件");
 //                }
 //               model.setModelGlbUrl(JSONArray.toJSONString(Arrays.asList(queryPath + localPath.replace("/mnt/",""))));
@@ -129,7 +129,7 @@ public class ThreadService {
                 ShellUtil.yunUpload(mntFile.getPath(),ossPath);
 
                 model.setModelGlbUrl(JSONArray.toJSONString(Arrays.asList(queryPath  +ossPath +"/webcloud")));
-                if(!uploadToOssUtil.existKey(ossPath+"/webcloud/cloud.js")){
+                if(!localToOssUtil.existKey(ossPath+"/webcloud/cloud.js")){
                     throw new BusinessException(-1,"缺少cloud.js文件");
                 }
             }

+ 1 - 2
src/main/java/com/fdkankan/fusion/service/impl/TmCameraServiceImpl.java

@@ -1,7 +1,7 @@
 package com.fdkankan.fusion.service.impl;
 import java.util.*;
 
-import cn.dev33.satoken.stp.StpUtil;
+
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -98,7 +98,6 @@ public class TmCameraServiceImpl extends ServiceImpl<ITmCameraMapper, TmCamera>
         tmCamera.setDeptId(param.getDeptId());
         tmCamera.setUserId(param.getUserId());
         tmCamera.setFdCameraId(fdkkResponse.getData().getId());
-        tmCamera.setCreatorId((String) StpUtil.getLoginId());
         this.save(tmCamera);
 
     }

+ 3 - 33
src/main/java/com/fdkankan/fusion/service/impl/TmDepartmentServiceImpl.java

@@ -1,8 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import cn.dev33.satoken.context.SaHolder;
-import cn.dev33.satoken.stp.StpInterface;
-import cn.dev33.satoken.stp.StpUtil;
+
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
@@ -59,7 +57,6 @@ public class TmDepartmentServiceImpl extends ServiceImpl<ITmDepartmentMapper, Tm
         }
         dept.setId(IdPreEnum.DEPARTMENT_PRE.getPre() +IdUtil.getSnowflake(1).nextId() );
         //dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
-        dept.setCreatorId((String) StpUtil.getLoginId());
         this.save(dept);
     }
 
@@ -130,29 +127,7 @@ public class TmDepartmentServiceImpl extends ServiceImpl<ITmDepartmentMapper, Tm
 
     @Override
     public List<TmDepartment> getDeptList() {
-        String share = SaHolder.getRequest().getHeader("share");
-        if(StringUtils.isNotBlank(share) && "1".equals(share)){ //分享请求头
-            return getDeptList("0");
-        }
-        String userId  =(String) StpUtil.getLoginId();
-        TmUser tmUser = tmUserService.getById(userId);
-        if(tmUser == null){
-            return new ArrayList<>();
-        }
-        List<TmUserRole> tmUserRoles = tmUserRoleService.getByUserId(tmUser.getId());
-        if(tmUserRoles.size() >0){
-            TmUserRole tmUserRole = tmUserRoles.get(0);
-            TmRole tmRole = tmRoleService.getById(tmUserRole.getRoleId());
-            if(tmRole != null && tmRole.getRoleKey().equals("admin-ordinary")){
-                TmDepartment tmDepartment = this.getById(tmUser.getDeptId());
-                TmDepartment parentDept = this.getById(tmDepartment.getParentId());
-                if(parentDept !=null){
-                    tmDepartment.setParentName(parentDept.getName());
-                }
-                return Arrays.asList(tmDepartment);
-            }
-        }
-        return getDeptList(tmUser.getDeptId());
+        return getDeptList("0");
     }
 
     public List<TmDepartment> getDeptList(String deptId) {
@@ -222,12 +197,7 @@ public class TmDepartmentServiceImpl extends ServiceImpl<ITmDepartmentMapper, Tm
 
     @Override
     public String getDeptId() {
-        String userId  =(String) StpUtil.getLoginId();
-        TmUser tmUser = tmUserService.getById(userId);
-        if(tmUser == null){
-            return null;
-        }
-        return tmUser.getDeptId();
+        return "";
     }
 
     public void getDeptIds(List<TmDepartment> departments, List<String > Ids) {

+ 1 - 3
src/main/java/com/fdkankan/fusion/service/impl/TmMessageServiceImpl.java

@@ -5,7 +5,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import cn.dev33.satoken.stp.StpUtil;
+
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.fusion.common.PageInfo;
@@ -55,8 +55,6 @@ public class TmMessageServiceImpl extends ServiceImpl<ITmMessageMapper, TmMessag
         tmMessage.setId(IdUtils.genId(IdPreEnum.MESSAGE_PRE.getPre()));
         tmMessage.setContent(body.getContent());
         tmMessage.setProjectId(body.getProjectId());
-        tmMessage.setUserId((String) StpUtil.getLoginId());
-        tmMessage.setCreatorId((String) StpUtil.getLoginId());
         this.save(tmMessage);
 
 

+ 2 - 11
src/main/java/com/fdkankan/fusion/service/impl/TmProjectServiceImpl.java

@@ -1,7 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import cn.dev33.satoken.context.SaHolder;
-import cn.dev33.satoken.stp.StpUtil;
+
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.RandomUtil;
@@ -70,18 +69,10 @@ public class TmProjectServiceImpl extends ServiceImpl<ITmProjectMapper, TmProjec
     public Object pageList(ProjectRequestDto tmProject) {
         LambdaQueryWrapper<TmProject> wrapper = new LambdaQueryWrapper<>();
         //教学场景
-        List<String> deptIds;
+        List<String> deptIds = new ArrayList<>();
         if(tmProject.getQueryType() != null && tmProject.getQueryType() == 2){
             wrapper.eq(TmProject::getIsTeached,1);
             deptIds = tmDepartmentService.getByZdDeptIds();
-        }else {
-            String share = SaHolder.getRequest().getHeader("share");
-            if(StringUtils.isNotBlank(share) && "1".equals(share)){ //分享请求头
-                deptIds = tmDepartmentService.list().stream().map(TmDepartment::getId).collect(Collectors.toList());
-                wrapper.eq(TmProject::getMapShow,true);
-            }else {
-                deptIds = tmDepartmentService.getDeptIds();
-            }
         }
         if(deptIds.size() <=0){
             throw new BusinessException(ResultCode.NOT_DEPT);

+ 2 - 4
src/main/java/com/fdkankan/fusion/service/impl/TmUserServiceImpl.java

@@ -9,7 +9,7 @@ import com.fdkankan.fusion.common.util.IdUtils;
 import com.fdkankan.fusion.config.SecurityUtil;
 import com.fdkankan.fusion.httpClient.response.FdkkLoginVo;
 
-import cn.dev33.satoken.stp.StpUtil;
+
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -149,7 +149,6 @@ public class TmUserServiceImpl extends ServiceImpl<ITmUserMapper, TmUser> implem
         tmUser.setDeptId(param.getDeptId());
         tmUser.setUserName(param.getUserName());
         tmUser.setNickName(param.getNickName());
-        tmUser.setCreatorId((String) StpUtil.getLoginId());
         this.save(tmUser);
 
         tmUserRoleService.add(id,tmRole.getId());
@@ -286,8 +285,7 @@ public class TmUserServiceImpl extends ServiceImpl<ITmUserMapper, TmUser> implem
 
     @Override
     public TmUser getLoginUser() {
-        String userId = (String) StpUtil.getLoginId();
-        return this.getById(userId);
+        return null;
     }
 
     @Override

+ 8 - 6
src/main/java/com/fdkankan/fusion/service/impl/UploadService.java

@@ -2,12 +2,14 @@ package com.fdkankan.fusion.service.impl;
 
 import com.fdkankan.fusion.common.FilePath;
 import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.util.LocalToOssUtil;
 import com.fdkankan.fusion.common.util.ShellUtil;
-import com.fdkankan.fusion.common.util.UploadToOssUtil;
+import com.fdkankan.fusion.common.util.LocalToOssUtil;
 import com.fdkankan.fusion.common.util.VideoUtil;
 import com.fdkankan.fusion.exception.BusinessException;
 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 org.springframework.web.multipart.MultipartFile;
@@ -24,8 +26,8 @@ import java.util.UUID;
 @Slf4j
 public class UploadService {
 
-    @Resource
-    private UploadToOssUtil uploadToOssUtil;
+    @Autowired
+    LocalToOssUtil localToOssUtil;
 
     @Value("${upload.query-path}")
     private String queryPath;
@@ -96,8 +98,8 @@ public class UploadService {
             localFile = File.createTempFile(fileName + suffixName,suffixName);
             file.transferTo(localFile);
             String path = localFile.getPath();
-            uploadToOssUtil.uploadOss(path,filePathAdd+ fileName + suffixName);
-            if(!uploadToOssUtil.existKey(filePathAdd + fileName + suffixName)){
+            localToOssUtil.uploadOss(path,filePathAdd+ fileName + suffixName);
+            if(!localToOssUtil.existKey(filePathAdd + fileName + suffixName)){
                 throw new BusinessException(ResultCode.UPLOAD_ERROR.code,ResultCode.UPLOAD_ERROR.msg);
             }
             return queryPath +filePathAdd+ URLEncoder.encode(fileName,"utf-8") + suffixName;
@@ -115,7 +117,7 @@ public class UploadService {
     public void deleteOssUrl(String path) {
         try {
             String replace = path.replace(queryPath, "");
-            uploadToOssUtil.delete(replace);
+            localToOssUtil.delete(replace);
         }catch (Exception e){
             e.printStackTrace();
         }

+ 2 - 2
src/main/java/com/fdkankan/fusion/service/impl/UserServiceImpl.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
-import com.baomidou.dynamic.datasource.annotation.DS;
+
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.fusion.entity.User;
 import com.fdkankan.fusion.mapper.IUserMapper;
@@ -17,7 +17,7 @@ import org.springframework.stereotype.Service;
  * @since 2024-07-29
  */
 @Service
-@DS("db2")
+
 public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements IUserService {
 
     @Override

+ 0 - 99
src/main/java/com/fdkankan/fusion/websocket/MyWebSocketServer.java

@@ -1,99 +0,0 @@
-package com.fdkankan.fusion.websocket;
-
-
-import com.fdkankan.fusion.common.ResultData;
-import com.fdkankan.fusion.websocket.enums.CommonEnum;
-import com.fdkankan.fusion.websocket.service.MessageService;
-import com.fdkankan.fusion.websocket.vo.WsMessage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.util.StringUtils;
-
-import javax.websocket.*;
-import javax.websocket.server.PathParam;
-import javax.websocket.server.ServerEndpoint;
-import java.io.IOException;
-
-@Component
-@ServerEndpoint(value = "/ws/{caseId}",configurator = WebSocketConfigurator.class)
-public class MyWebSocketServer {
-
-    private Logger webSocketLogger = LoggerFactory.getLogger("webSocketLogger");
-
-    private static SessionService sessionService;
-
-    private static MessageService messageService;
-
-    @Autowired
-    public void setWebSocketServerHandler(SessionService sessionService, MessageService messageService) {
-        MyWebSocketServer.sessionService = sessionService;
-        MyWebSocketServer.messageService = messageService;
-    }
-
-    @OnOpen
-    public void onOpen(Session session, @PathParam("caseId") Integer caseId) {
-        try {
-            Long startTime = System.currentTimeMillis();
-            session.getUserProperties().put("caseId" , caseId);
-            sessionService.onOpen(session, caseId);
-            sessionService.sendSingleBySession(WsMessage.okResult(CommonEnum.ON_OPEN, ResultData.ok("连接建立成功")),session);
-            Long endTime = System.currentTimeMillis();
-            if(endTime -startTime > 100){
-                webSocketLogger.info("WebSocketServer|onOpenStart|" + "session = [" + session.getId() + "]" +",startTime = "+ startTime);
-                webSocketLogger.info("WebSocketServer|onOpenOver|" + "session = [" + session.getId() + "]" +",endTime = "+ endTime+", totalTime = "+(endTime-startTime));
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    @OnClose
-    public void onClose(Session session) {
-        try {
-            sessionService.onClose(session);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    @OnError
-    public void onError(Session session, Throwable error) {
-        if (error instanceof IOException) {
-            webSocketLogger.error("错误,断开链接{},{}", session, error.getMessage());
-        } else {
-            webSocketLogger.error("错误,断开链接{}", session, error);
-        }
-        try {
-            session.close();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * 收到客户端消息后调用的方法
-     *
-     * @param msg 客户端发送过来的消息
-     */
-    @OnMessage
-    public void onMessage(String msg, Session session) {
-        try {
-            if(StringUtils.isEmpty(msg)){
-                return;
-            }
-            Long startTime = System.currentTimeMillis();
-            messageService.onMessage(msg, session);
-            Long endTime = System.currentTimeMillis();
-            if(endTime -startTime > 100){
-                webSocketLogger.info("WebSocketServer|onMessageStart|" + "request = "+ msg + "session = [" + session.getId() + "]"+ ",startTime = "+ startTime);
-                webSocketLogger.info("WebSocketServer|onMessageOver|" + "request = "+ msg +"session = [" + session.getId() + "]" +",endTime = "+ endTime+", totalTime = "+(endTime-startTime));
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-
-}

+ 0 - 128
src/main/java/com/fdkankan/fusion/websocket/SessionService.java

@@ -1,128 +0,0 @@
-package com.fdkankan.fusion.websocket;
-
-import com.alibaba.druid.util.Utils;
-import com.fdkankan.fusion.entity.TmUser;
-import com.fdkankan.fusion.service.ITmUserService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import javax.websocket.Session;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.locks.ReentrantLock;
-
-@Component("sessionService")
-public class SessionService {
-    private static Logger webSocketLogger = LoggerFactory.getLogger("webSocketLogger");
-
-    public static ConcurrentHashMap<Session, Integer> sessionMap = new ConcurrentHashMap<>();
-
-
-
-
-    /**
-     * 用户注册和离开都需要这个锁
-     */
-    private final ReentrantLock lock = new ReentrantLock();
-
-
-    /**
-     * 用户链接上来
-     *
-     * @param session
-     */
-    public void onOpen(Session session, Integer caseId) {
-
-        try {
-            lock.lock();
-            sessionMap.put(session,caseId);
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            lock.unlock();
-        }
-
-    }
-
-
-    /**
-     * 关闭
-     *
-     * @param session
-     */
-    public void onClose(Session session) {
-        try {
-            lock.lock();
-            sessionMap.remove(session.getId());
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            lock.unlock();
-        }
-    }
-
-
-    /**
-     * 服务端向 全体客户端广播消息
-     *
-     * @param message
-     */
-    public synchronized void sendALL(String message) {
-        Set<Session> keySet = sessionMap.keySet();
-        if (keySet.isEmpty()) {
-            return;
-        }
-        sessionMap.forEach((session, caseId) -> {
-            if (null != session && session.isOpen()) {
-                sendMessage(message,session);
-            }
-        });
-    }
-
-
-    /**
-     * 服务端向 通过token向客服端发送消息
-     *
-     * @param message
-     */
-    public synchronized void sendSingleByCaseId(Integer caseId, String message) {
-        Set<Session> keySet = sessionMap.keySet();
-        if (keySet.isEmpty()) {
-            return;
-        }
-        if(!sessionMap.containsValue(caseId)){
-            return;
-        }
-        sessionMap.forEach((session, caseIdMap) -> {
-            if (null != session && session.isOpen() && caseIdMap.equals(caseId)) {
-                sendMessage(message,session);
-            }
-        });
-    }
-
-    public void sendSingleBySession(String msg, Session session) {
-        sendMessage(msg, session);
-    }
-
-    private synchronized  void sendMessage(String msg, Session session) {
-
-
-        if (null == session || !session.isOpen()) {
-            return;
-        }
-        synchronized (session) {
-            try {
-                session.getBasicRemote().sendText(msg);
-            } catch(Exception e){
-                webSocketLogger.error("---------------------------------------------------->"+e.getMessage()+"\n"+ Utils.toString(e.getStackTrace()));
-            }
-        }
-    }
-
-
-}

+ 0 - 25
src/main/java/com/fdkankan/fusion/websocket/WebSocketConfig.java

@@ -1,25 +0,0 @@
-package com.fdkankan.fusion.websocket;
-
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.socket.config.annotation.EnableWebSocket;
-import org.springframework.web.socket.server.standard.ServerEndpointExporter;
-
-/**
- * SpringBoot + WebSocket 是用@ServerEndpoint注入,必须有此配置
- *
- */
-@Configuration
-public class WebSocketConfig {
-
-    @Bean
-    public ServerEndpointExporter serverEndpointExporter() {
-        return new ServerEndpointExporter();
-    }
-
-
-}
-

+ 0 - 85
src/main/java/com/fdkankan/fusion/websocket/WebSocketConfigurator.java

@@ -1,85 +0,0 @@
-package com.fdkankan.fusion.websocket;
-
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.context.annotation.Configuration;
-
-import javax.servlet.http.HttpSession;
-import javax.websocket.HandshakeResponse;
-import javax.websocket.server.HandshakeRequest;
-import javax.websocket.server.ServerEndpointConfig;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Map;
-
-@Slf4j
-@Configuration
-public class WebSocketConfigurator extends ServerEndpointConfig.Configurator{
-    public static final String HTTP_SESSION_ID_ATTR_NAME = "HTTP.SESSION.ID";
-
-    @Override
-    public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
-
-        Map<String, Object> attributes = sec.getUserProperties();
-        HttpSession session = (HttpSession) request.getHttpSession();
-        if (session != null) {
-            attributes.put(HTTP_SESSION_ID_ATTR_NAME, session.getId());
-            Enumeration<String> names = session.getAttributeNames();
-            while (names.hasMoreElements()) {
-                String name = names.nextElement();
-                attributes.put(name, session.getAttribute(name));
-            }
-
-        }
-
-
-        Map<String, List<String>> headerList =   request.getHeaders();
-        String ip = getIpAddr(headerList);
-        attributes.put("clientIp" , ip);
-
-    }
-
-
-    private String getIpAddr(Map<String, List<String>> headerList) {
-        String ip = null;
-        try {
-            ip = getHeader("x-forwarded-for" , headerList);
-            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
-                ip = getHeader("Proxy-Client-IP" , headerList);
-            }
-            if (StringUtils.isEmpty(ip) || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
-                ip = getHeader("WL-Proxy-Client-IP" , headerList);
-            }
-            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
-                ip = getHeader("HTTP_CLIENT_IP" , headerList);
-            }
-            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
-                ip = getHeader("HTTP_X_FORWARDED_FOR" , headerList);
-            }
-            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
-                ip = headerList.get("host").get(0);
-            }
-        } catch (Exception e) {
-            log.error("MyWebListener|getIpAddr|" + e.getMessage(), e);
-        }
-        // 使用代理,则获取第一个IP地址
-        if (StringUtils.isNotBlank(ip) && ip.length() > 15) {
-            if (StringUtils.contains(ip, ",")) {
-                ip = StringUtils.substringBefore(ip, ",");
-            }
-        }
-        if (StringUtils.startsWith(ip, "0:0:0:0:0:0:0")) {
-            ip = "127.0.0.1";
-        }
-        return ip;
-    }
-
-    private String getHeader(String key , Map<String, List<String>> headerList){
-        List<String> l = headerList.get(key);
-        if(null == l){
-            return null;
-        }
-
-        return l.get(0);
-    }
-}

+ 0 - 7
src/main/java/com/fdkankan/fusion/websocket/enums/CommonEnum.java

@@ -1,7 +0,0 @@
-package com.fdkankan.fusion.websocket.enums;
-
-public class CommonEnum {
-    public final static String ON_OPEN = "open";
-    public final static String PING = "ping";
-    public final static String NOTICE = "notice";
-}

+ 0 - 40
src/main/java/com/fdkankan/fusion/websocket/service/MessageService.java

@@ -1,40 +0,0 @@
-package com.fdkankan.fusion.websocket.service;
-
-import com.alibaba.fastjson.JSON;
-import com.fdkankan.fusion.common.ResultData;
-import com.fdkankan.fusion.websocket.SessionService;
-import com.fdkankan.fusion.websocket.enums.CommonEnum;
-import com.fdkankan.fusion.websocket.vo.RequestMsg;
-import com.fdkankan.fusion.websocket.vo.WsMessage;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import javax.websocket.Session;
-
-@Service
-public class MessageService {
-
-    @Autowired
-    private SessionService sessionService;
-
-    public void onMessage(String msg, Session session) {
-        if (StringUtils.isBlank(msg)) {
-            return;
-        }
-        RequestMsg requestMsg = JSON.parseObject(msg, RequestMsg.class);
-
-        switch (requestMsg.getCommand()) {
-            case CommonEnum.PING:
-                messageByPing(requestMsg, session); //ping
-                break;
-            default:
-                break;
-        }
-    }
-
-    private void messageByPing(RequestMsg requestMsg, Session session) {
-        String msg = WsMessage.okResult(CommonEnum.PING, ResultData.ok("ping"));
-        sessionService.sendSingleBySession(msg, session);
-    }
-}

+ 0 - 45
src/main/java/com/fdkankan/fusion/websocket/vo/RequestMsg.java

@@ -1,45 +0,0 @@
-package com.fdkankan.fusion.websocket.vo;
-
-import java.io.Serializable;
-import java.util.Map;
-
-/***
- * 前端发来的信息结构对象
- */
-public class RequestMsg implements Serializable {
-
-    private String command;
-    private int requestId;
-    private Map<String, Object> content;
-
-    public Object getMapValue(String key){
-        if(content != null){
-            return  content.get(key);
-        }
-        return null;
-    }
-
-    public String getCommand() {
-        return command;
-    }
-
-    public void setCommand(String command) {
-        this.command = command;
-    }
-
-    public Map<String, Object> getContent() {
-        return content;
-    }
-
-    public void setContent(Map<String, Object> content) {
-        this.content = content;
-    }
-
-    public int getRequestId() {
-        return requestId;
-    }
-
-    public void setRequestId(int requestId) {
-        this.requestId = requestId;
-    }
-}

+ 0 - 26
src/main/java/com/fdkankan/fusion/websocket/vo/WsMessage.java

@@ -1,26 +0,0 @@
-package com.fdkankan.fusion.websocket.vo;
-
-import com.alibaba.fastjson.JSONObject;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author tang
- */
-public class WsMessage {
-
-
-    public static String okResult(String command, Object content) {
-        JSONObject jsonObject = new JSONObject();
-        jsonObject.put("command", command);
-        jsonObject.put("content", content);
-        return jsonObject.toJSONString();
-    }
-
-
-
-
-
-
-}

+ 25 - 44
src/main/resources/application.yml

@@ -13,22 +13,20 @@ spring:
       max-file-size: 1000MB
       maxRequestSize: 1000MB
   datasource:
-    type: com.alibaba.druid.pool.DruidDataSource
-    #120.25.146.52
-    dynamic:
-      primary: db1
-      strict: false
-      datasource:
-        db1:
-          driver-class-name: com.mysql.jdbc.Driver
-          url: jdbc:mysql://127.0.0.1:3306/fd_fusion?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
-          username: root
-          password: 4dkk2023cuikuan%
-        db2:
-          driver-class-name: com.mysql.jdbc.Driver
-          url: jdbc:mysql://127.0.0.1:3306/4dkankan_v4?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
-          username: root
-          password: 4dkk2023cuikuan%
+    type: com.zaxxer.hikari.HikariDataSource          # 数据源类型:HikariCP
+    driver-class-name: com.mysql.jdbc.Driver          # mysql驱动
+    url: jdbc:mysql://127.0.0.1:3307/laser?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
+    username: root
+    password: laser
+    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   # 连接测试语句
 
 
   redis:
@@ -45,20 +43,6 @@ spring:
     lettuce:
       shutdown-timeout: 0ms
 
-  rabbitmq:
-    host: 127.0.0.1
-    port: 5672
-    username: root
-    password: root
-    virtual-host: 4dkankan
-    connection-timeout: 0
-    listener:
-      simple:
-        prefetch: 5
-        max-concurrency: 10
-        acknowledge-mode: manual #开启消费者手动确认
-    #开启消息投递确认机制
-    publisher-confirm-type: correlated
 4dkk:
   laserService:
     basePath: http://127.0.0.1:9295
@@ -68,7 +52,6 @@ spring:
     basePath: http://127.0.0.1:8081
 
 
-
 logging:
   config: classpath:logback-spring.xml
   path: /www/VR/4dkankan
@@ -108,6 +91,17 @@ oss:
 fdkk:
   register:
     validCode: 2a22bac40f44af4d3b5fdc20ea706fc5
+  # 文件路径 示例( Windows配置D:/fdkk/uploadPath,Linux配置 /home/fdkk/uploadPath)
+  profile: ${PROFILE_PATH}
+  #算法软件目录
+  binPath: ${BIN_PATH}
+  defaultFolder: datav1
+  # 是否本地化部署:开启此项会使用minio文件管理
+  isLocalization: true
+  # 是否使用文件存储系统
+  isBucket: false
+  #是否使用软连接
+  isLink: false
 
 # MinIO 配置
 minio:
@@ -122,16 +116,3 @@ geoquery:
   dataFilePath: ${FDMGEA_HOME}/geoFile/GeoJSON.json
   saveWkbsFilePath: ${FDMGEA_HOME}/geoFile/GeoJSON.wkbs
 
-# 项目相关配置
-fdkk:
-  # 文件路径 示例( Windows配置D:/fdkk/uploadPath,Linux配置 /home/fdkk/uploadPath)
-  profile: ${PROFILE_PATH}
-  #算法软件目录
-  binPath: ${BIN_PATH}
-  defaultFolder: datav1
-  # 是否本地化部署:开启此项会使用minio文件管理
-  isLocalization: true
-  # 是否使用文件存储系统
-  isBucket: false
-  #是否使用软连接
-  isLink: false