Browse Source

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

wangh 1 year ago
parent
commit
bc19df56d8

+ 11 - 6
OASystem/OASystem.Api/Controllers/BusinessController.cs

@@ -4,6 +4,7 @@ using OASystem.API.OAMethodLib.ALiYun;
 using OASystem.API.OAMethodLib.ExcelOutput;
 using OASystem.Domain.Common;
 using OASystem.Domain.Dtos.Business;
+using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Business;
 using OASystem.Domain.Entities.Groups;
@@ -118,25 +119,30 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostGroupTeamRateByDiIdAndCTableId(int portType, int diId,int CTbale)
+        public async Task<IActionResult> PostGroupTeamRateByDiIdAndCTableId(GeneralTeamRateInfoDto dto)
         {
             try
             {
-                if (diId == 0)
+                if (dto == null)
+                {
+                    return Ok(JsonView(false, "请输入参数!"));
+                }
+
+                if (dto.DiId == 0)
                 {
                     return Ok(JsonView(false, "请输入正确的团组Id!"));
                 }
-                if (CTbale == 0)
+                if (dto.CTbale == 0)
                 {
                     return Ok(JsonView(false, "请输入正确的业务类型(CTable)Id!"));
                 }
 
 
-                if (portType == 1 || portType == 2 || portType == 3 )
+                if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3 )
                 {
                     string teamRateInfoSql = string.Format(@"Select sd.Name,tr.* From Grp_TeamRate tr 
                                                      Left Join Sys_SetData  sd On sd.IsDel=0 And sd.STid=16  And tr.CTable = sd.Id 
-                                                     Where tr.IsDel = 0 And tr.DiId = {0} And tr.CTable = {1}", diId,CTbale);
+                                                     Where tr.IsDel = 0 And tr.DiId = {0} And tr.CTable = {1}", dto.DiId,dto.CTbale);
 
                     var teamRateInfo = await _teamRateRep._sqlSugar.SqlQueryable<TeamRateInfoView>(teamRateInfoSql).ToListAsync();
 
@@ -291,7 +297,6 @@ namespace OASystem.API.Controllers
             catch (Exception)
             {
                 return Ok(JsonView(false, "程序错误!"));
-                throw;
             }
         }
 

+ 21 - 1
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -900,6 +900,19 @@ namespace OASystem.API.Controllers
                     return Ok(JsonView(false, "参数不能为空!"));
                 }
 
+
+                PageFunAuthViewBase pageFunAuth = new PageFunAuthViewBase();
+                #region 页面功能权限处理
+
+                pageFunAuth = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
+
+                if (pageFunAuth.CheckAuth == 0)
+                {
+                    return Ok(JsonView(false, "您没有当前页面查询权限!"));
+                }
+
+                #endregion
+
                 Result _result = await _paymentRefundAndOtherMoneyRep.PostItemByDiId(dto.DiId);
 
                 if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)  //1 Web 2 Android 3 Ios
@@ -908,12 +921,19 @@ namespace OASystem.API.Controllers
                     {
                         return Ok(JsonView(false, _result.Msg));
                     }
+
+                    var data = new
+                    {
+                        PageFuncAuth = pageFunAuth,
+                        Data = _result.Data
+                    };
+
+                    return Ok(JsonView(true, "操作成功!", data));
                 }
                 else
                 {
                     return Ok(JsonView(false, "请输入正确的端口号! 1 Web 2 Android 3 Ios;"));
                 }
-                return Ok(JsonView(true, "操作成功!", _result.Data));
             }
             catch (Exception ex)
             {

+ 72 - 0
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -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
     }
 }

+ 16 - 0
OASystem/OASystem.Domain/Dtos/DtoBase.cs

@@ -73,4 +73,20 @@ namespace OASystem.Domain.Dtos
         /// </summary>
         public string Remark { get; set; }
     }
