|
@@ -1,14 +1,19 @@
|
|
|
using OASystem.Domain.Entities.PersonnelModule;
|
|
|
using OASystem.Domain.Entities.System;
|
|
|
using OASystem.Domain.ViewModels.PersonnelModule;
|
|
|
+using OASystem.Infrastructure.Repositories.Groups;
|
|
|
using System.IdentityModel.Tokens.Jwt;
|
|
|
using System.Security.Claims;
|
|
|
|
|
|
namespace OASystem.API.OAMethodLib
|
|
|
{
|
|
|
+
|
|
|
public static class GeneralMethod
|
|
|
{
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
#region 消息
|
|
|
|
|
|
|
|
@@ -126,5 +131,72 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+
|
|
|
+ #region 用户页面操作功能
|
|
|
+ //团组信息
|
|
|
+ private readonly static DelegationInfoRepository _dirRep = AutofacIocManager.Instance.GetService<DelegationInfoRepository>();
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 用户页面操作功能(可使用)
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="userId">用户Id</param>
|
|
|
+ /// <param name="PageId">页面Id</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static async Task<PageFunAuthViewBase> PostUserPageFuncDatas(int userId,int PageId)
|
|
|
+ {
|
|
|
+ PageFunAuthViewBase pageFunAuth = new PageFunAuthViewBase();
|
|
|
+
|
|
|
+ List<UserPageFuncView> userPageFuncDatas = new List<UserPageFuncView>();
|
|
|
+ string sql = string.Format(@"Select Distinct ua.UId As UserId, u.CnName As UserName, pa.ModuleId,pa.ModuleName,pa.PageId,pa.PageName,pa.PageIsEnable,
|
|
|
+ pa.PagePhoneIsEnable,pa.FuncId,pa.FuncName,pa.FuncIsEnable
|
|
|
+ From Sys_UserAuthority ua
|
|
|
+ Left Join Sys_Users u On ua.UId = u.Id
|
|
|
+ Left Join (
|
|
|
+ Select sd.Id As ModuleId,sd.Name As ModuleName, smp.Id As PageId,smp.Name As PageName,smp.IsEnable As PageIsEnable,
|
|
|
+ smp.phoneIsEnable As PagePhoneIsEnable,pfp.Id As FuncId,pfp.FunctionName As FuncName,pfp.IsEnable As FuncIsEnable
|
|
|
+ From Sys_SystemMenuAndFunction smaf
|
|
|
+ Left Join Sys_SystemMenuPermission smp On smaf.SmId = smp.Id
|
|
|
+ Left Join Sys_SetData sd On sd.STid = 5 And smp.Mid = sd.Id
|
|
|
+ Left Join Sys_PageFunctionPermission pfp On smaf.FId = pfp.Id
|
|
|
+ Where smaf.IsDel = 0 And smp.IsDel = 0 And pfp.IsDel = 0 And sd.IsDel = 0
|
|
|
+ ) As pa On ua.SmId = pa.PageId
|
|
|
+ Where ua.IsDel = 0 And ua.UId = {0} And pa.PageId = {1}
|
|
|
+ Order By ModuleId,PageId,FuncId Asc", userId, PageId);
|
|
|
+
|
|
|
+ userPageFuncDatas = await _dirRep._sqlSugar.SqlQueryable<UserPageFuncView>(sql).ToListAsync();
|
|
|
+
|
|
|
+ if (userPageFuncDatas.Count <= 0)
|
|
|
+ {
|
|
|
+ return pageFunAuth;
|
|
|
+ }
|
|
|
+
|
|
|
+ UserPageFuncView userPageFunc = new UserPageFuncView();
|
|
|
+
|
|
|
+ //查询 1
|
|
|
+ userPageFunc = userPageFuncDatas.Where(it => it.FuncId == 1).FirstOrDefault();
|
|
|
+ if (userPageFunc != null) pageFunAuth.CheckAuth = 1;
|
|
|
+ //删除 2
|
|
|
+ userPageFunc = userPageFuncDatas.Where(it => it.FuncId == 2).FirstOrDefault();
|
|
|
+ if (userPageFunc != null) pageFunAuth.DeleteAuth = 1;
|
|
|
+ //编辑 3
|
|
|
+ userPageFunc = userPageFuncDatas.Where(it => it.FuncId == 3).FirstOrDefault();
|
|
|
+ if (userPageFunc != null) pageFunAuth.EditAuth = 1;
|
|
|
+ //下载 4
|
|
|
+ userPageFunc = userPageFuncDatas.Where(it => it.FuncId == 4).FirstOrDefault();
|
|
|
+ if (userPageFunc != null) pageFunAuth.FilesDownloadAuth = 1;
|
|
|
+ //上传 5
|
|
|
+ userPageFunc = userPageFuncDatas.Where(it => it.FuncId == 5).FirstOrDefault();
|
|
|
+ if (userPageFunc != null) pageFunAuth.FilesUploadAuth = 1;
|
|
|
+ //添加 11
|
|
|
+ userPageFunc = userPageFuncDatas.Where(it => it.FuncId == 11).FirstOrDefault();
|
|
|
+ if (userPageFunc != null) pageFunAuth.AddAuth = 1;
|
|
|
+ //审核 12
|
|
|
+ userPageFunc = userPageFuncDatas.Where(it => it.FuncId == 12).FirstOrDefault();
|
|
|
+ if (userPageFunc != null) pageFunAuth.AuditAuth = 1;
|
|
|
+
|
|
|
+ return pageFunAuth;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
}
|
|
|
}
|