|
@@ -1178,6 +1178,35 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
);
|
|
);
|
|
if (wbsTreeContract1 != null) {
|
|
if (wbsTreeContract1 != null) {
|
|
wbsTreeContractMapper.insert(wbsTreeContract);
|
|
wbsTreeContractMapper.insert(wbsTreeContract);
|
|
|
|
+
|
|
|
|
+ //新增同步到对应的复制或新增的父级节点下
|
|
|
|
+ //获取当前新增表单的上级父节点
|
|
|
|
+ WbsTreeContract wbsTreeContracts1 = wbsTreeContractMapper.selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
|
+ .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
|
|
|
|
+ .eq(WbsTreeContract::getContractId, contractInfoId.getId())
|
|
|
|
+ .eq(WbsTreeContract::getProjectId, pawDTO.getProjectId())
|
|
|
|
+ .eq(WbsTreeContract::getWbsId, pawDTO.getWbsId())
|
|
|
|
+ .eq(WbsTreeContract::getType, 1)
|
|
|
|
+ );
|
|
|
|
+ if (wbsTreeContracts1 != null) {
|
|
|
|
+ //获取上级父级节点同级别的复制或新增节点
|
|
|
|
+ List<WbsTreeContract> wbsTreeContracts2 = wbsTreeContractMapper.selectList(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
|
+ .eq(WbsTreeContract::getOldId, wbsTreeContracts1.getId())
|
|
|
|
+ .eq(WbsTreeContract::getContractId, contractInfoId.getId())
|
|
|
|
+ .eq(WbsTreeContract::getProjectId, pawDTO.getProjectId())
|
|
|
|
+ .eq(WbsTreeContract::getWbsId, pawDTO.getWbsId())
|
|
|
|
+ .eq(WbsTreeContract::getType, 1)
|
|
|
|
+ );
|
|
|
|
+ if (wbsTreeContracts2.size() > 0) {
|
|
|
|
+ //将表单同步到复制或新增的节点下
|
|
|
|
+ for (WbsTreeContract treeContract : wbsTreeContracts2) {
|
|
|
|
+ wbsTreeContract.setPKeyId(SnowFlakeUtil.getId());
|
|
|
|
+ wbsTreeContract.setParentId(treeContract.getId());
|
|
|
|
+ wbsTreeContractMapper.insert(wbsTreeContract);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1257,6 +1286,35 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
);
|
|
);
|
|
if (wbsTreeContract1 != null) {
|
|
if (wbsTreeContract1 != null) {
|
|
wbsTreeContractMapper.insert(wbsTreeContract);
|
|
wbsTreeContractMapper.insert(wbsTreeContract);
|
|
|
|
+
|
|
|
|
+ //新增同步到对应的复制或新增的父级节点下
|
|
|
|
+ //获取当前新增表单的上级父节点
|
|
|
|
+ WbsTreeContract wbsTreeContracts1 = wbsTreeContractMapper.selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
|
+ .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
|
|
|
|
+ .eq(WbsTreeContract::getContractId, contractInfoId.getId())
|
|
|
|
+ .eq(WbsTreeContract::getProjectId, pawDTO.getProjectId())
|
|
|
|
+ .eq(WbsTreeContract::getWbsId, pawDTO.getPrimaryKeyId())
|
|
|
|
+ .eq(WbsTreeContract::getType, 1)
|
|
|
|
+ );
|
|
|
|
+ if (wbsTreeContracts1 != null) {
|
|
|
|
+ //获取上级父级节点同级别的复制或新增节点
|
|
|
|
+ List<WbsTreeContract> wbsTreeContracts2 = wbsTreeContractMapper.selectList(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
|
+ .eq(WbsTreeContract::getOldId, wbsTreeContracts1.getId())
|
|
|
|
+ .eq(WbsTreeContract::getContractId, contractInfoId.getId())
|
|
|
|
+ .eq(WbsTreeContract::getProjectId, pawDTO.getProjectId())
|
|
|
|
+ .eq(WbsTreeContract::getWbsId, pawDTO.getPrimaryKeyId())
|
|
|
|
+ .eq(WbsTreeContract::getType, 1)
|
|
|
|
+ );
|
|
|
|
+ if (wbsTreeContracts2.size() > 0) {
|
|
|
|
+ //将表单同步到复制或新增的节点下
|
|
|
|
+ for (WbsTreeContract treeContract : wbsTreeContracts2) {
|
|
|
|
+ wbsTreeContract.setPKeyId(SnowFlakeUtil.getId());
|
|
|
|
+ wbsTreeContract.setParentId(treeContract.getId());
|
|
|
|
+ wbsTreeContractMapper.insert(wbsTreeContract);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|