+
+    /// <summary>
+    /// 员工页面操作功能权限
+    /// </summary>
+    public class UserPageFuncDtoBase : PortDtoBase
+    {
+        /// <summary>
+        /// 用户Id
+        /// </summary>
+        public int UserId { get; set; }
+
+        /// <summary>
+        /// 页面Id
+        /// </summary>
+        public int PageId { get; set; }
+    }
 }

+ 1 - 1
OASystem/OASystem.Domain/Dtos/Financial/PaymentRefundAndOtherMoneyDto.cs

@@ -10,7 +10,7 @@ namespace OASystem.Domain.Dtos.Financial
     /// 收款退还与其他款项
     /// Item Dto
     /// </summary>
-    public class PaymentRefundAndOtherMoneyItemByDiIdDto : PortDtoBase
+    public class PaymentRefundAndOtherMoneyItemByDiIdDto : UserPageFuncDtoBase
     {
         /// <summary>
         /// 团组Id 

+ 17 - 0
OASystem/OASystem.Domain/Dtos/Financial/TeamRateDto.cs

@@ -68,4 +68,21 @@ namespace OASystem.Domain.Dtos.Financial
         /// </summary>
         public List<TeamRateDescView>? teamRates { get; set; }
     }
+
+    /// <summary>
+    /// 通用团组汇率 Dto
+    /// </summary>
+    public class GeneralTeamRateInfoDto:PortDtoBase
+    {
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 业务类型Id
+        /// 酒店预定,机票预定,等等
+        /// </summary>
+        public int CTbale { get; set; }
+    }
 }

+ 33 - 1
OASystem/OASystem.Domain/ViewModels/Financial/Fin_PaymentRefundAndOtherMoneyView.cs

@@ -38,13 +38,45 @@ namespace OASystem.Domain.ViewModels.Financial
         /// <summary>
         /// 币种Name
         /// </summary>
-        public string? CurrencyName { get; set; }
+        public string? CurrencyCode { get; set; }
 
         /// <summary>
         /// 备注
         /// </summary>
         public string? Remark { get; set; }
 
+        /// <summary>
+        /// 总经理是否审核 
+        /// 0 未审核 1已通过 2 未通过
+        /// </summary>
+        public int IsAuditGM { get; set; }
+
+        /// <summary>
+        /// 编辑权限
+        /// 0 不可编辑 1 可编辑
+        /// </summary>
+        public int EditAuth
+        {
+            get
+            {
+                if (IsAuditGM == 1) return 0;
+                else return 1;
+            }
+        }
+
+        /// <summary>
+        /// 删除权限
+        /// 0 不可删除 1 可删除
+        /// </summary>
+        public int DelAuth
+        {
+            get
+            {
+                if (IsAuditGM == 1) return 0;
+                else return 1;
+            }
+        }
+
         /// <summary>
         /// 创建人
         /// </summary>

+ 67 - 0
OASystem/OASystem.Domain/ViewModels/System/UserAuthorityView.cs

@@ -30,4 +30,71 @@ namespace OASystem.Domain.ViewModels.System
         public int IsTemp { get; set; }
 
     }
+
+    /// <summary>
+    /// 用户页面功能
+    /// View
+    /// </summary>
+    public class UserPageFuncView
+    {
+        /// <summary>
+        /// 用户Id
+        /// </summary>
+        public int UserId { get; set; }
+
+        /// <summary>
+        /// 用户名称
+        /// </summary>
+        public string? UserName { get; set; }
+
+        /// <summary>
+        /// 模块Id
+        /// </summary>
+        public int ModuleId { get; set; }
+
+        /// <summary>
+        /// 模块名称
+        /// </summary>
+        public string? ModuleName { get; set; }
+
+        /// <summary>
+        /// 页面Id 
+        /// </summary>
+        public int PageId { get; set; }
+
+        /// <summary>
+        /// 页面名称
+        /// </summary>
+        public string? PageName { get; set; }
+
+        /// <summary>
+        /// 页面是否启用
+        /// 0 未启用 1 已启用
+        /// </summary>
+        public int PageIsEnable { get; set; }
+
+        /// <summary>
+        /// 手机端页面也否启用
+        ///  0 未启用 1 已启用
+        /// </summary>
+        public int PagePhoneIsEnable { get; set; }
+
+        /// <summary>
+        /// 功能Id
+        /// </summary>
+        public int FuncId { get; set; }
+
+        /// <summary>
+        /// 功能名称
+        /// </summary>
+        public string FuncName { get; set; }
+
+        /// <summary>
+        /// 功能是否启用
+        /// 0 未启用 1 已启用
+        /// </summary>
+        public int FuncIsEnable { get; set; }
+    }
+
+
 }

