Browse Source

计量公式/资料保存速度优化

yangyj 1 year ago
parent
commit
18e4aa4b7e

+ 3 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/TreeNode.java

@@ -21,4 +21,7 @@ public class TreeNode<T> {
        public boolean hasChildren(){
           return !children.isEmpty();
        }
+       public boolean isTop(){
+              return parentId==0L;
+       }
 }

+ 4 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/Payment.java

@@ -49,4 +49,8 @@ public class Payment {
         }
     }
 
+    public String meterFormKey(){
+        return this.meterId.toString()+this.formId;
+    }
+
 }

+ 2 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SubInterimMeterPaySummary.java

@@ -1,12 +1,14 @@
 package org.springblade.manager.vo;
 
 import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
 
 /**
  * @author yangyj
  * @Date 2024/1/16 16:58
  * @description 分项工程中期计量支付表
  */
+@Data
 public class SubInterimMeterPaySummary {
     public static final String ID="20250000000";
     public static final String TBN="SubIMeterPaySum";

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

@@ -496,7 +496,7 @@ public class CustomFunction {
                List<Object> ranges= (List<Object>) range;
                 if( Func.isNotEmpty(ranges)) {
                    return ranges.stream().filter(Func::isNotEmpty).map(e->{
-                        String[] s = Func.toStr(e).replaceAll("[\\[\\]\\s]+", "").split(",");
+                        String[] s = Func.toStr(e).replaceAll("[\\[\\]\\s\\\\]+", "").split(",");
                         return dateCp(s[0], s[1], isAsc);
                     }).collect(Collectors.toList());
                 }

+ 26 - 0
blade-service/blade-manager/src/main/java/com/mixsmart/utils/FormulaUtils.java

@@ -440,6 +440,7 @@ public class FormulaUtils {
     }
 
 
+    /*list转TreeNode*/
     public  static <K,T>   Map<K, TreeNode<T>>  list2TreeNode(Function<TreeNode<T>,K> keyMapper,List<T> list,Function<T,TreeNode<T>> fc,Function<TreeNode<T>,K>  classifier){
         Map<K, TreeNode<T>> mTreeMap = new HashMap<>();
         if (Func.isNotEmpty(list)) {
@@ -455,12 +456,37 @@ public class FormulaUtils {
                     parent.setChildren(v);
                     v.forEach(e -> e.setParent(parent));
                 }
+
             });
 
         }
         return mTreeMap;
     }
 
+    /*TreeNode 排序*/
+    public static <T> void  treeNodeSort(int base,TreeNode<T> top){
+          top.setSort(base);
+          if(top.hasChildren()){
+              for(TreeNode<T> child:top.getChildren()){
+                    child.setSort(base++);
+              }
+          }
+    }
+
+    /*获取层级链*/
+    public static <T> List<T> treeNodeChains( TreeNode<T> tmp){
+        List<T> result = new ArrayList<>();
+        int loop = 10;
+        do{
+            /*不包括顶层*/
+            if(tmp.getParentId()!=0L) {
+                result.add(tmp.getValue());
+            }
+            tmp=tmp.getParent();
+        }while (tmp!=null&&loop-->0);
+        Collections.reverse(result);
+        return result;
+    }
 
 
     /**从元素名称中解析项目名称,细化项目匹配用*/

