Browse Source

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/v1.1.0^2
wanjing 1 year ago
parent
commit
bf00c91a93
1 changed files with 16 additions and 9 deletions
  1. +16
    -9
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/delete/DeleteDeptService.java

+ 16
- 9
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/delete/DeleteDeptService.java View File

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

}

Loading…
Cancel
Save