|
|
@@ -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; |
|
|
|
|
|
|
|
/** |
|
|
@@ -139,10 +141,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)); |
|
|
|
} |
|
|
|
|
|
|
|
} |