Эх сурвалжийг харах

Merge remote-tracking branch 'origin/test-merge' into test-merge

LHB 2 цаг өмнө
parent
commit
5112a369b8
14 өөрчлөгдсөн 220 нэмэгдсэн , 38 устгасан
  1. 37 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/ExcelTabVO2.java
  2. 9 8
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  3. 1 7
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  4. 3 3
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/WeatherInfoServiceImpl.java
  5. 16 6
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  6. 7 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeController.java
  7. 2 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeMapper.java
  8. 12 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeMapper.xml
  9. 3 4
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java
  10. 2 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreeService.java
  11. 6 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java
  12. 85 5
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  13. 35 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeServiceImpl.java
  14. 2 2
      blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

+ 37 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/ExcelTabVO2.java

@@ -0,0 +1,37 @@
+package org.springblade.manager.vo;
+
+import lombok.Data;
+
+@Data
+public class ExcelTabVO2 {
+    /**
+     * 清表id
+     */
+    private Long excelTabId;
+    /**
+     * 清表名称
+     */
+    private String excelTabName;
+    /**
+     * 元素表名称
+     */
+    private String elementTableName;
+    /**
+     * 表单类型
+     */
+    private Integer tableType;
+
+    /**
+     * 所属方
+     */
+    private Integer tableOwner;
+
+    /**
+     * 是否创建 0 可以创建  1已存在元素表,2未创建元素表,3未上传清表
+     */
+    private Integer isCreate;
+
+    private String initTableName;
+
+    private Long initTabId;
+}

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

@@ -971,10 +971,10 @@ public class InformationWriteQueryController extends BladeController {
         if (obj == null) {
             return R.data(status);
         }
-        InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, obj.getContractId()).eq(InformationQuery::getType, 1).last("order by id desc limit 1"));
+        InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, obj.getContractId()).eq(InformationQuery::getType, 1).last("order by IF(`status` = 3,0,`status`) desc , id desc limit 1"));
         if (businessData != null && businessData.getStatus() == 3) {
             this.informationQueryService.createNewInformationQueriesByStatusForLock(Collections.singletonList(businessData.getId() + ""));
-            InformationQuery businessData1 = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, obj.getContractId()).eq(InformationQuery::getType, 1).in(InformationQuery::getStatus, 0,1,2).last("order by id desc limit 1"));
+            InformationQuery businessData1 = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, obj.getContractId()).eq(InformationQuery::getType, 1).in(InformationQuery::getStatus, 0,1,2).last("order by `status` desc , id desc limit 1"));
             if (businessData1 != null) {
                 businessData = businessData1;
             }
@@ -1044,10 +1044,10 @@ public class InformationWriteQueryController extends BladeController {
         if (obj == null) {
             return R.data(status);
         }
-        InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, obj.getContractId()).eq(InformationQuery::getType, 1).last("order by id desc limit 1"));
+        InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, obj.getContractId()).eq(InformationQuery::getType, 1).last("order by IF(`status` = 3,0,`status`) desc , id desc limit 1"));
         if (businessData != null && businessData.getStatus() == 3) {
             this.informationQueryService.createNewInformationQueriesByStatusForLock(Collections.singletonList(businessData.getId() + ""));
-            InformationQuery businessData1 = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, obj.getContractId()).eq(InformationQuery::getType, 1).in(InformationQuery::getStatus, 0,1,2).last("order by id desc limit 1"));
+            InformationQuery businessData1 = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, obj.getContractId()).eq(InformationQuery::getType, 1).in(InformationQuery::getStatus, 0,1,2).last("order by `status` desc , id desc limit 1"));
             if (businessData1 != null) {
                 businessData = businessData1;
             }
