|
@@ -138,14 +138,23 @@ public class WbsSynchronousServiceImpl {
|
|
|
if (CollectionUtil.isEmpty(wbsTreePrivates)) {
|
|
|
throw new ServiceException("当前项目没有相同实体表的其他表单");
|
|
|
}
|
|
|
+
|
|
|
+ //筛选出有excelid的数据和无excelid的数据
|
|
|
+ List<WbsTreePrivate> collect1 = wbsTreePrivates.stream().filter(f -> f.getExcelId() == null).collect(Collectors.toList());
|
|
|
+ List<WbsTreePrivate> collect2 = wbsTreePrivates.stream().filter(f -> f.getExcelId() != null).collect(Collectors.toList());
|
|
|
+
|
|
|
//清表也相同的数据
|
|
|
- List<WbsTreePrivate> collect = wbsTreePrivates.stream().filter(f ->
|
|
|
+ List<WbsTreePrivate> collect = collect2.stream().filter(f ->
|
|
|
Objects.equals(f.getExcelId(), wbsTreePrivate.getExcelId())
|
|
|
).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if(CollectionUtil.isNotEmpty(collect1)){
|
|
|
+ collect.addAll(collect1);
|
|
|
+ }
|
|
|
//清表不同的数据
|
|
|
List<WbsTreePrivate> noExcelIdEq = wbsTreePrivates.stream().filter(f -> !Objects.equals(f.getExcelId(), wbsTreePrivate.getExcelId())).collect(Collectors.toList());
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
if (CollectionUtil.isNotEmpty(noExcelIdEq)) {
|
|
|
- StringBuilder sb = new StringBuilder();
|
|
|
for (WbsTreePrivate treePrivate : noExcelIdEq) {
|
|
|
List<WbsTreePrivate> list = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery().in(WbsTreePrivate::getPKeyId, Func.toLongList(treePrivate.getAncestorsPId())));
|
|
|
List<String> nodeNames = list.stream().map(WbsTreePrivate::getNodeName).collect(Collectors.toList());
|
|
@@ -154,9 +163,10 @@ public class WbsSynchronousServiceImpl {
|
|
|
}
|
|
|
throw new ServiceException("清表绑定错误:" + sb);
|
|
|
}
|
|
|
+
|
|
|
List<Long> ids = collect.stream().map(WbsTreePrivate::getPKeyId).collect(Collectors.toList());
|
|
|
//修改数据
|
|
|
- wbsSynchronousEViSaService.updateSyncPrivateForm(wbsTreePrivate.getHtmlUrl(), ids, wbsTreeSynchronousRecord.getId());
|
|
|
+ wbsSynchronousEViSaService.updateSyncPrivateForm(wbsTreePrivate, ids, wbsTreeSynchronousRecord.getId(),sb.toString());
|
|
|
}
|
|
|
|
|
|
/**
|