+ 66 - 6
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -90,6 +90,8 @@ import java.nio.file.StandardCopyOption;
 import java.text.SimpleDateFormat;
 import java.util.List;
 import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -2152,9 +2154,11 @@ public class ExcelTabController extends BladeController {
         /*全加载,或者可以优化成依赖加载*/
         List<AppWbsTreeContractVO> tableAll = new ArrayList<>();
         List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
+        long start = System.currentTimeMillis();
         if (tableInfoList != null) {
             tableAll = wbsTreeContractService.searchNodeAllTable(nodeId, "1", contractId, projectId, null);
-            List<Long> tableAllIds = tableAll.stream().map(AppWbsTreeContractVO::getPKeyId).collect(Collectors.toList());
+            doForTableIst(tableAll,tableInfoList);
+          /*  List<Long> tableAllIds = tableAll.stream().map(AppWbsTreeContractVO::getPKeyId).collect(Collectors.toList());
             if (tableAll.size() > tableInfoList.size()) {
                 List<Long> exclude = tableInfoList.stream().map(TableInfo::getPkeyId).map(Long::parseLong).collect(Collectors.toList());
                 JSONArray extra = new JSONArray();
@@ -2168,7 +2172,7 @@ public class ExcelTabController extends BladeController {
                     }
                 }
                 List<TableInfo> tableInfoExtra = this.excelTabService.getTableInfoList(extra);
-                /*默认额外加载的默认不更新,除非有元素数据变动*/
+                *//*默认额外加载的默认不更新,除非有元素数据变动*//*
                 tableInfoExtra.removeIf(e -> e.getPkeyId() == null);
                 TableInfo example = tableInfoList.get(0);
                 tableInfoExtra.forEach(e -> {
@@ -2181,9 +2185,9 @@ public class ExcelTabController extends BladeController {
                 });
                 tableInfoList.addAll(tableInfoExtra);
                 tableInfoList.sort(Comparator.comparingInt(a -> tableAllIds.indexOf(Long.parseLong(a.getPkeyId()))));
-            }
+            }*/
         }
-
+        System.out.println("加载所有表单数据耗时:"+(System.currentTimeMillis()-start));
         //公式填充
         this.excelTabService.formulaFillData(tableInfoList, Long.parseLong(nodeId), ExecuteType.INSPECTION);
         //保存数据到数据库
@@ -2193,19 +2197,33 @@ public class ExcelTabController extends BladeController {
         }
 
 
