|
|
@@ -1,5 +1,6 @@ |
|
|
|
package com.tuoheng.admin.service.dept.update; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.tuoheng.admin.constant.SystemConstant; |
|
|
|
import com.tuoheng.admin.dto.RoadSectionDto; |
|
|
@@ -268,12 +269,12 @@ public class UpdateDeptService { |
|
|
|
deptList.add(parentDept); |
|
|
|
queryChildDeptList(deptList, parentDept); |
|
|
|
|
|
|
|
for (Dept dept : deptList) { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
map.put("tenantId", tenantId); |
|
|
|
map.put("deptId", dept.getId()); |
|
|
|
map.put("roadIdList", roadIdList); |
|
|
|
roadDeptMapper.deleteBatchByMap(map); |
|
|
|
List<String> deptIdList = deptList.stream().map(p -> p.getId()).collect(Collectors.toList());; |
|
|
|
for (String roadId : roadIdList) { |
|
|
|
roadDeptMapper.delete(new LambdaQueryWrapper<RoadDept>() |
|
|
|
.eq(RoadDept::getTenantId, tenantId) |
|
|
|
.eq(RoadDept::getRoadId, roadId) |
|
|
|
.in(RoadDept::getDeptId, deptIdList)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -363,11 +364,16 @@ public class UpdateDeptService { |
|
|
|
* @return 结果 |
|
|
|
*/ |
|
|
|
private void removeSectionToDept(String tenantId, String deptId, Collection<String> sectionIdList) { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
map.put("tenantId", tenantId); |
|
|
|
map.put("deptId", deptId); |
|
|
|
map.put("sectionIdList", sectionIdList); |
|
|
|
sectionDeptMapper.deleteBatchByMap(map); |
|
|
|
List<String> deptIdList = deptMapper.selectAllChildListById(deptId); |
|
|
|
if (CollectionUtil.isEmpty(deptIdList)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
for (String sectionId : sectionIdList) { |
|
|
|
sectionDeptMapper.delete(new LambdaQueryWrapper<SectionDept>() |
|
|
|
.eq(SectionDept::getTenantId, tenantId) |
|
|
|
.eq(SectionDept::getSectionId, sectionId) |
|
|
|
.in(SectionDept::getDeptId, deptIdList)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |