浏览代码

修改部门去除公路,路段时问题

tags/v1.1.0^2
wanjing 1年前
父节点
当前提交
fb1c90c875
共有 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);
}
}
}


正在加载...
取消
保存