|
@@ -327,31 +327,29 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
|| (ObjectUtils.isNotEmpty(wbsTree.getImportMatchingInfo()) && !wbsTree.getImportMatchingInfo().equals(wbsTreePrivate.getImportMatchingInfo()))
|
|
|
)) {
|
|
|
//修改项目wbs信息
|
|
|
- WbsTreePrivate wbsPrivate = new WbsTreePrivate();
|
|
|
- BeanUtil.copyProperties(wbsTree, wbsPrivate);
|
|
|
- wbsPrivate.setProjectId(projectId);
|
|
|
- listPrivate.add(wbsPrivate);
|
|
|
-
|
|
|
+ WbsTreePrivate wbsPrivate = BeanUtil.copyProperties(wbsTree, WbsTreePrivate.class);
|
|
|
+ if (wbsPrivate != null) {
|
|
|
+ wbsPrivate.setProjectId(projectId);
|
|
|
+ listPrivate.add(wbsPrivate);
|
|
|
+ }
|
|
|
for (ContractInfo contractInfo : contractInfos) {
|
|
|
//修改合同段wbs信息
|
|
|
- WbsTreeContract wbsContract = new WbsTreeContract();
|
|
|
- BeanUtil.copyProperties(wbsTree, wbsContract);
|
|
|
- wbsContract.setContractId(String.valueOf(contractInfo.getId()));
|
|
|
- wbsContract.setProjectId(projectId);
|
|
|
- listContract.add(wbsContract);
|
|
|
+ WbsTreeContract wbsContract = BeanUtil.copyProperties(wbsTree, WbsTreeContract.class);
|
|
|
+ if (wbsContract != null) {
|
|
|
+ wbsContract.setContractId(String.valueOf(contractInfo.getId()));
|
|
|
+ wbsContract.setProjectId(projectId);
|
|
|
+ listContract.add(wbsContract);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- try {
|
|
|
- if (listPrivate.size() > 0) {
|
|
|
- baseMapper.updateBatchWbsPrivate(listPrivate);
|
|
|
- }
|
|
|
- if (listContract.size() > 0) {
|
|
|
- wbsTreeContractMapper.updateBatchWbsContract(listContract);
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- throw new ServiceException("节点基础信息同步修改失败 " + e.getMessage());
|
|
|
+
|
|
|
+ if (listPrivate.size() > 0) {
|
|
|
+ baseMapper.updateBatchWbsPrivate(listPrivate);
|
|
|
+ }
|
|
|
+ if (listContract.size() > 0) {
|
|
|
+ wbsTreeContractMapper.updateBatchWbsContract(listContract);
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -375,32 +373,30 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
|| (ObjectUtils.isNotEmpty(wbsTreePrivate.getImportMatchingInfo()) && !wbsTreePrivate.getImportMatchingInfo().equals(treePrivateNow.getImportMatchingInfo()))
|
|
|
)) {
|
|
|
//修改项目wbs信息
|
|
|
- WbsTreePrivate wbsPrivate = new WbsTreePrivate();
|
|
|
- BeanUtil.copyProperties(wbsTreePrivate, wbsPrivate);
|
|
|
- wbsPrivate.setWbsId(wbsId);
|
|
|
- wbsPrivate.setProjectId(projectId);
|
|
|
- listPrivate.add(wbsPrivate);
|
|
|
-
|
|
|
+ WbsTreePrivate wbsPrivate = BeanUtil.copyProperties(wbsTreePrivate, WbsTreePrivate.class);
|
|
|
+ if (wbsPrivate != null) {
|
|
|
+ wbsPrivate.setWbsId(wbsId);
|
|
|
+ wbsPrivate.setProjectId(projectId);
|
|
|
+ listPrivate.add(wbsPrivate);
|
|
|
+ }
|
|
|
for (ContractInfo contractInfo : contractInfos) {
|
|
|
//修改合同段wbs信息
|
|
|
- WbsTreeContract wbsContract = new WbsTreeContract();
|
|
|
- BeanUtil.copyProperties(wbsTreePrivate, wbsContract);
|
|
|
- wbsContract.setContractId(String.valueOf(contractInfo.getId()));
|
|
|
- wbsContract.setProjectId(projectId);
|
|
|
- listContract.add(wbsContract);
|
|
|
+ WbsTreeContract wbsContract = BeanUtil.copyProperties(wbsTreePrivate, WbsTreeContract.class);
|
|
|
+ if (wbsContract != null) {
|
|
|
+ wbsContract.setContractId(String.valueOf(contractInfo.getId()));
|
|
|
+ wbsContract.setProjectId(projectId);
|
|
|
+ listContract.add(wbsContract);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- try {
|
|
|
- if (listPrivate.size() > 0) {
|
|
|
- baseMapper.updateBatchWbsPrivate(listPrivate);
|
|
|
- }
|
|
|
- if (listContract.size() > 0) {
|
|
|
- wbsTreeContractMapper.updateBatchWbsContract(listContract);
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- throw new ServiceException("节点基础信息同步修改失败 " + e.getMessage());
|
|
|
+
|
|
|
+ if (listPrivate.size() > 0) {
|
|
|
+ baseMapper.updateBatchWbsPrivate(listPrivate);
|
|
|
+ }
|
|
|
+ if (listContract.size() > 0) {
|
|
|
+ wbsTreeContractMapper.updateBatchWbsContract(listContract);
|
|
|
}
|
|
|
return true;
|
|
|
}
|