|
@@ -4678,6 +4678,38 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public R<List<WbsTreeContract>> getSiblingWbsContract(Long pKeyId) {
|
|
|
+ return R.data(wbsTreeContractMapper.getSiblingWbsContract(pKeyId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public R moveNode(MoveNodeDTO dto) {
|
|
|
+ List<WbsTreeContract> list= wbsTreeContractMapper.getWbsTreeContractsByPKeyIds(dto.getLeftPkeyIds());
|
|
|
+ WbsTreeContract fatherContract = this.getById(dto.getRightPkeyId());
|
|
|
+ for (WbsTreeContract contract : list) {
|
|
|
+ String oldancestorsPId = contract.getAncestorsPId();
|
|
|
+ String oldancestors = contract.getAncestors();
|
|
|
+ contract.setPId(fatherContract.getPKeyId());
|
|
|
+ contract.setParentId(fatherContract.getId());
|
|
|
+ contract.setAncestorsPId(fatherContract.getAncestorsPId()+","+contract.getPId());
|
|
|
+ contract.setAncestors(fatherContract.getAncestors());
|
|
|
+ //查出当前节点所有子节点。
|
|
|
+ List<WbsTreeContract> childContracts = wbsTreeContractMapper.getChildWbsTreeContracts(contract.getPKeyId());
|
|
|
+ if(!childContracts.isEmpty()){
|
|
|
+ for (WbsTreeContract childContract : childContracts) {
|
|
|
+ String ancestorsPid = childContract.getAncestorsPId();
|
|
|
+ ancestorsPid=ancestorsPid.replace(oldancestorsPId,contract.getAncestorsPId());
|
|
|
+ String ancestors = childContract.getAncestors();
|
|
|
+ ancestors=ancestors.replace(oldancestors,contract.getAncestors());
|
|
|
+ wbsTreeContractMapper.updateAncestorsPid(ancestorsPid,ancestors,childContract.getPKeyId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.updateBatchById(list);
|
|
|
+ return R.success("操作成功");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 检查单元格是否有效
|
|
|
*/
|