Selaa lähdekoodia

😁调整系统账号类型及相关

zuohuaijun 3 vuotta sitten
vanhempi
commit
5306d177fe

+ 15 - 4
Admin.NET/Admin.NET.Core/Entity/SysUser.cs

@@ -190,20 +190,31 @@ public class SysUser : EntityTenant
     /// 账号类型
     /// </summary>
     [SugarColumn(ColumnDescription = "账号类型")]
-    public AccountTypeEnum AccountType { get; set; } = AccountTypeEnum.None;
+    public AccountTypeEnum AccountType { get; set; } = AccountTypeEnum.NormalUser;
 
     /// <summary>
-    /// 机构Id
+    /// 直属机构Id
     /// </summary>
-    [SugarColumn(ColumnDescription = "机构Id")]
+    [SugarColumn(ColumnDescription = "直属机构Id")]
     public long OrgId { get; set; }
 
     /// <summary>
-    /// 机构
+    /// 直属机构
     /// </summary>
     [Navigate(NavigateType.OneToOne, nameof(OrgId))]
     public SysOrg SysOrg { get; set; }
 
+    ///// <summary>
+    ///// 直属主管Id
+    ///// </summary>
+    //public long ManagerUserId { get; set; }
+
+    ///// <summary>
+    ///// 直属主管
+    ///// </summary>
+    //[Navigate(NavigateType.OneToOne, nameof(ManagerUserId))]
+    //public SysUser ManagerUser { get; set; }
+
     /// <summary>
     /// 职位Id
     /// </summary>

+ 12 - 12
Admin.NET/Admin.NET.Core/Enum/AccountTypeEnum.cs

@@ -16,26 +16,26 @@ namespace Admin.NET.Core;
 public enum AccountTypeEnum
 {
     /// <summary>
-    /// 其他
+    /// 超级管理员
     /// </summary>
-    [Description("其他")]
-    None = 0,
+    [Description("超级管理员")]
+    SuperAdmin = 999,
 
     /// <summary>
-    /// 普通账号
+    /// 系统管理员
     /// </summary>
-    [Description("普通账号")]
-    User = 1,
+    [Description("系统管理员")]
+    SysAdmin = 888,
 
     /// <summary>
-    /// 系统管理员
+    /// 普通账号
     /// </summary>
-    [Description("系统管理员")]
-    Admin = 4,
+    [Description("普通账号")]
+    NormalUser = 777,
 
     /// <summary>
-    /// 超级管理
+    /// 
     /// </summary>
-    [Description("超级管理员")]
-    SuperAdmin = 999,
+    [Description("员")]
+    Member = 666,
 }

+ 5 - 5
Admin.NET/Admin.NET.Core/SeedData/SysUserSeedData.cs

@@ -25,11 +25,11 @@ public class SysUserSeedData : ISqlSugarEntitySeedData<SysUser>
         return new[]
         {
             new SysUser{ Id=1300000000101, Account="superadmin", Password=encryptPasswod, NickName="超级管理员", RealName="超级管理员", Phone="18020030720", Birthday=DateTime.Parse("1986-06-28"), Sex=GenderEnum.Male, AccountType=AccountTypeEnum.SuperAdmin, Remark="超级管理员", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), TenantId=1300000000001 },
-            new SysUser{ Id=1300000000111, Account="admin", Password=encryptPasswod, NickName="系统管理员", RealName="系统管理员", Phone="18020030720", Birthday=DateTime.Parse("1986-06-28"), Sex=GenderEnum.Male, AccountType=AccountTypeEnum.Admin, Remark="系统管理员", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000101, PosId=1300000000102, TenantId=1300000000001 },
-            new SysUser{ Id=1300000000112, Account="user1", Password=encryptPasswod, NickName="部门主管", RealName="部门主管", Phone="18020030720", Birthday=DateTime.Parse("1986-06-28"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.User, Remark="部门主管", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000102, PosId=1300000000108, TenantId=1300000000001 },
-            new SysUser{ Id=1300000000113, Account="user2", Password=encryptPasswod, NickName="部门职员", RealName="部门职员", Phone="18020030720", Birthday=DateTime.Parse("1986-06-28"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.User, Remark="部门职员", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000103, PosId=1300000000110, TenantId=1300000000001 },
-            new SysUser{ Id=1300000000114, Account="user3", Password=encryptPasswod, NickName="普通用户", RealName="普通用户", Phone="18020030720", Birthday=DateTime.Parse("1986-06-28"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.User, Remark="普通用户", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000104, PosId=1300000000115, TenantId=1300000000001 },
-            new SysUser{ Id=1300000000115, Account="user4", Password=encryptPasswod, NickName="其他", RealName="其他", Phone="18020030720", Birthday=DateTime.Parse("1986-06-28"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.None, Remark="普通用户", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000105, PosId=1300000000116, TenantId=1300000000001 },
+            new SysUser{ Id=1300000000111, Account="admin", Password=encryptPasswod, NickName="系统管理员", RealName="系统管理员", Phone="18020030720", Birthday=DateTime.Parse("1986-06-28"), Sex=GenderEnum.Male, AccountType=AccountTypeEnum.SysAdmin, Remark="系统管理员", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000101, PosId=1300000000102, TenantId=1300000000001 },
+            new SysUser{ Id=1300000000112, Account="user1", Password=encryptPasswod, NickName="部门主管", RealName="部门主管", Phone="18020030720", Birthday=DateTime.Parse("1986-06-28"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.NormalUser, Remark="部门主管", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000102, PosId=1300000000108, TenantId=1300000000001 },
+            new SysUser{ Id=1300000000113, Account="user2", Password=encryptPasswod, NickName="部门职员", RealName="部门职员", Phone="18020030720", Birthday=DateTime.Parse("1986-06-28"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.NormalUser, Remark="部门职员", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000103, PosId=1300000000110, TenantId=1300000000001 },
+            new SysUser{ Id=1300000000114, Account="user3", Password=encryptPasswod, NickName="普通用户", RealName="普通用户", Phone="18020030720", Birthday=DateTime.Parse("1986-06-28"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.NormalUser, Remark="普通用户", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000104, PosId=1300000000115, TenantId=1300000000001 },
+            new SysUser{ Id=1300000000115, Account="user4", Password=encryptPasswod, NickName="其他", RealName="其他", Phone="18020030720", Birthday=DateTime.Parse("1986-06-28"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.Member, Remark="会员", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000105, PosId=1300000000116, TenantId=1300000000001 },
         };
     }
 }

+ 2 - 2
Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs

@@ -199,7 +199,7 @@ public class SysTenantService : IDynamicApiController, ITransient
             NickName = "租管",
             Email = tenant.Email,
             Phone = tenant.Phone,
-            AccountType = AccountTypeEnum.Admin,
+            AccountType = AccountTypeEnum.SysAdmin,
             OrgId = newOrg.Id,
             PosId = newPos.Id,
             Birthday = DateTime.Parse("1986-06-28"),
@@ -303,7 +303,7 @@ public class SysTenantService : IDynamicApiController, ITransient
     [DisplayName("授权租户管理员角色菜单")]
     public async Task GrantMenu(RoleMenuInput input)
     {
-        var tenantAdminUser = await _sysUserRep.GetFirstAsync(u => u.TenantId == input.Id && u.AccountType == AccountTypeEnum.Admin);
+        var tenantAdminUser = await _sysUserRep.GetFirstAsync(u => u.TenantId == input.Id && u.AccountType == AccountTypeEnum.SysAdmin);
         if (tenantAdminUser == null) return;
 
         var roleIds = await _sysUserRoleService.GetUserRoleIdList(tenantAdminUser.Id);