Просмотр исходного кода

20240819 数据同步nodePDfURl

zhuwei 3 месяцев назад
Родитель
Сommit
29b462770e
15 измененных файлов с 140 добавлено и 486 удалено
  1. 1 1
      blade-common/src/main/java/org/springblade/common/utils/AsyncConfigurer.java
  2. 2 0
      blade-common/src/main/java/org/springblade/common/utils/CommonUtil.java
  3. 3 3
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/feign/NewIOSSClient.java
  4. 5 6
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/AliOssBuilder.java
  5. 2 1
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/MinioOssBuilder.java
  6. 19 23
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/OssBuilder.java
  7. 53 54
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/ossre/AliossTemplateRe.java
  8. 21 364
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/ossre/MinioTemplateRe.java
  9. 1 3
      blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/ossre/OssTemplateRe.java
  10. 11 11
      blade-ops/blade-resource/src/main/java/org/springblade/resource/feign/NewIOSSClientImpl.java
  11. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  12. 3 4
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController.java
  13. 2 2
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java
  14. 8 11
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  15. 8 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

+ 1 - 1
blade-common/src/main/java/org/springblade/common/utils/AsyncConfigurer.java

@@ -15,7 +15,7 @@ public class AsyncConfigurer {
     /**
      * cpu 核心数量
      */
-    public static final int cpuNum =1 ;//Runtime.getRuntime().availableProcessors();
+    public static final int cpuNum =10 ;//Runtime.getRuntime().availableProcessors();
 
     /**
      * 线程池配置

+ 2 - 0
blade-common/src/main/java/org/springblade/common/utils/CommonUtil.java

@@ -520,8 +520,10 @@ public class CommonUtil {
                 // 获取 Orientation 标签的值
                 int orientation = exifIFD0Directory.getInt(ExifIFD0Directory.TAG_ORIENTATION);
                 // 需要旋转图片
+
                 // 1 无需纠正 2 水平翻转(镜像)3 垂直翻转(旋转180°) 4 水平翻转+垂直翻转 5 水平翻转+旋转90°
                 // 6 旋转90° 7 水平翻转+旋转270° 8 +旋转270°
+                
                 BufferedImage originalImage = ImageIO.read(new ByteArrayInputStream(imageData));
                 AffineTransform transform = new AffineTransform();
                 if (orientation == 3) {

+ 3 - 3
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/feign/NewIOSSClient.java

@@ -36,9 +36,9 @@ public interface NewIOSSClient {
     BladeFile uploadFile(@RequestParam String fileName, @RequestParam String localFileUrl);
 
 
-//    @PostMapping(UPLOAD_FILE_INFO_WITH_PATH)
-//    BladeFile uploadFile(@RequestParam String fileName, @RequestParam  String localFileUrl,
-//                         @RequestParam(required=false)  String filePath,@RequestParam(required=false) Long projectId);
+    @PostMapping(UPLOAD_FILE_INFO_WITH_PATH)
+    BladeFile uploadFile(@RequestParam String fileName, @RequestParam  String localFileUrl,
+                        @RequestParam(required=false)  String filePath,@RequestParam(required=false) Long projectId);
 
     @PostMapping(UPLOAD_FILE_INFO_BYTE)
     BladeFile updateFile(@RequestBody byte[] fileByte, @RequestParam String fileName);

+ 5 - 6
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/AliOssBuilder.java

@@ -24,6 +24,7 @@ import lombok.SneakyThrows;
 import org.springblade.core.oss.AliossTemplate;
 import org.springblade.core.oss.OssTemplate;
 import org.springblade.core.oss.props.OssProperties;
+import org.springblade.core.oss.rule.BladeOssRule;
 import org.springblade.core.oss.rule.OssRule;
 import org.springblade.resource.builder.ossre.AliossTemplateRe;
 import org.springblade.resource.builder.ossre.OssTemplateRe;
@@ -37,7 +38,7 @@ import org.springblade.resource.entity.Oss;
 public class AliOssBuilder {
 
     @SneakyThrows
-    public static OssTemplate template(Oss oss, OssRule ossRule) {
+    public static AliossTemplateRe template(Oss oss, BladeOssRule ossRule) {
         // 创建ClientConfiguration。ClientConfiguration是OSSClient的配置类,可配置代理、连接超时、最大连接数等参数。
         ClientConfiguration conf = new ClientConfiguration();
         // 设置OSSClient允许打开的最大HTTP连接数,默认为1024个。
@@ -54,17 +55,15 @@ public class AliOssBuilder {
         conf.setMaxErrorRetry(5);
         OssProperties ossProperties = new OssProperties();
 
-       // ossProperties.setEndpoint(oss.getEndpoint());
-        //本地测试1
-        ossProperties.setEndpoint("https://oss-cn-shenzhen.aliyuncs.com/");
+        ossProperties.setEndpoint(oss.getEndpoint());
+      //  ossProperties.setEndpoint("https://oss-cn-shenzhen.aliyuncs.com/");
 
         ossProperties.setAccessKey(oss.getAccessKey());
         ossProperties.setSecretKey(oss.getSecretKey());
         ossProperties.setBucketName(oss.getBucketName());
         CredentialsProvider credentialsProvider = new DefaultCredentialProvider(ossProperties.getAccessKey(), ossProperties.getSecretKey());
         OSSClient ossClient = new OSSClient(ossProperties.getEndpoint(), credentialsProvider, conf);
-
-        return new AliossTemplate(ossClient, ossProperties, ossRule);
+        return new AliossTemplateRe(ossClient, ossProperties, ossRule);
     }
 
 }

+ 2 - 1
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/MinioOssBuilder.java

@@ -23,6 +23,7 @@ import org.springblade.core.oss.MinioTemplate;
 import org.springblade.core.oss.props.OssProperties;
 import org.springblade.core.oss.rule.OssRule;
 import org.springblade.resource.builder.ossre.MinioTemplateRe;
+import org.springblade.resource.builder.ossre.OssTemplateRe;
 import org.springblade.resource.entity.Oss;
 
 /**
@@ -33,7 +34,7 @@ import org.springblade.resource.entity.Oss;
 public class MinioOssBuilder {
 
     @SneakyThrows
-    public static OssTemplate template(Oss oss, OssRule ossRule) {
+    public static OssTemplateRe template(Oss oss, OssRule ossRule) {
         MinioClient minioClient = MinioClient.builder()
                 .endpoint(oss.getEndpoint())
                 .credentials(oss.getAccessKey(), oss.getSecretKey())

+ 19 - 23
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/oss/OssBuilder.java

@@ -29,6 +29,7 @@ import org.springblade.core.oss.rule.BladeOssRule;
 import org.springblade.core.oss.rule.OssRule;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.utils.*;
+import org.springblade.resource.builder.ossre.AliossTemplateRe;
 import org.springblade.resource.builder.ossre.OssTemplateRe;
 import org.springblade.resource.entity.Oss;
 import org.springblade.resource.service.IOssService;
@@ -37,6 +38,7 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 import static org.springblade.core.cache.constant.CacheConstant.RESOURCE_CACHE;
+import static org.springblade.resource.builder.oss.AliOssBuilder.*;
 
 /**
  * Oss云存储统一构建类
@@ -57,34 +59,29 @@ public class OssBuilder {
         this.ossService = ossService;
     }
 
-    /**
-     * OssTemplate配置缓存池
-     */
-  //  private final Map<String, OssTemplateRe> templatePool = new ConcurrentHashMap<>();
 
-    private final Map<String, OssTemplate> templatePool = new ConcurrentHashMap<>();
 
     /**
      * oss配置缓存池
      */
     private final Map<String, Oss> ossPool = new ConcurrentHashMap<>();
 
-
-    /**
+/*
+    *//**
      * 获取template
      *
      * @return OssTemplate
-     */
+     *//*
     public OssTemplate template() {
         return template(StringPool.EMPTY);
     }
-
-    /**
+     private final Map<String, OssTemplate> templatePool = new ConcurrentHashMap<>();
+    *//**
      * 获取template
      *
      * @param code 资源编号--minio
      * @return OssTemplate
-     */
+     *//*
     public OssTemplate template(String code) {
         String tenantId = AuthUtil.getTenantId();
         Oss oss = getOss(tenantId, code);
@@ -117,28 +114,29 @@ public class OssBuilder {
                 }
             }
         }
-
         return template;
-    }
+    }*/
 
 
+    /**
+     * OssTemplate配置缓存池
+     */
+    private final Map<String, OssTemplateRe> templatePool = new ConcurrentHashMap<>();
 
     /**
      * 获取template --阿里云
-     *
      * @return OssTemplate
      */
-/*    public OssTemplateRe template() {
+    public OssTemplateRe template() {
         return template(StringPool.EMPTY);
-    }*/
+    }
 
     /**
      * 获取template ---- 阿里云
-     *
      * @param code 资源编号
      * @return OssTemplate
      */
-  /*  public OssTemplateRe template(String code) {
+    public OssTemplateRe template(String code) {
         String tenantId = AuthUtil.getTenantId();
         Oss oss = getOss(tenantId, code);
         Oss ossCached = ossPool.get(tenantId);
@@ -148,7 +146,7 @@ public class OssBuilder {
             synchronized (OssBuilder.class) {
                 template = templatePool.get(tenantId);
                 if (Func.hasEmpty(template, ossCached) || !oss.getEndpoint().equals(ossCached.getEndpoint()) || !oss.getAccessKey().equals(ossCached.getAccessKey())) {
-                    OssRule ossRule;
+                    BladeOssRule ossRule;
                     // 若采用默认设置则开启多租户模式, 若是用户自定义oss则不开启
                     if (oss.getEndpoint().equals(ossProperties.getEndpoint()) && oss.getAccessKey().equals(ossProperties.getAccessKey()) && ossProperties.getTenantMode()) {
                         ossRule = new BladeOssRule(Boolean.TRUE);
@@ -161,7 +159,7 @@ public class OssBuilder {
                    } else if (oss.getCategory() == OssEnum.QINIU.getCategory()) {
                        // template = QiniuOssBuilder.template(oss, ossRule);
                    } else if (oss.getCategory() == OssEnum.ALI.getCategory()) {
-                        template = AliOssBuilder.template(oss, ossRule);
+                       template = AliOssBuilder.template(oss, ossRule);
                    } else if (oss.getCategory() == OssEnum.TENCENT.getCategory()) {
                        // template = TencentOssBuilder.template(oss, ossRule);
                    }
@@ -170,9 +168,8 @@ public class OssBuilder {
                 }
             }
         }
-
         return template;
-    }*/
+    }
 
     /**
      * 获取对象存储实体
@@ -203,7 +200,6 @@ public class OssBuilder {
                 defaultOss.setId(0L);
                 defaultOss.setCategory(OssEnum.of(ossProperties.getName()).getCategory());
                 defaultOss.setEndpoint(ossProperties.getEndpoint());
-               // defaultOss.setEndpoint("https://oss-cn-hangzhou.aliyuncs.com");
                 defaultOss.setBucketName(ossProperties.getBucketName());
                 defaultOss.setAccessKey(ossProperties.getAccessKey());
                 defaultOss.setSecretKey(ossProperties.getSecretKey());

+ 53 - 54
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/ossre/AliossTemplateRe.java

@@ -26,7 +26,7 @@ import org.springblade.core.tool.jackson.JsonUtil;
 import org.springframework.util.StringUtils;
 import org.springframework.web.multipart.MultipartFile;
 
-public class AliossTemplateRe implements OssTemplate {
+public class AliossTemplateRe implements OssTemplateRe {
 
     private final OSSClient ossClient;
     private final OssProperties ossProperties;
@@ -331,59 +331,58 @@ public class AliossTemplateRe implements OssTemplate {
     }
 
     //不使用
-//    public BladeFile putFileWithPath(String fileName, String filePath,Long projectId, InputStream stream) {
-//
-//        try {
-//
-//            String suffix = "";
-//            int indexOfDot = fileName.lastIndexOf('.');
-//            if (indexOfDot > 0) {
-//                suffix = fileName.substring(indexOfDot + 1);
-//            }
-//
-//            String ossUrl = "";
-//            // 判断容器是否存在,不存在就创建
-//            String bucket=getBucketName();
-//            if (!ossClient.doesBucketExist(bucket)) {
-//                ossClient.createBucket(bucket);
-//                CreateBucketRequest createBucketRequest = new CreateBucketRequest(bucket);
-//                createBucketRequest.setCannedACL(CannedAccessControlList.PublicRead);
-//                ossClient.createBucket(createBucketRequest);
-//            }
-//            // 设置文件路径和名称
-//            //判断是否为存储成   upload/20230322/xxxx.pdf 还是指定目录 aaaa/bbbb.pdf
-//            if (StringUtils.isEmpty(filePath)) {
-//                Date now = new Date();
-//                SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
-//                String formattedDate = sdf.format(now);
-//                filePath = OssConstant.NORMAL_DIRECTORY + "/" + formattedDate;
-//            }
-//
-//            //如果有项目ID,则存为 项目id/....  ,否则直接在最外层, 临时目录除外
-//            if (!filePath.equals(OssConstant.TEMP_DIRECTORY)) {
-//                if (projectId != null  ) {
-//                    filePath = projectId + "/" + filePath;
-//                }
-//            }
-//
-//            String fileUrl = filePath + "/" + fileName;
-//            ObjectMetadata objectMetadata = new ObjectMetadata();
-//            objectMetadata.setContentType(getcontentType(suffix));
-//            ossUrl = getOssHost() + fileUrl;
-//
-//            // 上传文件
-//            PutObjectResult result = ossClient.putObject(new PutObjectRequest(bucket, fileUrl, stream,objectMetadata));
-//
-//            BladeFile file = new BladeFile();
-//            file.setOriginalName(fileName);
-//            file.setName(fileName);
-//            file.setDomain(this.getOssHost(bucket));
-//            file.setLink(ossUrl);
-//            return file;
-//        } catch (Throwable var9) {
-//            throw var9;
-//        }
-//    }
+    public BladeFile putFileWithPath(String fileName, String filePath,Long projectId, InputStream stream) {
+        try {
+
+            String suffix = "";
+            int indexOfDot = fileName.lastIndexOf('.');
+            if (indexOfDot > 0) {
+                suffix = fileName.substring(indexOfDot + 1);
+            }
+
+            String ossUrl = "";
+            // 判断容器是否存在,不存在就创建
+            String bucket=getBucketName();
+            if (!ossClient.doesBucketExist(bucket)) {
+                ossClient.createBucket(bucket);
+                CreateBucketRequest createBucketRequest = new CreateBucketRequest(bucket);
+                createBucketRequest.setCannedACL(CannedAccessControlList.PublicRead);
+                ossClient.createBucket(createBucketRequest);
+            }
+            // 设置文件路径和名称
+            //判断是否为存储成   upload/20230322/xxxx.pdf 还是指定目录 aaaa/bbbb.pdf
+            if (StringUtils.isEmpty(filePath)) {
+                Date now = new Date();
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+                String formattedDate = sdf.format(now);
+                filePath = OssConstant.NORMAL_DIRECTORY + "/" + formattedDate;
+            }
+
+            //如果有项目ID,则存为 项目id/....  ,否则直接在最外层, 临时目录除外
+            if (!filePath.equals(OssConstant.TEMP_DIRECTORY)) {
+                if (projectId != null  ) {
+                    filePath = projectId + "/" + filePath;
+                }
+            }
+
+            String fileUrl = filePath + "/" + fileName;
+            ObjectMetadata objectMetadata = new ObjectMetadata();
+            objectMetadata.setContentType(getcontentType(suffix));
+            ossUrl = getOssHost() + fileUrl;
+
+            // 上传文件
+            PutObjectResult result = ossClient.putObject(new PutObjectRequest(bucket, fileUrl, stream,objectMetadata));
+
+            BladeFile file = new BladeFile();
+            file.setOriginalName(fileName);
+            file.setName(fileName);
+            file.setDomain(this.getOssHost(bucket));
+            file.setLink(ossUrl);
+            return file;
+        } catch (Throwable var9) {
+            throw var9;
+        }
+    }
 
     // 获取某个存储空间下指定目录(文件夹)下的文件大小。
     private static long calculateFolderLength(OSS ossClient, String bucketName, String folder) {

+ 21 - 364
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/ossre/MinioTemplateRe.java

@@ -5,388 +5,45 @@
 
 package org.springblade.resource.builder.ossre;
 
-import io.minio.BucketExistsArgs;
-import io.minio.CopyObjectArgs;
-import io.minio.CopySource;
-import io.minio.GetPresignedObjectUrlArgs;
-import io.minio.MakeBucketArgs;
+import com.aliyun.oss.model.*;
 import io.minio.MinioClient;
-import io.minio.PutObjectArgs;
-import io.minio.RemoveBucketArgs;
-import io.minio.RemoveObjectArgs;
-import io.minio.RemoveObjectsArgs;
-import io.minio.SetBucketPolicyArgs;
-import io.minio.StatObjectArgs;
-import io.minio.StatObjectResponse;
-import io.minio.http.Method;
-import io.minio.messages.Bucket;
-import io.minio.messages.DeleteObject;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.Stream;
-
-import lombok.SneakyThrows;
-import org.springblade.core.oss.OssTemplate;
-import org.springblade.core.oss.enums.PolicyType;
+import org.springblade.core.oss.MinioTemplate;
 import org.springblade.core.oss.model.BladeFile;
-import org.springblade.core.oss.model.OssFile;
 import org.springblade.core.oss.props.OssProperties;
 import org.springblade.core.oss.rule.OssRule;
-import org.springblade.core.tool.utils.DateUtil;
-import org.springblade.core.tool.utils.Func;
-import org.springframework.web.multipart.MultipartFile;
-
-public class MinioTemplateRe implements OssTemplate {
-
-    private final MinioClient client;
-    private final OssRule ossRule;
-    private final OssProperties ossProperties;
-
-    @SneakyThrows
-    public void makeBucket(String bucketName) {
-        try {
-            if (!this.client.bucketExists((BucketExistsArgs)((BucketExistsArgs.Builder)BucketExistsArgs.builder().bucket(this.getBucketName(bucketName))).build())) {
-                this.client.makeBucket((MakeBucketArgs)((MakeBucketArgs.Builder)MakeBucketArgs.builder().bucket(this.getBucketName(bucketName))).build());
-                this.client.setBucketPolicy((SetBucketPolicyArgs)((SetBucketPolicyArgs.Builder)SetBucketPolicyArgs.builder().bucket(this.getBucketName(bucketName))).config(getPolicyType(this.getBucketName(bucketName), PolicyType.READ)).build());
-            }
-
-        } catch (Throwable var3) {
-            throw var3;
-        }
-    }
-
-    public Bucket getBucket() {
-        try {
-            return this.getBucket(this.getBucketName());
-        } catch (Throwable var2) {
-            throw var2;
-        }
-    }
-
-    @SneakyThrows
-    public Bucket getBucket(String bucketName) {
-        try {
-            Optional<Bucket> bucketOptional = this.client.listBuckets().stream().filter((bucket) -> {
-                return bucket.name().equals(this.getBucketName(bucketName));
-            }).findFirst();
-            return (Bucket)bucketOptional.orElse(null);
-        } catch (Throwable var3) {
-            throw var3;
-        }
-    }
-
-    @SneakyThrows
-    public List<Bucket> listBuckets() {
-        try {
-            return this.client.listBuckets();
-        } catch (Throwable var2) {
-            throw var2;
-        }
-    }
-
-    @SneakyThrows
-    public void removeBucket(String bucketName) {
-        try {
-            this.client.removeBucket((RemoveBucketArgs)((RemoveBucketArgs.Builder)RemoveBucketArgs.builder().bucket(this.getBucketName(bucketName))).build());
-        } catch (Throwable var3) {
-            throw var3;
-        }
-    }
 
-    @SneakyThrows
-    public boolean bucketExists(String bucketName) {
-        try {
-            return this.client.bucketExists((BucketExistsArgs)((BucketExistsArgs.Builder)BucketExistsArgs.builder().bucket(this.getBucketName(bucketName))).build());
-        } catch (Throwable var3) {
-            throw var3;
-        }
-    }
-
-    public void copyFile(String bucketName, String fileName, String destBucketName) {
-        try {
-            this.copyFile(bucketName, fileName, destBucketName, fileName);
-        } catch (Throwable var5) {
-            throw var5;
-        }
-    }
-
-    @SneakyThrows
-    public void copyFile(String bucketName, String fileName, String destBucketName, String destFileName) {
-        try {
-            this.client.copyObject((CopyObjectArgs)((CopyObjectArgs.Builder)((CopyObjectArgs.Builder)CopyObjectArgs.builder().source((CopySource)((CopySource.Builder)((CopySource.Builder)CopySource.builder().bucket(this.getBucketName(bucketName))).object(fileName)).build()).bucket(this.getBucketName(destBucketName))).object(destFileName)).build());
-        } catch (Throwable var6) {
-            throw var6;
-        }
-    }
-
-    public OssFile statFile(String fileName) {
-        try {
-            return this.statFile(this.ossProperties.getBucketName(), fileName);
-        } catch (Throwable var3) {
-            throw var3;
-        }
-    }
-
-    @SneakyThrows
-    public OssFile statFile(String bucketName, String fileName) {
-        try {
-            StatObjectResponse stat = this.client.statObject((StatObjectArgs)((StatObjectArgs.Builder)((StatObjectArgs.Builder)StatObjectArgs.builder().bucket(this.getBucketName(bucketName))).object(fileName)).build());
-            OssFile ossFile = new OssFile();
-            ossFile.setName(Func.isEmpty(stat.object()) ? fileName : stat.object());
-            ossFile.setLink(this.fileLink(ossFile.getName()));
-            ossFile.setHash(String.valueOf(stat.hashCode()));
-            ossFile.setLength(stat.size());
-            ossFile.setPutTime(DateUtil.toDate(stat.lastModified().toLocalDateTime()));
-            ossFile.setContentType(stat.contentType());
-            return ossFile;
-        } catch (Throwable var5) {
-            throw var5;
-        }
-    }
-
-    public String filePath(String fileName) {
-        return this.getBucketName().concat("/").concat(fileName);
-    }
-
-    public String filePath(String bucketName, String fileName) {
-        return this.getBucketName(bucketName).concat("/").concat(fileName);
-    }
-
-    public String fileLink(String fileName) {
-        try {
-            return this.ossProperties.getEndpoint().concat("/").concat(this.getBucketName()).concat("/").concat(fileName);
-        } catch (Throwable var3) {
-            throw var3;
-        }
-    }
-
-    public String fileLink(String bucketName, String fileName) {
-        try {
-            String fileUrl = this.ossProperties.getEndpoint().concat("/").concat(this.getBucketName(bucketName)).concat("/").concat(fileName);
-            if (fileUrl.indexOf("152.168.2.15") >= 0) {
-                fileUrl = fileUrl.replaceAll("152.168.2.15", "183.247.216.148").replace(":9000//",":9000/");
-            }
-            return  fileUrl;
-        } catch (Throwable var4) {
-            throw var4;
-        }
-    }
-
-    public BladeFile putFile(MultipartFile file) {
-        try {
-            return this.putFile(this.ossProperties.getBucketName(), file.getOriginalFilename(), file);
-        } catch (Throwable var3) {
-            throw var3;
-        }
-    }
-
-    public BladeFile putFile(String fileName, MultipartFile file) {
-        try {
-            return this.putFile(this.ossProperties.getBucketName(), fileName, file);
-        } catch (Throwable var4) {
-            throw var4;
-        }
-    }
-
-    @SneakyThrows
-    public BladeFile putFile(String bucketName, String fileName, MultipartFile file) {
-        try {
-            return this.putFile(bucketName, file.getOriginalFilename(), file.getInputStream());
-        } catch (Throwable var5) {
-            throw var5;
-        }
-    }
-
-    public BladeFile putFile(String fileName, InputStream stream) {
-        try {
-            return this.putFile(this.ossProperties.getBucketName(), fileName, stream);
-        } catch (Throwable var4) {
-            throw var4;
-        }
-    }
-
-    public BladeFile putFile(String bucketName, String fileName, InputStream stream) {
-        try {
-            return this.putFile(bucketName, fileName, stream, "application/octet-stream");
-        } catch (Throwable var5) {
-            throw var5;
-        }
-    }
-
-    @SneakyThrows
-    public BladeFile putFile(String bucketName, String fileName, InputStream stream, String contentType) {
-        try {
-            this.makeBucket(bucketName);
-            String originalName = fileName;
-            fileName = this.getFileName(fileName);
-            this.client.putObject((PutObjectArgs)((PutObjectArgs.Builder)((PutObjectArgs.Builder)PutObjectArgs.builder().bucket(this.getBucketName(bucketName))).object(fileName)).stream(stream, (long)stream.available(), -1L).contentType(contentType).build());
-            BladeFile file = new BladeFile();
-            file.setOriginalName(originalName);
-            file.setName(fileName);
-            file.setDomain(this.getOssHost(bucketName));
-            file.setLink(this.fileLink(bucketName, fileName));
-            return file;
-        } catch (Throwable var7) {
-            throw var7;
-        }
-    }
-
-    public void removeFile(String fileName) {
-        try {
-            this.removeFile(this.ossProperties.getBucketName(), fileName);
-        } catch (Throwable var3) {
-            throw var3;
-        }
-    }
-
-    @SneakyThrows
-    public void removeFile(String bucketName, String fileName) {
-        try {
-            this.client.removeObject((RemoveObjectArgs)((RemoveObjectArgs.Builder)((RemoveObjectArgs.Builder)RemoveObjectArgs.builder().bucket(this.getBucketName(bucketName))).object(fileName)).build());
-        } catch (Throwable var4) {
-            throw var4;
-        }
-    }
-
-    public void removeFiles(List<String> fileNames) {
-        try {
-            this.removeFiles(this.ossProperties.getBucketName(), fileNames);
-        } catch (Throwable var3) {
-            throw var3;
-        }
-    }
-
-    public void removeFiles(String bucketName, List<String> fileNames) {
-        try {
-            Stream<DeleteObject> stream = fileNames.stream().map(DeleteObject::new);
-            MinioClient var10000 = this.client;
-            RemoveObjectsArgs.Builder var10001 = (RemoveObjectsArgs.Builder)RemoveObjectsArgs.builder().bucket(this.getBucketName(bucketName));
-            stream.getClass();
-            var10000.removeObjects((RemoveObjectsArgs)var10001.objects(stream::iterator).build());
-        } catch (Throwable var4) {
-            throw var4;
-        }
-    }
+import java.io.InputStream;
 
-    private String getBucketName() {
-        return this.getBucketName(this.ossProperties.getBucketName());
-    }
 
-    private String getBucketName(String bucketName) {
-        return this.ossRule.bucketName(bucketName);
-    }
+public class MinioTemplateRe extends MinioTemplate implements OssTemplateRe{
 
-    private String getFileName(String originalFilename) {
-        return this.ossRule.fileName(originalFilename);
+    public MinioTemplateRe(MinioClient client, OssRule ossRule, OssProperties ossProperties) {
+        super(client, ossRule, ossProperties);
     }
 
-    @SneakyThrows
-    public String getPresignedObjectUrl(String bucketName, String fileName, Integer expires) {
-        try {
-            return this.client.getPresignedObjectUrl((GetPresignedObjectUrlArgs)((GetPresignedObjectUrlArgs.Builder)((GetPresignedObjectUrlArgs.Builder)GetPresignedObjectUrlArgs.builder().method(Method.GET).bucket(this.getBucketName(bucketName))).object(fileName)).expiry(expires).build());
-        } catch (Throwable var5) {
-            throw var5;
-        }
-    }
 
-    public String getPolicyType(PolicyType policyType) {
-        return getPolicyType(this.getBucketName(), policyType);
+    @Override
+    public UploadPartResult uploadPart(UploadPartRequest request) {
+        return null;
     }
 
-    public static String getPolicyType(String bucketName, PolicyType policyType) {
-        StringBuilder builder = new StringBuilder();
-        builder.append("{\n");
-        builder.append("    \"Statement\": [\n");
-        builder.append("        {\n");
-        builder.append("            \"Action\": [\n");
-        switch (policyType) {
-            case WRITE:
-                builder.append("                \"s3:GetBucketLocation\",\n");
-                builder.append("                \"s3:ListBucketMultipartUploads\"\n");
-                break;
-            case READ_WRITE:
-                builder.append("                \"s3:GetBucketLocation\",\n");
-                builder.append("                \"s3:ListBucket\",\n");
-                builder.append("                \"s3:ListBucketMultipartUploads\"\n");
-                break;
-            default:
-                builder.append("                \"s3:GetBucketLocation\"\n");
-        }
-
-        builder.append("            ],\n");
-        builder.append("            \"Effect\": \"Allow\",\n");
-        builder.append("            \"Principal\": \"*\",\n");
-        builder.append("            \"Resource\": \"arn:aws:s3:::");
-        builder.append(bucketName);
-        builder.append("\"\n");
-        builder.append("        },\n");
-        if (PolicyType.READ.equals(policyType)) {
-            builder.append("        {\n");
-            builder.append("            \"Action\": [\n");
-            builder.append("                \"s3:ListBucket\"\n");
-            builder.append("            ],\n");
-            builder.append("            \"Effect\": \"Deny\",\n");
-            builder.append("            \"Principal\": \"*\",\n");
-            builder.append("            \"Resource\": \"arn:aws:s3:::");
-            builder.append(bucketName);
-            builder.append("\"\n");
-            builder.append("        },\n");
-        }
-
-        builder.append("        {\n");
-        builder.append("            \"Action\": ");
-        switch (policyType) {
-            case WRITE:
-                builder.append("[\n");
-                builder.append("                \"s3:AbortMultipartUpload\",\n");
-                builder.append("                \"s3:DeleteObject\",\n");
-                builder.append("                \"s3:ListMultipartUploadParts\",\n");
-                builder.append("                \"s3:PutObject\"\n");
-                builder.append("            ],\n");
-                break;
-            case READ_WRITE:
-                builder.append("[\n");
-                builder.append("                \"s3:AbortMultipartUpload\",\n");
-                builder.append("                \"s3:DeleteObject\",\n");
-                builder.append("                \"s3:GetObject\",\n");
-                builder.append("                \"s3:ListMultipartUploadParts\",\n");
-                builder.append("                \"s3:PutObject\"\n");
-                builder.append("            ],\n");
-                break;
-            default:
-                builder.append("\"s3:GetObject\",\n");
-        }
-
-        builder.append("            \"Effect\": \"Allow\",\n");
-        builder.append("            \"Principal\": \"*\",\n");
-        builder.append("            \"Resource\": \"arn:aws:s3:::");
-        builder.append(bucketName);
-        builder.append("/*\"\n");
-        builder.append("        }\n");
-        builder.append("    ],\n");
-        builder.append("    \"Version\": \"2012-10-17\"\n");
-        builder.append("}\n");
-        return builder.toString();
+    @Override
+    public CompleteMultipartUploadResult completeMultipartUpload(CompleteMultipartUploadRequest request) {
+        return null;
     }
 
-    public String getOssHost(String bucketName) {
-        String prefix = this.ossProperties.getEndpoint().contains("https://") ? "https://" : "http://";
-        if (this.ossProperties.getEndpoint().indexOf("152.168.2.15") >= 0) {
-            String fileUrl =  prefix + this.getBucketName(bucketName) + "." + this.ossProperties.getEndpoint().replaceAll("152.168.2.15", "183.247.216.148").replaceFirst(prefix, "");
-            return fileUrl;
-        } else {
-            return prefix + this.getBucketName(bucketName) + "." + this.ossProperties.getEndpoint().replaceFirst(prefix, "");
-        }
+    @Override
+    public InitiateMultipartUploadResult initiateMultipartUpload(InitiateMultipartUploadRequest request) {
+        return null;
     }
 
-    public String getOssHost() {
-        return this.getOssHost(this.ossProperties.getBucketName());
+    @Override
+    public Long getAllFileSizeByFileUrl(String fileUrl) {
+        return 0L;
     }
 
-    public MinioTemplateRe(final MinioClient client, final OssRule ossRule, final OssProperties ossProperties) {
-        this.client = client;
-        this.ossRule = ossRule;
-        this.ossProperties = ossProperties;
+    @Override
+    public BladeFile putFileWithPath(String fileName, String filePath, Long projectId, InputStream stream) {
+        return null;
     }
 }

+ 1 - 3
blade-ops/blade-resource/src/main/java/org/springblade/resource/builder/ossre/OssTemplateRe.java

@@ -3,10 +3,8 @@ package org.springblade.resource.builder.ossre;
 import com.aliyun.oss.model.*;
 import org.springblade.core.oss.OssTemplate;
 import org.springblade.core.oss.model.BladeFile;
-
 import java.io.InputStream;
 
-
 public interface OssTemplateRe extends OssTemplate {
 
     // OSS 分片上传
@@ -22,5 +20,5 @@ public interface OssTemplateRe extends OssTemplate {
     Long getAllFileSizeByFileUrl(String fileUrl);
 
     //指定路径上传
-//    BladeFile putFileWithPath(String fileName, String filePath,Long projectId, InputStream stream);
+    BladeFile putFileWithPath(String fileName, String filePath,Long projectId, InputStream stream);
 }

+ 11 - 11
blade-ops/blade-resource/src/main/java/org/springblade/resource/feign/NewIOSSClientImpl.java

@@ -94,15 +94,15 @@ public class NewIOSSClientImpl implements NewIOSSClient {
         return null;
     }
 
-//    @Override
-//    public BladeFile uploadFile(String fileName, String localFileUrl,String filePath, Long projectId) {
-//        try {
-//            //获取文件流
-//            InputStream inputStream = new FileInputStream(new File(localFileUrl));
-//            return this.ossBuilder.template().putFileWithPath(fileName,filePath, projectId,inputStream);
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//        return null;
-//    }
+    @Override
+    public BladeFile uploadFile(String fileName, String localFileUrl,String filePath, Long projectId) {
+        try {
+            //获取文件流
+            InputStream inputStream = new FileInputStream(new File(localFileUrl));
+            return this.ossBuilder.template().putFileWithPath(fileName,filePath, projectId,inputStream);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
 }

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -2861,7 +2861,7 @@ public class InformationWriteQueryController extends BladeController {
             throw new ServiceException("该节点为缓存信息,请重试");
         }
 
-        //半选
+        //半选allSelectedNodeList = {ArrayList@21723}  size = 206
         List<AddContractTreeNodeVO.Node> halfSelectedNodeList = vo.getHalfSelectedList();
         //全选
         List<AddContractTreeNodeVO.Node> allSelectedNodeList = vo.getAllSelectedList();

+ 3 - 4
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController.java

@@ -55,16 +55,15 @@ public class EVisaController {
 
     private final TaskClient taskClient;
 
-    private final NewIOSSClient newIOSSClient;
 
     // 电签主类
 
-   // @Scheduled(cron = "0/30 * * * * ?")
+    @Scheduled(cron = "0/10 * * * * ?")
     public void SignInfo() {
         //执行代码
         log.info("扫描开始");
         //String sql = "SELECT * from u_task_batch where json_data like '%1821798868568768512%' and is_deleted<>5  LIMIT 10";
-        String sql = "SELECT * from u_task_batch where is_deleted<>5 and id=1684040525583613953 LIMIT 5";
+        String sql = "SELECT * from u_task_batch where is_deleted<>5 LIMIT 5";
         List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
         if (maps != null && maps.size() >= 1) {
             for (Map<String, Object> dataInfo : maps) {
@@ -80,7 +79,7 @@ public class EVisaController {
                     taskApprovalVO.setNickName(nickName);
 
                     if (!aBoolean) {
-                        RedisTemplate.opsForValue().set("sign-" + taskApprovalVO.getFormDataId(), "1",120, TimeUnit.SECONDS);
+                        RedisTemplate.opsForValue().set("sign-" + taskApprovalVO.getFormDataId(), "1",600, TimeUnit.SECONDS);
                         CompletableFuture<Void> runAsync = CompletableFuture.runAsync(() -> {
                             try {
                                 /*===============执行批量任务===============*/

