|
@@ -10,6 +10,7 @@ import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.node.ForestNodeMerger;
|
|
|
+import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.StringPool;
|
|
|
import org.springblade.manager.dto.WbsTreePrivateDTO2;
|
|
|
import org.springblade.manager.dto.WbsTreePrivateDTO3;
|
|
@@ -294,6 +295,8 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
|
|
|
@Override
|
|
|
public boolean updateBatchByIds(List<WbsTree> wbsTreeListAll, List<WbsTreePrivate> wbsTreePrivatesAll, String projectId) {
|
|
|
+ List<WbsTreePrivate> listPrivate = new ArrayList<>();
|
|
|
+ List<WbsTreeContract> listContract = new ArrayList<>();
|
|
|
//获取当前项目下所有合同段信息
|
|
|
List<ContractInfo> contractInfos = contractInfoMapper.selectList(Wrappers.<ContractInfo>query().lambda().eq(ContractInfo::getPId, projectId));
|
|
|
|
|
@@ -308,21 +311,38 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
|| (wbsTree.getMajorDataType() != null && !wbsTree.getMajorDataType().equals(wbsTreePrivate.getMajorDataType()))
|
|
|
|| (wbsTree.getTableType() != null && !wbsTree.getTableType().equals(wbsTreePrivate.getTableType()))
|
|
|
|| (wbsTree.getTableOwner() != null && !wbsTree.getTableOwner().equals(wbsTreePrivate.getTableOwner())))) {
|
|
|
- //同步修改私有项目节点、元素表基础信息
|
|
|
- baseMapper.updateBatchByIds(wbsTree, projectId);
|
|
|
+ //修改项目wbs信息
|
|
|
+ //baseMapper.updateBatchByIds(wbsTree, projectId);
|
|
|
+ WbsTreePrivate wbsPrivate = new WbsTreePrivate();
|
|
|
+ BeanUtil.copyProperties(wbsTree,wbsPrivate);
|
|
|
+ wbsPrivate.setProjectId(projectId);
|
|
|
+ listPrivate.add(wbsPrivate);
|
|
|
|
|
|
- //同步修改合同段节点信息、元素表基础信息
|
|
|
for (ContractInfo contractInfo : contractInfos) {
|
|
|
- wbsTreeContractMapper.updateBatchByIds(wbsTree, contractInfo.getId());
|
|
|
+ //修改合同段wbs信息
|
|
|
+ //wbsTreeContractMapper.updateBatchByIds(wbsTree, contractInfo.getId());
|
|
|
+ WbsTreeContract wbsContract = new WbsTreeContract();
|
|
|
+ BeanUtil.copyProperties(wbsTree,wbsContract);
|
|
|
+ wbsContract.setContractId(String.valueOf(contractInfo.getId()));
|
|
|
+ wbsContract.setProjectId(projectId);
|
|
|
+ listContract.add(wbsContract);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ try {
|
|
|
+ baseMapper.updateBatchWbsPrivate(listPrivate);
|
|
|
+ wbsTreeContractMapper.updateBatchWbsContract(listContract);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new ServiceException("节点基础信息同步修改失败");
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public boolean updateBatchByIds2(List<WbsTreePrivate> wbsTreePrivates, List<WbsTreePrivate> wbsTreePrivatesAllNow, String projectId, String wbsId) {
|
|
|
+ List<WbsTreePrivate> listPrivate = new ArrayList<>();
|
|
|
+ List<WbsTreeContract> listContract = new ArrayList<>();
|
|
|
//获取当前项目下所有合同段信息
|
|
|
List<ContractInfo> contractInfos = contractInfoMapper.selectList(Wrappers.<ContractInfo>query().lambda().eq(ContractInfo::getPId, projectId));
|
|
|
|
|
@@ -339,16 +359,31 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
|| (wbsTreePrivate.getTableOwner() != null && !wbsTreePrivate.getTableOwner().equals(treePrivateNow.getTableOwner())))) {
|
|
|
|
|
|
//修改项目wbs信息
|
|
|
- baseMapper.updateBatchByIds2(wbsTreePrivate, projectId, wbsId);
|
|
|
+ //baseMapper.updateBatchByIds2(wbsTreePrivate, projectId, wbsId);
|
|
|
+ WbsTreePrivate wbsPrivate = new WbsTreePrivate();
|
|
|
+ BeanUtil.copyProperties(wbsTreePrivate,wbsPrivate);
|
|
|
+ wbsPrivate.setWbsId(wbsId);
|
|
|
+ wbsPrivate.setProjectId(projectId);
|
|
|
+ listPrivate.add(wbsPrivate);
|
|
|
|
|
|
for (ContractInfo contractInfo : contractInfos) {
|
|
|
//修改合同段wbs信息
|
|
|
- wbsTreeContractMapper.updateBatchByIds2(wbsTreePrivate, contractInfo.getId());
|
|
|
+ //wbsTreeContractMapper.updateBatchByIds2(wbsTreePrivate, contractInfo.getId());
|
|
|
+ WbsTreeContract wbsContract = new WbsTreeContract();
|
|
|
+ BeanUtil.copyProperties(wbsTreePrivate,wbsContract);
|
|
|
+ wbsContract.setContractId(String.valueOf(contractInfo.getId()));
|
|
|
+ wbsContract.setProjectId(projectId);
|
|
|
+ listContract.add(wbsContract);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ try {
|
|
|
+ baseMapper.updateBatchWbsPrivate(listPrivate);
|
|
|
+ wbsTreeContractMapper.updateBatchWbsContract(listContract);
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new ServiceException("节点基础信息同步修改失败");
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|