fix: 删除

This commit is contained in:
ls
2025-03-05 13:34:26 +08:00
parent 47acf70c81
commit 2c682213ab

View File

@@ -137,7 +137,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
verification(deptIds); verification(deptIds);
Set<String> depts = new HashSet<>(); Set<String> depts = new HashSet<>();
Set<String> pids = new HashSet<>(); Set<String> pids = new HashSet<>();
List<SysDept> deptList = sysDeptMapper.selectList(new QueryWrapper<SysDept>().in("deptId", deptIds)); List<SysDept> deptList = sysDeptMapper.selectList(new QueryWrapper<SysDept>().in("dept_id", deptIds));
for (String deptId : deptIds) { for (String deptId : deptIds) {
depts.add(deptId); depts.add(deptId);
String allChild = sysDeptMapper.findAllChild(deptId); String allChild = sysDeptMapper.findAllChild(deptId);
@@ -146,7 +146,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
depts.addAll(Arrays.asList(split)); depts.addAll(Arrays.asList(split));
} }
} }
this.remove(new QueryWrapper<SysDept>().in("deptId", depts)); this.remove(new QueryWrapper<SysDept>().in("dept_id", depts));
deptList.forEach(dept -> { deptList.forEach(dept -> {
if (StringUtils.isNotEmpty(dept.getPid())){sysDeptMapper.updateSubCount(dept.getPid());} if (StringUtils.isNotEmpty(dept.getPid())){sysDeptMapper.updateSubCount(dept.getPid());}
}); });