瀏覽代碼

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/v1.1.0^2
wanjing 1 年之前
父節點
當前提交
f5d46df379
共有 1 個文件被更改,包括 13 次插入1 次删除
  1. +13
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/update/UpdateDeptService.java

+ 13
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/update/UpdateDeptService.java 查看文件

@@ -210,8 +210,20 @@ public class UpdateDeptService {

// 差集:删除公路
Collection<String> subRoadIdList = org.apache.commons.collections4.CollectionUtils.subtract(oldRoadIdList, newRoadIdList);
Map<String, Long> oldRoadIdMap = oldRoadIdList.stream().collect(Collectors.groupingBy(p -> p, Collectors.counting()));
Map<String, Long> subRoadIdMap = subRoadIdList.stream().collect(Collectors.groupingBy(p -> p, Collectors.counting()));
if (!CollectionUtils.isEmpty(subRoadIdList)) {
this.removeRoadToDept(tenantId, newEditDeptRequest.getId(), subRoadIdList);
List<String> deleteRoadIdList = new ArrayList<>();
for (String roadId : subRoadIdList) {
Long oldCount = oldRoadIdMap.get(roadId);
Long subCount = subRoadIdMap.get(roadId);
if (oldCount.equals(subCount)) {
deleteRoadIdList.add(roadId);
}
}
if (CollectionUtil.isNotEmpty(deleteRoadIdList)) {
this.removeRoadToDept(tenantId, newEditDeptRequest.getId(), subRoadIdList);
}
}
}


Loading…
取消
儲存