Commit 9a7387ad authored by liudong1993's avatar liudong1993

菜单调整(兼容 资产)

parent 25b67d43
...@@ -65,5 +65,11 @@ namespace Edu.Model.Entity.System ...@@ -65,5 +65,11 @@ namespace Edu.Model.Entity.System
/// ///
/// </summary> /// </summary>
public int IsUserCenter { get; set; } public int IsUserCenter { get; set; }
}
/// <summary>
/// 菜单类型 1教育菜单 2资产菜单
/// </summary>
public int TeamType { get; set; }
}
} }
...@@ -61,9 +61,9 @@ namespace Edu.Module.System ...@@ -61,9 +61,9 @@ namespace Edu.Module.System
/// <param name="postIds"></param> /// <param name="postIds"></param>
/// <param name="MenuType">菜单类型</param> /// <param name="MenuType">菜单类型</param>
/// <returns></returns> /// <returns></returns>
public List<RB_Menu_ViewModel> GetPostMenuListModule(string postIds,int MenuType) public List<RB_Menu_ViewModel> GetPostMenuListModule(string postIds,int MenuType, int teamType)
{ {
return menuRepository.GetPostMenuListRepository(postIds, MenuType); return menuRepository.GetPostMenuListRepository(postIds, MenuType, teamType);
} }
/// <summary> /// <summary>
...@@ -87,6 +87,7 @@ namespace Edu.Module.System ...@@ -87,6 +87,7 @@ namespace Edu.Module.System
{nameof(RB_Menu_ViewModel.SortNum),model.SortNum }, {nameof(RB_Menu_ViewModel.SortNum),model.SortNum },
{nameof(RB_Menu_ViewModel.Status),model.Status }, {nameof(RB_Menu_ViewModel.Status),model.Status },
{nameof(RB_Menu_ViewModel.IsUserCenter),model.IsUserCenter }, {nameof(RB_Menu_ViewModel.IsUserCenter),model.IsUserCenter },
{nameof(RB_Menu_ViewModel.TeamType),model.TeamType },
}; };
flag = menuRepository.Update(fileds, new WhereHelper(nameof(RB_Menu_ViewModel.MenuId), model.MenuId)); flag = menuRepository.Update(fileds, new WhereHelper(nameof(RB_Menu_ViewModel.MenuId), model.MenuId));
} }
...@@ -136,7 +137,8 @@ namespace Edu.Module.System ...@@ -136,7 +137,8 @@ namespace Edu.Module.System
List<RB_Menu_ViewModel> list = new List<RB_Menu_ViewModel>(); List<RB_Menu_ViewModel> list = new List<RB_Menu_ViewModel>();
if (!string.IsNullOrEmpty(postIds)) if (!string.IsNullOrEmpty(postIds))
{ {
list = GetPostMenuListModule(postIds,query.MenuType); query.TeamType = 1;
list = GetPostMenuListModule(postIds,query.MenuType, query.TeamType);
} }
userCenterList = menuRepository.GetMenuListRepository(new RB_Menu_ViewModel() { IsUserCenter = 1 }); userCenterList = menuRepository.GetMenuListRepository(new RB_Menu_ViewModel() { IsUserCenter = 1 });
var newList= list.Where(qitem => qitem.MenuType == query.MenuType && qitem.IsUserCenter ==0).ToList(); var newList= list.Where(qitem => qitem.MenuType == query.MenuType && qitem.IsUserCenter ==0).ToList();
......
...@@ -128,7 +128,7 @@ WHERE 1=1 ...@@ -128,7 +128,7 @@ WHERE 1=1
/// <param name="postIds"></param> /// <param name="postIds"></param>
/// <param name="menuType"></param> /// <param name="menuType"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Menu_ViewModel> GetPostMenuListRepository(string postIds,int menuType) public List<RB_Menu_ViewModel> GetPostMenuListRepository(string postIds,int menuType, int teamType)
{ {
if (string.IsNullOrEmpty(postIds)) if (string.IsNullOrEmpty(postIds))
{ {
...@@ -138,13 +138,13 @@ WHERE 1=1 ...@@ -138,13 +138,13 @@ WHERE 1=1
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT * SELECT *
FROM rb_menu FROM rb_menu
WHERE Status=0 AND MenuType={0} AND MenuId IN WHERE Status=0 AND MenuType={0} AND TeamType={2} AND MenuId IN
( (
SELECT Menu_Id SELECT Menu_Id
FROM rb_role_permission FROM rb_role_permission
WHERE Role_Id IN(SELECT RoleId FROM rb_role WHERE Status=0 AND RoleId IN(SELECT RoleId FROM rb_post_role WHERE PostId IN({1}))) WHERE Role_Id IN(SELECT RoleId FROM rb_role WHERE Status=0 AND RoleId IN(SELECT RoleId FROM rb_post_role WHERE PostId IN({1})))
) )
", menuType, postIds); ", menuType, postIds, teamType);
return Get<RB_Menu_ViewModel>(builder.ToString()).ToList(); return Get<RB_Menu_ViewModel>(builder.ToString()).ToList();
} }
} }
......
...@@ -113,6 +113,7 @@ namespace Edu.WebApi.Controllers.Public ...@@ -113,6 +113,7 @@ namespace Edu.WebApi.Controllers.Public
{ {
var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_Menu_ViewModel>(RequestParm.Msg.ToString()); var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_Menu_ViewModel>(RequestParm.Msg.ToString());
extModel.CreateTime = DateTime.Now; extModel.CreateTime = DateTime.Now;
extModel.TeamType = extModel.TeamType == 0 ? 1 : extModel.TeamType;
bool flag = menuModule.SetMenuModule(extModel); bool flag = menuModule.SetMenuModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
......
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