Jelajahi Sumber

fix bug: 计算坐标的问题

lijie 3 tahun lalu
induk
melakukan
73671fdd2d

+ 2 - 2
dmp-business/dmp-rwd/src/main/java/com/persagy/dmp/rwd/basic/utils/GeoToolsUtil.java

@@ -31,10 +31,10 @@ public class GeoToolsUtil {
         double y =0L;
         double z =0L;
         if(pointLocal.get("X") != null){
-            x =pointLocal.get("X").doubleValue();
+            x =pointLocal.get("X").asDouble();
         }
         if(pointLocal.get("Y") != null){
-            y = pointLocal.get("Y").doubleValue();
+            y = pointLocal.get("Y").asDouble();
         }
         GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
         Coordinate coord = new Coordinate(x, y,z);

+ 4 - 3
dmp-cloud/dmp-file/src/main/java/com/persagy/dmp/file/config/FileWebConfigurer.java

@@ -1,9 +1,8 @@
 package com.persagy.dmp.file.config;
 
-import com.persagy.dmp.auth.handler.AppContextHandler;
-import com.persagy.dmp.file.controller.CompatibleOldFileController;
 import com.persagy.dmp.file.handler.OldFileAuthHandler;
 import com.persagy.dmp.file.handler.OldFileContextHandler;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.core.annotation.Order;
@@ -12,6 +11,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
 @Configuration
 @Order(100)
+@ConditionalOnProperty(value = "persagy.common.file.storage", havingValue = "2")
 public class FileWebConfigurer implements WebMvcConfigurer {
     /***
      * Description: 旧文件的上下文处理器
@@ -21,6 +21,7 @@ public class FileWebConfigurer implements WebMvcConfigurer {
      * Update By lijie 2021/11/19 10:12
      */
     @Bean
+
     public OldFileContextHandler oldFileContextHandler() {
         return new OldFileContextHandler();
     }
@@ -56,7 +57,7 @@ public class FileWebConfigurer implements WebMvcConfigurer {
                 "/common/image_upload"};
         registry.addInterceptor(oldFileAuthHandler())
                 .order(101)
-                .addPathPatterns()
+                .addPathPatterns(authIncludePaths)
                 .excludePathPatterns(excludePaths);
     }
 

+ 7 - 0
dmp-cloud/dmp-file/src/main/java/com/persagy/dmp/file/service/impl/MinioStorageServiceImpl.java

@@ -7,6 +7,7 @@ import com.persagy.dmp.file.config.FileExceptionHandler;
 import com.persagy.dmp.file.constant.FileCommonConst;
 import com.persagy.dmp.file.service.IFileStorageService;
 import io.minio.*;
+import io.minio.errors.ErrorResponseException;
 import io.minio.http.Method;
 import io.minio.messages.Item;
 import lombok.RequiredArgsConstructor;
@@ -116,8 +117,14 @@ public class MinioStorageServiceImpl implements IFileStorageService, Initializin
             // 查看文件元数据
 //            ObjectStat stat = minioClient.statObject(bucketName, fileName);
 //            return stat != null;
+            //Iterable<Result<Item>> results = minioClient.listObjects(ListObjectsArgs.builder().bucket(bucketName).startAfter(fileName).build());
             StatObjectResponse stat = minioClient.statObject(StatObjectArgs.builder().bucket(bucketName).object(fileName).build());
             return stat != null;
+        }catch (ErrorResponseException errorResponseException){
+          if ("NoSuchKey".equals(errorResponseException.errorResponse().code())){
+              return false;
+          }
+          FileExceptionHandler.handleException(errorResponseException);
         } catch (Exception e) {
             FileExceptionHandler.handleException(e);
         }