|
@@ -95,17 +95,19 @@ public class AuthOrgTreeServiceImpl implements IAuthOrgTreeService {
|
|
|
}
|
|
|
}
|
|
|
private void updateTask(List<String> updateOrgCodes, List<AuthOrgInfo> delOrgInfos) {
|
|
|
+ // 被删除的上机构(如果上级机构没有一起被删除的话)也需要加入更新的机构集合中
|
|
|
+ ArrayList<String> cpUpdateOrgCodes = new ArrayList<>(updateOrgCodes);
|
|
|
// 被删除的上机构(如果上级机构没有一起被删除的话)也需要加入更新的机构集合中
|
|
|
List<String> delUpOrgCodes = delOrgInfos.stream()
|
|
|
.map(AuthOrgInfo::getUpGovCode)
|
|
|
.distinct()
|
|
|
.collect(Collectors.toList());
|
|
|
- updateOrgCodes.addAll(delUpOrgCodes);
|
|
|
- List<AuthOrgInfo> updateOrgInfos = authOrgInfoService.getOrgByCodes(updateOrgCodes);
|
|
|
+ cpUpdateOrgCodes.addAll(delUpOrgCodes);
|
|
|
+ List<AuthOrgInfo> updateOrgInfos = authOrgInfoService.getOrgByCodes(cpUpdateOrgCodes);
|
|
|
//构建需要更新的树节点
|
|
|
List<OrgTreeNodeDTO> treeNods = getTreeNods(updateOrgInfos);
|
|
|
|
|
|
- List<AuthOrgInfo> childInfos = authOrgInfoService.getChildByCodes(updateOrgCodes);
|
|
|
+ List<AuthOrgInfo> childInfos = authOrgInfoService.getChildByCodes(cpUpdateOrgCodes);
|
|
|
Map<String, List<AuthOrgInfo>> childIdGroup = childInfos
|
|
|
.stream()
|
|
|
.collect(Collectors.groupingBy(AuthOrgInfo::getUpGovId));
|