From 76859d54c1013b047ba19ae97a5531ac90be40b9 Mon Sep 17 00:00:00 2001 From: samisgod <21gh@163.com> Date: Wed, 17 Nov 2021 14:55:53 +0800 Subject: [PATCH] fix dept delete --- ZR.Admin.WebApi/Controllers/System/SysDeptController.cs | 2 +- ZR.Service/System/IService/ISysUserService.cs | 2 +- ZR.Service/System/SysUserService.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/System/SysDeptController.cs b/ZR.Admin.WebApi/Controllers/System/SysDeptController.cs index 29f1fc8..c9efa2e 100644 --- a/ZR.Admin.WebApi/Controllers/System/SysDeptController.cs +++ b/ZR.Admin.WebApi/Controllers/System/SysDeptController.cs @@ -138,7 +138,7 @@ namespace ZR.Admin.WebApi.Controllers.System { return ToResponse(GetApiResult(ResultCode.CUSTOM_ERROR, $"存在下级部门,不允许删除")); } - if (DeptService.Queryable().Count(it => it.DeptId == deptId && it.DelFlag == "0") > 0) + if (UserService.Queryable().Count(it => it.DeptId == deptId && it.DelFlag == "0") > 0) { return ToResponse(GetApiResult(ResultCode.CUSTOM_ERROR, $"部门存在用户,不允许删除")); } diff --git a/ZR.Service/System/IService/ISysUserService.cs b/ZR.Service/System/IService/ISysUserService.cs index 4f56323..f49e926 100644 --- a/ZR.Service/System/IService/ISysUserService.cs +++ b/ZR.Service/System/IService/ISysUserService.cs @@ -8,7 +8,7 @@ using ZR.Model.System; namespace ZR.Service.System.IService { - public interface ISysUserService + public interface ISysUserService : IBaseService { public List SelectUserList(SysUser user, PagerInfo pager); diff --git a/ZR.Service/System/SysUserService.cs b/ZR.Service/System/SysUserService.cs index 919d494..2fe57d4 100644 --- a/ZR.Service/System/SysUserService.cs +++ b/ZR.Service/System/SysUserService.cs @@ -11,7 +11,7 @@ using ZR.Service.System.IService; namespace ZR.Service { [AppService(ServiceType = typeof(ISysUserService), ServiceLifetime = LifeTime.Transient)] - public class SysUserService : ISysUserService + public class SysUserService : BaseService, ISysUserService { private readonly SysUserRepository UserRepository; private readonly ISysRoleService RoleService;