|
|
@@ -1,5 +1,6 @@ |
|
|
|
package com.tuoheng.admin.service.dept.delete; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.tuoheng.admin.entity.*; |
|
|
|
import com.tuoheng.admin.enums.MarkEnum; |
|
|
@@ -17,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
@@ -125,10 +127,13 @@ public class DeleteDeptService { |
|
|
|
* @return 结果 |
|
|
|
*/ |
|
|
|
private void deleteRoadDept(String tenantId, String deptId) { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
map.put("tenant_id", tenantId); |
|
|
|
map.put("dept_id", deptId); |
|
|
|
roadDeptMapper.deleteByMap(map); |
|
|
|
List<String> deptIdList = deptMapper.selectAllChildListById(deptId); |
|
|
|
if (CollectionUtil.isEmpty(deptIdList)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
roadDeptMapper.delete(new LambdaQueryWrapper<RoadDept>() |
|
|
|
.eq(RoadDept::getTenantId, tenantId) |
|
|
|
.in(RoadDept::getDeptId, deptIdList)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -139,10 +144,12 @@ public class DeleteDeptService { |
|
|
|
* @return 结果 |
|
|
|
*/ |
|
|
|
private void deleteSectionDept(String tenantId, String deptId) { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
map.put("tenant_id", tenantId); |
|
|
|
map.put("dept_id", deptId); |
|
|
|
sectionDeptMapper.deleteByMap(map); |
|
|
|
List<String> deptIdList = deptMapper.selectAllChildListById(deptId); |
|
|
|
if (CollectionUtil.isEmpty(deptIdList)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
sectionDeptMapper.delete(new LambdaQueryWrapper<SectionDept>() |
|
|
|
.eq(SectionDept::getTenantId, tenantId) |
|
|
|
.in(SectionDept::getDeptId, deptIdList)); |
|
|
|
} |
|
|
|
|
|
|
|
} |