Преглед на файлове

档案系统自动组卷无法生成封面,关闭客户端的公配置自动识别,去除档案删除oss的权限

DengLinLang преди 1 седмица
родител
ревизия
04036cb5f4

+ 1 - 8
blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/OssEndpoint.java

@@ -23,7 +23,6 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.poi.util.IOUtils;
 import org.springblade.common.utils.CommonUtil;
-import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.oss.model.OssFile;
@@ -42,14 +41,8 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.imageio.ImageIO;
-import java.awt.*;
-import java.awt.image.BufferedImage;
 import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.security.SecureRandom;
 import java.text.DecimalFormat;
-import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.Objects;
 
@@ -432,7 +425,7 @@ public class OssEndpoint {
      */
     @SneakyThrows
     @PostMapping("/remove-file")
-    @PreAuth(RoleConstant.HAS_ROLE_ADMIN)
+    //@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
     public R removeFile(@RequestParam String fileName) {
         ossBuilder.template().removeFile(fileName);
         return R.success("操作成功");

+ 7 - 5
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveAutoPdfServiceImpl.java

@@ -340,7 +340,8 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         // Step 1: Get the list of formulas using archiveFormulaConfigService
         List<ArchiveFormulaConfig> formulaConfigs = archiveFormulaConfigService.getByNumber(number);
 
-        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String file_path = FileUtils.getSysLocalFileUrl(); //ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+
         String excelUrl = getUrlByNumber(number);
         Map<String, Object> dataInfo = new HashMap<>();
 
@@ -382,6 +383,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         } else {
             try {
                 String url = getBussPdfInfo(fileName, dataInfo, excelUrl, file_path, OssConstant.ARCHIVE_DIRECTORY, archivesAuto.getProjectId());
+                url = url+"@@@"+fileName;
                 urls.add(url);
             } catch (Exception e) {
                 e.printStackTrace();
@@ -484,10 +486,10 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
 //            FileUtils.PdfCopyPublicMethods(bos, localUrls);
 //            BladeFile bladeFile = newIOSSClient.updateFile(bos.toByteArray(),fileName + ".pdf");
             if (bladeFile != null) {
-                urls.add(bladeFile.getLink());
+                urls.add(bladeFile.getLink()+"@@@"+fileName);
             }
         } else if (localUrls.size() == 1) {
-            urls.add(localUrls.get(0));
+            urls.add(localUrls.get(0)+"@@@"+fileName);
         }
     }
 
@@ -671,7 +673,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         String absoluteFileName = FileUtils.getOssPath(OssConstant.ARCHIVE_DIRECTORY, fileName, projectId);
         BladeFile bladeFile = newIOSSClient.uploadFile(absoluteFileName + ".pdf", localPdfPath);
 
-        ///BladeFile bladeFile = newIOSSClient.uploadFile(fileName + ".pdf", localPdfPath,ossPath, projectId);
+     //   BladeFile bladeFile = newIOSSClient.uploadFile(absoluteFileName + ".pdf", localPdfPath,ossPath, projectId);
         String pdfLink = "";
         if (bladeFile != null) {
             pdfLink = bladeFile.getLink();
@@ -912,7 +914,7 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
     public String MergePdfAndUpload(List<String> urlList, String fileName, String filePath, Long pojectId) {
         String url = "";
         Long id = SnowFlakeUtil.getId();
-        String localPdf = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL) + "/pdf/" + id + ".pdf";
+        String localPdf = FileUtils.getSysLocalFileUrl() + "/pdf/" + id + ".pdf";
 
         try {
             //合并pdf

+ 22 - 4
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java

@@ -2020,13 +2020,31 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			if (frontUrls != null) {
 				for (String frontUrl : frontUrls) {
 					if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[0]) && config.getFactorType().contains("1")) {
-						front = frontUrl;
+						if(frontUrl.contains("@@@")){
+							front = frontUrl.substring(0,frontUrl.indexOf("@@@"));
+						}else {
+							front = frontUrl;
+						}
 					} else if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[1]) && config.getFactorType().contains("2")) {
-						cataLog = frontUrl;
+						if(frontUrl.contains("@@@")){
+							cataLog = frontUrl.substring(0,frontUrl.indexOf("@@@"));
+						}else {
+							cataLog = frontUrl;
+						}
+
 					} else if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[2]) && config.getFactorType().contains("3")) {
-						spare = frontUrl;
+						if(frontUrl.contains("@@@")){
+							spare = frontUrl.substring(0,frontUrl.indexOf("@@@"));
+						}else {
+							spare = frontUrl;
+						}
+
 					} else if (frontUrl.contains(ArchiveAutoPdfServiceImpl.ARCHIVE_NUMBER[3]) && config.getFactorType().contains("4")) {
-						back = frontUrl;
+						if(frontUrl.contains("@@@")){
+							back = frontUrl.substring(0,frontUrl.indexOf("@@@"));
+						}else {
+							back = frontUrl;
+						}
 					}
 				}
 			}

+ 7 - 12
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -11,15 +11,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.jfireel.expression.Expression;
-import com.mixsmart.utils.*;
-import com.sun.org.apache.bcel.internal.generic.NEW;
+import com.mixsmart.utils.CustomFunction;
+import com.mixsmart.utils.FormulaUtils;
+import com.mixsmart.utils.RegexUtils;
+import com.mixsmart.utils.StringUtils;
 import lombok.RequiredArgsConstructor;
 import org.apache.poi.ss.usermodel.*;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
-import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.BaseUtils;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
@@ -30,8 +31,8 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.*;
 import org.springblade.manager.bean.TableInfo;
 import org.springblade.manager.dto.*;
-import org.springblade.manager.entity.*;
 import org.springblade.manager.entity.EvaluateDate;
+import org.springblade.manager.entity.*;
 import org.springblade.manager.enums.ExecuteType;
 import org.springblade.manager.formula.*;
 import org.springblade.manager.formula.impl.*;
@@ -44,22 +45,16 @@ import org.springblade.manager.vo.*;
 import org.springblade.meter.entity.InterimPayCertificateItem;
 import org.springblade.meter.feign.CertificateItemClient;
 import org.springblade.resource.feign.NewIOSSClient;
-import org.springblade.system.cache.ParamCache;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.dao.EmptyResultDataAccessException;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.transaction.annotation.Transactional;
-
 
 import javax.validation.constraints.NotNull;
-import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.util.*;
@@ -2908,7 +2903,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             }
 
            // 检查是否可以自动绑定参数公式
-            List<FormData> notFormulaFds=fds.stream().filter(f->f.getFormulaId()==null).collect(Collectors.toList());
+            /*List<FormData> notFormulaFds=fds.stream().filter(f->f.getFormulaId()==null).collect(Collectors.toList());
             if(notFormulaFds.size()>0){
                 List<WbsParam> finalTotal = total;
                 notFormulaFds.forEach(e->{
@@ -2926,7 +2921,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                         }
                     });
                 });
-            }
+            }*/
             fds.removeIf(f->f.getFormula()==null);
             if(fds.size()>0) {
                 /*执行结果放回数据集合*/

+ 1 - 1
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/MiddleMeterApplyServiceImpl.java

@@ -707,7 +707,7 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
             }else {
                 for (int i = 0; i < list.size() - 1; i++) {
                     Integer num = list.get(i);
-                    if (num == list.get(i+1)){
+                    if (num .equals(list.get(i+1)) ){
                         throw new ServiceException("计量期期号出现相同,请联系管理员");
                     }
                     Integer j = ++num;