+        long start2= System.currentTimeMillis();
         List<String> errorPKeyIds = new ArrayList<>();
         //单个pdf加载
         if (tableInfoList != null) {
-            for (TableInfo tableInfo : tableInfoList) {
+/*            for (TableInfo tableInfo : tableInfoList) {
                 R bussPdfInfo = excelTabService.getBussPdfInfo(Long.parseLong(tableInfo.getPkeyId()));
 
                 if (ObjectUtil.isEmpty(bussPdfInfo) || bussPdfInfo.getCode() != 200) {
                     //如果返回的单张pdfUrl为空,那么表示发生异常,返回异常信息
                     errorPKeyIds.add(tableInfo.getPkeyId());
                 }
-            }
+            }*/
+            tableInfoList.parallelStream().forEach(tableInfo -> {
+                R bussPdfInfo = null;
+                try {
+                    bussPdfInfo = excelTabService.getBussPdfInfo(Long.parseLong(tableInfo.getPkeyId()));
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                if (ObjectUtil.isEmpty(bussPdfInfo) || bussPdfInfo.getCode() != 200) {
+                    //如果返回的单张pdfUrl为空,那么表示发生异常,返回异常信息
+                    errorPKeyIds.add(tableInfo.getPkeyId());
+                }
+            });
         }
 
+        System.out.println("PDF刷新耗时:"+(System.currentTimeMillis()-start2));
         //发生异常后直接返回,不进行合并
         if (errorPKeyIds.size() > 0) {
             List<AppWbsTreeContractVO> errorTabs = new LinkedList<>();
@@ -2229,6 +2247,48 @@ public class ExcelTabController extends BladeController {
         return R.data("操作成功");
     }
 
+    /*并发加载表单数据*/
+    public void doForTableIst(List<AppWbsTreeContractVO> tableAll,List<TableInfo> tableInfoList){
+        if (tableAll.size() > tableInfoList.size()) {
+            List<Long> tableAllIds = tableAll.stream().map(AppWbsTreeContractVO::getPKeyId).collect(Collectors.toList());
+            List<Long> exclude = tableInfoList.stream().map(TableInfo::getPkeyId).map(Long::parseLong).collect(Collectors.toList());
+            JSONArray extra = new JSONArray();
+/*            for (Long pk : tableAllIds) {
+                if (!exclude.contains(pk)) {
+                    Map<String, Object> jo = this.excelTabService.getBussDataInfo(pk, 1);
+                    if (ObjectUtils.isNotEmpty(jo)) {
+                        jo.put("pkeyId", pk);
+                        extra.add(jo);
+                    }
+                }
+            }*/
+            ConcurrentHashMap<String,String> htmlStrCache  =new ConcurrentHashMap<>();
+            tableAllIds.parallelStream().filter(pk -> !exclude.contains(pk))
+                    .map(pk -> {
+                        Map<String, Object> jo = this.excelTabService.getBussDataInfoMulti(pk, 1,false,htmlStrCache);
+                        if (ObjectUtils.isNotEmpty(jo)) {
+                            jo.put("pkeyId", pk);
+                            return jo;
+                        }
+                        return null;
+                    }).filter(Objects::nonNull).forEach(extra::add);
+            List<TableInfo> tableInfoExtra = this.excelTabService.getTableInfoList(extra);
+            /*默认额外加载的默认不更新,除非有元素数据变动*/
+            tableInfoExtra.removeIf(e -> e.getPkeyId() == null);
+            TableInfo example = tableInfoList.get(0);
+            tableInfoExtra.forEach(e -> {
+                e.setToBeUpdated(false);
+                e.setBusinessId(null);
+                e.setContractId(example.getContractId());
+                e.setClassify(example.getClassify());
+                e.setProjectId(example.getProjectId());
+                e.setGroupId(example.getGroupId());
+            });
+            tableInfoList.addAll(tableInfoExtra);
+            tableInfoList.sort(Comparator.comparingInt(a -> tableAllIds.indexOf(Long.parseLong(a.getPkeyId()))));
+        }
+    }
+
 
     public static final String CACHE_DEL = "delete from m_cache where remark is null";
 

+ 18 - 10
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeController.java

@@ -291,19 +291,27 @@ public class WbsTreeController extends BladeController {
     }
 
     public  boolean isModel(String id){
-         List<String> list = new ArrayList<>();
-         list.add(BaseInfo.ID);
-         list.add(MeterPeriodInfo.ID);
-         return list.contains(id);
+         Set<String> set = new HashSet<>();
+         set.add(BaseInfo.ID);
+         set.add(MeterPeriodInfo.ID);
+         set.add(InterimPaymentCertificate.ID);
+         set.add(InterimPaymentSummary.ID);
+         set.add(SubprojectInterimPaymentSummary.ID);
+         set.add(SubInterimMeterPaySummary.ID);
+         return set.contains(id);
      };
 
+   public final static Map<String,List<WbsFormElementVO>> MODEL_MAP = new HashMap<>();
+    {
+        MODEL_MAP.put(BaseInfo.ID,FormulaUtils.toElementVos(BaseInfo.class));
+        MODEL_MAP.put(MeterPeriodInfo.ID,FormulaUtils.toElementVos(MeterPeriodInfo.class));
+        MODEL_MAP.put(InterimPaymentCertificate.ID,FormulaUtils.toElementVos(InterimPaymentCertificate.class));
+        MODEL_MAP.put(InterimPaymentSummary.ID,FormulaUtils.toElementVos(InterimPaymentSummary.class));
+        MODEL_MAP.put(SubprojectInterimPaymentSummary.ID,FormulaUtils.toElementVos(SubprojectInterimPaymentSummary.class));
+        MODEL_MAP.put(SubInterimMeterPaySummary.ID,FormulaUtils.toElementVos(SubInterimMeterPaySummary.class));
+    }
     public List<WbsFormElementVO> dataModel(String id){
-          if(BaseInfo.ID.equals(id)) {
-              return FormulaUtils.toElementVos(BaseInfo.class);
-          }else if(MeterPeriodInfo.ID.equals(id)){
-              return FormulaUtils.toElementVos(MeterPeriodInfo.class);
-          }
-          return Collections.emptyList();
+          return MODEL_MAP.getOrDefault(id,Collections.emptyList());
     }
 
     /**

+ 37 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorSpecial.java

@@ -542,15 +542,48 @@ public class ExecutorSpecial extends FormulaExecutor {
             /*s_change_token_inventory每个清单关联的变更令,s_change_token_meter每个计量单元关联的变更令*/
             try {
                 Map<Long, TreeNode<MeterTree>> treeNodeMap = tec.getMeterTreeMap().get();
-                List<TreeNode<MeterTree>> treeNodeList= new ArrayList<>();
-                current.forEach(e->{
-                    treeNodeList.add(treeNodeMap.get(e.getMeterId()));
-                });
+                Optional<TreeNode<MeterTree>> optionalTreeNode=  treeNodeMap.values().stream().filter(TreeNode::isTop).findAny();
+                if(optionalTreeNode.isPresent()) {
+                    /*计量单元根节点*/
+                    TreeNode<MeterTree> top= optionalTreeNode.get();
+                    List<TreeNode<MeterTree>> treeNodeList = new ArrayList<>();
+                    Map<Long, List<Payment>> paymentGroup = current.stream().collect(Collectors.groupingBy(Payment::getMeterId));
+                    Map<String,Payment> preMeterPaymentGroup = previous.stream().collect(Collectors.toMap(Payment::meterFormKey,p->p,(p1,p2)->p2));
+                    FormulaUtils.treeNodeSort(0,top);
+                    current.forEach(e -> {
+                        TreeNode<MeterTree> meterTreeNode=treeNodeMap.get(e.getMeterId());
+                        if(meterTreeNode!=null){
+                            treeNodeList.add(meterTreeNode);
+                        }
+                    });
+                    if(treeNodeList.size()>0){
+                        treeNodeList.sort(Comparator.comparingInt(TreeNode::getSort));
+                        for(TreeNode<MeterTree> node:treeNodeList){
+                             MeterTree meterUnit = node.getValue();
+                             List<MeterTree> chains = FormulaUtils.treeNodeChains(node);
+                             List<Payment> paymentList = paymentGroup.get(meterUnit.getId());
+                             for(Payment payment:paymentList){
+                                 Payment prePayment = preMeterPaymentGroup.get(meterUnit.getId().toString()+payment.getFormId());
+                                 SubInterimMeterPaySummary smps= new SubInterimMeterPaySummary();
+                                 smps.setItemName(payment.getName());
+                                 smps.setFormNumber(payment.getNumber());
+                                 smps.setUnit(payment.getUnit());
+                             }
+                        }
+                    }
+
+                }
             }catch (Exception e){
                 e.printStackTrace();
             }
 
         }
+
+
+        public void traversal(TreeNode<MeterTree> top){
+
+        }
+
     }
 
     public interface  Special{

+ 3 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java

@@ -39,6 +39,7 @@ import java.io.IOException;
 import java.sql.SQLException;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 /**
  * 清表基础数据表 服务类
@@ -113,6 +114,8 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
     Map<String,Object> getBussDataInfo(Long pkeyId, int type);
     // 获取用户端 单个表单接口数据
     Map<String,Object> getBussDataInfo(Long pkeyId, int type,Boolean isFormLoading);
+    // 获取用户端 多个表单接口数据
+    Map<String,Object> getBussDataInfoMulti(Long pkeyId, int type, Boolean isFormLoading, ConcurrentHashMap<String,String> htmlStrCache);
     // 单个pdf 生成
     R getBussPdfInfo(Long pkeyId) throws Exception;
 

+ 269 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -86,6 +86,8 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.List;
 import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentSkipListMap;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Function;
@@ -1513,6 +1515,273 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         return reData;
     }
 
+    @Override
+    public Map<String, Object> getBussDataInfoMulti(Long pkeyId, int type, Boolean isFormLoading, ConcurrentHashMap<String,String> htmlStrCache) {
+        Document document=null;
+        Map<String, Object> reData = new HashMap<>();
+
+        WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                .eq(WbsTreeContract::getPKeyId, pkeyId));
+        if (wbsTreeContract == null) {
+            return reData;
+        }
+
+        if (wbsTreeContract.getHtmlUrl() == null) {
+            return reData;
+        }
+
+        //表单是否存储在
+        String tabName = wbsTreeContract.getInitTableName();
+        String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
+        List<Map<String, Object>> tabList = jdbcTemplate.queryForList(isExitSql);
+        if (tabList.size() <= 0) {
+            return reData;
+        }
+
+        String querySql = "select * from " + wbsTreeContract.getInitTableName() + " where p_key_id=" + pkeyId;
+
+
+        //String querySql = "select * from table_data_info where p_key_id=" + pkeyId;
+        List<Map<String, Object>> dataIn = jdbcTemplate.queryForList(querySql);
+
+        // 匹配关联
+        try {
+            String htmlString;
+            if(htmlStrCache.containsKey(wbsTreeContract.getInitTableName())) {
+                htmlString = htmlStrCache.get(wbsTreeContract.getInitTableName());
+            }else{
+                InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(wbsTreeContract.getHtmlUrl());
+                htmlString = IoUtil.readToString(inputStreamByUrl);
+            }
+            Document doc = Jsoup.parse(htmlString);
+            document=doc;
+            // 解析
+            // 模糊匹配
+            Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
+            Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
+            Elements sgtitle1 = doc.select("el-input[placeholder=安装单位]");
+
+            Elements defText = doc.getElementsByAttribute("defText");
+
+            sgtitle.addAll(sgtitle1);
+
+            //合同段显示合同编号
+            Elements htdtitle = doc.select("el-input[placeholder~=.*合同段.*]");
+            //合同名称显示合同名称
+            Elements htdtitle1 = doc.select("el-input[placeholder~=合同名称.*]");
+//            htdtitle.addAll(htdtitle1);
+
+            Elements jltitle = doc.select("el-input[placeholder~=监理单位.*]");
+
+            //编号为父节点划分编号
+            Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
+            //合同编号为合同编号
+            Elements bhtitle1 = doc.select("el-input[placeholder~=合同编号.*]");
+            bhtitle1.addAll(htdtitle);
+
+            Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
+
+
+            // Elements title = doc.select("el-input[placeholder~=^编号]");
+
+            /**
+             * 承包单位 承包单位、施工单位:引用施工单位名称 ,
+             * 监理单位:引用监理单位名称
+             * 合同段、所属建设项目(合同段):引用合同段编号
+             *
+             * 施工单位:施工单位 和 安装单位
+             *
+             */
+            ContractInfo contractInfo = contractInfoService.getById(wbsTreeContract.getContractId());
+            // 施工单位名称
+            if (dwtitle.size() >= 1) {
+                int y = Integer.parseInt(dwtitle.attr("trindex"));
+                if (y <= 10) {
+                    reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
+                }
+
+            }
+            if (sgtitle.size() >= 1) {
+                int y = Integer.parseInt(sgtitle.attr("trindex"));
+                if (y <= 10) {
+                    reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
+                }
+            }
+
+            // 合同段名称
+            if (htdtitle1.size() >= 1) {
+                for (Element element : htdtitle1) {
+                    int trindex = Integer.parseInt(element.attr("trindex"));
+                    if (trindex <= 8) {
+                        reData.put(element.attr("keyName"), contractInfo.getContractName());
+                    }
+                }
+            }
+            // 监理单位名称
+            if (jltitle.size() >= 1) {
+
+                for (Element element : jltitle) {
+                    int trindex = Integer.parseInt(element.attr("trindex"));
+                    if (trindex <= 10) {
+                        reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
+                    }
+                }
+            }
+            //获取父节点划分编号
+            WbsTreeContract node = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                    .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
+                    .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
+            // 编号
+            if (bhtitle.size() >= 1 && contractInfo.getIsReferenceNumber() == 1) {
+                for (Element element : bhtitle) {
+                    int trindex = Integer.parseInt(element.attr("trindex"));
+                    if (trindex <= 10) {
+                        if (StringUtils.isNotBlank(node.getPartitionCode())) {
+                            reData.put(element.attr("keyName"), node.getPartitionCode());
+                        }
+                    }
+                }
+            }
+            //获取合同编号
+            if (bhtitle1.size() >= 1) {
+                for (Element element : bhtitle1) {
+                    int trindex = Integer.parseInt(element.attr("trindex"));
+                    if (trindex <= 10) {
+                        reData.put(element.attr("keyName"), contractInfo.getContractNumber());
+                    }
+                }
+            }
+
+            // 项目名称
+            if (xmtitle.size() >= 1) {
+                for (Element element : xmtitle) {
+                    int trindex = Integer.parseInt(element.attr("trindex"));
+                    if (trindex <= 6) {
+                        ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
+                        reData.put(element.attr("keyName"), projectInfo.getProjectName());
+                    }
+                }
+            }
+
+            //电签默认值
+            if (defText.size() >= 1) {
+                for (Element element : defText) {
+                    reData.put(element.attr("id"), element.attr("defText"));
+                }
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+       /* if (dataIn != null && dataIn.size() >= 1) {
+            for (Map<String, Object>  data : dataIn) {
+                reData.put(data.get("tab_key")+"",data.get("key_val"));
+            }
+        }*/
+
+        if (dataIn != null && dataIn.size() >= 1) {
+            Map<String, Object> mysqlData = dataIn.get(0);
+            for (String key : mysqlData.keySet()) {
+                String tabVal = mysqlData.get(key) + "";
+                // 时间段处理
+                if (StringUtils.isNotEmpty(tabVal) && tabVal.indexOf("null") < 0) {
+                    if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z]") >= 0) {
+                        String[] tabData = tabVal.split("_\\^_");
+
+                        if (reData.containsKey("pickerKey")) {
+                            String pickerKey = reData.get("pickerKey") + "," + key + "__" + tabData[1];
+                            reData.put("pickerKey", pickerKey);
+                        } else {
+                            reData.put("pickerKey", key + "__" + tabData[1]);
+                        }
+
+                        String sql = tabData[0];
+                        sql = sql.replaceAll("\\[", "['");
+                        sql = sql.replaceAll("]", "']");
+                        sql = sql.replaceAll("000Z,", "000Z',");
+                        sql = sql.replaceAll(", 20", ", '20");
+                        //   sql = sql.replaceAll("'", "");
+                        if (StringUtils.isNotEmpty(tabData[0])) {
+                            reData.put(key + "__" + tabData[1], sql);
+                        }
+                    } else if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z") >= 0) { //时间
+                        // 时间和字符串合作
+                        if (tabVal.indexOf("☆") >= 0) {
+                            String[] mysql = tabVal.split("☆");
+                            for (String data : mysql) {
+                                String[] tabData = data.split("_\\^_");
+                                if (StringUtils.isNotEmpty(tabData[0])) {
+                                    reData.put(key + "__" + tabData[1], tabData[0]);
+                                }
+                            }
+                        } else {
+                            String[] tabData = tabVal.split("_\\^_");
+                            if (StringUtils.isNotEmpty(tabData[0])) {
+                                reData.put(key + "__" + tabData[1], tabData[0]);
+                            }
+                        }
+                    } else if (tabVal.indexOf("☆") >= 0) {
+                        String[] mysql = tabVal.split("☆");
+                        for (String data : mysql) {
+                            String[] tabData = data.split("_\\^_");
+                            if (StringUtils.isNotEmpty(tabData[0])) {
+                                reData.put(key + "__" + tabData[1], tabData[0]);
+                            }
+                        }
+                    } else if (tabVal.indexOf("_^_") >= 0) {
+                        String[] tabData = tabVal.split("_\\^_");
+                        if (StringUtils.isNotEmpty(tabData[0])) {
+                            if (tabVal.contains("[") && tabVal.contains("年")) {
+                                String[] strings = StringUtils.strip(tabData[0], "[]").split(",");
+
+                                reData.put(key + "__" + tabData[1], strings);
+                            } else {
+                                reData.put(key + "__" + tabData[1], tabData[0]);
+                            }
+                        }
+                    } else {
+                        reData.put(key, tabVal);
+                    }
+                }
+            }
+        }
+
+        // 获取默认值
+        QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("type", 4);
+        queryWrapper.eq("tab_id", wbsTreeContract.getIsTypePrivatePid());
+        final List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
+        if (!textdictInfos.isEmpty()) {
+            for (TextdictInfo textdictInfo : textdictInfos) {
+                if (reData.containsKey(textdictInfo.getColKey())) {
+                    String keyVal = reData.get(textdictInfo.getColKey()) + "";
+                } else {
+                    reData.put(textdictInfo.getColKey() + "", textdictInfo.getSigRoleName());
+                }
+            }
+        }
+
+        // 移除Id 和 p_key_id
+        if (type == 0) {
+            reData.remove("id");
+            reData.remove("p_key_id");
+            reData.remove("classify");
+            reData.remove("contractId");
+            reData.remove("pkeyId");
+            reData.remove("projectId");
+        }
+        if (type == 1) {
+            reData.put("pkeyId", reData.get("p_key_id"));
+        }
+        reData.put("tabGroupId", wbsTreeContract.getTabGroupId());
+        /*表单公式*/
+        if(isFormLoading) {
+            this.formulaService.paramFormula(wbsTreeContract, reData, document);
+        }
+        return reData;
+    }
+
     @Override
     public R getBussPdfInfo(Long pkeyId) throws Exception {
         String file_path = FileUtils.getSysLocalFileUrl();

+ 4 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java

@@ -259,6 +259,10 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
         Map<String, String[]> titleMap = new HashMap<>();
         titleMap.put(BaseInfo.TBN_CH, new String[]{BaseInfo.TBN, BaseInfo.ID});
         titleMap.put(MeterPeriodInfo.TBN_CH, new String[]{MeterPeriodInfo.TBN, MeterPeriodInfo.ID});
+        titleMap.put(InterimPaymentCertificate.TBN_CH, new String[]{InterimPaymentCertificate.TBN, InterimPaymentCertificate.ID});
+        titleMap.put(InterimPaymentSummary.TBN_CH, new String[]{InterimPaymentSummary.TBN, InterimPaymentSummary.ID});
+        titleMap.put(SubprojectInterimPaymentSummary.TBN_CH, new String[]{SubprojectInterimPaymentSummary.TBN, SubprojectInterimPaymentSummary.ID});
+        titleMap.put(SubInterimMeterPaySummary.TBN_CH, new String[]{SubInterimMeterPaySummary.TBN, SubInterimMeterPaySummary.ID});
         return titleMap.entrySet().stream().map(kv -> {
             TreeNodeVOByTabType tn = new TreeNodeVOByTabType();
             tn.setTitle(kv.getKey());

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

@@ -190,7 +190,7 @@ public class FileUtils {
             for (String urlStr : urlList) {
                 try {
                     //获取OSS文件输入流
-                    reader = new PdfReader(CommonUtil.getOSSInputStream(urlStr));
+                    reader = new PdfReader(Objects.requireNonNull(CommonUtil.getOSSInputStream(urlStr)));
 
                     pageCount = reader.getNumberOfPages();