liuyc 2 年之前
父节点
当前提交
54ba854797

+ 3 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/CopyContractTreeNodeVO.java

@@ -24,6 +24,9 @@ public class CopyContractTreeNodeVO {
     @ApiModelProperty("复制到的节点PrimaryKeyId和对应的name集合(复制多份时使用)")
     private List<CopyBatch> copyBatchToPaths = new ArrayList<>();
 
+    @ApiModelProperty("所属方 1=施工 2=监理")
+    private Integer tableOwner;
+
     public void setCopyBatchToPaths(String primaryKeyId, String nodeName){
         this.copyBatchToPaths.add(new CopyBatch(primaryKeyId, nodeName));
     }

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

@@ -1119,7 +1119,6 @@ public class InformationWriteQueryController extends BladeController {
                 if (!contractAllNodeMap.containsKey(contractTree.getId().toString())) {
                     contractAllNodeMap.put(contractTree.getId().toString(), new ArrayList<>());
                 }
-
             });
         }
 
@@ -2107,12 +2106,12 @@ public class InformationWriteQueryController extends BladeController {
                 contractIds.add(contractIdRelation);
             }
             if (contractIds.size() > 0) {
+                //原始classify=2时查不出数量统计,所以改成传1
                 if (StringUtils.isNotEmpty(parentId)) {
                     //子节点
                     rootTreeNode = this.informationQueryService.queryContractTreeSupervision(contractIds, parentId, 1);
                 } else {
                     //根节点
-                    //classify = 2 时查不出数量统计,改成传1
                     rootTreeNode = this.informationQueryService.queryContractTreeSupervision(contractIds, "0", 1);
 
                     //设置根节点数量统计

+ 249 - 68
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FirstController.java

@@ -1,5 +1,6 @@
 package org.springblade.manager.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -22,12 +23,15 @@ import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.*;
 import org.springblade.manager.entity.*;
 import org.springblade.manager.service.*;
 import org.springblade.manager.service.impl.ContractInfoServiceImpl;
+import org.springblade.manager.service.impl.TableInfoServiceImpl;
+import org.springblade.manager.service.impl.WbsTreePrivateServiceImpl;
 import org.springblade.manager.utils.FileUtils;
 import org.springblade.resource.feign.CommonFileClient;
 import org.springblade.resource.feign.IOSSClient;
@@ -63,6 +67,7 @@ import java.util.stream.Collectors;
 public class FirstController extends BladeController {
 
     private final IWbsTreeContractService wbsTreeContractService;
+    private final WbsTreePrivateServiceImpl wbsTreePrivateService;
     private final IOSSClient iossClient;
     private final CommonFileClient commonFileClient;
     private final ITableFileService tableFileService;
@@ -73,6 +78,7 @@ public class FirstController extends BladeController {
     private final ITextdictInfoService textdictInfoService;
     private final IProjectInfoService projectInfoService;
     private final ContractInfoServiceImpl contractInfoService;
+    private final TableInfoServiceImpl tableInfoService;
 
     /**
      * 首件表单获取 html页面
@@ -216,11 +222,11 @@ public class FirstController extends BladeController {
                     }
 
                     //获取填报数据
-                    List<Map<String, Object>> businessDataMapList = this.getFirstBusinessData(firstId, tableNode.getContractId()).getData().get("data");
+                    List<Map<String, Object>> firstBusinessDataInfos = this.getFirstBusinessDataImpl2(firstId, tableNode.getContractId());
 
                     try {
                         //处理数据
-                        for (Map<String, Object> dataMap : businessDataMapList) {
+                        for (Map<String, Object> dataMap : firstBusinessDataInfos) {
                             // 获取excel流 和 html流
                             Workbook wb = new Workbook();
                             wb.loadFromMHtml(CommonUtil.getOSSInputStream(excelTab.getFileUrl()));
@@ -392,19 +398,25 @@ public class FirstController extends BladeController {
             @ApiImplicitParam(name = "firstId", value = "pkeyId", required = true),
             @ApiImplicitParam(name = "contractId", value = "contractId", required = true)
     })
-    public R<Map<String, List<Map<String, Object>>>> getFirstBusinessData(String firstId, String contractId) {
-        if (StringUtils.isNotEmpty(firstId) && StringUtils.isNotEmpty(contractId)) {
-            //数据结果
-            Map<String, List<Map<String, Object>>> result = new HashMap<>();
-            List<Map<String, Object>> dataResult = new ArrayList<>();
-            Map<String, Object> reData = new HashMap<>();
+    public R getFirstBusinessData(String firstId, String contractId) {
+        Map<String, Object> firstBusinessData = this.getFirstBusinessDataImpl(firstId, contractId);
+        if (firstBusinessData.size() > 0) {
+            return R.data(firstBusinessData);
+        }
+        return R.data(300, null, "未找到对应的业务数据");
+    }
 
-            WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda().eq(WbsTreeContract::getContractId, contractId).eq(WbsTreeContract::getTableType, "111"));
+    private Map<String, Object> getFirstBusinessDataImpl(String firstId, String contractId) {
+        //数据结果
+        Map<String, Object> reData = new HashMap<>();
+        if (StringUtils.isNotEmpty(firstId) && StringUtils.isNotEmpty(contractId)) {
+            WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                    .eq(WbsTreeContract::getContractId, contractId).eq(WbsTreeContract::getTableType, "111"));
             if (wbsTreeContract == null) {
-                return R.fail("该数据下无此节点!");
+                throw new ServiceException("该数据下无此节点");
             }
             if (wbsTreeContract.getHtmlUrl() == null) {
-                return R.fail("请上传清表!");
+                throw new ServiceException("请上传清表");
             }
 
             //匹配关联Title等
@@ -482,10 +494,6 @@ public class FirstController extends BladeController {
                     }
                 }
 
-                //入参
-                if (reData.size() > 0){
-                    dataResult.add(reData);
-                }
             } catch (FileNotFoundException e) {
                 e.printStackTrace();
             }
@@ -494,72 +502,245 @@ public class FirstController extends BladeController {
             //解析数据Data
             if (json != null) {
                 //获取数据所在表格
-                WbsTreeContract tableNode = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, json.getString("tableId")));
-                if (tableNode != null && StringUtils.isNotEmpty(tableNode.getInitTableName())) {
-                    //获取填报数据
-                    List<Map<String, Object>> businessDataMapList = this.jdbcTemplate.queryForList("SELECT * FROM " + tableNode.getInitTableName() + " WHERE group_id = " + json.getString("id"));
-                    if (businessDataMapList.size() > 0) {
-                        for (Map<String, Object> mysqlData : businessDataMapList) {
-                            for (String key : mysqlData.keySet()) {
-                                String tabVal = mysqlData.get(key) + "";
-                                // 时间段处理
-                                if (StringUtils.isNotEmpty(tabVal) && !tabVal.equals("null")) {
-                                    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("'", "");
-                                        reData.put(key + "__" + tabData[1], sql);
-                                    } else if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z") >= 0) { //时间
-                                        String[] tabData = tabVal.split("_\\^_");
-                                        reData.put(key + "__" + tabData[1], tabData[0]);
-                                    } else if (tabVal.indexOf("☆") >= 0) {
-                                        String[] mysql = tabVal.split("☆");
-                                        for (String data : mysql) {
-                                            String[] tabData = data.split("_\\^_");
-                                            reData.put(key + "__" + tabData[1], tabData[0]);
+                WbsTreeContract contractNode = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, json.getString("tableId")));
+                if (ObjectUtil.isNotEmpty(contractNode)) {
+                    WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery()
+                            .eq(WbsTreePrivate::getId, contractNode.getId())
+                            .eq(WbsTreePrivate::getProjectId, contractNode.getProjectId())
+                            .eq(WbsTreePrivate::getWbsId, contractNode.getWbsId())
+                            .eq(WbsTreePrivate::getTableType, 111)
+                    );
+                    if (StringUtils.isNotEmpty(wbsTreePrivate.getInitTableId())) {
+                        TableInfo tableId = tableInfoService.getBaseMapper().selectById(wbsTreePrivate.getInitTableId());
+                        if (tableId != null) {
+                            //获取填报数据
+                            List<Map<String, Object>> businessDataMapList = this.jdbcTemplate.queryForList("SELECT * FROM " + tableId.getTabEnName() + " WHERE group_id = " + json.getString("id"));
+                            if (businessDataMapList.size() > 0) {
+                                for (Map<String, Object> mysqlData : businessDataMapList) {
+                                    for (String key : mysqlData.keySet()) {
+                                        String tabVal = mysqlData.get(key) + "";
+                                        // 时间段处理
+                                        if (StringUtils.isNotEmpty(tabVal) && !tabVal.equals("null")) {
+                                            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("'", "");
+                                                reData.put(key + "__" + tabData[1], sql);
+                                            } else if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z") >= 0) { //时间
+                                                String[] tabData = tabVal.split("_\\^_");
+                                                reData.put(key + "__" + tabData[1], tabData[0]);
+                                            } else if (tabVal.indexOf("☆") >= 0) {
+                                                String[] mysql = tabVal.split("☆");
+                                                for (String data : mysql) {
+                                                    String[] tabData = data.split("_\\^_");
+                                                    reData.put(key + "__" + tabData[1], tabData[0]);
+                                                }
+                                            } else if (tabVal.indexOf("_^_") >= 0) {
+                                                String[] tabData = tabVal.split("_\\^_");
+                                                reData.put(key + "__" + tabData[1], tabData[0]);
+                                            } else {
+                                                reData.put(key, tabVal);
+                                            }
                                         }
-                                    } else if (tabVal.indexOf("_^_") >= 0) {
-                                        String[] tabData = tabVal.split("_\\^_");
-                                        reData.put(key + "__" + tabData[1], tabData[0]);
-                                    } else {
-                                        reData.put(key, tabVal);
                                     }
+                                    reData.remove("p_key_id");
+                                    reData.remove("classify");
+                                    reData.remove("contractId");
+                                    reData.remove("pkeyId");
+                                    reData.remove("projectId");
                                 }
+                                //获取关联
+                                List<Map<String, Object>> linkMapList = this.jdbcTemplate.queryForList("SELECT link_id AS id,title AS name FROM u_first_link_data WHERE first_id = " + firstId + " and is_deleted = 0");
+                                //设置关联数据
+                                reData.put("link", linkMapList);
                             }
+                        }
+                    }
+                }
+            }
+        }
+        return reData;
+    }
+
+    private List<Map<String, Object>> getFirstBusinessDataImpl2(String firstId, String contractId) {
+        List<Map<String, Object>> result = new ArrayList<>();
+        //数据结果
+        Map<String, Object> reData = new HashMap<>();
+        if (StringUtils.isNotEmpty(firstId) && StringUtils.isNotEmpty(contractId)) {
+            WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda().eq(WbsTreeContract::getContractId, contractId).eq(WbsTreeContract::getTableType, "111"));
+            if (wbsTreeContract == null) {
+                throw new ServiceException("该数据下无此节点");
+            }
+            if (wbsTreeContract.getHtmlUrl() == null) {
+                throw new ServiceException("请上传清表");
+            }
+
+            //匹配关联Title等
+            try {
+                File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
+                String htmlString = IoUtil.readToString(new FileInputStream(file1));
+                Document doc = Jsoup.parse(htmlString);
+
+                // 模糊匹配
+                Elements dwTitle = doc.select("el-input[placeholder~=.*承包单位]");
+                Elements sgTitle = doc.select("el-input[placeholder~=^施工单位]");
+                Elements sgTitle1 = doc.select("el-input[placeholder=安装单位]");
+                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~=合同编号.*]");
+                bhTitle.addAll(bhTitle1);
+                Elements xmTitle = 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());
+                    }
+                }
 
-                            reData.remove("p_key_id");
-                            reData.remove("classify");
-                            reData.remove("contractId");
-                            reData.remove("pkeyId");
-                            reData.remove("projectId");
+                // 合同段名称
+                if (htdTitle.size() >= 1) {
+                    for (Element element : htdTitle) {
+                        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());
+                        }
+                    }
+                }
+                // 编号
+                if (bhTitle.size() >= 1 && contractInfo.getIsReferenceNumber() == 1) {
+                    for (Element element : bhTitle) {
+                        int trIndex = Integer.parseInt(element.attr("trindex"));
+                        if (trIndex <= 10) {
+                            reData.put(element.attr("keyName"), contractInfo.getContractNumber());
+                        }
+                    }
+                }
 
-                            dataResult.add(reData);
+                // 项目名称
+                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());
                         }
-                        //获取关联
-                        List<Map<String, Object>> linkMapList = this.jdbcTemplate.queryForList("SELECT link_id AS id,title AS name FROM u_first_link_data WHERE first_id = " + firstId + " and is_deleted = 0");
-                        //设置关联数据
-                        result.put("link", linkMapList);
                     }
                 }
+
+            } catch (FileNotFoundException e) {
+                e.printStackTrace();
             }
 
-            //设置表格数据
-            result.put("data", dataResult);
+            JSONObject json = this.informationQueryClient.queryFirstBusinessDataByFirstId(firstId);
+            //解析数据Data
+            if (json != null) {
+                //获取数据所在表格
+                WbsTreeContract contractNode = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, json.getString("tableId")));
+                if (ObjectUtil.isNotEmpty(contractNode)) {
+                    WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery()
+                            .eq(WbsTreePrivate::getId, contractNode.getId())
+                            .eq(WbsTreePrivate::getProjectId, contractNode.getProjectId())
+                            .eq(WbsTreePrivate::getWbsId, contractNode.getWbsId())
+                            .eq(WbsTreePrivate::getTableType, 111)
+                    );
+                    if (StringUtils.isNotEmpty(wbsTreePrivate.getInitTableId())) {
+                        TableInfo tableId = tableInfoService.getBaseMapper().selectById(wbsTreePrivate.getInitTableId());
+                        if (tableId != null) {
+                            //获取填报数据
+                            List<Map<String, Object>> businessDataMapList = this.jdbcTemplate.queryForList("SELECT * FROM " + tableId.getTabEnName() + " WHERE group_id = " + json.getString("id"));
+                            if (businessDataMapList.size() > 0) {
+                                for (Map<String, Object> mysqlData : businessDataMapList) {
+                                    for (String key : mysqlData.keySet()) {
+                                        String tabVal = mysqlData.get(key) + "";
+                                        // 时间段处理
+                                        if (StringUtils.isNotEmpty(tabVal) && !tabVal.equals("null")) {
+                                            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("'", "");
+                                                reData.put(key + "__" + tabData[1], sql);
+                                            } else if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z") >= 0) { //时间
+                                                String[] tabData = tabVal.split("_\\^_");
+                                                reData.put(key + "__" + tabData[1], tabData[0]);
+                                            } else if (tabVal.indexOf("☆") >= 0) {
+                                                String[] mysql = tabVal.split("☆");
+                                                for (String data : mysql) {
+                                                    String[] tabData = data.split("_\\^_");
+                                                    reData.put(key + "__" + tabData[1], tabData[0]);
+                                                }
+                                            } else if (tabVal.indexOf("_^_") >= 0) {
+                                                String[] tabData = tabVal.split("_\\^_");
+                                                reData.put(key + "__" + tabData[1], tabData[0]);
+                                            } else {
+                                                reData.put(key, tabVal);
+                                            }
+                                        }
+                                    }
 
-            return R.data(result);
-        }
+                                    reData.remove("p_key_id");
+                                    reData.remove("classify");
+                                    reData.remove("contractId");
+                                    reData.remove("pkeyId");
+                                    reData.remove("projectId");
 
-        return R.data(300, null, "未找到对应的业务数据");
+                                }
+                                //获取关联
+                                List<Map<String, Object>> linkMapList = this.jdbcTemplate.queryForList("SELECT link_id AS id,title AS name FROM u_first_link_data WHERE first_id = " + firstId + " and is_deleted = 0");
+                                //设置关联数据
+                                reData.put("link", linkMapList);
+
+
+                            }
+                        }
+                    }
+                }
+            }
+            result.add(reData);
+        }
+        return result;
     }
 
 }

+ 56 - 66
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -87,37 +87,21 @@ import java.util.stream.Collectors;
 @AllArgsConstructor
 public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTab> implements IExcelTabService {
 
-    //客户端资料查询接口
     private final InformationQueryClient informationQueryClient;
-    // 元素信息表-
     private final IWbsTreeContractService wbsTreeContractService;
-
     private final IFormulaService formulaService;
     private final JdbcTemplate jdbcTemplate;
-
     private final IWbsParamService wbsParamService;
-
     private final IWbsTreePrivateService wbsTreePrivateService;
-
     private final ContractLogClient contractLogClient;
-
-    // 表单字典信息表
     private final ITextdictInfoService textdictInfoService;
-
-    // Oss接口
     private final NewIOSSClient newIOSSClient;
-    // 表单附件信息
     private final ITableFileService tableFileService;
-
-    // 合同端信息
     private final IContractInfoService contractInfoService;
-
     private final IProjectInfoService projectInfoService;
-
-    // 用户操作日志信息
     private final OperationLogClient operationLogClient;
-
     private final TrialSelfInspectionRecordClient inspectionRecordClient;
+    private final TableInfoServiceImpl tableInfoService;
 
     @Override
     public IPage<ExcelTabVO> selectExcelTabPage(IPage<ExcelTabVO> page, ExcelTabVO excelTab) {
@@ -590,66 +574,72 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         if (linkProcessList == null) {
             linkProcessList = new ArrayList<>();
         }
-
         //获取数据所在数据表名
-        WbsTreeContract table = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery()
+        WbsTreeContract contractNode = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery()
                 .eq(WbsTreeContract::getContractId, tableInfoList.get(0).getContractId())
                 .eq(WbsTreeContract::getTableType, 111));
-        if (table == null) {
-            return null;
-        }
-        String tableName = table.getInitTableName();
-        if (StringUtils.isEmpty(tableName)) {
-            return null;
-        }
+        if (ObjectUtil.isNotEmpty(contractNode)) {
+            WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery()
+                    .eq(WbsTreePrivate::getId, contractNode.getId())
+                    .eq(WbsTreePrivate::getProjectId, contractNode.getProjectId())
+                    .eq(WbsTreePrivate::getWbsId, contractNode.getWbsId())
+                    .eq(WbsTreePrivate::getTableType, 111)
+            );
+            if (StringUtils.isNotEmpty(wbsTreePrivate.getInitTableName())) {
+                if (StringUtils.isNotEmpty(wbsTreePrivate.getInitTableId())) {
+                    org.springblade.manager.entity.TableInfo table = tableInfoService.getBaseMapper().selectById(wbsTreePrivate.getInitTableId());
+                    if (ObjectUtil.isNotEmpty(table)) {
+                        //获取首件记录ID
+                        String firstId = tableInfoList.get(0).getFirstId();
+                        if (StringUtils.isNotEmpty(firstId)) {
+                            //删除掉旧数据
+                            this.jdbcTemplate.execute("DELETE FROM " + table.getTabEnName() + " WHERE group_id = " + firstId);
+                        } else {
+                            firstId = SnowFlakeUtil.getId() + "";
+                        }
 
-        //获取首件记录ID
-        String firstId = tableInfoList.get(0).getFirstId();
-        if (StringUtils.isNotEmpty(firstId)) {
-            //删除掉旧数据
-            this.jdbcTemplate.execute("DELETE FROM " + tableName + " WHERE group_id = " + firstId);
-        } else {
-            firstId = SnowFlakeUtil.getId() + "";
-        }
+                        //获取上传的文件相关
+                        String sourceUrl = tableInfoList.get(0).getSourceUrl(),
+                                pdfUrl = tableInfoList.get(0).getPdfUrl(),
+                                firstFileName = tableInfoList.get(0).getFirstFileName();
 
-        //获取上传的文件相关
-        String sourceUrl = tableInfoList.get(0).getSourceUrl(),
-                pdfUrl = tableInfoList.get(0).getPdfUrl(),
-                firstFileName = tableInfoList.get(0).getFirstFileName();
+                        //新增数据
+                        for (TableInfo tableInfo : tableInfoList) {
+                            //获取字段信息
+                            LinkedHashMap<String, String> dataMap2 = tableInfo.getDataMap();
 
-        //新增数据
-        for (TableInfo tableInfo : tableInfoList) {
-            //获取字段信息
-            LinkedHashMap<String, String> dataMap2 = tableInfo.getDataMap();
+                            //拼接SQL
+                            StringBuilder sql = new StringBuilder("INSERT INTO " + table.getTabEnName()),
+                                    keySql = new StringBuilder("id, group_id"),
+                                    valSql = new StringBuilder("" + SnowFlakeUtil.getId() + ", " + firstId);
 
-            //拼接SQL
-            StringBuilder sql = new StringBuilder("INSERT INTO " + tableName),
-                    keySql = new StringBuilder("id, group_id"),
-                    valSql = new StringBuilder("" + SnowFlakeUtil.getId() + ", " + firstId);
+                            for (String key : dataMap2.keySet()) {
+                                keySql.append(", ").append(key);
+                                valSql.append(", '").append(dataMap2.get(key)).append("'");
+                            }
 
-            for (String key : dataMap2.keySet()) {
-                keySql.append(", ").append(key);
-                valSql.append(", '").append(dataMap2.get(key)).append("'");
-            }
+                            sql.append("(").append(keySql).append(")").append(" values(").append(valSql).append(")");
 
-            sql.append("(").append(keySql).append(")").append(" values(").append(valSql).append(")");
-
-            //新增数据
-            try {
-                this.jdbcTemplate.execute(sql.toString());
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
+                            //新增数据
+                            try {
+                                this.jdbcTemplate.execute(sql.toString());
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                        }
 
-        //获取文件题名
-        String fileTitleNames = this.getFileTitleNames(firstNodeId);
+                        //获取文件题名
+                        String fileTitleNames = this.getFileTitleNames(firstNodeId);
 
-        try {
-            //新增或修改首件记录
-            return this.informationQueryClient.saveOrUpdateInformationQueryData(firstNodeId, table.getPKeyId() + "", firstId, StringUtils.isNotEmpty(fileTitleNames) ? fileTitleNames : "首件文件名称为空", Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "true", sourceUrl, pdfUrl, firstFileName, linkProcessList);
-        } catch (Exception e) {
-            e.printStackTrace();
+                        try {
+                            //新增或修改首件记录
+                            return this.informationQueryClient.saveOrUpdateInformationQueryData(firstNodeId, contractNode.getPKeyId() + "", firstId, StringUtils.isNotEmpty(fileTitleNames) ? fileTitleNames : "首件文件名称为空", Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "true", sourceUrl, pdfUrl, firstFileName, linkProcessList);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+            }
         }
         return null;
     }