Sfoglia il codice sorgente

1、lazyQueryContractWbsTree
2、search-node-tables

liuyc 1 anno fa
parent
commit
b157fc00a0

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

@@ -2128,7 +2128,7 @@ public class ExcelTabController extends BladeController {
         List<AppWbsTreeContractVO> tableAll = new ArrayList<>();
         List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
         if (tableInfoList != null) {
-            tableAll = wbsTreeContractService.searchNodeAllTable(nodeId, "1", contractId, projectId);
+            tableAll = wbsTreeContractService.searchNodeAllTable(nodeId, "1", contractId, projectId,null);
             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());
@@ -3809,7 +3809,7 @@ public class ExcelTabController extends BladeController {
                 String classify = dataMap.get("classify") + "";
                 String contractId = dataMap.get("contract_id") + "";
                 String projectId = dataMap.get("project_id") + "";
-                List<AppWbsTreeContractVO> tableAll = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
+                List<AppWbsTreeContractVO> tableAll = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId,null);
                 if (tableAll != null && tableAll.size() >= 1) {
                     for (AppWbsTreeContractVO tab : tableAll) {
                         try {
@@ -3932,7 +3932,7 @@ public class ExcelTabController extends BladeController {
             for (String noId : nodeId) {
                 JSONObject js = new JSONObject();
                 JSONObject js2 = new JSONObject();
-                List<AppWbsTreeContractVO> tableAll = wbsTreeContractService.searchNodeAllTable(noId, classify, contractId, projectId);
+                List<AppWbsTreeContractVO> tableAll = wbsTreeContractService.searchNodeAllTable(noId, classify, contractId, projectId,null);
                 JSONArray array = new JSONArray();
                 if (tableAll != null && tableAll.size() >= 1) {
                     for (AppWbsTreeContractVO tab : tableAll) {

+ 3 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeContractController.java

@@ -47,6 +47,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.*;
 import java.net.URLEncoder;
@@ -78,8 +79,8 @@ public class WbsTreeContractController extends BladeController {
     @GetMapping("/search-node-tables")
     @ApiOperationSupport(order = 1)
     @ApiOperation(value = "查询当前节点下所有元素表信息", notes = "传入节点primaryKeyId、type、合同段id、项目id")
-    public R searchNodeAllTable(String primaryKeyId, String type, String contractId, String projectId) {
-        List<AppWbsTreeContractVO> list = iWbsTreeContractService.searchNodeAllTable(primaryKeyId, type, contractId, projectId);
+    public R searchNodeAllTable(String primaryKeyId, String type, String contractId, String projectId, HttpServletRequest request) {
+        List<AppWbsTreeContractVO> list = iWbsTreeContractService.searchNodeAllTable(primaryKeyId, type, contractId, projectId, request);
         if (list.size() > 0) {
             list.forEach(l -> {
                 if (StringUtils.isNotBlank(l.getHtmlUrl())) {

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java

@@ -421,7 +421,7 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
 
     @Override
     public List<AppWbsTreeContractVO> searchNodeAllTableInfo(String primaryKeyId, String type, String contractId, String projectId,Long userId) {
-        List<AppWbsTreeContractVO> list = wbsTreeContractService.searchNodeAllTable(primaryKeyId+":"+userId, type, contractId, projectId);
+        List<AppWbsTreeContractVO> list = wbsTreeContractService.searchNodeAllTable(primaryKeyId+":"+userId, type, contractId, projectId,null);
         return list;
     }
 

+ 4 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.java

@@ -8,6 +8,7 @@ import org.springblade.manager.injector.EasyBaseMapper;
 import org.springblade.manager.vo.*;
 
 import java.util.List;
+import java.util.Set;
 
 //@CacheNamespace
 public interface WbsTreeContractMapper extends EasyBaseMapper<WbsTreeContract> {
@@ -58,7 +59,9 @@ public interface WbsTreeContractMapper extends EasyBaseMapper<WbsTreeContract> {
 
     List<WbsTableOwnerRole> selectWbsTableOwnerRoleList(String roleId);
 
-    List<AppWbsTreeContractVO> selectWbsTreeContractList(List<String> tableOwnerNumbers, String projectId, String wbsId, String contractId, Long parentId, String contractIdRelation, List<String> tableOwnerList);
+    List<AppWbsTreeContractVO> selectWbsTreeContractList(Set<String> roleTableOwnerSets, String projectId, String wbsId, String contractId, Long parentId, String contractIdRelation);
+
+    List<AppWbsTreeContractVO> selectWbsTreeContractListClient(Set<String> roleTableOwnerSets, String projectId, String wbsId, String contractId, Long parentId, String contractIdRelation);
 
     SaveUserInfoByProject selectRoleInfo(Long userId, String contractId, String projectId);
 

+ 88 - 66
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.xml

@@ -109,7 +109,6 @@
         </collection>
     </resultMap>
 
-
     <resultMap id="resultMap2" type="org.springblade.manager.vo.WbsTreeContractVO">
         <result column="id" property="id"/>
         <result column="wbs_id" property="wbsId"/>
@@ -416,6 +415,7 @@
         where role_id = #{roleId}
     </select>
 
+    <!--APP返回appResultMap(内部嵌套子查询(不清楚为什么要这样嵌套查询,导致一直递归))-->
     <select id="selectWbsTreeContractList" resultMap="appResultMap">
         SELECT * FROM
         m_wbs_tree_contract
@@ -423,25 +423,43 @@
         AND wbs_id = #{wbsId}
         AND contract_id = #{contractId}
         AND parent_id = #{parentId}
-        AND table_owner in
-        <foreach item="tableOwnerNumbers" collection="tableOwnerNumbers" open="(" close=")" separator=",">
-            #{tableOwnerNumbers}
-        </foreach>
         AND type = 2
         AND status = 1
         AND is_deleted = 0
         <if test="contractIdRelation != null and contractIdRelation!= ''">
             AND contract_id = #{contractIdRelation}
         </if>
-        <if test="tableOwnerList != null and tableOwnerList!= ''">
+        <if test="roleTableOwnerSets != null and roleTableOwnerSets!= ''">
             AND table_owner in
-            <foreach item="tableOwnerList" collection="tableOwnerList" open="(" close=")" separator=",">
-                #{tableOwnerList}
+            <foreach item="roleTableOwnerSets" collection="roleTableOwnerSets" open="(" close=")" separator=",">
+                #{roleTableOwnerSets}
             </foreach>
         </if>
         ORDER BY sort,full_name,create_time
     </select>
 
+    <!--客户端返回WbsTreeContract-->
+    <select id="selectWbsTreeContractListClient" resultType="org.springblade.manager.vo.AppWbsTreeContractVO">
+        SELECT * FROM
+        m_wbs_tree_contract
+        WHERE project_id = #{projectId}
+        AND wbs_id = #{wbsId}
+        AND contract_id = #{contractId}
+        AND parent_id = #{parentId}
+        AND type = 2
+        AND status = 1
+        AND is_deleted = 0
+        <if test="contractIdRelation != null and contractIdRelation!= ''">
+            AND contract_id = #{contractIdRelation}
+        </if>
+        <if test="roleTableOwnerSets != null and roleTableOwnerSets!= ''">
+            AND table_owner in
+            <foreach item="roleTableOwnerSets" collection="roleTableOwnerSets" open="(" close=")" separator=",">
+                #{roleTableOwnerSets}
+            </foreach>
+        </if>
+    </select>
+
     <select id="selectRoleInfo" resultType="org.springblade.manager.entity.SaveUserInfoByProject">
         SELECT role_id
         FROM m_project_assignment_user
@@ -566,25 +584,29 @@
     <update id="updateContractTablesInfo">
         UPDATE m_wbs_tree_contract
         SET
-            node_name =
-                CASE
-                    WHEN node_name LIKE '%_PL_%' THEN CONCAT(#{wbsTreePrivate.nodeName}, SUBSTRING(node_name FROM INSTR(node_name, '_PL_')))
-                    WHEN node_name LIKE '%__%' THEN CONCAT(#{wbsTreePrivate.nodeName}, SUBSTRING(node_name FROM INSTR(node_name, '__')))
-                ELSE #{wbsTreePrivate.nodeName}
-                END,
-            full_name =
-                CASE
-                    WHEN full_name LIKE '%_PL_%' THEN CONCAT(#{wbsTreePrivate.nodeName}, SUBSTRING(full_name FROM INSTR(full_name, '_PL_')))
-                    WHEN full_name LIKE '%__%' THEN CONCAT(#{wbsTreePrivate.nodeName}, SUBSTRING(full_name FROM INSTR(full_name, '__')))
-                    ELSE #{wbsTreePrivate.nodeName}
-                END,
-            table_type = #{wbsTreePrivate.tableType},
-            table_owner = #{wbsTreePrivate.tableOwner}
-            <if test="wbsTreePrivate.sort != null and wbsTreePrivate.sort != ''">
-                ,sort = #{wbsTreePrivate.sort}
-            </if>
+        node_name =
+        CASE
+        WHEN node_name LIKE '%_PL_%' THEN CONCAT(#{wbsTreePrivate.nodeName}, SUBSTRING(node_name FROM INSTR(node_name,
+        '_PL_')))
+        WHEN node_name LIKE '%__%' THEN CONCAT(#{wbsTreePrivate.nodeName}, SUBSTRING(node_name FROM INSTR(node_name,
+        '__')))
+        ELSE #{wbsTreePrivate.nodeName}
+        END,
+        full_name =
+        CASE
+        WHEN full_name LIKE '%_PL_%' THEN CONCAT(#{wbsTreePrivate.nodeName}, SUBSTRING(full_name FROM INSTR(full_name,
+        '_PL_')))
+        WHEN full_name LIKE '%__%' THEN CONCAT(#{wbsTreePrivate.nodeName}, SUBSTRING(full_name FROM INSTR(full_name,
+        '__')))
+        ELSE #{wbsTreePrivate.nodeName}
+        END,
+        table_type = #{wbsTreePrivate.tableType},
+        table_owner = #{wbsTreePrivate.tableOwner}
+        <if test="wbsTreePrivate.sort != null and wbsTreePrivate.sort != ''">
+            ,sort = #{wbsTreePrivate.sort}
+        </if>
         WHERE
-            p_key_id in
+        p_key_id in
         <foreach collection="pKeyIdsContracts" item="pKeyIds" open="(" close=")" separator=",">
             #{pKeyIds}
         </foreach>
@@ -595,47 +617,47 @@
             UPDATE m_wbs_tree_contract
             <set>
                 node_name =
-                    CASE
-                        WHEN node_name LIKE '%_PL_%'
-                            THEN CONCAT(
-                            <if test="item.nodeName != null and item.nodeName != ''">
-                                #{item.nodeName}
-                            </if>,
-                            SUBSTRING(node_name FROM INSTR(node_name, '_PL_'))
-                            )
-                        WHEN node_name LIKE '%__%'
-                            THEN CONCAT(
-                            <if test="item.nodeName != null and item.nodeName != ''">
-                                #{item.nodeName}
-                            </if>,
-                            SUBSTRING(node_name FROM INSTR(node_name, '__'))
-                            )
-                        ELSE
-                        <if test="item.nodeName != null and item.nodeName != ''">
-                            #{item.nodeName}
-                        </if>
-                    END,
+                CASE
+                WHEN node_name LIKE '%_PL_%'
+                THEN CONCAT(
+                <if test="item.nodeName != null and item.nodeName != ''">
+                    #{item.nodeName}
+                </if>,
+                SUBSTRING(node_name FROM INSTR(node_name, '_PL_'))
+                )
+                WHEN node_name LIKE '%__%'
+                THEN CONCAT(
+                <if test="item.nodeName != null and item.nodeName != ''">
+                    #{item.nodeName}
+                </if>,
+                SUBSTRING(node_name FROM INSTR(node_name, '__'))
+                )
+                ELSE
+                <if test="item.nodeName != null and item.nodeName != ''">
+                    #{item.nodeName}
+                </if>
+                END,
                 full_name =
-                    CASE
-                        WHEN full_name LIKE '%_PL_%'
-                            THEN CONCAT(
-                            <if test="item.nodeName != null and item.nodeName != ''">
-                                #{item.nodeName}
-                            </if>,
-                            SUBSTRING(full_name FROM INSTR(full_name, '_PL_'))
-                            )
-                        WHEN full_name LIKE '%__%'
-                            THEN CONCAT(
-                            <if test="item.nodeName != null and item.nodeName != ''">
-                                #{item.nodeName}
-                            </if>,
-                            SUBSTRING(full_name FROM INSTR(full_name, '__'))
-                            )
-                        ELSE
-                        <if test="item.nodeName != null and item.nodeName != ''">
-                            #{item.nodeName}
-                        </if>
-                    END,
+                CASE
+                WHEN full_name LIKE '%_PL_%'
+                THEN CONCAT(
+                <if test="item.nodeName != null and item.nodeName != ''">
+                    #{item.nodeName}
+                </if>,
+                SUBSTRING(full_name FROM INSTR(full_name, '_PL_'))
+                )
+                WHEN full_name LIKE '%__%'
+                THEN CONCAT(
+                <if test="item.nodeName != null and item.nodeName != ''">
+                    #{item.nodeName}
+                </if>,
+                SUBSTRING(full_name FROM INSTR(full_name, '__'))
+                )
+                ELSE
+                <if test="item.nodeName != null and item.nodeName != ''">
+                    #{item.nodeName}
+                </if>
+                END,
                 <if test="item.nodeType != null and item.nodeType != ''">
                     node_type = #{item.nodeType},
                 </if>

+ 2 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreeContractService.java

@@ -10,6 +10,7 @@ import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.vo.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletRequest;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.List;
@@ -37,7 +38,7 @@ public interface IWbsTreeContractService extends BaseService<WbsTreeContract> {
 
     List<WbsTreeContractTreeVO3> lazyTreeThree(String contractIdRelation, Long parentId, String contractId);
 
-    List<AppWbsTreeContractVO> searchNodeAllTable(String primaryKeyId, String tableOwner, String contractId, String projectId);
+    List<AppWbsTreeContractVO> searchNodeAllTable(String primaryKeyId, String tableOwner, String contractId, String projectId, HttpServletRequest request);
 
     List<WbsTreeContract> searchParentAllNode(long primaryKeyId, Long contractId);
 

+ 2 - 34
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java

@@ -336,18 +336,15 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
         if (StringUtils.isNotEmpty(queryValue) && StringUtils.isNotEmpty(contractId)) {
             ContractInfo contractInfo = contractInfoMapper.selectById(contractId);
             if (contractInfo != null) {
-                //TODO 质检
+                /*质检施工合同段*/
                 if (contractInfo.getContractType().equals(1)) {
-                    //获取查询有效节点信息
                     LambdaQueryWrapper<WbsTreeContract> queryWrapper = new LambdaQueryWrapper<>();
                     queryWrapper.select(WbsTreeContract::getParentId, WbsTreeContract::getId, WbsTreeContract::getPKeyId);
                     queryWrapper.like(WbsTreeContract::getFullName, queryValue);
                     queryWrapper.eq(WbsTreeContract::getContractId, contractId);
                     queryWrapper.eq(WbsTreeContract::getType, 1);
-                    //所有匹配节点
                     List<WbsTreeContract> nodes = wbsTreeContractMapper.selectList(queryWrapper);
                     if (nodes.size() > 0) {
-                        //获取当前合同段所有缓存节点信息
                         List<WbsTreeContractLazyVO> nodesAllTemp;
                         Object data = redisTemplate.opsForValue().get("blade-manager::contract:wbstree:" + contractId);
                         if (data != null) {
@@ -355,7 +352,6 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                         } else {
                             nodesAllTemp = jdbcTemplate.query("select a.p_key_id,a.id,a.parent_id from m_wbs_tree_contract a where a.type = 1 and a.status = 1 and a.is_deleted = 0 and a.contract_id = " + contractId, new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
                             if (nodesAllTemp.size() > 0) {
-                                //判断是否有子级,赋值
                                 Map<Long, List<WbsTreeContractLazyVO>> groupedByParentId = nodesAllTemp.stream().collect(Collectors.groupingBy(WbsTreeContractLazyVO::getParentId));
                                 for (WbsTreeContractLazyVO vo : nodesAllTemp) {
                                     if (vo.getParentId() == 0) {
@@ -373,13 +369,11 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                             }
                         }
 
-                        //去重
                         List<WbsTreeContractLazyVO> distinctNodesAll = nodesAllTemp.stream()
                                 .collect(Collectors.collectingAndThen(
                                         Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreeContractLazyVO::getPKeyId))),
                                         ArrayList::new
                                 ));
-                        //所有最底层节点
                         List<WbsTreeContractLazyVO> distinctLowestNodesAll = distinctNodesAll.stream().filter(f -> f.getHasChildren().equals(0)).collect(Collectors.collectingAndThen(
                                 Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreeContractLazyVO::getPKeyId))),
                                 ArrayList::new
@@ -387,19 +381,13 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
 
                         List<Long> parentIds = nodes.stream().map(WbsTreeContract::getParentId).collect(Collectors.toList());
                         List<Long> ids = nodes.stream().map(WbsTreeContract::getId).collect(Collectors.toList());
-                        //所有匹配的PKeyIds
                         Set<Long> resultNodesPKeyIds = new LinkedHashSet<>();
-                        //获取所有匹配节点的父级
                         this.recursiveGetParentNodes(resultNodesPKeyIds, parentIds, nodesAllTemp);
-                        //获取所有匹配节点的子级
                         this.recursiveGetChildNodes(resultNodesPKeyIds, ids, nodesAllTemp);
 
-                        //获取结果集节点
                         resultNodesPKeyIds.addAll(nodes.stream().map(WbsTreeContract::getPKeyId).collect(Collectors.toList()));
                         List<WbsTreeContract> wbsTreeContractList = wbsTreeContractMapper.selectList(Wrappers.<WbsTreeContract>lambdaQuery().in(WbsTreeContract::getPKeyId, resultNodesPKeyIds));
 
-                        //获取当前合同段填报过的资料信息Map
-                        //获取当前合同段所有填报资料缓存信息
                         List<WbsTreeContractLazyQueryInfoVO> queryInfoList;
                         Object dataInformationQuery;
                         if (cn.hutool.core.util.ObjectUtil.isEmpty(tableOwner)) {
@@ -428,44 +416,29 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                                 .collect(Collectors.toMap(WbsTreeContractLazyQueryInfoVO::getWbsId, WbsTreeContractLazyQueryInfoVO::getStatus, (existingValue, newValue) -> existingValue));
                         List<Long> pKeyIdList = new ArrayList<>(queryInfoMaps.keySet());
 
-                        //TODO 处理数量
-                        //填报过的所有最底层节点
                         List<WbsTreeContractLazyVO> lowestNodesTB = distinctLowestNodesAll.parallelStream().filter(f -> pKeyIdList.contains(f.getPKeyId()) && resultNodesPKeyIds.contains(f.getPKeyId())).collect(Collectors.toList());
                         List<Long> lowestNodeParentIdsTB = lowestNodesTB.parallelStream().map(WbsTreeContractLazyVO::getParentId).collect(Collectors.toList());
                         List<WbsTreeContractLazyVO> resultParentNodesTB = new ArrayList<>();
                         wbsTreeContractServiceImpl.recursiveGetParentNodes(resultParentNodesTB, lowestNodeParentIdsTB, nodesAllTemp);
 
-                        //最底层节点颜色构造后Map
                         Map<Long, WbsTreeContractLazyVO> lowestNodesMap = lowestNodesTB.stream()
                                 .peek(vo -> {
                                     Integer colorStatus = queryInfoMaps.get(vo.getPKeyId());
                                     if (colorStatus != null) {
-                                        //任务状态0=未上报=颜色2蓝色、任务状态1=待审批=颜色3橙色、任务状态2=已审批=颜色4绿色
-                                        ///*任务状态3=已废除=颜色1黑色*/(2023年10月16日13:59:00 已废除改为=颜色2蓝色)
                                         vo.setColorStatus(colorStatus == 0 ? 2 : (colorStatus == 1 ? 3 : (colorStatus == 2 ? 4 : 2)));
                                     } else {
-                                        //未填报的=颜色1黑色
                                         vo.setColorStatus(1);
                                     }
                                 }).collect(Collectors.toMap(WbsTreeContractLazyVO::getPKeyId, Function.identity()));
 
-                        //TODO 处理颜色
-                        //先将WbsTreeContractLazyVO转为NodeVO
                         List<NodeVO> nodeVOList = distinctNodesAll.stream().map(wbsTreeContractServiceImpl::convertToNodeVO).collect(Collectors.toList());
-                        //转为Map<Long, NodeVO>
                         Map<Long, NodeVO> nodeVOMap = nodeVOList.stream().collect(Collectors.toMap(NodeVO::getId, vo -> vo, (existing, replacement) -> existing));
-                        //把distinctNodesAll把所有节点转为树形结构,再转为List<NodeVO>对象
                         List<NodeVO> treeNodeVOList = wbsTreeContractServiceImpl.buildNodeTreeByStream(distinctNodesAll, lowestNodesMap);
-                        //处理节点颜色
                         NodeVO.calculateStatusToDFS(treeNodeVOList, nodeVOMap);
-                        //把树形结构转为普通List集合
                         List<NodeVO> nodeVOS = wbsTreeContractServiceImpl.flattenTree(treeNodeVOList);
-                        //获取所有节点颜色Map
                         Map<Long, Integer> nodeColorStatusMap = nodeVOS.stream().collect(Collectors.toMap(NodeVO::getPKeyId, NodeVO::getStatus, (existing, replacement) -> existing));
 
-                        //构造vo
                         if (wbsTreeContractList.size() > 0) {
-                            //处理填报数量
                             Map<Long, Long> countMap = new HashMap<>();
                             for (WbsTreeContractLazyVO node : resultParentNodesTB) {
                                 Long key = node.getPKeyId();
@@ -484,10 +457,8 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                                             vo.setTitle(ObjectUtil.isNotEmpty(node.getFullName()) ? node.getFullName() : node.getNodeName());
                                             vo.setPrimaryKeyId(node.getPKeyId());
 
-                                            //设置数量
                                             vo.setSubmitCounts(ObjectUtil.isNotEmpty(countMap.get(vo.getPrimaryKeyId())) ? countMap.get(vo.getPrimaryKeyId()) : (ObjectUtil.isNotEmpty(queryInfoMaps.get(vo.getPrimaryKeyId())) ? 1L : 0L));
 
-                                            //设置颜色
                                             Integer parentColorStatus = nodeColorStatusMap.get(vo.getPrimaryKeyId());
                                             if (parentColorStatus != null) {
                                                 vo.setColorStatus(parentColorStatus);
@@ -504,8 +475,8 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                         }
                     }
 
+                    /*监理、业主合同段*/
                 } else if (contractInfo.getContractType().equals(2) || contractInfo.getContractType().equals(3)) {
-                    //TODO 监理、指挥部
                     Map<Long, List<WbsTreeContractTreeAllVO>> resultMaps = new LinkedHashMap<>();
                     List<ContractRelationJlyz> relationJLYZList = jdbcTemplate.query("select * from m_contract_relation_jlyz where contract_id_jlyz = " + contractId, new BeanPropertyRowMapper<>(ContractRelationJlyz.class));
                     if (ObjectUtil.isEmpty(relationJLYZList) || relationJLYZList.size() <= 0) {
@@ -562,7 +533,6 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                             resultNodesPKeyIds.addAll(nodes.stream().map(WbsTreeContract::getPKeyId).collect(Collectors.toList()));
                             List<WbsTreeContract> wbsTreeContractList = wbsTreeContractMapper.selectList(Wrappers.<WbsTreeContract>lambdaQuery().in(WbsTreeContract::getPKeyId, resultNodesPKeyIds));
 
-                            //资料信息缓存
                             List<WbsTreeContractLazyQueryInfoVO> queryInfoList;
                             Object dataInformationQuery;
                             if (cn.hutool.core.util.ObjectUtil.isEmpty(tableOwner)) {
@@ -601,14 +571,12 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                                     .peek(vo -> {
                                         Integer colorStatus = queryInfoMaps.get(vo.getPKeyId());
                                         if (colorStatus != null) {
-                                            ///*任务状态3=已废除=颜色1黑色*/(2023年10月16日13:59:00 已废除改为=颜色2蓝色)
                                             vo.setColorStatus(colorStatus == 0 ? 2 : (colorStatus == 1 ? 3 : (colorStatus == 2 ? 4 : 2)));
                                         } else {
                                             vo.setColorStatus(1);
                                         }
                                     }).collect(Collectors.toMap(WbsTreeContractLazyVO::getPKeyId, Function.identity()));
 
-                            //颜色
                             List<NodeVO> nodeVOList = distinctNodesAll.stream().map(wbsTreeContractServiceImpl::convertToNodeVO).collect(Collectors.toList());
                             Map<Long, NodeVO> nodeVOMap = nodeVOList.stream().collect(Collectors.toMap(NodeVO::getId, vo -> vo, (existing, replacement) -> existing));
                             List<NodeVO> treeNodeVOList = wbsTreeContractServiceImpl.buildNodeTreeByStream(distinctNodesAll, lowestNodesMap);

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

@@ -467,7 +467,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     private List<NodeTable> createNodeTables(Long nodeId, String contractId, String projectId, ExecuteType type) {
         List<NodeTable> tableAll = new ArrayList<>();
         if (type.equals(ExecuteType.INSPECTION)) {
-            List<AppWbsTreeContractVO> treeNode = wbsTreeContractService.searchNodeAllTable(nodeId.toString(), "1", contractId, projectId);
+            List<AppWbsTreeContractVO> treeNode = wbsTreeContractService.searchNodeAllTable(nodeId.toString(), "1", contractId, projectId,null);
             tableAll = BeanUtil.copyProperties(treeNode, NodeTable.class);
         } else if (type.equals(ExecuteType.TESTING)) {
             List<WbsTreePrivateVO4> wbsTreePrivateVO4s = wbsTreePrivateService.searchNodeAllTable(nodeId.toString(), "1", "9", contractId, projectId, null, null);
@@ -1873,7 +1873,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
         String file_path = FileUtils.getSysLocalFileUrl();
         // 获取有权限的节点信息
-        List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
+        List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId,null);
         List<String> data = new ArrayList<>();
         if (wbsTreeContractList != null && wbsTreeContractList.size() >= 1) {
             for (WbsTreeContract wbsInfo : wbsTreeContractList) {

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

@@ -167,7 +167,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             /*节点参数*/
             tec.constantMap.put(WP,getWpMap(one));
             /*表格名称*/
-            List<AppWbsTreeContractVO> tableList =wbsTreeContractService.searchNodeAllTable(one.getPkId().toString(), "1", tec.getContractId().toString(),tec.getProjectId().toString());
+            List<AppWbsTreeContractVO> tableList =wbsTreeContractService.searchNodeAllTable(one.getPkId().toString(), "1", tec.getContractId().toString(),tec.getProjectId().toString(),null);
             tec.constantMap.put(TABLE_LIST,tableList);
             /*监表质量附件,过滤掉隐藏表格*/
             tec.constantMap.put("tableNames",tableList.stream().filter(e->StringUtils.isEquals(e.getIsBussShow(),1)&&StringUtils.isNotEquals(e.getTableType(),4)).map(WbsTreeContract::getNodeName).collect(Collectors.toList()));

+ 134 - 218
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

@@ -53,6 +53,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.LinkedCaseInsensitiveMap;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletRequest;
 import java.io.*;
 import java.math.BigInteger;
 import java.util.*;
@@ -418,7 +419,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
     }
 
     @Override
-    public List<AppWbsTreeContractVO> searchNodeAllTable(String primaryKeyId, String tableOwner, String contractId, String projectId) {
+    public List<AppWbsTreeContractVO> searchNodeAllTable(String primaryKeyId, String tableOwner, String contractId, String projectId, HttpServletRequest request) {
         //由于Feign调用时,获取不到UserId
         Long userId;
         if (StringUtils.isNotEmpty(primaryKeyId) && primaryKeyId.contains(":")) {
@@ -431,7 +432,9 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
         } else {
             userId = AuthUtil.getUserId();
         }
+
         WbsTreeContract wbsTreeContract = baseMapper.selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                .select(WbsTreeContract::getId, WbsTreeContract::getProjectId, WbsTreeContract::getContractId, WbsTreeContract::getContractIdRelation, WbsTreeContract::getWbsId)
                 .eq(WbsTreeContract::getPKeyId, primaryKeyId));
         if (wbsTreeContract == null) {
             return Collections.emptyList();
@@ -450,12 +453,13 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
             throw new ServiceException("当前用户角色未授权,请先分配角色查看元素表相对应的权限");
         }
 
-        List<String> tableOwnerNumbers = wbsTableOwnerRoleList.stream().map(WbsTableOwnerRole::getTableOwnerNumber).collect(Collectors.toList());
+        //角色表单权限(后管权限配置)
+        Set<String> roleTableOwnerSets = wbsTableOwnerRoleList.stream().map(WbsTableOwnerRole::getTableOwnerNumber).collect(Collectors.toSet());
 
-        List<String> tableOwnerList = null;
+        //接口请求表单类型(施工质检 或 监理抽检)
+        Set<String> tabTableOwnerSets = new HashSet<>();
         if (StringUtils.isNotEmpty(tableOwner)) {
             String tableOwners;
-            //字典owner_type
             if (tableOwner.equals("1")) {
                 tableOwners = "1,2,3";
             } else if (tableOwner.equals("2")) {
@@ -463,14 +467,43 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
             } else {
                 tableOwners = "7,8,9";
             }
-            tableOwnerList = Func.toStrList(tableOwners);
+            tabTableOwnerSets.addAll(Func.toStrList(tableOwners));
+        }
+        //取交集
+        roleTableOwnerSets.retainAll(tabTableOwnerSets);
+
+        //判断是客户端还是APP
+        List<AppWbsTreeContractVO> resultTabs;
+        if (ObjectUtil.isNotEmpty(request)) {
+            /*暂时通过获取请求头,不通过Auth获取clientId标识来判断是客户端或APP*/
+            String userAgent = request.getHeader("User-Agent");
+            if (userAgent != null && (userAgent.contains("Windows") || userAgent.contains("windows") || userAgent.contains("Mac") || userAgent.contains("mac"))) {
+                //客户端查询
+                resultTabs = baseMapper.selectWbsTreeContractListClient(roleTableOwnerSets,
+                        wbsTreeContract.getProjectId(), wbsTreeContract.getWbsId(),
+                        wbsTreeContract.getContractId(), wbsTreeContract.getId(),
+                        wbsTreeContract.getContractIdRelation());
+            } else {
+                //APP查询
+                resultTabs = baseMapper.selectWbsTreeContractList(roleTableOwnerSets,
+                        wbsTreeContract.getProjectId(), wbsTreeContract.getWbsId(),
+                        wbsTreeContract.getContractId(), wbsTreeContract.getId(),
+                        wbsTreeContract.getContractIdRelation());
+            }
+        } else {
+            //其他接口调用默认保持原始调用方式的查询
+            resultTabs = baseMapper.selectWbsTreeContractList(roleTableOwnerSets,
+                    wbsTreeContract.getProjectId(), wbsTreeContract.getWbsId(),
+                    wbsTreeContract.getContractId(), wbsTreeContract.getId(),
+                    wbsTreeContract.getContractIdRelation());
         }
-
-        List<AppWbsTreeContractVO> resultTabs = baseMapper.selectWbsTreeContractList(tableOwnerNumbers, wbsTreeContract.getProjectId(), wbsTreeContract.getWbsId(), wbsTreeContract.getContractId(), wbsTreeContract.getId(), wbsTreeContract.getContractIdRelation(), tableOwnerList);
 
         //表单排序
-        List<AppWbsTreeContractVO> resultTabsToCopy = this.sortTabs(resultTabs, "__"); //复制表排序
-        return this.sortTabs(resultTabsToCopy, "_PL_"); //频率表排序
+        if (resultTabs.size() > 0) {
+            List<AppWbsTreeContractVO> resultTabsToCopy = this.sortTabs(resultTabs, "__"); //复制表排序
+            return this.sortTabs(resultTabsToCopy, "_PL_"); //频率表排序
+        }
+        return resultTabs;
     }
 
     /**
@@ -684,61 +717,20 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
 
     @Override
     public List<WbsTreeContractLazyVO> lazyQueryContractWbsTree(String id, String contractId, String contractIdRelation, String tableOwner) {
+        if (StringUtils.isEmpty(tableOwner)) {
+            throw new ServiceException("tableOwner is not null");
+        }
         if (ObjectUtil.isNotEmpty(contractId)) {
             ContractInfo contractInfo = contractInfoMapper.selectOne(Wrappers.<ContractInfo>lambdaQuery().select(ContractInfo::getContractName, ContractInfo::getContractType).eq(ContractInfo::getId, contractId));
             if (contractInfo != null) {
-                //TODO ************ 施工合同段 ************
+                /*施工合同段*/
                 if (new Integer(1).equals(contractInfo.getContractType())) {
-                    /*获取本地缓存*/
-                    List<WbsTreeContractLazyVO> nodesAll = localCacheNodes.get(contractId);
-
-                    if (nodesAll == null || nodesAll.size() == 0) {
-
-                        //获取当前合同段所有缓存节点信息
-                        Object data = redisTemplate.opsForValue().get("blade-manager::contract:wbstree:" + contractId);
-                        if (data != null) {
-                            //从Redis获取数据
-                            nodesAll = JSON.parseArray(data.toString(), WbsTreeContractLazyVO.class);
-                            /*更新本地缓存*/
-                            localCacheNodes.put(contractId, nodesAll);
-
-                        } else {
-
-                            long startTime1 = System.currentTimeMillis();
-
-                            nodesAll = jdbcTemplate.query("select a.p_key_id,a.id,a.parent_id from m_wbs_tree_contract a where a.type = 1 and a.status = 1 and a.is_deleted = 0 and a.contract_id = " + contractId, new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
-
-                            long endTime1 = System.currentTimeMillis();
-                            long executionTime1 = endTime1 - startTime1;
-                            logger.info("查询合同段" + contractId + "所有树执行时间:" + executionTime1 + " ms");
-
-                            if (nodesAll.size() > 0) {
-                                //判断是否有子级,赋值
-                                Map<Long, List<WbsTreeContractLazyVO>> groupedByParentId = nodesAll.stream().collect(Collectors.groupingBy(WbsTreeContractLazyVO::getParentId));
-                                for (WbsTreeContractLazyVO vo : nodesAll) {
-                                    if (vo.getParentId() == 0) {
-                                        vo.setHasChildren(1);
-                                    }
-                                    List<WbsTreeContractLazyVO> childNodes = groupedByParentId.getOrDefault(vo.getId(), null);
-                                    if (childNodes != null && childNodes.size() > 0) {
-                                        vo.setHasChildren(1);
-                                    } else {
-                                        vo.setHasChildren(0);
-                                    }
-                                }
-                                /*更新本地缓存*/
-                                localCacheNodes.put(contractId, nodesAll);
-
-                                JSONArray array = JSONArray.parseArray(JSON.toJSONString(nodesAll));
-                                redisTemplate.opsForValue().set("blade-manager::contract:wbstree:" + contractId, JSON.toJSON(array).toString());
-                            }
-                        }
-                    }
+                    //获取本地缓存节点信息
+                    List<WbsTreeContractLazyVO> nodesAll = this.getNodeAll(contractId);
 
                     //获取当前层懒加载节点
                     List<WbsTreeContractLazyVO> lazyNodes = jdbcTemplate.query("select p_key_id,contract_id,(SELECT id FROM u_contract_tree_drawings where process_id = p_key_id) AS drawingsId,id,parent_id,node_type,type,wbs_type,is_concrete,major_data_type,partition_code,old_id,contract_id_relation,is_concealed_works_node,CASE (SELECT count(1) FROM u_tree_contract_first AS tcf WHERE tcf.is_deleted = 0 AND tcf.wbs_node_id = a.p_key_id) WHEN 0 THEN 'false' ELSE 'true' END AS isFirst,IFNULL(if(length(trim(full_name))>0,full_name,node_name),node_name) AS title,(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id AND b.type = 1 and b.status = 1 AND b.contract_id = " + contractId + " AND b.is_deleted = 0 ) AS hasChildren from m_wbs_tree_contract a where a.node_type != 111 and a.type = 1 and a.status = 1 and a.is_deleted = 0 and parent_id = " + (StringUtils.isNotEmpty(id) ? id : 0) + " and contract_id = " + contractId + " ORDER BY a.sort,title,a.create_time", new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
                     if (lazyNodes.size() > 0 && nodesAll.size() > 0) {
-                        //所有节点
                         List<WbsTreeContractLazyVO> distinctNodesAll = nodesAll.stream()
                                 .collect(Collectors.collectingAndThen(
                                         Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreeContractLazyVO::getPKeyId))),
@@ -751,37 +743,14 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                                 ArrayList::new
                         ));
 
-                        //获取当前合同段所有填报资料缓存信息
+                        //获取本地缓存资料信息
                         List<WbsTreeContractLazyQueryInfoVO> queryInfoList = this.getQueryInfoList(contractId, tableOwner);
-                        /*List<WbsTreeContractLazyQueryInfoVO> queryInfoList;
-                        Object dataInformationQuery;
-                        if (ObjectUtil.isEmpty(tableOwner)) {
-                            dataInformationQuery = redisTemplate.opsForValue().get("blade-manager::contract:wbstree:byInformationQuery:" + contractId + "_1");
-                        } else {
-                            dataInformationQuery = redisTemplate.opsForValue().get("blade-manager::contract:wbstree:byInformationQuery:" + contractId + "_" + tableOwner);
-                        }
-                        if (dataInformationQuery != null) {
-                            queryInfoList = JSON.parseArray(dataInformationQuery.toString(), WbsTreeContractLazyQueryInfoVO.class);
-                        } else {
-                            if (ObjectUtil.isEmpty(tableOwner)) {
-                                queryInfoList = jdbcTemplate.query("select wbs_id,status from u_information_query where type = 1 and contract_id = " + contractId, new BeanPropertyRowMapper<>(WbsTreeContractLazyQueryInfoVO.class));
-                                if (queryInfoList.size() > 0) {
-                                    JSONArray array = JSONArray.parseArray(JSON.toJSONString(queryInfoList));
-                                    redisTemplate.opsForValue().set("blade-manager::contract:wbstree:byInformationQuery:" + contractId + "_1", JSON.toJSON(array).toString());
-                                }
-                            } else {
-                                queryInfoList = jdbcTemplate.query("select wbs_id,status from u_information_query where type = 1 and contract_id = " + contractId + " and classify = " + tableOwner, new BeanPropertyRowMapper<>(WbsTreeContractLazyQueryInfoVO.class));
-                                if (queryInfoList.size() > 0) {
-                                    JSONArray array = JSONArray.parseArray(JSON.toJSONString(queryInfoList));
-                                    redisTemplate.opsForValue().set("blade-manager::contract:wbstree:byInformationQuery:" + contractId + "_" + tableOwner, JSON.toJSON(array).toString());
-                                }
-                            }
-                        }*/
+
                         Map<Long, Integer> queryInfoMaps = queryInfoList.stream().filter(f -> ObjectUtil.isNotEmpty(f.getWbsId()))
                                 .collect(Collectors.toMap(WbsTreeContractLazyQueryInfoVO::getWbsId, WbsTreeContractLazyQueryInfoVO::getStatus, (existingValue, newValue) -> existingValue));
                         List<Long> pKeyIdList = new ArrayList<>(queryInfoMaps.keySet());
 
-                        //TODO 处理数量
+                        /*处理数量*/
                         //填报过的所有最底层节点
                         List<WbsTreeContractLazyVO> lowestNodesTB = distinctLowestNodesAll.parallelStream().filter(f -> pKeyIdList.contains(f.getPKeyId())).collect(Collectors.toList());
                         List<Long> lowestNodeParentIdsTB = lowestNodesTB.parallelStream().map(WbsTreeContractLazyVO::getParentId).collect(Collectors.toList());
@@ -811,7 +780,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
 
                         long startTime3 = System.currentTimeMillis();
 
-                        //TODO 处理颜色
+                        /*处理颜色*/
                         //先将WbsTreeContractLazyVO转为NodeVO
                         List<NodeVO> nodeVOList = distinctNodesAll.stream().map(this::convertToNodeVO).collect(Collectors.toList());
                         //转为Map<Long, NodeVO>
@@ -829,7 +798,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                         long executionTime3 = endTime3 - startTime3;
                         logger.info("处理颜色执行时间:" + executionTime3 + " ms");
 
-                        //TODO 处理最终结果集
+                        /*处理最终结果集*/
                         if (lazyNodes.size() > 0) {
                             //处理填报数量
                             Map<Long, Integer> countMap = new HashMap<>();
@@ -857,6 +826,11 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                                 lazyNodeVO.setSubmitCounts(ObjectUtil.isNotEmpty(countMap.get(lazyNodeVO.getPKeyId())) ? countMap.get(lazyNodeVO.getPKeyId()) : (ObjectUtil.isNotEmpty(queryInfoMaps.get(lazyNodeVO.getPKeyId())) ? 1 : 0));
 
                                 //设置颜色
+                                if (lazyNodeVO.getSubmitCounts().equals(0)) {
+                                    lazyNodeVO.setColorStatus(1);
+                                    continue;
+                                }
+
                                 Integer parentColorStatus = nodeColorStatusMap.get(lazyNodeVO.getPKeyId());
                                 if (parentColorStatus != null) {
                                     lazyNodeVO.setColorStatus(parentColorStatus);
@@ -871,7 +845,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                         return lazyNodes;
                     }
 
-                    //TODO ************ 监理、业主合同段 ************
+                    /*监理、业主合同段*/
                 } else if (new Integer("2").equals(contractInfo.getContractType()) || new Integer("3").equals(contractInfo.getContractType())) {
                     List<WbsTreeContractLazyVO> lazyNodesAll = new ArrayList<>();
                     List<String> contractIds = new ArrayList<>();
@@ -888,128 +862,49 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                     for (String sgContractId : contractIds) {
                         ContractInfo sgContractInfo = jdbcTemplate.query("select contract_name from m_contract_info where id = " + sgContractId, new BeanPropertyRowMapper<>(ContractInfo.class)).stream().findAny().orElse(null);
                         if (sgContractInfo != null) {
-                            /*获取本地缓存*/
-                            List<WbsTreeContractLazyVO> nodesAll = localCacheNodes.get(sgContractId);
+                            List<WbsTreeContractLazyVO> nodesAll = this.getNodeAll(sgContractId);
 
-                            if (nodesAll == null || nodesAll.size() == 0) {
-
-                                //获取当前合同段所有缓存节点信息
-                                Object data = redisTemplate.opsForValue().get("blade-manager::contract:wbstree:" + sgContractId);
-                                if (data != null) {
-                                    //从Redis获取数据
-                                    nodesAll = JSON.parseArray(data.toString(), WbsTreeContractLazyVO.class);
-                                    /*更新本地缓存*/
-                                    localCacheNodes.put(sgContractId, nodesAll);
-
-                                } else {
-                                    nodesAll = jdbcTemplate.query("select a.p_key_id,a.id,a.parent_id from m_wbs_tree_contract a where a.type = 1 and a.status = 1 and a.is_deleted = 0 and a.contract_id = " + sgContractId, new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
-                                    if (nodesAll.size() > 0) {
-                                        //判断是否有子级,赋值
-                                        Map<Long, List<WbsTreeContractLazyVO>> groupedByParentId = nodesAll.stream().collect(Collectors.groupingBy(WbsTreeContractLazyVO::getParentId));
-                                        for (WbsTreeContractLazyVO vo : nodesAll) {
-                                            if (vo.getParentId() == 0) {
-                                                vo.setHasChildren(1);
-                                            }
-                                            List<WbsTreeContractLazyVO> childNodes = groupedByParentId.getOrDefault(vo.getId(), null);
-                                            if (childNodes != null && childNodes.size() > 0) {
-                                                vo.setHasChildren(1);
-                                            } else {
-                                                vo.setHasChildren(0);
-                                            }
-                                        }
-                                        /*更新本地缓存*/
-                                        localCacheNodes.put(sgContractId, nodesAll);
-
-                                        JSONArray array = JSONArray.parseArray(JSON.toJSONString(nodesAll));
-                                        redisTemplate.opsForValue().set("blade-manager::contract:wbstree:" + sgContractId, JSON.toJSON(array).toString());
-                                    }
-                                }
-                            }
-
-                            //获取当前层懒加载节点
                             List<WbsTreeContractLazyVO> lazyNodes = jdbcTemplate.query("select p_key_id,contract_id,(SELECT id FROM u_contract_tree_drawings where process_id = p_key_id) AS drawingsId,id,parent_id,node_type,type,wbs_type,major_data_type,partition_code,old_id,contract_id_relation,is_concealed_works_node,CASE (SELECT count(1) FROM u_tree_contract_first AS tcf WHERE tcf.is_deleted = 0 AND tcf.wbs_node_id = a.p_key_id) WHEN 0 THEN 'false' ELSE 'true' END AS isFirst,IFNULL(if(length(trim(full_name))>0,full_name,node_name),node_name) AS title,(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id AND  b.type = 1 and b.status = 1 AND b.contract_id = " + sgContractId + " AND b.is_deleted = 0 ) AS hasChildren from m_wbs_tree_contract a where a.node_type != 111 and a.type = 1 and a.status = 1 and a.is_deleted = 0 and parent_id = " + (StringUtils.isNotEmpty(id) ? id : 0) + " and contract_id = " + sgContractId + " ORDER BY a.sort,title,a.create_time", new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
                             if (lazyNodes.size() > 0 && nodesAll.size() > 0) {
-                                //所有节点
                                 List<WbsTreeContractLazyVO> distinctNodesAll = nodesAll.stream()
                                         .collect(Collectors.collectingAndThen(
                                                 Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreeContractLazyVO::getPKeyId))),
                                                 ArrayList::new
                                         ));
-
-                                //所有最底层节点
                                 List<WbsTreeContractLazyVO> distinctLowestNodesAll = distinctNodesAll.stream().filter(f -> f.getHasChildren().equals(0)).collect(Collectors.collectingAndThen(
                                         Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreeContractLazyVO::getPKeyId))),
                                         ArrayList::new
                                 ));
 
-                                //获取当前合同段所有填报资料缓存信息
                                 List<WbsTreeContractLazyQueryInfoVO> queryInfoList = this.getQueryInfoList(sgContractId, tableOwner);
-                                /*List<WbsTreeContractLazyQueryInfoVO> queryInfoList;
-                                Object dataInformationQuery;
-                                if (ObjectUtil.isEmpty(tableOwner)) {
-                                    dataInformationQuery = redisTemplate.opsForValue().get("blade-manager::contract:wbstree:byInformationQuery:" + sgContractId + "_1");
-                                } else {
-                                    dataInformationQuery = redisTemplate.opsForValue().get("blade-manager::contract:wbstree:byInformationQuery:" + sgContractId + "_" + tableOwner);
-                                }
-                                if (dataInformationQuery != null) {
-                                    queryInfoList = JSON.parseArray(dataInformationQuery.toString(), WbsTreeContractLazyQueryInfoVO.class);
-                                } else {
-                                    if (ObjectUtil.isEmpty(tableOwner)) {
-                                        queryInfoList = jdbcTemplate.query("select wbs_id,status from u_information_query where type = 1 and contract_id = " + sgContractId + " and classify = 1", new BeanPropertyRowMapper<>(WbsTreeContractLazyQueryInfoVO.class));
-                                        if (queryInfoList.size() > 0) {
-                                            JSONArray array = JSONArray.parseArray(JSON.toJSONString(queryInfoList));
-                                            redisTemplate.opsForValue().set("blade-manager::contract:wbstree:byInformationQuery:" + sgContractId + "_1", JSON.toJSON(array).toString());
-                                        }
-                                    } else {
-                                        queryInfoList = jdbcTemplate.query("select wbs_id,status from u_information_query where type = 1 and contract_id = " + sgContractId + " and classify = " + tableOwner, new BeanPropertyRowMapper<>(WbsTreeContractLazyQueryInfoVO.class));
-                                        if (queryInfoList.size() > 0) {
-                                            JSONArray array = JSONArray.parseArray(JSON.toJSONString(queryInfoList));
-                                            redisTemplate.opsForValue().set("blade-manager::contract:wbstree:byInformationQuery:" + sgContractId + "_" + tableOwner, JSON.toJSON(array).toString());
-                                        }
-                                    }
-                                }*/
+
                                 Map<Long, Integer> queryInfoMaps = queryInfoList.stream().filter(f -> ObjectUtil.isNotEmpty(f.getWbsId()))
                                         .collect(Collectors.toMap(WbsTreeContractLazyQueryInfoVO::getWbsId, WbsTreeContractLazyQueryInfoVO::getStatus, (existingValue, newValue) -> existingValue));
                                 List<Long> pKeyIdList = new ArrayList<>(queryInfoMaps.keySet());
 
-                                //TODO 处理数量
-                                //填报过的所有最底层节点
                                 List<WbsTreeContractLazyVO> lowestNodesTB = distinctLowestNodesAll.parallelStream().filter(f -> pKeyIdList.contains(f.getPKeyId())).collect(Collectors.toList());
                                 List<Long> lowestNodeParentIdsTB = lowestNodesTB.parallelStream().map(WbsTreeContractLazyVO::getParentId).collect(Collectors.toList());
                                 List<WbsTreeContractLazyVO> resultParentNodesTB = new ArrayList<>();
                                 this.recursiveGetParentNodes(resultParentNodesTB, lowestNodeParentIdsTB, nodesAll);
 
-                                //最底层节点颜色构造后Map
                                 Map<Long, WbsTreeContractLazyVO> lowestNodesMap = lowestNodesTB.stream()
                                         .peek(vo -> {
                                             Integer colorStatus = queryInfoMaps.get(vo.getPKeyId());
                                             if (colorStatus != null) {
-                                                //任务状态0=未上报=颜色2蓝色、任务状态1=待审批=颜色3橙色、任务状态2=已审批=颜色4绿色
-                                                ///*任务状态3=已废除=颜色1黑色*/(2023年10月16日13:59:00 已废除改为=颜色2蓝色)
                                                 vo.setColorStatus(colorStatus == 0 ? 2 : (colorStatus == 1 ? 3 : (colorStatus == 2 ? 4 : 2)));
                                             } else {
-                                                //未填报的=颜色1黑色
                                                 vo.setColorStatus(1);
                                             }
                                         }).collect(Collectors.toMap(WbsTreeContractLazyVO::getPKeyId, Function.identity()));
 
-                                //TODO 处理颜色
-                                //先将WbsTreeContractLazyVO转为NodeVO
                                 List<NodeVO> nodeVOList = distinctNodesAll.stream().map(this::convertToNodeVO).collect(Collectors.toList());
-                                //转为Map<Long, NodeVO>
                                 Map<Long, NodeVO> nodeVOMap = nodeVOList.stream().collect(Collectors.toMap(NodeVO::getId, vo -> vo, (existing, replacement) -> existing));
-                                //把distinctNodesAll把所有节点转为树形结构,再转为List<NodeVO>对象
                                 List<NodeVO> treeNodeVOList = this.buildNodeTreeByStream(distinctNodesAll, lowestNodesMap);
-                                //处理节点颜色
                                 NodeVO.calculateStatusToDFS(treeNodeVOList, nodeVOMap);
-                                //把树形结构转为普通List集合
                                 List<NodeVO> nodeVOS = this.flattenTree(treeNodeVOList);
-                                //获取所有节点颜色Map
                                 Map<Long, Integer> nodeColorStatusMap = nodeVOS.stream().collect(Collectors.toMap(NodeVO::getPKeyId, NodeVO::getStatus, (existing, replacement) -> existing));
 
-                                //TODO 处理最终结果集
                                 if (lazyNodes.size() > 0) {
-                                    //处理填报数量
                                     Map<Long, Integer> countMap = new HashMap<>();
                                     for (WbsTreeContractLazyVO node : resultParentNodesTB) {
                                         Long key = node.getPKeyId();
@@ -1020,9 +915,8 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                                         }
                                     }
 
-                                    //返回最终结果集
                                     for (WbsTreeContractLazyVO lazyNodeVO : lazyNodes) {
-                                        lazyNodeVO.setType(lazyNodeVO.getNodeType()); //前端显示需要一样的,所以修改成一样的
+                                        lazyNodeVO.setType(lazyNodeVO.getNodeType());
                                         lazyNodeVO.setNotExsitChild(!lazyNodeVO.getHasChildren().equals(1));
                                         lazyNodeVO.setPrimaryKeyId(lazyNodeVO.getPKeyId());
                                         lazyNodeVO.setContractIdRelation(sgContractId);
@@ -1032,10 +926,12 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                                             }
                                         }
 
-                                        //设置数量
                                         lazyNodeVO.setSubmitCounts(ObjectUtil.isNotEmpty(countMap.get(lazyNodeVO.getPKeyId())) ? countMap.get(lazyNodeVO.getPKeyId()) : (ObjectUtil.isNotEmpty(queryInfoMaps.get(lazyNodeVO.getPKeyId())) ? 1 : 0));
+                                        if (lazyNodeVO.getSubmitCounts().equals(0)) {
+                                            lazyNodeVO.setColorStatus(1);
+                                            continue;
+                                        }
 
-                                        //设置颜色
                                         Integer parentColorStatus = nodeColorStatusMap.get(lazyNodeVO.getPKeyId());
                                         if (parentColorStatus != null) {
                                             lazyNodeVO.setColorStatus(parentColorStatus);
@@ -1058,54 +954,91 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
         return null;
     }
 
-    //构建资料查询缓存的key
-    private String buildCacheKey(String contractId, String tableOwner) {
-        if (StringUtils.isNotEmpty(tableOwner)) {
-            return contractId + "_" + tableOwner;
-        } else {
-            return contractId + "_1";
+    //获取当前合同段所有节点缓存
+    public List<WbsTreeContractLazyVO> getNodeAll(String contractId) {
+        /*获取本地缓存*/
+        List<WbsTreeContractLazyVO> nodesAll = localCacheNodes.get(contractId);
+
+        if (nodesAll == null || nodesAll.size() == 0) {
+
+            //获取当前合同段所有缓存节点信息
+            Object data = redisTemplate.opsForValue().get("blade-manager::contract:wbstree:" + contractId);
+            if (data != null) {
+                //从Redis获取数据
+                nodesAll = JSON.parseArray(data.toString(), WbsTreeContractLazyVO.class);
+                /*更新本地缓存*/
+                localCacheNodes.put(contractId, nodesAll);
+
+            } else {
+
+                long startTime1 = System.currentTimeMillis();
+
+                nodesAll = jdbcTemplate.query("select a.p_key_id,a.id,a.parent_id from m_wbs_tree_contract a where a.type = 1 and a.status = 1 and a.is_deleted = 0 and a.contract_id = " + contractId, new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
+
+                long endTime1 = System.currentTimeMillis();
+                long executionTime1 = endTime1 - startTime1;
+                logger.info("查询合同段" + contractId + "所有树执行时间:" + executionTime1 + " ms");
+
+                if (nodesAll.size() > 0) {
+                    //判断是否有子级,赋值
+                    Map<Long, List<WbsTreeContractLazyVO>> groupedByParentId = nodesAll.stream().collect(Collectors.groupingBy(WbsTreeContractLazyVO::getParentId));
+                    for (WbsTreeContractLazyVO vo : nodesAll) {
+                        if (vo.getParentId() == 0) {
+                            vo.setHasChildren(1);
+                        }
+                        List<WbsTreeContractLazyVO> childNodes = groupedByParentId.getOrDefault(vo.getId(), null);
+                        if (childNodes != null && childNodes.size() > 0) {
+                            vo.setHasChildren(1);
+                        } else {
+                            vo.setHasChildren(0);
+                        }
+                    }
+                    /*更新本地缓存*/
+                    localCacheNodes.put(contractId, nodesAll);
+
+                    JSONArray array = JSONArray.parseArray(JSON.toJSONString(nodesAll));
+                    redisTemplate.opsForValue().set("blade-manager::contract:wbstree:" + contractId, JSON.toJSON(array).toString());
+                }
+            }
         }
+        return nodesAll;
     }
 
     //获取当前合同段所有填报资料缓存信息
     public List<WbsTreeContractLazyQueryInfoVO> getQueryInfoList(String contractId, String tableOwner) {
         //从本地缓存获取
-        String cacheKey = buildCacheKey(contractId, tableOwner);
+        String cacheKey = contractId + "_" + tableOwner;
         List<WbsTreeContractLazyQueryInfoVO> cachedQueryInfoList = localCacheQueryInfos.get(cacheKey);
 
         if (cachedQueryInfoList != null && !cachedQueryInfoList.isEmpty()) {
             return cachedQueryInfoList;
         }
 
-        //根据需要更新localCacheQueryInfos
-        Object dataInformationQuery;
-        if (ObjectUtil.isEmpty(tableOwner)) {
-            dataInformationQuery = redisTemplate.opsForValue().get("blade-manager::contract:wbstree:byInformationQuery:" + contractId + "_1");
-        } else {
-            dataInformationQuery = redisTemplate.opsForValue().get("blade-manager::contract:wbstree:byInformationQuery:" + contractId + "_" + tableOwner);
-        }
+        //获取redis缓存
+        Object dataInformationQuery = redisTemplate.opsForValue().get("blade-manager::contract:wbstree:byInformationQuery:" + cacheKey);
+
         List<WbsTreeContractLazyQueryInfoVO> queryInfoList;
         if (dataInformationQuery != null) {
             //返回redis数据
             queryInfoList = JSON.parseArray(dataInformationQuery.toString(), WbsTreeContractLazyQueryInfoVO.class);
-            localCacheQueryInfos.put(cacheKey, queryInfoList); //更新本地缓存
+
+            //更新本地缓存
+            localCacheQueryInfos.put(cacheKey, queryInfoList);
 
         } else {
             //返回数据库数据
-            String querySql = ObjectUtil.isEmpty(tableOwner) ?
-                    "select wbs_id,status from u_information_query where type = 1 and contract_id = " + contractId + " and classify =1" :
-                    "select wbs_id,status from u_information_query where type = 1 and contract_id = " + contractId + " and classify = " + tableOwner;
+            String querySql = "select wbs_id,status from u_information_query where type = 1 and contract_id = " + contractId + " and classify = " + tableOwner;
 
             queryInfoList = jdbcTemplate.query(querySql, new BeanPropertyRowMapper<>(WbsTreeContractLazyQueryInfoVO.class));
 
             if (!queryInfoList.isEmpty()) {
                 JSONArray array = JSONArray.parseArray(JSON.toJSONString(queryInfoList));
-                if (ObjectUtil.isEmpty(tableOwner)) {
-                    redisTemplate.opsForValue().set("blade-manager::contract:wbstree:byInformationQuery:" + contractId + "_1", JSON.toJSON(array).toString());
-                } else {
-                    redisTemplate.opsForValue().set("blade-manager::contract:wbstree:byInformationQuery:" + contractId + "_" + tableOwner, JSON.toJSON(array).toString());
-                }
-                localCacheQueryInfos.put(cacheKey, queryInfoList); //更新本地缓存
+
+                //存储redis
+                redisTemplate.opsForValue().set("blade-manager::contract:wbstree:byInformationQuery:" + cacheKey, JSON.toJSON(array).toString());
+
+                //更新本地缓存
+                localCacheQueryInfos.put(cacheKey, queryInfoList);
             }
         }
 
@@ -1118,9 +1051,8 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
         if (ObjectUtil.isNotEmpty(contractId)) {
             ContractInfo contractInfo = jdbcTemplate.query("select contract_name,contract_type from m_contract_info where id = " + contractId, new BeanPropertyRowMapper<>(ContractInfo.class)).stream().findAny().orElse(null);
             if (contractInfo != null) {
-                //TODO 施工合同段
+                /*质检施工合同段*/
                 if (new Integer(1).equals(contractInfo.getContractType())) {
-                    //获取当前合同段所有缓存节点信息
                     List<WbsTreeContractLazyVO> nodesAll;
                     Object data = redisTemplate.opsForValue().get("blade-manager::contract:wbstree:" + contractId);
                     if (data != null) {
@@ -1128,7 +1060,6 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                     } else {
                         nodesAll = jdbcTemplate.query("select a.p_key_id,a.id,a.parent_id from m_wbs_tree_contract a where a.type = 1 and a.status = 1 and a.is_deleted = 0 and a.contract_id = " + contractId, new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
                         if (nodesAll.size() > 0) {
-                            //判断是否有子级,赋值
                             Map<Long, List<WbsTreeContractLazyVO>> groupedByParentId = nodesAll.stream().collect(Collectors.groupingBy(WbsTreeContractLazyVO::getParentId));
                             for (WbsTreeContractLazyVO vo : nodesAll) {
                                 if (vo.getParentId() == 0) {
@@ -1145,24 +1076,21 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                             redisTemplate.opsForValue().set("blade-manager::contract:wbstree:" + contractId, JSON.toJSON(array).toString());
                         }
                     }
-                    //获取当前层懒加载节点
                     List<WbsTreeContractLazyVO> lazyNodes = jdbcTemplate.query("select p_key_id,(SELECT id FROM u_contract_tree_drawings where process_id = p_key_id) AS drawingsId,id,parent_id,node_type,type,wbs_type,is_concrete,major_data_type,partition_code,old_id,contract_id_relation,is_concealed_works_node,CASE (SELECT count(1) FROM u_tree_contract_first AS tcf WHERE tcf.is_deleted = 0 AND tcf.wbs_node_id = a.p_key_id) WHEN 0 THEN 'false' ELSE 'true' END AS isFirst,IFNULL(if(length(trim(full_name))>0,full_name,node_name),node_name) AS title,(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id AND b.type = 1 and b.status = 1 AND b.contract_id = " + contractId + " AND b.is_deleted = 0 ) AS hasChildren from m_wbs_tree_contract a where a.node_type != 111 and a.type = 1 and a.status = 1 and a.is_deleted = 0 and parent_id = " + (StringUtils.isNotEmpty(id) ? id : 0) + " and contract_id = " + contractId + " ORDER BY a.sort,title,a.create_time", new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
                     if (lazyNodes.size() > 0 && nodesAll.size() > 0) {
-                        //所有节点
                         List<WbsTreeContractLazyVO> distinctNodesAll = nodesAll.stream()
                                 .collect(Collectors.collectingAndThen(
                                         Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreeContractLazyVO::getPKeyId))),
                                         ArrayList::new
                                 ));
 
-                        //所有最底层节点
                         List<WbsTreeContractLazyVO> distinctLowestNodesAll = distinctNodesAll.stream().filter(f -> f.getHasChildren().equals(0)).collect(Collectors.collectingAndThen(
                                 Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreeContractLazyVO::getPKeyId))),
                                 ArrayList::new
                         ));
-                        //获取当前合同段所有影像文件信息
+
                         List<WbsTreeContractLazyFileVO> queryFileList = jdbcTemplate.query("select wbs_id,id from u_image_classification_file where status = 1 and is_deleted = 0 and contract_id = " + contractId + " and classify_id = " + classId, new BeanPropertyRowMapper<>(WbsTreeContractLazyFileVO.class));
-                        //最底层节点与存储文件数量map
+
                         Map<Long, Integer> queryFileMaps = queryFileList.stream()
                                 .filter(f -> ObjectUtil.isNotEmpty(f.getWbsId()))
                                 .collect(Collectors.groupingBy(
@@ -1189,7 +1117,6 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                         List<WbsTreeContractLazyVO> resultParentNodesTB = new ArrayList<>();
                         this.recursiveGetParentNodes(resultParentNodesTB, lowestNodeParentIdsTB, nodesAll);
 
-                        //处理最终结果集
                         if (lazyNodes.size() > 0) {
                             Map<Long, Integer> countMap = new HashMap<>();
                             for (WbsTreeContractLazyVO node : resultParentNodesTB) {
@@ -1201,7 +1128,6 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                                 }
                             }
 
-                            //返回最终结果集
                             for (WbsTreeContractLazyVO lazyNodeVO : lazyNodes) {
                                 lazyNodeVO.setType(lazyNodeVO.getNodeType());
                                 lazyNodeVO.setNotExsitChild(!lazyNodeVO.getHasChildren().equals(1));
@@ -1211,14 +1137,13 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                                         lazyNodeVO.setTitle(contractInfo.getContractName());
                                     }
                                 }
-                                //设置数量
                                 lazyNodeVO.setSubmitCounts(ObjectUtil.isNotEmpty(countMap.get(lazyNodeVO.getPKeyId())) ? countMap.get(lazyNodeVO.getPKeyId()) : (ObjectUtil.isNotEmpty(queryFileMaps.get(lazyNodeVO.getPKeyId())) ? queryFileMaps.get(lazyNodeVO.getPKeyId()) : 0));
                             }
                         }
                         return lazyNodes;
                     }
 
-                    //TODO 监理、业主合同段
+                    /*监理、业主合同段*/
                 } else if (new Integer("2").equals(contractInfo.getContractType()) || new Integer("3").equals(contractInfo.getContractType())) {
                     List<WbsTreeContractLazyVO> lazyNodesAll = new ArrayList<>();
                     List<String> contractIds = new ArrayList<>();
@@ -1235,7 +1160,6 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                     for (String sgContractId : contractIds) {
                         ContractInfo sgContractInfo = jdbcTemplate.query("select contract_name from m_contract_info where id = " + sgContractId, new BeanPropertyRowMapper<>(ContractInfo.class)).stream().findAny().orElse(null);
                         if (sgContractInfo != null) {
-                            //获取当前合同段所有缓存节点信息
                             List<WbsTreeContractLazyVO> nodesAll;
                             Object data = redisTemplate.opsForValue().get("blade-manager::contract:wbstree:" + sgContractId);
                             if (data != null) {
@@ -1243,7 +1167,6 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                             } else {
                                 nodesAll = jdbcTemplate.query("select a.p_key_id,a.id,a.parent_id from m_wbs_tree_contract a where a.type = 1 and a.status = 1 and a.is_deleted = 0 and a.contract_id = " + sgContractId, new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
                                 if (nodesAll.size() > 0) {
-                                    //判断是否有子级,赋值
                                     Map<Long, List<WbsTreeContractLazyVO>> groupedByParentId = nodesAll.stream().collect(Collectors.groupingBy(WbsTreeContractLazyVO::getParentId));
                                     for (WbsTreeContractLazyVO vo : nodesAll) {
                                         if (vo.getParentId() == 0) {
@@ -1261,17 +1184,13 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                                 }
                             }
 
-                            //获取当前层懒加载节点
                             List<WbsTreeContractLazyVO> lazyNodes = jdbcTemplate.query("select p_key_id,(SELECT id FROM u_contract_tree_drawings where process_id = p_key_id) AS drawingsId,id,parent_id,node_type,type,wbs_type,major_data_type,partition_code,old_id,contract_id_relation,is_concealed_works_node,CASE (SELECT count(1) FROM u_tree_contract_first AS tcf WHERE tcf.is_deleted = 0 AND tcf.wbs_node_id = a.p_key_id) WHEN 0 THEN 'false' ELSE 'true' END AS isFirst,IFNULL(if(length(trim(full_name))>0,full_name,node_name),node_name) AS title,(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id AND  b.type = 1 and b.status = 1 AND b.contract_id = " + sgContractId + " AND b.is_deleted = 0 ) AS hasChildren from m_wbs_tree_contract a where a.node_type != 111 and a.type = 1 and a.status = 1 and a.is_deleted = 0 and parent_id = " + (StringUtils.isNotEmpty(id) ? id : 0) + " and contract_id = " + sgContractId + " ORDER BY a.sort,title,a.create_time", new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
                             if (lazyNodes.size() > 0 && nodesAll.size() > 0) {
-                                //所有节点
                                 List<WbsTreeContractLazyVO> distinctNodesAll = nodesAll.stream()
                                         .collect(Collectors.collectingAndThen(
                                                 Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreeContractLazyVO::getPKeyId))),
                                                 ArrayList::new
                                         ));
-
-                                //所有最底层节点
                                 List<WbsTreeContractLazyVO> distinctLowestNodesAll = distinctNodesAll.stream().filter(f -> f.getHasChildren().equals(0)).collect(Collectors.collectingAndThen(
                                         Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(WbsTreeContractLazyVO::getPKeyId))),
                                         ArrayList::new
@@ -1279,7 +1198,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
 
                                 //获取当前合同段所有影像文件信息(只查看监理自己的,资料填报是查看的施工合同段的,这里有区别)
                                 List<WbsTreeContractLazyFileVO> queryFileList = jdbcTemplate.query("select wbs_id,id from u_image_classification_file where status = 1 and contract_id = " + contractId + " and classify_id = " + classId, new BeanPropertyRowMapper<>(WbsTreeContractLazyFileVO.class));
-                                //最底层节点与存储文件数量map
+
                                 Map<Long, Integer> queryFileMaps = queryFileList.stream()
                                         .filter(f -> ObjectUtil.isNotEmpty(f.getWbsId()))
                                         .collect(Collectors.groupingBy(
@@ -1304,7 +1223,6 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                                 List<WbsTreeContractLazyVO> resultParentNodesTB = new ArrayList<>();
                                 this.recursiveGetParentNodes(resultParentNodesTB, lowestNodeParentIdsTB, nodesAll);
 
-                                //处理最终结果集
                                 if (lazyNodes.size() > 0) {
                                     Map<Long, Integer> countMap = new HashMap<>();
                                     for (WbsTreeContractLazyVO node : resultParentNodesTB) {
@@ -1316,9 +1234,8 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                                         }
                                     }
 
-                                    //返回最终结果集
                                     for (WbsTreeContractLazyVO lazyNodeVO : lazyNodes) {
-                                        lazyNodeVO.setType(lazyNodeVO.getNodeType()); //前端显示需要一样的,所以修改成一样的
+                                        lazyNodeVO.setType(lazyNodeVO.getNodeType());
                                         lazyNodeVO.setNotExsitChild(!lazyNodeVO.getHasChildren().equals(1));
                                         lazyNodeVO.setPrimaryKeyId(lazyNodeVO.getPKeyId());
                                         lazyNodeVO.setContractIdRelation(sgContractId);
@@ -1327,7 +1244,6 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                                                 lazyNodeVO.setTitle(sgContractInfo.getContractName());
                                             }
                                         }
-                                        //设置数量
                                         lazyNodeVO.setSubmitCounts(ObjectUtil.isNotEmpty(countMap.get(lazyNodeVO.getPKeyId())) ? countMap.get(lazyNodeVO.getPKeyId()) : (ObjectUtil.isNotEmpty(queryFileMaps.get(lazyNodeVO.getPKeyId())) ? queryFileMaps.get(lazyNodeVO.getPKeyId()) : 0));
                                     }
                                 }
@@ -1365,7 +1281,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
     @Override
     public List<AppWbsTreeContractVO> searchNodeAllTableAndFile(String primaryKeyId, String type, String
             contractId, String projectId) {
-        List<AppWbsTreeContractVO> vos = this.searchNodeAllTable(primaryKeyId, type, contractId, projectId);
+        List<AppWbsTreeContractVO> vos = this.searchNodeAllTable(primaryKeyId, type, contractId, projectId, null);
         if (vos != null && vos.size() > 0) {
             List<Long> list = vos.stream().map(AppWbsTreeContractVO::getPKeyId).collect(Collectors.toList());
             List<TableFile> files = tableFileService.getAllFileByIds(list);