|
@@ -730,11 +730,16 @@ public class InformationWriteQueryController extends BladeController {
|
|
//首先查询需要复制的节点及其下级所有子节点的信息
|
|
//首先查询需要复制的节点及其下级所有子节点的信息
|
|
WbsTreeContract needCopyNode = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getNeedCopyPrimaryKeyId());
|
|
WbsTreeContract needCopyNode = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getNeedCopyPrimaryKeyId());
|
|
|
|
|
|
|
|
+ //获取当前合同段所有节点
|
|
|
|
+
|
|
List<WbsTreeContract> parentList = new ArrayList<>(), childList = new ArrayList<>(), allList = new ArrayList<>(), saveList = new ArrayList<>();
|
|
List<WbsTreeContract> parentList = new ArrayList<>(), childList = new ArrayList<>(), allList = new ArrayList<>(), saveList = new ArrayList<>();
|
|
//新增施工台账
|
|
//新增施工台账
|
|
List<ConstructionLedger> saveLedger = new ArrayList<>();
|
|
List<ConstructionLedger> saveLedger = new ArrayList<>();
|
|
|
|
|
|
parentList.add(needCopyNode);
|
|
parentList.add(needCopyNode);
|
|
|
|
+
|
|
|
|
+// this.wbsTreeContractClient.searchContractTree(needCopyNode.getContractId());
|
|
|
|
+
|
|
//查询所有有效子节点
|
|
//查询所有有效子节点
|
|
this.foreachQueryChildContract(parentList, childList);
|
|
this.foreachQueryChildContract(parentList, childList);
|
|
allList.addAll(parentList);
|
|
allList.addAll(parentList);
|
|
@@ -906,7 +911,13 @@ public class InformationWriteQueryController extends BladeController {
|
|
if(contractNodeMap.containsKey(newData.getOldId())){
|
|
if(contractNodeMap.containsKey(newData.getOldId())){
|
|
WbsTreeContract contractNode = contractNodeMap.get(newData.getOldId());
|
|
WbsTreeContract contractNode = contractNodeMap.get(newData.getOldId());
|
|
if(contractNode.getParentId() != null && StringUtils.isNotEmpty(contractNode.getParentId().toString())){
|
|
if(contractNode.getParentId() != null && StringUtils.isNotEmpty(contractNode.getParentId().toString())){
|
|
- WbsTreeContract parentNode = this.wbsTreeContractClient.queryCurrentNodeAllParent(Long.parseLong(contractNode.getContractId()), contractNode.getParentId());
|
|
|
|
|
|
+ WbsTreeContract parentNode;
|
|
|
|
+ if(contractNodeMap.containsKey(contractNode.getParentId().toString())){
|
|
|
|
+ parentNode = contractNodeMap.get(contractNode.getParentId().toString());
|
|
|
|
+ } else {
|
|
|
|
+ parentNode = this.wbsTreeContractClient.queryCurrentNodeAllParent(Long.parseLong(contractNode.getContractId()), contractNode.getParentId());
|
|
|
|
+ }
|
|
|
|
+
|
|
if(parentNode != null){
|
|
if(parentNode != null){
|
|
ledger.setStation(StringUtils.isNotEmpty(parentNode.getFullName()) ? parentNode.getFullName() : parentNode.getDeptName());
|
|
ledger.setStation(StringUtils.isNotEmpty(parentNode.getFullName()) ? parentNode.getFullName() : parentNode.getDeptName());
|
|
}
|
|
}
|
|
@@ -916,8 +927,15 @@ public class InformationWriteQueryController extends BladeController {
|
|
if(projectNodeMap.containsKey(newData.getOldId())){
|
|
if(projectNodeMap.containsKey(newData.getOldId())){
|
|
WbsTreePrivate contractNode = projectNodeMap.get(newData.getOldId());
|
|
WbsTreePrivate contractNode = projectNodeMap.get(newData.getOldId());
|
|
if(contractNode.getParentId() != null && StringUtils.isNotEmpty(contractNode.getParentId().toString())){
|
|
if(contractNode.getParentId() != null && StringUtils.isNotEmpty(contractNode.getParentId().toString())){
|
|
- WbsTreePrivate parentNode = this.wbsTreePrivateClient.queryPeersNodeByProjectIdAndId(contractNode.getProjectId(), contractNode.getParentId());
|
|
|
|
- ledger.setStation(StringUtils.isNotEmpty(parentNode.getFullName()) ? parentNode.getFullName() : parentNode.getDeptName());
|
|
|
|
|
|
+ WbsTreePrivate parentNode;
|
|
|
|
+ if(projectNodeMap.containsKey(contractNode.getParentId().toString())){
|
|
|
|
+ parentNode = projectNodeMap.get(contractNode.getParentId().toString());
|
|
|
|
+ } else {
|
|
|
|
+ parentNode = this.wbsTreePrivateClient.queryPeersNodeByProjectIdAndId(contractNode.getProjectId(), contractNode.getParentId());
|
|
|
|
+ }
|
|
|
|
+ if(parentNode != null){
|
|
|
|
+ ledger.setStation(StringUtils.isNotEmpty(parentNode.getFullName()) ? parentNode.getFullName() : parentNode.getDeptName());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1271,9 +1289,15 @@ public class InformationWriteQueryController extends BladeController {
|
|
//查询数据
|
|
//查询数据
|
|
selectedNodeList = this.unifiedCode(allSelectedNodeList, treeContract);
|
|
selectedNodeList = this.unifiedCode(allSelectedNodeList, treeContract);
|
|
|
|
|
|
- //全选的集合则进一步向下查询
|
|
|
|
|
|
+ //检查当前操作的节点是否是填报节点,如果是则需要查询相关联表格
|
|
|
|
+ List<WbsTreePrivate> submitNodeList = selectedNodeList.stream().filter(treePrivate -> Arrays.asList("1,2,3,4".split(",")).contains(treePrivate.getMajorDataType().toString())).distinct().collect(Collectors.toList());
|
|
|
|
+
|
|
List<WbsTreePrivate> childList = new ArrayList<>();
|
|
List<WbsTreePrivate> childList = new ArrayList<>();
|
|
- this.foreachQueryChild(selectedNodeList, childList);
|
|
|
|
|
|
+ if(submitNodeList.size() > 0){
|
|
|
|
+ this.foreachQueryChild(submitNodeList, childList);
|
|
|
|
+ //将表格数据设置
|
|
|
|
+ selectedNodeList.addAll(childList);
|
|
|
|
+ }
|
|
|
|
|
|
if(childList.size() > 0){
|
|
if(childList.size() > 0){
|
|
//处理重复的数据
|
|
//处理重复的数据
|
|
@@ -1461,12 +1485,12 @@ public class InformationWriteQueryController extends BladeController {
|
|
*/
|
|
*/
|
|
private void foreachQueryChild(List<WbsTreePrivate> parentList, List<WbsTreePrivate> childList){
|
|
private void foreachQueryChild(List<WbsTreePrivate> parentList, List<WbsTreePrivate> childList){
|
|
parentList.forEach(parent -> {
|
|
parentList.forEach(parent -> {
|
|
- //查询子节点
|
|
|
|
List<WbsTreePrivate> childs = this.wbsTreePrivateClient.queryChildByParentId(parent);
|
|
List<WbsTreePrivate> childs = this.wbsTreePrivateClient.queryChildByParentId(parent);
|
|
|
|
+
|
|
if(childs != null && childs.size() > 0){
|
|
if(childs != null && childs.size() > 0){
|
|
//添加入结果集
|
|
//添加入结果集
|
|
childList.addAll(childs);
|
|
childList.addAll(childs);
|
|
- //还有子级,继续向下
|
|
|
|
|
|
+ //继续向下检查子集
|
|
this.foreachQueryChild(childs, childList);
|
|
this.foreachQueryChild(childs, childList);
|
|
}
|
|
}
|
|
});
|
|
});
|