|
@@ -38,6 +38,7 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
private final ContractInfoMapper contractInfoMapper;
|
|
|
private final WbsInfoMapper wbsInfoMapper;
|
|
|
private final WbsParamServiceImpl wbsParamServiceImpl;
|
|
|
+ private final WbsParamMapper wbsParamMapper;
|
|
|
|
|
|
@Override
|
|
|
public List<WbsTreePrivateVO> tree(String wbsId, String projectId) {
|
|
@@ -476,8 +477,8 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
for (WbsParam wbsParam : paramList) {
|
|
|
wbsParam.setWbsId(wbsTreePrivate.getPKeyId());
|
|
|
wbsParam.setId(SnowFlakeUtil.getId());
|
|
|
+ paramListData.add(wbsParam);
|
|
|
}
|
|
|
- paramListData.addAll(paramList);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -505,31 +506,31 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
|
|
|
for (WbsParam wbsParam : paramList) {
|
|
|
wbsParam.setWbsId(wbsTreePrivate.getPKeyId());
|
|
|
wbsParam.setId(SnowFlakeUtil.getId());
|
|
|
+ paramListData.add(wbsParam);
|
|
|
}
|
|
|
- paramListData.addAll(paramList);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //删除已存在的参数,只新增未存在的节点参数
|
|
|
- if (paramListData.size() > 0) {
|
|
|
- for (int i = 0; i < paramListData.size(); i++) {
|
|
|
- List<WbsParam> paramList = wbsParamServiceImpl.findByNodeId(paramListData.get(i).getWbsId());
|
|
|
- if (paramList.size() > 0) {
|
|
|
- for (WbsParam wbsParam : paramList) {
|
|
|
- if (paramListData.get(i).getK().equals(wbsParam.getK())
|
|
|
- && paramListData.get(i).getV().equals(wbsParam.getV())
|
|
|
- && paramListData.get(i).getName().equals(wbsParam.getName())) {
|
|
|
-
|
|
|
- paramListData.remove(paramListData.get(i));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ //去重
|
|
|
+ Iterator<WbsParam> iterator = paramListData.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ WbsParam next = iterator.next();
|
|
|
+ WbsParam wbsParam = wbsParamMapper.selectOne(Wrappers.<WbsParam>query().lambda()
|
|
|
+ .eq(WbsParam::getK, next.getK())
|
|
|
+ .eq(WbsParam::getV, next.getV())
|
|
|
+ .eq(WbsParam::getName, next.getName())
|
|
|
+ .eq(WbsParam::getWbsId, next.getWbsId())
|
|
|
+ );
|
|
|
+ if (wbsParam != null) {
|
|
|
+ iterator.remove();
|
|
|
}
|
|
|
}
|
|
|
wbsParamServiceImpl.saveBatch(paramListData, 1000);
|
|
|
+
|
|
|
return true;
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
return false;
|