Browse Source

修改删除部门时,删除子部门公路,路段信息

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

+ 9
- 5
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;

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

}

Loading…
Cancel
Save