@@ -1121,14 +1121,14 @@ public class InformationWriteQueryController extends BladeController {
         InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery()
                 .eq(InformationQuery::getId, id)
                 .eq(InformationQuery::getContractId, obj.getContractId())
-                .eq(InformationQuery::getType, 3).last("order by id desc limit 1")
+                .eq(InformationQuery::getType, 3).last("order by IF(`status` = 3,0,`status`) desc , id desc limit 1")
         );
         if (businessData != null && businessData.getStatus() == 3) {
             this.informationQueryService.createNewInformationQueriesByStatusForLock(Collections.singletonList(businessData.getId() + ""));
             InformationQuery businessData1 = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery()
                     .eq(InformationQuery::getId, id)
                     .eq(InformationQuery::getContractId, obj.getContractId()).in(InformationQuery::getStatus, 0,1,2)
-                    .eq(InformationQuery::getType, 3).last("order by id desc limit 1")
+                    .eq(InformationQuery::getType, 3).last("order by `status` desc , id desc limit 1")
             );
             if (businessData1 != null) {
                 businessData = businessData1;
@@ -1197,11 +1197,11 @@ public class InformationWriteQueryController extends BladeController {
         String status = "1";
         //查询填报状态,type=2试验
         InformationQuery businessData = this.informationQueryService.getBaseMapper().selectList(Wrappers.<InformationQuery>lambdaQuery()
-                .eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2).last("order by id desc limit 1")).stream().findAny().orElse(null);
+                .eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2).last("order by IF(`status` = 3,0,`status`) desc , id desc limit 1")).stream().findAny().orElse(null);
         if (businessData != null && businessData.getStatus() == 3) {
             this.informationQueryService.createNewInformationQueriesByStatusForLock(Collections.singletonList(businessData.getId() + ""));
             InformationQuery businessData1 = this.informationQueryService.getBaseMapper().selectList(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getStatus, 0, 1, 2)
-                    .eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2).last("order by id desc limit 1")).stream().findAny().orElse(null);
+                    .eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2).last("order by `status` desc , id desc limit 1")).stream().findAny().orElse(null);
             if (businessData1 != null) {
                 businessData = businessData1;
             }
@@ -1835,6 +1835,7 @@ public R<Object> batchTask(@RequestBody StartTaskVO startTaskVO) {
                         if (query.getStatus() != null && query.getStatus() == 3) {
                             query.setId(SnowFlakeUtil.getId());
                             query.setStatus(0);
+                            query.setCreateTime(new Date());
                             this.informationQueryService.save(query);
                         }
                     } else {

+ 1 - 7
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -702,13 +702,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                         jdbcTemplate.execute("update u_information_query set e_visa_pdf_url='',status=3 where id='" + taskApp.getFormDataId() + "'");
                         InformationQuery informationQuery = informationQueryService.getById(taskApp.getFormDataId());
                         Long primaryKeyId = informationQuery.getWbsId();
-                        informationQuery.setStatus(0);
-                        informationQuery.setId(SnowFlakeUtil.getId());
-                        informationQuery.setEVisaPdfUrl(null);
-                        informationQuery.setReportNumber(null);
-                        informationQuery.setAuditUserIdAndName(null);
-                        informationQuery.setTaskId(null);
-                        informationQueryService.save(informationQuery);
+                        informationQueryService.createNewInformationQueriesByStatusForLock(Collections.singletonList(taskApp.getFormDataId()));
                         if (taskApp.getApprovalType() == 9 && primaryKeyId != null) {
                             //修改试验任务状态为未上报
                             String sql = "update u_trial_self_inspection_record set task_status = '未上报' where id=" + primaryKeyId;

+ 3 - 3
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/WeatherInfoServiceImpl.java

@@ -298,9 +298,9 @@ public class WeatherInfoServiceImpl extends ServiceImpl<WeatherInfoMapper, Weath
     //去除重复天气,并填充每个合同段缺失的天气
     @Scheduled(cron = "0 0 9 * * ?")
     public void scanMissWeather(){
-//        if (!SystemUtils.isLinux()) {
-//            return;
-//        }
+        if (!SystemUtils.isLinux()) {
+            return;
+        }
         //获取所有项目的合同段
         List<ContractInfoVO> contractInfos = baseMapper.getAllContract();
         for (ContractInfoVO contract : contractInfos) {

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

@@ -384,9 +384,6 @@ public class ExcelTabController extends BladeController {
         return R.success("上传成功");
     }
 
-    public void checkHtml(){
-
-    }
 
 
     public static InputStream getOSSInputStream(String urlStr) throws Exception {
@@ -650,9 +647,7 @@ public class ExcelTabController extends BladeController {
                          if (titleName.equals(ysName)) {
                             lastName = elementInfo.getEName();
                             attrInfo = elementInfo.getEKey() + "__" + i + "_" + j;
-
                             filedType = WbsElementUtil.getInitTableFiledType(elementInfo.getEType());
-
                             filedLength = elementInfo.getELength().toString();
 
                             maxScore = 100;
@@ -5417,9 +5412,17 @@ public class ExcelTabController extends BladeController {
         return R.data(query);
     }
 
-    @Scheduled(cron = "0 0 0 */2 * ?")
+    @Scheduled(cron = "0 0 23 * * ?")
     @GetMapping("/checkAllNodeDate")
     public void checkAllNodeDate() throws Exception {
+        String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
+        if (sys_isonline.equals("20")||!SystemUtils.isLinux()) {
+            return;
+        }
+        String deleteSql="delete from m_is_data_complete";
+        jdbcTemplate.execute(deleteSql);
+        String insertSql="INSERT INTO m_is_data_complete (p_key_id) SELECT DISTINCT p_key_id FROM m_wbs_tree_contract WHERE date_is_complete = 2";
+        jdbcTemplate.execute(insertSql);
         String updateSql="update m_wbs_tree_contract set date_is_complete=1 where is_deleted=0 and type=1";
         jdbcTemplate.update(updateSql);
         String sql="select * from m_wbs_tree_contract where is_deleted=0 and type=2 and date_is_complete=2 AND html_url is not null and p_id is not null and is_buss_show!=2";
@@ -5521,4 +5524,11 @@ public class ExcelTabController extends BladeController {
         }
         return R.data(result);
     }
+
+    @GetMapping("/getWbsTreeExcelTab")
+    @ApiOperation("获取批量挂表时的Excel表")
+    public R <ExcelTabVO2> getWbsTreeExcelTab(@RequestParam Long id,@RequestParam Long nodeId){
+        return R.data(excelTabService.getWbsTreeExcelTab(id,nodeId));
+    }
+
 }

+ 7 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeController.java

@@ -587,6 +587,13 @@ public class WbsTreeController extends BladeController {
         return R.status(wbsTreeService.copyNode(vo.getLeftIds(),vo.getRightIds()));
     }
 
+
+    @PostMapping("/saveBatchWbsTree")
+    @ApiOperation("批量保存系统wbs表单")
+    public R saveBatchWbsTree(@RequestBody List<ExcelTabVO2> list,Long nodeId,Long wbsId){
+        return wbsTreeService.saveBatchWbsTree(list,nodeId,wbsId);
+    }
+
 }
 
 

+ 2 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeMapper.java

@@ -104,4 +104,6 @@ public interface WbsTreeMapper extends EasyBaseMapper<WbsTree> {
                                        @Param("wbsType")Integer wbsType);
 
     List<WbsTree> selectAllChildNode(@Param("leftIds") List<Long> leftIds);
+
+    Integer getMaxSort(@Param("nodeId") Long nodeId);
 }

+ 12 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeMapper.xml

@@ -588,5 +588,17 @@
             )
         </if>
     </select>
+    <select id="getMaxSort" resultType="java.lang.Integer">
+        SELECT
+            CASE
+                WHEN COUNT(*) = 0 THEN 0
+                WHEN COUNT(CASE WHEN sort IS NOT NULL THEN 1 END) = 0 THEN 0
+                ELSE MAX(sort)
+                END AS maxSort
+        FROM m_wbs_tree
+        WHERE type = 2
+          AND is_deleted = 0
+          AND parent_id = #{nodeId}
+    </select>
 
 </mapper>

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

@@ -31,10 +31,7 @@ import org.springblade.manager.entity.ExcelTab;
 import org.springblade.manager.entity.WbsFormElement;
 import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.enums.ExecuteType;
-import org.springblade.manager.vo.ExceTabTreVO;
-import org.springblade.manager.vo.ExcelTabVO;
-import org.springblade.manager.vo.ExcelTabWbsTypeVO;
-import org.springblade.manager.vo.WbsTreeVO;
+import org.springblade.manager.vo.*;
 
 import java.io.FileNotFoundException;
 import java.sql.SQLException;
@@ -238,4 +235,6 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
     Map<String, String> getFormulaData(JSONArray dataArray, WbsTreeContract wbsTreeTable);
 
     StringBuilder buildMTableInsertSql(String tabName, Map<String, String> dataMap2, Object id, Object groupId, Object pKeyId);
+
+    ExcelTabVO2 getWbsTreeExcelTab(Long id,Long nodeId);
 }

+ 2 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreeService.java

@@ -83,4 +83,6 @@ public interface IWbsTreeService extends BaseService<WbsTree> {
     Object getQueryValueByNodeType(WbsTreePrivateQueryVO vo);
 
     boolean copyNode(List<Long> leftIds, List<Long> rightIds);
+
+    R saveBatchWbsTree(List<ExcelTabVO2> list,Long nodeId,Long wbsId);
 }

+ 6 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java

@@ -1034,7 +1034,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                 }
             }
 
-            return this.submitContractRelevantInfo(row, contractInfo);
+            return this.submitContractRelevantInfo(row, contractInfo, null);
 
         } else {
             //修改
@@ -1135,7 +1135,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
             }
             //}
 
-            return this.submitContractRelevantInfo(row, contractInfo);
+            return this.submitContractRelevantInfo(row, contractInfo, contractInfo1.getProjectPlace());
         }
     }
 
@@ -1194,7 +1194,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
     }
 
     @Async
