|
@@ -221,6 +221,12 @@ public class SysDepartController {
|
|
|
if(sysDepart==null) {
|
|
|
result.error500("未找到对应实体");
|
|
|
}else {
|
|
|
+ QueryWrapper<SysUser> queryWrapper = new QueryWrapper();
|
|
|
+ queryWrapper.eq("depart_ids",id);
|
|
|
+ List<SysUser> list = sysUserService.list(queryWrapper);
|
|
|
+ if(list.size()>0){
|
|
|
+ return result.error500("删除失败!该部门下存在人员,无法删除!");
|
|
|
+ }
|
|
|
boolean ok = sysDepartService.delete(id);
|
|
|
if(ok) {
|
|
|
//清除部门树内存
|