|
@@ -1002,18 +1002,23 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
|
|
|
|
|
|
for (ArchiveTreeVO2 src : srcChilds) {
|
|
|
if (dstMap.get(src.getId()) == null ) {
|
|
|
- List<ArchiveTreeContract> tmpSaveList = new ArrayList<>();
|
|
|
+ boolean flag = false;
|
|
|
if (contractInfos != null && !contractInfos.isEmpty()) {
|
|
|
- addNewContract1(contractInfos,src,dstTree,tmpSaveList);
|
|
|
- } else {
|
|
|
- tmpSaveList = archiveTreeContractSync.getNormalSaveListEx(src.getId(),src,dstNode.getId(),dstTree);
|
|
|
+ List<ArchiveTreeContract> tmpSaveList = new ArrayList<>();
|
|
|
+ flag = addNewContract1(contractInfos,src,dstTree,tmpSaveList);
|
|
|
+ saveList.addAll(tmpSaveList);
|
|
|
+ }
|
|
|
+ if (!flag) {
|
|
|
+ List<ArchiveTreeContract> tmpSaveList = archiveTreeContractSync.getNormalSaveListEx(src.getId(),src,dstNode.getId(),dstTree);
|
|
|
+ if (tmpSaveList != null) {
|
|
|
+ saveList.addAll(tmpSaveList);
|
|
|
+ }
|
|
|
}
|
|
|
- saveList.addAll(tmpSaveList);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- void addNewContract1(List<ContractInfo> contractInfos,ArchiveTreeVO2 srcTree,ArchiveTreeContractVO2 dstTree,List<ArchiveTreeContract> saveList){
|
|
|
+ boolean addNewContract1(List<ContractInfo> contractInfos,ArchiveTreeVO2 srcTree,ArchiveTreeContractVO2 dstTree,List<ArchiveTreeContract> saveList){
|
|
|
|
|
|
dstTree.setValue(1L);
|
|
|
ArchiveTreeContract contractNode = null;
|
|
@@ -1026,6 +1031,7 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
|
|
|
contractNode = new ArchiveTreeContract(srcTree);
|
|
|
contractNode.setId(SnowFlakeUtil.getId());
|
|
|
contractNode.setParentId(dstTree.getId());
|
|
|
+ contractNode.setContractId(contractInfo.getId());
|
|
|
saveList.add(contractNode);
|
|
|
contractNode.setTreeCode("C");
|
|
|
}
|
|
@@ -1040,6 +1046,7 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
|
|
|
contractNode = new ArchiveTreeContract(srcTree);
|
|
|
contractNode.setId(SnowFlakeUtil.getId());
|
|
|
contractNode.setParentId(dstTree.getId());
|
|
|
+ contractNode.setContractId(contractInfo.getId());
|
|
|
saveList.add(contractNode);
|
|
|
contractNode.setTreeCode("S");
|
|
|
}
|
|
@@ -1051,6 +1058,7 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
|
|
|
}
|
|
|
saveList.addAll(tmpSaveList);
|
|
|
}
|
|
|
+ return contractNode != null;
|
|
|
}
|
|
|
|
|
|
/**
|