This commit is contained in:
Xy
2021-04-23 10:02:36 +00:00
parent c83391cf5a
commit e4c3350726
15 changed files with 58 additions and 35 deletions

View File

@@ -14,7 +14,8 @@ namespace Dilon.Core
/// 代码生成主表ID
/// </summary>
[Comment("代码生成主表ID")]
public long CodeGenId { get; set; }
[Column("代码生成主表ID", TypeName = "varchar(36)")]
public string CodeGenId { get; set; }
/// <summary>
/// 数据库字段名

View File

@@ -14,7 +14,8 @@ namespace Dilon.Core
/// 字典类型Id
/// </summary>
[Comment("字典类型Id")]
public long TypeId { get; set; }
[Column("字典类型Id", TypeName = "varchar(36)")]
public string TypeId { get; set; }
/// <summary>
/// 值

View File

@@ -19,7 +19,8 @@ namespace Dilon.Core
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Comment("用户Id")]
public long Id { get; set; }
[Column("用户Id", TypeName = "varchar(36)")]
public string Id { get; set; }
/// <summary>
/// 工号
@@ -31,7 +32,8 @@ namespace Dilon.Core
/// 机构Id
/// </summary>
[Comment("机构Id")]
public long OrgId { get; set; }
[Column("机构Id", TypeName = "varchar(36)")]
public string OrgId { get; set; }
/// <summary>
/// 机构名称

View File

@@ -18,7 +18,8 @@ namespace Dilon.Core
/// 员工Id
/// </summary>
[Comment("员工Id")]
public long SysEmpId { get; set; }
[Column("员工Id", TypeName = "varchar(36)")]
public string SysEmpId { get; set; }
/// <summary>
/// 一对一引用(员工)
@@ -29,7 +30,8 @@ namespace Dilon.Core
/// 机构Id
/// </summary>
[Comment("机构Id")]
public long SysOrgId { get; set; }
[Column("机构Id", TypeName = "varchar(36)")]
public string SysOrgId { get; set; }
/// <summary>
/// 一对一引用(机构)
@@ -40,7 +42,8 @@ namespace Dilon.Core
/// 职位Id
/// </summary>
[Comment("职位Id")]
public long SysPosId { get; set; }
[Column("职位Id", TypeName = "varchar(36)")]
public string SysPosId { get; set; }
/// <summary>
/// 一对一引用(职位)
@@ -56,11 +59,11 @@ namespace Dilon.Core
{
return new[]
{
new SysEmpExtOrgPos { SysEmpId = 142307070910551, SysOrgId = 142307070910539, SysPosId = 142307070910547 },
new SysEmpExtOrgPos { SysEmpId = 142307070910551, SysOrgId = 142307070910540, SysPosId = 142307070910548 },
new SysEmpExtOrgPos { SysEmpId = 142307070910551, SysOrgId = 142307070910541, SysPosId = 142307070910549 },
new SysEmpExtOrgPos { SysEmpId = 142307070910551, SysOrgId = 142307070910542, SysPosId = 142307070910550 },
new SysEmpExtOrgPos { SysEmpId = 142307070910553, SysOrgId = 142307070910542, SysPosId = 142307070910547 }
new SysEmpExtOrgPos { SysEmpId = "d0ead3dc-5096-4e15-bc6d-f640be5301ec", SysOrgId = "12d888de-f55d-4c88-b0a0-7c3510664d97", SysPosId = "A88D1488-C873-4C7D-A73D-966418151343" },
new SysEmpExtOrgPos { SysEmpId = "d0ead3dc-5096-4e15-bc6d-f640be5301ec", SysOrgId = "8a2271d6-5bda-4544-bdd3-27e53a8b418e", SysPosId = "3440E091-E1FE-413C-A2C9-BEFB81A30D88" },
new SysEmpExtOrgPos { SysEmpId = "d0ead3dc-5096-4e15-bc6d-f640be5301ec", SysOrgId = "127c0a5d-43ac-4370-b313-082361885aca", SysPosId = "E27B073B-6AB8-411B-AD6D-35275D084A64" },
new SysEmpExtOrgPos { SysEmpId = "d0ead3dc-5096-4e15-bc6d-f640be5301ec", SysOrgId = "2FF6DE19-8D61-4100-A391-25C75BF6FA6C", SysPosId = "2261B0D0-5EA9-49CC-B21E-50B72935BD23" },
new SysEmpExtOrgPos { SysEmpId = "16a74726-e156-499f-9942-0e0e24ad0c3f", SysOrgId = "2FF6DE19-8D61-4100-A391-25C75BF6FA6C", SysPosId = "A88D1488-C873-4C7D-A73D-966418151343" }
};
}
}

View File

@@ -15,7 +15,8 @@ namespace Dilon.Core
/// 员工Id
/// </summary>
[Comment("员工Id")]
public long SysEmpId { get; set; }
[Column("员工Id", TypeName = "varchar(36)")]
public string SysEmpId { get; set; }
/// <summary>
/// 一对一引用(员工)
@@ -26,7 +27,8 @@ namespace Dilon.Core
/// 职位Id
/// </summary>
[Comment("职位Id")]
public long SysPosId { get; set; }
[Column("职位Id", TypeName = "varchar(36)")]
public string SysPosId { get; set; }
/// <summary>
/// 一对一引用(职位)

View File

@@ -46,7 +46,8 @@ namespace Dilon.Core
/// 操作人Id
/// </summary>
[Comment("操作人Id")]
public long UserId { get; set; }
[Column("操作人Id", TypeName = "varchar(36)")]
public string UserId { get; set; }
/// <summary>
/// 操作人名称