+ 49 - 0
OASystem/OASystem.Domain/ViewModels/ViewBase.cs

@@ -39,4 +39,53 @@
     {
         public int Count { get; set; }
     }
+
+    /// <summary>
+    /// 页面功能权限
+    /// </summary>
+    public class PageFunAuthViewBase
+    {
+        /// <summary>
+        /// 查看权限
+        /// 0 不可操作 1 可操作
+        /// </summary>
+        public int CheckAuth { get; set; } = 0;
+
+        /// <summary>
+        /// 删除权限
+        /// 0 不可操作 1 可操作
+        /// </summary>
+        public int DeleteAuth { get; set; } = 0;
+
+        /// <summary>
+        /// 编辑权限
+        /// 0 不可操作 1 可操作
+        /// </summary>
+        public int EditAuth { get; set; } = 0;
+
+        /// <summary>
+        /// 文件下载权限
+        /// 0 不可操作 1 可操作
+        /// </summary>
+        public int FilesDownloadAuth { get; set; } = 0;
+
+        /// <summary>
+        /// 文件上传权限
+        /// 0 不可操作 1 可操作
+        /// </summary>
+        public int FilesUploadAuth { get; set; } = 0;
+
+        /// <summary>
+        /// 添加权限
+        /// 0 不可操作 1 可操作
+        /// </summary>
+        public int AddAuth { get; set; } = 0;
+
+        /// <summary>
+        /// 审核权限
+        /// 0 不可操作 1 可操作
+        /// </summary>
+        public int AuditAuth { get; set; } = 0;
+
+    }
 }

+ 7 - 2
OASystem/OASystem.Infrastructure/Repositories/Financial/PaymentRefundAndOtherMoneyRepository.cs

@@ -49,11 +49,16 @@ namespace OASystem.Infrastructure.Repositories.Financial
         /// <returns></returns>
         public async Task<Result> PostItemByDiId(int diId)
         {
-            string sql = string.Format(@"Select prom.Id,prom.PriceName,prom.Price,sd.Name As CurrencyName,prom.Remark,u.CnName As CreateUserName,prom.CreateTime 
+
+
+            string sql = string.Format(@"Select prom.Id,prom.PriceName,prom.Price,sd.Name As CurrencyCode,
+					                     prom.Remark,ccp.IsAuditGM,u.CnName As CreateUserName,prom.CreateTime 
 				                         From Fin_PaymentRefundAndOtherMoney prom
 				                         Left Join Sys_Users u On u.Id = prom.CreateUserId 
 				                         Left Join Sys_SetData sd On prom.CurrencyId = sd.Id
-				                         Where prom.IsDel = 0  And prom.DiId={0}", diId);
+					                     Left Join Grp_CreditCardPayment ccp On ccp.CTable = 285 And ccp.CId = prom.Id
+				                         Where prom.IsDel = 0 And u.IsDel = 0 And sd.IsDel = 0 And  ccp.IsDel = 0
+					                     And prom.DiId = {0}", diId);
 
             var data = await _sqlSugar.SqlQueryable<Fin_PaymentRefundAndOtherMoneyItemView>(sql).ToListAsync();