|
|
@@ -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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|