|
@@ -731,6 +731,27 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
WbsTreeContract needCopyNode = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getNeedCopyPrimaryKeyId());
|
|
|
|
|
|
//获取当前合同段所有节点
|
|
|
+ List<WbsTreeContract> allContractNodeList = this.wbsTreeContractClient.searchContractTree(needCopyNode.getContractId());
|
|
|
+
|
|
|
+ //设置父子节点关系
|
|
|
+ Map<String, List<WbsTreeContract>> contractAllNodeMap = new HashMap<>();
|
|
|
+ if(allContractNodeList != null && allContractNodeList.size() > 0){
|
|
|
+ allContractNodeList.forEach(contractTree -> {
|
|
|
+ List<WbsTreeContract> parentList;
|
|
|
+ if(contractAllNodeMap.containsKey(contractTree.getParentId().toString())){
|
|
|
+ parentList = contractAllNodeMap.get(contractTree.getParentId().toString());
|
|
|
+ } else {
|
|
|
+ parentList = new ArrayList<>();
|
|
|
+ }
|
|
|
+ parentList.add(contractTree);
|
|
|
+ contractAllNodeMap.put(contractTree.getParentId().toString(), parentList);
|
|
|
+
|
|
|
+ if(!contractAllNodeMap.containsKey(contractTree.getId().toString())){
|
|
|
+ contractAllNodeMap.put(contractTree.getId().toString(), new ArrayList<>());
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
List<WbsTreeContract> parentList = new ArrayList<>(), childList = new ArrayList<>(), allList = new ArrayList<>(), saveList = new ArrayList<>();
|
|
|
//新增施工台账
|
|
@@ -738,10 +759,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
parentList.add(needCopyNode);
|
|
|
|
|
|
-// this.wbsTreeContractClient.searchContractTree(needCopyNode.getContractId());
|
|
|
-
|
|
|
//查询所有有效子节点
|
|
|
- this.foreachQueryChildContract(parentList, childList);
|
|
|
+ this.foreachQueryChildContract(parentList, childList, contractAllNodeMap);
|
|
|
allList.addAll(parentList);
|
|
|
allList.addAll(childList);
|
|
|
|
|
@@ -956,26 +975,29 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
* @param parentList 父节点集合
|
|
|
* @param childList 保存集合
|
|
|
*/
|
|
|
- private void foreachQueryChildContract(List<WbsTreeContract> parentList, List<WbsTreeContract> childList){
|
|
|
+ private void foreachQueryChildContract(List<WbsTreeContract> parentList, List<WbsTreeContract> childList, Map<String, List<WbsTreeContract>> contractAllNodeMap){
|
|
|
parentList.forEach(parent -> {
|
|
|
- if(!new Integer("6").equals(parent.getDeptCategory())){
|
|
|
- //查询子节点
|
|
|
- List<WbsTreeContract> childs = this.wbsTreeContractClient.queryChildByParentId(parent, "notQueryTable", "");
|
|
|
- if(childs != null && childs.size() > 0){
|
|
|
- //添加入结果集
|
|
|
- childList.addAll(childs);
|
|
|
- //还有子级,继续向下
|
|
|
- this.foreachQueryChildContract(childs, childList);
|
|
|
- }
|
|
|
+ List<WbsTreeContract> childs;
|
|
|
+ if(contractAllNodeMap.containsKey(parent.getId().toString())){
|
|
|
+ childs = contractAllNodeMap.get(parent.getId().toString());
|
|
|
} else {
|
|
|
- //工序,则查询对应的表格数据
|
|
|
- List<WbsTreeContract> childs = this.wbsTreeContractClient.queryChildByParentId(parent, "queryTable", "");
|
|
|
- if(childs != null && childs.size() > 0){
|
|
|
- //添加入结果集
|
|
|
- childList.addAll(childs);
|
|
|
+ if(!Arrays.asList("1,2,3,4".split(",")).contains(parent.getMajorDataType().toString())){
|
|
|
+ childs = this.wbsTreeContractClient.queryChildByParentId(parent, "notQueryTable", "");
|
|
|
+ } else {
|
|
|
+ childs = this.wbsTreeContractClient.queryChildByParentId(parent, "queryTable", "");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if(childs != null && childs.size() > 0){
|
|
|
+ //添加入结果集
|
|
|
+ childList.addAll(childs);
|
|
|
+
|
|
|
+ //还有子级,继续向下
|
|
|
+ this.foreachQueryChildContract(childs, childList, contractAllNodeMap);
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1038,6 +1060,11 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
} else {
|
|
|
queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(parentId, 1, contractId);
|
|
|
}
|
|
|
+
|
|
|
+ //删除掉首件工程
|
|
|
+ result.removeIf(vos -> vos.getDeptCategory() != null && vos.getDeptCategory() == 111);
|
|
|
+
|
|
|
+
|
|
|
result.forEach(vos -> {
|
|
|
if(StringUtils.isEmpty(parentId) || "0".equals(parentId)){
|
|
|
vos.setTitle(contractInfo.getContractName());
|