Commit e999bedb authored by 黄奎's avatar 黄奎

新增缓存字段

parent 6ed9df02
......@@ -105,6 +105,10 @@ namespace Edu.Cache.User
/// 账号仓储层对象
/// </summary>
private static readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 部门仓储层对象
/// </summary>
private static readonly RB_DepartmentRepository departmentRepository = new RB_DepartmentRepository();
/// <summary>
/// 获取用户登录信息
......@@ -138,12 +142,18 @@ namespace Edu.Cache.User
})?.FirstOrDefault();
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
{
Id = model.Id,
Group_Id = model.Group_Id,
School_Id = model.School_Id,
AccountType=model.AccountType,
AccountType = model.AccountType,
AccountName = model.AccountName,
GroupName = model.GroupName,
SchoolName = model.SchoolName,
......@@ -165,6 +175,7 @@ namespace Edu.Cache.User
IsTenCccUser = model.IsTenCccUser,
IsCourseConsultant = (model != null && model.UserRole == UserRoleEnum.CourseConsultant) ? 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);
}
......
......@@ -177,6 +177,11 @@ namespace Edu.Model.CacheModel
/// 是否是市场(1-是)
/// </summary>
public int IsMarket { get; set; }
/// <summary>
/// 部门负责人(1-是)
/// </summary>
public int IsManager { get; set; }
}
/// <summary>
......
......@@ -54,6 +54,11 @@ namespace Edu.WebApi.Controllers.User
private readonly StudentModule studentModule = new StudentModule();
/// <summary>
/// 部门处理类对象
/// </summary>
private readonly DepartmentModule departmentModule = new DepartmentModule();
[HttpGet]
[HttpPost]
[AllowAnonymous]
......@@ -153,10 +158,6 @@ namespace Edu.WebApi.Controllers.User
string erpToken = WebApiTokenHelper.CreateToken(Common.GlobalKey.JWT_ERP_User_Key, erpUserInfo);
#region 获取甲鹤教育Token
string JHTenantId = Config.JHTenantId;
string JHMallBaseId = Config.JHMallBaseId;
......@@ -190,6 +191,7 @@ namespace Edu.WebApi.Controllers.User
#endregion
var treeList = menuModule.GetPostMenuTreeModule(new Model.ViewModel.System.RB_Menu_ViewModel()
{
MenuType = accountType
......@@ -198,6 +200,7 @@ namespace Edu.WebApi.Controllers.User
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 deptList= departmentModule.GetDepartmentListModule(new RB_Department_ViewModel() { DeptId = model.Dept_Id, Group_Id = model.Group_Id, ManagerIds = model.Id.ToString() });
UserInfo obj = new UserInfo
{
......@@ -225,6 +228,7 @@ namespace Edu.WebApi.Controllers.User
PostId = model.Post_Id,
PostName = model.PostName,
Email = model.Email,
IsManager=(deptList?.Count??0)>0?1:0,
IsTenCccUser = model.IsTenCccUser,
IsCourseConsultant = (model != null && model.UserRole == UserRoleEnum.CourseConsultant) ? 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