hongchuangyanfa %!s(int64=2) %!d(string=hai) anos
pai
achega
47e1250082

+ 15 - 1
blade-service/blade-manager/src/main/java/com/mixsmart/utils/FormulaUtils.java

@@ -7,6 +7,8 @@ import org.apache.commons.text.similarity.JaccardSimilarity;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.*;
 import org.jsoup.Jsoup;
+import org.springblade.common.constant.CommonConstant;
+import org.springblade.common.utils.CommonUtil;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.IoUtil;
@@ -16,6 +18,7 @@ import org.springblade.manager.dto.Coords;
 import org.springblade.manager.dto.ElementData;
 import org.springblade.manager.dto.FormData;
 import org.springblade.manager.entity.Formula;
+import org.springblade.system.cache.ParamCache;
 
 import java.io.*;
 import java.math.BigDecimal;
@@ -422,8 +425,19 @@ public class FormulaUtils {
     }
 
     public static Map<String, String> getElementCell(String uri) {
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
         try {
-            return  Jsoup.parse(IoUtil.readToString(new FileInputStream(ResourceUtil.getFile(uri))))
+            File file1 = ResourceUtil.getFile(uri);
+            InputStream fileInputStream = null;
+            if(file1.exists()){
+                fileInputStream = new FileInputStream(file1);;
+            }else{
+                String path = sys_file_net_url+uri.replaceAll("//","/").replaceAll(file_path,"");
+                fileInputStream = CommonUtil.getOSSInputStream(path);
+            }
+
+            return  Jsoup.parse(IoUtil.readToString(fileInputStream))
                     .select("table").first()
                     .select("tr").stream()
                     .flatMap(tr->tr.select("td").stream())

+ 16 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -130,6 +130,7 @@ public class ExcelTabController extends BladeController {
 
     private final IContractInfoService contractInfoService;
 
+
     /**
      * 详情
      */
@@ -3044,8 +3045,9 @@ public class ExcelTabController extends BladeController {
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
     })
-    public R getHtmlBussCols(Long pkeyId) throws FileNotFoundException {
-
+    public R getHtmlBussCols(Long pkeyId) throws Exception {
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
         if (wbsTreeContract == null) {
@@ -3055,9 +3057,18 @@ public class ExcelTabController extends BladeController {
             return R.fail("暂无表单!");
         }
 
-        File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
-//        File file1 = ResourceUtil.getFile("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1578963584895942656.html");
-        FileInputStream fileInputStream = new FileInputStream(file1);
+        String fileUrl = wbsTreeContract.getHtmlUrl();
+        File file1 = ResourceUtil.getFile(fileUrl);
+        InputStream fileInputStream = null;
+        if(file1.exists()){
+            fileInputStream = new FileInputStream(file1);;
+        }else{
+            String path = sys_file_net_url+fileUrl.replaceAll("//","/").replaceAll(file_path,"");
+            fileInputStream = CommonUtil.getOSSInputStream(path);
+        }
+
+
+
         String htmlString = IoUtil.readToString(fileInputStream);
         // 解析 style
         Document doc = Jsoup.parse(htmlString);

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java

@@ -297,7 +297,7 @@ public class TextdictInfoController extends BladeController {
                 JSONArray objs = new JSONArray();
                 for (int i = 0; i < optionList.size(); i++) {
                     JSONObject jsonObject = new JSONObject();
-                    jsonObject.put("key", optionList.get(i).getDictValue());
+                    jsonObject.put("key", i+1);
                     jsonObject.put("name", optionList.get(i).getDictValue());
                     objs.add(jsonObject);
                 }

+ 6 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -1293,7 +1293,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     @Override
     public R getBussPdfInfo(Long pkeyId) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        //String file_path = "/Users/hongchuangyanfa/Desktop/";
+        String sys_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
 
@@ -1304,8 +1304,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             return R.fail("请关联清表!");
         }
 
-        String pdfPath = file_path + "/pdf//" + pkeyId + ".pdf";
-        String excelPath = file_path + "/pdf//" + pkeyId + ".xlsx";
+        String pdfPath = sys_net_url + "/pdf//" + pkeyId + ".pdf";
+        String excelPath = sys_net_url + "/pdf//" + pkeyId + ".xlsx";
         File tabPdf = ResourceUtil.getFile(pdfPath);
         if (tabPdf.exists()) {
             tabPdf.delete();
@@ -1554,6 +1554,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             }
         }
         //输出流
+
+
+
         FileOutputStream outputStream = new FileOutputStream(excelPath);
         workbook.write(outputStream);
         FileUtils.setExcelScaleToPdf(excelPath, pdfPath);
@@ -1562,8 +1565,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         //附件
         TableFile tableFile1 = tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId + "").eq(TableFile::getType, 1)).stream().findAny().orElse(null);
         if (tableFile1 != null) {
-            /*tableFile1.setDomainPdfUrl(bladeFile.getLink());
-            tableFileService.saveOrUpdate(tableFile1);*/
             tableFileService.update(Wrappers.<TableFile>lambdaUpdate().set(TableFile::getDomainPdfUrl, bladeFile.getLink()).eq(TableFile::getId, tableFile1.getId()));
         } else {
             TableFile tableFile = new TableFile();

+ 6 - 7
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/FileUtils.java

@@ -23,6 +23,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
+import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.common.vo.DataVO;
@@ -30,6 +31,7 @@ import org.springblade.core.tool.api.ResultCode;
 import org.springblade.core.tool.utils.FileUtil;
 import org.springblade.core.tool.utils.IoUtil;
 import org.springblade.core.tool.utils.ResourceUtil;
+import org.springblade.system.cache.ParamCache;
 
 import javax.imageio.ImageIO;
 import javax.servlet.http.HttpServletResponse;
@@ -377,13 +379,10 @@ public class FileUtils {
     public static void main123(String[] args) throws Exception {
 
 
-        String excelPath="/Users/hongchuangyanfa/Desktop/pdf/1625671101419880450.xlsx";
-        File file_out = ResourceUtil.getFile("/Users/hongchuangyanfa/Desktop/pdf/12345.xlsx");
-        InputStream exceInp =CommonUtil.getOSSInputStream("https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20230308/aede5ee70ecc095c8e1dd76aa2f49d1a.xlsx");
-        String htmlString = IoUtil.readToString(exceInp);
-        FileUtil.writeToFile(file_out, htmlString);
-
-
+      //  String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String sys_file_net_url = "http://192.168.0.109:6371/12345.pdf";
+        File file = new File(sys_file_net_url);
+        file.mkdir();
 
 
     }