+ 2 - 2
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java

@@ -100,8 +100,8 @@ import java.util.stream.Collectors;
 @AllArgsConstructor
 public class EVisaServiceImpl implements EVisaService {
 
-   // private static final String SIGN_HOST = "172.30.224.79";
-    private static final String SIGN_HOST = "47.115.117.246";
+    private static final String SIGN_HOST = "172.30.224.79";
+   // private static final String SIGN_HOST = "47.115.117.246";
 
     private static final String SIGN_PORT = "8183";
 

+ 8 - 11
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -167,8 +167,8 @@ public class ExcelTabController extends BladeController {
 
 
     // 线程池
-    @Resource(name = "taskExecutor1")
-    private ThreadPoolExecutor executor;
+ //   @Resource(name = "taskExecutor1")
+   // private ThreadPoolExecutor executor;
 
 
     @Autowired
@@ -953,9 +953,6 @@ public class ExcelTabController extends BladeController {
                 }
             }
         }
-
-        //fileInputStream.close();
-
         return R.data(table + "");
     }
 
@@ -4101,8 +4098,8 @@ public class ExcelTabController extends BladeController {
     }
 
 
-    @Scheduled(cron = "0/20 * * * * ?")
-    public void SignInfo() {
+  //  @Scheduled(cron = "0/20 * * * * ?")
+ /*   public void SignInfo() {
         //执行代码
         String sql = "SELECT a.* from u_information_query a,m_wbs_tree_contract b  where a.wbs_id=b.p_key_id and  a.project_id='1681859557657550850' and  a.create_dept=100 LIMIT 5";
         List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
@@ -4115,7 +4112,7 @@ public class ExcelTabController extends BladeController {
                         RedisTemplate.opsForValue().set("sign-" + idkey, "1",30, TimeUnit.SECONDS);
                         CompletableFuture<Void> runAsync = CompletableFuture.runAsync(() -> {
                             try {
-                                /*===============执行批量任务===============*/
+                                *//*===============执行批量任务===============*//*
                                 this.checkIsExsitTaskBatch(dataInfo);
                             } catch (Exception e) {
                                 e.printStackTrace();
@@ -4185,11 +4182,11 @@ public class ExcelTabController extends BladeController {
             String dateInfo = "";
             for (String iId : list) {
                 //获取
-               /* if(StringUtils.isNotBlank(dataInfo.get("file_user_id_and_name")+"")){
+               *//* if(StringUtils.isNotBlank(dataInfo.get("file_user_id_and_name")+"")){
                     String userIdAndName = dataInfo.get("file_user_id_and_name")+"";
                     String[] split = userIdAndName.split("-");
                     userId = Long.parseLong(split[0]);
-                }*/
+                }*//*
 
                 List<AppWbsTreeContractVO> WbsTreeContract = wbsTreeContractService.searchNodeAllTable(nodeId+":"+userId, classify, contractId, projectId ,null);
 
@@ -4236,5 +4233,5 @@ public class ExcelTabController extends BladeController {
         }catch (Exception e) {
              throw new RuntimeException(e);
         }
-    }
+    }*/
 }

+ 8 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -1862,6 +1862,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     @Override
     public R getBussPdfInfo(Long pkeyId) throws Exception {
         String file_path = FileUtils.getSysLocalFileUrl();
+        String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
 
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
@@ -2083,8 +2084,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
                                 InputStream imageIn = CommonUtil.getOSSInputStream(myData);
                                 if (imageIn != null) {
-                                    byte[] byteNew = IOUtils.toByteArray(imageIn);
-                                    byte[] bytes = CommonUtil.compressImage(byteNew);
+                                    byte[] bytes = null;
+                                    if (sys_isonline.equals("20")) {
+                                        bytes = IOUtils.toByteArray(imageIn);
+                                    } else {
+                                        byte[] byteNew = IOUtils.toByteArray(imageIn);
+                                        bytes = CommonUtil.compressImage(byteNew);
+                                    }
                                     // 这里根据实际需求选择图片类型
                                     int pictureIdx = workbook.addPicture(bytes, 6);
                                     CreationHelper helper = workbook.getCreationHelper();