|
@@ -36,10 +36,9 @@ import org.springblade.core.tool.jackson.JsonUtil;
|
|
|
import org.springblade.core.tool.support.Kv;
|
|
|
import org.springblade.core.tool.utils.*;
|
|
|
import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
|
|
|
-import org.springblade.manager.entity.ContractInfo;
|
|
|
-import org.springblade.manager.entity.ContractRelationJlyz;
|
|
|
-import org.springblade.manager.entity.WbsTreeContract;
|
|
|
+import org.springblade.manager.entity.*;
|
|
|
import org.springblade.manager.feign.ContractClient;
|
|
|
+import org.springblade.manager.vo.PrivateTreeVO;
|
|
|
import org.springblade.manager.vo.WbsTreeContractLazyQueryInfoVO;
|
|
|
import org.springblade.manager.vo.WbsTreeContractLazyVO;
|
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
@@ -1067,6 +1066,35 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<PrivateTreeVO> treePrivate(String projectId) {
|
|
|
+ String sql = "SELECT id,p_key_id,parent_id,node_name FROM m_wbs_tree_private WHERE project_id = ? AND wbs_type = 1 AND type = 1 AND status = 1 AND is_deleted = 0";
|
|
|
+ List<WbsTreePrivate> wbsTreePrivatesNodes = jdbcTemplate.query(sql, new Object[]{projectId}, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
|
|
|
+ return buildTree(wbsTreePrivatesNodes);
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<PrivateTreeVO> buildTree(List<WbsTreePrivate> wbsTreePrivatesNodes) {
|
|
|
+ List<PrivateTreeVO> privateTreeVOS = BeanUtil.copyProperties(wbsTreePrivatesNodes, PrivateTreeVO.class);
|
|
|
+ if (!privateTreeVOS.isEmpty()) {
|
|
|
+ Map<Long, List<PrivateTreeVO>> map = privateTreeVOS.stream().collect(Collectors.groupingBy(PrivateTreeVO::getParentId));
|
|
|
+ List<PrivateTreeVO> list = privateTreeVOS.stream().filter(f -> f.getParentId() == 0L).collect(Collectors.toList());
|
|
|
+ buildChildNodes(list, map);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void buildChildNodes(List<PrivateTreeVO> list, Map<Long, List<PrivateTreeVO>> map) {
|
|
|
+ for (PrivateTreeVO privateTreeVO : list) {
|
|
|
+ List<PrivateTreeVO> childrenList = map.getOrDefault(privateTreeVO.getId(), null);
|
|
|
+ if (childrenList != null && childrenList.size() > 0) {
|
|
|
+ privateTreeVO.setChildren(childrenList);
|
|
|
+ privateTreeVO.setNotExsitChild(false);
|
|
|
+ buildChildNodes(childrenList, map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取当前合同段所有节点缓存
|
|
|
*
|
|
@@ -1192,8 +1220,8 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
* @param nodesAll
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<WbsTreeContractLazyVO> getCachedParentCountNodes(String
|
|
|
- contractId, List<Long> lowestNodeParentIdsTB, List<WbsTreeContractLazyVO> nodesAll, String tableOwner) {
|
|
|
+ public List<WbsTreeContractLazyVO> getCachedParentCountNodes(String contractId, List<Long> lowestNodeParentIdsTB,
|
|
|
+ List<WbsTreeContractLazyVO> nodesAll, String tableOwner) {
|
|
|
//从本地缓存获取数据
|
|
|
String cacheKey = contractId + "_" + tableOwner;
|
|
|
List<WbsTreeContractLazyVO> resultParentNodesTB = localCacheParentCountNodes.get(cacheKey);
|
|
@@ -1225,8 +1253,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
* @param lowestNodeParentIds 最底层节点ParentIds
|
|
|
* @param nodesAll 所有节点
|
|
|
*/
|
|
|
- public void recursiveGetParentNodes
|
|
|
- (List<WbsTreeContractLazyVO> result, List<Long> lowestNodeParentIds, List<WbsTreeContractLazyVO> nodesAll) {
|
|
|
+ public void recursiveGetParentNodes(List<WbsTreeContractLazyVO> result,
|
|
|
+ List<Long> lowestNodeParentIds,
|
|
|
+ List<WbsTreeContractLazyVO> nodesAll) {
|
|
|
if (lowestNodeParentIds.isEmpty()) {
|
|
|
return;
|
|
|
}
|