-    boolean submitContractRelevantInfo(boolean row, ContractInfoVO contractInfo) {
+    boolean submitContractRelevantInfo(boolean row, ContractInfoVO contractInfo, String oldProjectPlace) {
         if (row) {
             List<SaveUserInfoByProjectDTO> list = saveUserInfoByProjectMapper.selectList(Wrappers.<SaveUserInfoByProjectDTO>query().lambda()
                     .eq(SaveUserInfoByProjectDTO::getProjectId, contractInfo.getPId())
@@ -1208,6 +1208,9 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                 });
             }
             String projectPlace = contractInfo.getProjectPlace();
+            if (projectPlace == null || projectPlace.trim().isEmpty() || contractInfo.getProjectPlace().equals(oldProjectPlace)) {
+                return true;
+            }
             Map<String, String> position = new HashMap<>();
             try {
                 Map<String, Object> addressInfo = BaiduApiUtil.geocoding(projectPlace);

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

@@ -146,9 +146,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     private final TrialSelfInspectionRecordClient trialSelfInspectionRecordClient;
     private final WbsTreeContractOldHtmlService wbsTreeContractOldHtmlService;
 
+    private final IWbsTreeService wbsTreeService;
     // excel 解析结构
     private final IExctabCellService exctabCellService;
 
+
     private final IParameterElementService parameterElementService;
 
     @Autowired
@@ -244,11 +246,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         return excelTabVO;
     }
 
-    @Override
-    public R getExcelUrl(ExcelEditCallback callback) {
-        return null;
-    }
-
     @Override
     public List<ExceTabTreVO> tabLazyTree(String tenantId, Long modeId, Long parentId) {
         if (AuthUtil.isAdministrator()) {
@@ -2223,6 +2220,47 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         return sql;
     }
 
+    @Override
+    public ExcelTabVO2 getWbsTreeExcelTab(Long id,Long nodeId) {
+        ExcelTabVO2 vo2 = new ExcelTabVO2();
+        ExcelTab excelTab = this.getById(id);
+        if(excelTab==null){
+            throw new ServiceException("未找到该表单");
+        }
+        vo2.setExcelTabId(excelTab.getId());
+        vo2.setExcelTabName(excelTab.getName());
+        if(StringUtils.isNotEmpty(excelTab.getTabId())){
+            org.springblade.manager.entity.TableInfo tableInfo = tableInfoService.getById(excelTab.getTabId());
+            if(tableInfo!=null){
+                vo2.setElementTableName(tableInfo.getTabChName());
+                vo2.setTableType(tableInfo.getTabType());
+                vo2.setInitTableName(tableInfo.getTabEnName());
+                vo2.setInitTabId(tableInfo.getId());
+                //判断同级其他节点 是否存在相同元素表
+                List<WbsNodeTableVO> wbsNodeTableVOS = wbsTreeService.selectByNodeTable(id+"");
+                if(!wbsNodeTableVOS.isEmpty()){
+                    Set<String> initTabIds = wbsNodeTableVOS.stream().filter(w -> StringUtils.isNotEmpty(w.getInitTableId())).map(w -> w.getInitTableId()).collect(Collectors.toSet());
+                    if(!initTabIds.isEmpty()){
+                        if(initTabIds.contains(tableInfo.getId()+"")){
+                            vo2.setIsCreate(1);
+                        }
+                    }
+                }
+            }else {
+                vo2.setIsCreate(2);
+            }
+        }else {
+            vo2.setIsCreate(2);
+        }
+        if(StringUtils.isEmpty(excelTab.getFileUrl())){
+            vo2.setIsCreate(3);
+        }
+        if(vo2.getIsCreate()==null){
+            vo2.setIsCreate(0);
+        }
+        return vo2;
+    }
+
     // 获取用户
     @Override
     public Map<String, String> getTablbCols(String pkeyid, String colkey) throws FileNotFoundException {
@@ -6539,6 +6577,48 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
     }
 
+    @Override
+    @Async("taskExecutor1")
+    public void synchronizedPdf(List<TableInfo> tableInfoList, String nodeId, String classify, String contractId, String projectId) {
+        try {
+            List<String> errorPKeyIds = new ArrayList<>();
+            //单个pdf加载
+            if (tableInfoList != null) {
+                tableInfoList.parallelStream().forEach(tableInfo -> {
+                    R bussPdfInfo = null;
+                    try {
+                        bussPdfInfo = this.getBussPdfInfo(Long.parseLong(tableInfo.getPkeyId()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    if (ObjectUtil.isEmpty(bussPdfInfo) || bussPdfInfo.getCode() != 200) {
+                        //如果返回的单张pdfUrl为空,那么表示发生异常,返回异常信息
+                        errorPKeyIds.add(tableInfo.getPkeyId());
+                    }
+                });
+            }
+
+            //发生异常后直接返回,不进行合并
+//        if (errorPKeyIds.size() > 0) {
+//            List<AppWbsTreeContractVO> errorTabs = new LinkedList<>();
+//            for (AppWbsTreeContractVO appWbsTreeContractVO : tableAll) {
+//                if (errorPKeyIds.contains(appWbsTreeContractVO.getPKeyId().toString())) {
+//                    errorTabs.add(appWbsTreeContractVO);
+//                }
+//            }
+//            if (errorTabs.size() > 0) {
+//                List<String> names = errorTabs.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList());
+//                return R.fail("以下的表在生成pdf文件时发生了异常【" + StringUtils.join(names, "、") + "】");
+//            }
+//        }
+
+            //合并pdf加载
+            this.getBussPdfs(nodeId, classify, contractId, projectId);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new ServiceException("问题");
+        }
+    }
 
     @Override
     public void cancelSample(Long groupId, Long pkeyId, Long contractId, Long sampleId1) throws Exception {

+ 35 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeServiceImpl.java

@@ -656,6 +656,41 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
         return true;
     }
 
+    @Override
+    public R saveBatchWbsTree(List<ExcelTabVO2> list,Long nodeId,Long wbsId) {
+        List<WbsTree>insertList=new ArrayList<>();
+        WbsTree parentNode = this.getById(nodeId);
+        String tenantId = AuthUtil.getTenantId();
+        if(parentNode==null){
+            return R.fail(201, "父节点不存在");
+        }
+        Integer maxSort=this.baseMapper.getMaxSort(nodeId);
+        for (ExcelTabVO2 vo2 : list) {
+            WbsTree wbsTree = new WbsTree();
+            wbsTree.setId(SnowFlakeUtil.getId());
+            wbsTree.setWbsId(wbsId+"");
+            wbsTree.setTenantId(tenantId);
+            wbsTree.setParentId(nodeId);
+            wbsTree.setAncestors(parentNode.getAncestors()+","+parentNode.getId());
+            wbsTree.setNodeType(1);
+            wbsTree.setNodeName(vo2.getElementTableName());
+            wbsTree.setFullName(vo2.getElementTableName());
+            wbsTree.setSort(++maxSort);
+            wbsTree.setType(2);
+            wbsTree.setTableType(vo2.getTableType());
+            wbsTree.setStatus(1);
+            wbsTree.setTableOwner(vo2.getTableOwner()+"");
+            wbsTree.setInitTableName(vo2.getInitTableName());
+            wbsTree.setIsLinkTable(2);
+            wbsTree.setInitTableId(vo2.getInitTabId());
+            insertList.add(wbsTree);
+        }
+        if(!insertList.isEmpty()){
+            this.saveBatch(insertList);
+        }
+        return R.success("保存成功");
+    }
+
     /**
      * 重新构建整个树的id、parentId和ancestors
      */

+ 2 - 2
blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

@@ -1485,7 +1485,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
                         try {
                             List<WbsTreeContractLazyVO> query = jdbcTemplate.query(
                                     "SELECT p_key_id,id,parent_id " +
-                                            ",sort,create_time,IFNULL(if(LENGTH (trim(full_name)) > 0, full_name, node_name), node_name) AS fullName " +
+                                            ",sort,create_time,IFNULL(if(LENGTH (trim(full_name)) > 0, full_name, node_name), node_name) AS fullName, is_buss_show " +
                                             "FROM m_wbs_tree_contract " +
                                             "WHERE type = 1 " +
                                             "AND status = 1 " +
@@ -2320,7 +2320,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
         if (obj != null) {
             List<Long> resultPKeyId = new ArrayList<>();
             List<WbsTreeContractLazyVO> nodeAll = this.getNodeAll(obj.getContractId());
-            Map<Long, List<WbsTreeContractLazyVO>> map = nodeAll.stream().collect(Collectors.groupingBy(WbsTreeContractLazyVO::getParentId));
+            Map<Long, List<WbsTreeContractLazyVO>> map = nodeAll.stream().filter(item -> item.getIsBussShow() == null || !Objects.equals(item.getIsBussShow(), "2")).collect(Collectors.groupingBy(WbsTreeContractLazyVO::getParentId));
             this.recursionGetChildNodesPkeyIds(map, Collections.singletonList(obj.getId()), resultPKeyId, lowestNodesPkeyIds);
             if (resultPKeyId.size() > 0) {
                 return resultPKeyId;