View File

@@ -33,7 +33,8 @@ namespace Dilon.Core
/// 发布人Id
/// </summary>
[Comment("发布人Id")]
public long PublicUserId { get; set; }
[Column("发布人Id", TypeName = "varchar(36)")]
public string PublicUserId { get; set; }
/// <summary>
/// 发布人姓名
@@ -44,8 +45,9 @@ namespace Dilon.Core
/// <summary>
/// 发布机构Id
/// </summary>
[Comment("发布机构Id")]
public long PublicOrgId { get; set; }
[Comment("发布机构Id")]
[Column("发布机构Id", TypeName = "varchar(36)")]
public string PublicOrgId { get; set; }
/// <summary>
/// 发布机构名称

View File

@@ -17,13 +17,15 @@ namespace Dilon.Core
/// 通知公告Id
/// </summary>
[Comment("通知公告Id")]
public long NoticeId { get; set; }
[Column("通知公告Id", TypeName = "varchar(36)")]
public string NoticeId { get; set; }
/// <summary>
/// 用户Id
/// </summary>
[Comment("用户Id")]
public long UserId { get; set; }
[Comment("用户Id")]
[Column("用户Id", TypeName = "varchar(36)")]
public string UserId { get; set; }
/// <summary>
/// 阅读时间

View File

@@ -15,7 +15,8 @@ namespace Dilon.Core
/// 父Id
/// </summary>
[Comment("父Id")]
public long Pid { get; set; }
[Column("父Id", TypeName = "varchar(36)")]
public string Pid { get; set; }
/// <summary>
/// 父Ids

View File

@@ -14,8 +14,9 @@ namespace Dilon.Core
/// <summary>
/// 角色Id
/// </summary>
[Comment("角色Id")]
public long SysRoleId { get; set; }
[Comment("角色Id")]
[Column("角色Id", TypeName = "varchar(36)")]
public string SysRoleId { get; set; }
/// <summary>
/// 一对一引用(系统角色)
@@ -26,7 +27,8 @@ namespace Dilon.Core
/// 机构Id
/// </summary>
[Comment("机构Id")]
public long SysOrgId { get; set; }
[Column("机构Id", TypeName = "varchar(36)")]
public string SysOrgId { get; set; }
/// <summary>
/// 一对一引用(系统机构)

View File

@@ -15,7 +15,8 @@ namespace Dilon.Core
/// 角色Id
/// </summary>
[Comment("角色Id")]
public long SysRoleId { get; set; }
[Column("角色Id", TypeName = "varchar(36)")]
public string SysRoleId { get; set; }
/// <summary>
/// 一对一引用(系统用户)
@@ -26,7 +27,8 @@ namespace Dilon.Core
/// 菜单Id
/// </summary>
[Comment("菜单Id")]
public long SysMenuId { get; set; }
[Column("菜单Id", TypeName = "varchar(36)")]
public string SysMenuId { get; set; }
/// <summary>
/// 一对一引用(系统菜单)

View File

@@ -15,7 +15,8 @@ namespace Dilon.Core
/// 用户Id
/// </summary>
[Comment("用户Id")]
public long SysUserId { get; set; }
[Column("用户Id", TypeName = "varchar(36)")]
public string SysUserId { get; set; }
/// <summary>
/// 一对一引用(系统用户)
@@ -26,7 +27,8 @@ namespace Dilon.Core
/// 机构Id
/// </summary>
[Comment("机构Id")]
public long SysOrgId { get; set; }
[Column("机构Id", TypeName = "varchar(36)")]
public string SysOrgId { get; set; }
/// <summary>
/// 一对一引用(系统机构)

View File

@@ -15,7 +15,8 @@ namespace Dilon.Core
/// 用户Id
/// </summary>
[Comment("用户Id")]
public long SysUserId { get; set; }
[Column("用户Id", TypeName = "varchar(36)")]
public string SysUserId { get; set; }
/// <summary>
/// 一对一引用(系统用户)
@@ -26,7 +27,8 @@ namespace Dilon.Core
/// 系统角色Id
/// </summary>
[Comment("角色Id")]
public long SysRoleId { get; set; }
[Column("角色Id", TypeName = "varchar(36)")]
public string SysRoleId { get; set; }
/// <summary>
/// 一对一引用(系统角色)

View File

@@ -10,7 +10,7 @@ namespace Dilon.Core
SysUser User { get; }
long UserId { get; }
Task<SysUser> CheckUserAsync(long userId, bool tracking = true);
Task<SysEmp> GetUserEmpInfo(long userId);
Task<SysUser> CheckUserAsync(string userId, bool tracking = true);
Task<SysEmp> GetUserEmpInfo(string userId);
}
}

View File

@@ -55,7 +55,7 @@ namespace Dilon.Core
/// <param name="userId"></param>
/// <param name="tracking"></param>
/// <returns></returns>
public async Task<SysUser> CheckUserAsync(long userId, bool tracking = true)
public async Task<SysUser> CheckUserAsync(string userId, bool tracking = true)
{
var user = await _sysUserRep.FirstOrDefaultAsync(u => u.Id == userId, tracking);
return user ?? throw Oops.Oh(ErrorCode.D1002);
@@ -66,7 +66,7 @@ namespace Dilon.Core
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public async Task<SysEmp> GetUserEmpInfo(long userId)
public async Task<SysEmp> GetUserEmpInfo(string userId)
{
var emp = await _sysEmpRep.FirstOrDefaultAsync(u => u.Id == userId, false);
return emp ?? throw Oops.Oh(ErrorCode.D1002);