Commit e999bedb authored by 黄奎's avatar 黄奎

新增缓存字段

parent 6ed9df02
...@@ -105,6 +105,10 @@ namespace Edu.Cache.User ...@@ -105,6 +105,10 @@ namespace Edu.Cache.User
/// 账号仓储层对象 /// 账号仓储层对象
/// </summary> /// </summary>
private static readonly RB_AccountRepository accountRepository = new RB_AccountRepository(); private static readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 部门仓储层对象
/// </summary>
private static readonly RB_DepartmentRepository departmentRepository = new RB_DepartmentRepository();
/// <summary> /// <summary>
/// 获取用户登录信息 /// 获取用户登录信息
...@@ -138,12 +142,18 @@ namespace Edu.Cache.User ...@@ -138,12 +142,18 @@ namespace Edu.Cache.User
})?.FirstOrDefault(); })?.FirstOrDefault();
if (model != null) if (model != null)
{ {
var deptList = departmentRepository.GetDepartmentListRepository(new Model.ViewModel.User.RB_Department_ViewModel()
{
DeptId = model.Dept_Id,
Group_Id = model.Group_Id,
ManagerIds = model.Id.ToString()
});
userInfo = new UserInfo userInfo = new UserInfo
{ {
Id = model.Id, Id = model.Id,
Group_Id = model.Group_Id, Group_Id = model.Group_Id,
School_Id = model.School_Id, School_Id = model.School_Id,
AccountType=model.AccountType, AccountType = model.AccountType,
AccountName = model.AccountName, AccountName = model.AccountName,
GroupName = model.GroupName, GroupName = model.GroupName,
SchoolName = model.SchoolName, SchoolName = model.SchoolName,
...@@ -165,6 +175,7 @@ namespace Edu.Cache.User ...@@ -165,6 +175,7 @@ namespace Edu.Cache.User
IsTenCccUser = model.IsTenCccUser, IsTenCccUser = model.IsTenCccUser,
IsCourseConsultant = (model != null && model.UserRole == UserRoleEnum.CourseConsultant) ? 1 : 0, IsCourseConsultant = (model != null && model.UserRole == UserRoleEnum.CourseConsultant) ? 1 : 0,
IsMarket = (model != null && model.UserRole == UserRoleEnum.MarketPersion) ? 1 : 0, IsMarket = (model != null && model.UserRole == UserRoleEnum.MarketPersion) ? 1 : 0,
IsManager = (deptList?.Count ?? 0) > 0 ? 1 : 0,
}; };
UserInfoSet(Cache.CacheKey.User_Login_Key + Id.ToString(), userInfo, Common.Config.JwtExpirTime); UserInfoSet(Cache.CacheKey.User_Login_Key + Id.ToString(), userInfo, Common.Config.JwtExpirTime);
} }
......
...@@ -177,6 +177,11 @@ namespace Edu.Model.CacheModel ...@@ -177,6 +177,11 @@ namespace Edu.Model.CacheModel
/// 是否是市场(1-是) /// 是否是市场(1-是)
/// </summary> /// </summary>
public int IsMarket { get; set; } public int IsMarket { get; set; }
/// <summary>
/// 部门负责人(1-是)
/// </summary>
public int IsManager { get; set; }
} }
/// <summary> /// <summary>
......
...@@ -54,6 +54,11 @@ namespace Edu.WebApi.Controllers.User ...@@ -54,6 +54,11 @@ namespace Edu.WebApi.Controllers.User
private readonly StudentModule studentModule = new StudentModule(); private readonly StudentModule studentModule = new StudentModule();
/// <summary>
/// 部门处理类对象
/// </summary>
private readonly DepartmentModule departmentModule = new DepartmentModule();
[HttpGet] [HttpGet]
[HttpPost] [HttpPost]
[AllowAnonymous] [AllowAnonymous]
...@@ -153,10 +158,6 @@ namespace Edu.WebApi.Controllers.User ...@@ -153,10 +158,6 @@ namespace Edu.WebApi.Controllers.User
string erpToken = WebApiTokenHelper.CreateToken(Common.GlobalKey.JWT_ERP_User_Key, erpUserInfo); string erpToken = WebApiTokenHelper.CreateToken(Common.GlobalKey.JWT_ERP_User_Key, erpUserInfo);
#region 获取甲鹤教育Token #region 获取甲鹤教育Token
string JHTenantId = Config.JHTenantId; string JHTenantId = Config.JHTenantId;
string JHMallBaseId = Config.JHMallBaseId; string JHMallBaseId = Config.JHMallBaseId;
...@@ -190,6 +191,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -190,6 +191,7 @@ namespace Edu.WebApi.Controllers.User
#endregion #endregion
var treeList = menuModule.GetPostMenuTreeModule(new Model.ViewModel.System.RB_Menu_ViewModel() var treeList = menuModule.GetPostMenuTreeModule(new Model.ViewModel.System.RB_Menu_ViewModel()
{ {
MenuType = accountType MenuType = accountType
...@@ -198,6 +200,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -198,6 +200,7 @@ namespace Edu.WebApi.Controllers.User
var actionList = menuModule.GetPostMenuFunctionListModule(model.Post_Id.ToString()); var actionList = menuModule.GetPostMenuFunctionListModule(model.Post_Id.ToString());
//上传配置 //上传配置
var uploadConfig = publicModule.GetFileStoreList(new Model.Public.RB_File_Store() { Group_Id = model.Group_Id, IsDefault = 1 })?.FirstOrDefault(); var uploadConfig = publicModule.GetFileStoreList(new Model.Public.RB_File_Store() { Group_Id = model.Group_Id, IsDefault = 1 })?.FirstOrDefault();
var deptList= departmentModule.GetDepartmentListModule(new RB_Department_ViewModel() { DeptId = model.Dept_Id, Group_Id = model.Group_Id, ManagerIds = model.Id.ToString() });
UserInfo obj = new UserInfo UserInfo obj = new UserInfo
{ {
...@@ -225,6 +228,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -225,6 +228,7 @@ namespace Edu.WebApi.Controllers.User
PostId = model.Post_Id, PostId = model.Post_Id,
PostName = model.PostName, PostName = model.PostName,
Email = model.Email, Email = model.Email,
IsManager=(deptList?.Count??0)>0?1:0,
IsTenCccUser = model.IsTenCccUser, IsTenCccUser = model.IsTenCccUser,
IsCourseConsultant = (model != null && model.UserRole == UserRoleEnum.CourseConsultant) ? 1 : 0, IsCourseConsultant = (model != null && model.UserRole == UserRoleEnum.CourseConsultant) ? 1 : 0,
IsMarket= (model != null && model.UserRole == UserRoleEnum.MarketPersion) ? 1 : 0, IsMarket= (model != null && model.UserRole == UserRoleEnum.MarketPersion) ? 1 : 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment