|
@@ -221,6 +221,12 @@ public class SysDepartController {
|
|
if(sysDepart==null) {
|
|
if(sysDepart==null) {
|
|
result.error500("未找到对应实体");
|
|
result.error500("未找到对应实体");
|
|
}else {
|
|
}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);
|
|
boolean ok = sysDepartService.delete(id);
|
|
if(ok) {
|
|
if(ok) {
|
|
//清除部门树内存
|
|
//清除部门树内存
|