瀏覽代碼

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

wangh 1 年之前
父節點
當前提交
fe5012b12f

+ 36 - 17
OASystem/OASystem.Api/Controllers/BusinessController.cs

@@ -7,6 +7,7 @@ using OASystem.Domain.Dtos.Business;
 using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Business;
+using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.Business;
@@ -83,7 +84,6 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 币种 List
         /// </summary>
-        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpGet,HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -211,7 +211,7 @@ namespace OASystem.API.Controllers
                         {
                             teamRateDescViews = teamRateDescViews.OrderBy(it => it.CurrencyId).ToList();
                         }
-                        
+
                         teamRateModelInfo.TeamRates = teamRateDescViews;
                         teamRateModels = teamRateModelInfo;
                     }
@@ -266,40 +266,59 @@ namespace OASystem.API.Controllers
         }
         #endregion
 
-        #region 查询页面操作权限
+        #region 查询页面关联Ctable
+
 
         /// <summary>
-        /// 查询页面操作权限 根据 用户Id 及 页面ID
+        /// 页面关联Ctable
+        /// 根据PageId 返回 CTable Id
         /// </summary>
-        /// <param name="userId">用户Id</param>
-        /// <param name="pageId">页面Id</param>
-        /// <param name="portType">端口类型</param>
+        /// <param name="dto"></param>
         /// <returns></returns>
-        [HttpGet, HttpPost]
+        [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostPageOperationPermission(int userId,int pageId,int portType)
+        public async Task<IActionResult> PostPageLinkCTable(PageLinkCTableDto dto)
         {
             try
             {
+                if (dto == null)
+                {
+                    return Ok(JsonView(false, "请求参数不能为空!"));
+                }
 
+                if (dto.PageId == 0)
+                {
+                    return Ok(JsonView(false, "页面Id不能为0!"));
+                }
 
+                List<CTableCorrelationPageDatas> data =  AppSettingsHelper.Get<CTableCorrelationPageDatas>("CTableCorrelationPageDatas");
+                CTableCorrelationPageDatas correlationPageDatas = new CTableCorrelationPageDatas();
 
-                Result setData = await _setDataRep.GetSetDataBySTId(_setDataRep, 66); //币种类型
-                if (setData.Code == 0)
+                foreach (var item in data)
                 {
-                    return Ok(JsonView(true, "查询成功", setData.Data));
+                    if (item.PageIdDatas != null)
+                    {
+                        var pageId = item.PageIdDatas.Where(it => it == dto.PageId).FirstOrDefault();
+                        if (pageId != 0)
+                        {
+                            correlationPageDatas = item;
+                            break;
+                        }
+                    }
                 }
-                else
+
+                if (correlationPageDatas.CTableId == 0)
                 {
-                    return Ok(JsonView(false, setData.Msg));
+                    return Ok(JsonView(false, "您查询的页面Id,未配置AppSettings,请前往配置!"));
                 }
+
+                return Ok(JsonView(true, "操作成功",new { CTable = correlationPageDatas.CTableId }));
             }
-            catch (Exception)
+            catch (Exception ex)
             {
-                return Ok(JsonView(false, "程序错误!"));
+                return Ok(JsonView(false, ex.Message));
             }
         }
-
         #endregion
 
 

+ 47 - 11
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -895,15 +895,14 @@ namespace OASystem.API.Controllers
         {
             try
             {
-                if (dto == null)
-                {
-                    return Ok(JsonView(false, "参数不能为空!"));
-                }
-
+                if (dto == null)  return Ok(JsonView(false, "参数不能为空!"));
+               
+                if (dto.PageId <= 0) return Ok(JsonView(false, "请传入正确的的页面Id!"));
+               
+                if (dto.UserId <= 0)  return Ok(JsonView(false, "请传入正确的的员工Id!")); 
 
-                PageFunAuthViewBase pageFunAuth = new PageFunAuthViewBase();
                 #region 页面功能权限处理
-
+                PageFunAuthViewBase pageFunAuth = new PageFunAuthViewBase();
                 pageFunAuth = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
 
                 if (pageFunAuth.CheckAuth == 0)
@@ -953,11 +952,24 @@ namespace OASystem.API.Controllers
         {
             try
             {
-                if (dto == null)
+                if (dto == null) return Ok(JsonView(false, "参数不能为空!"));
+                if (dto.PageId <= 0) return Ok(JsonView(false, "请传入正确的的页面Id!"));
+                if (dto.UserId <= 0) return Ok(JsonView(false, "请传入正确的的员工Id!"));
+
+                PageFunAuthViewBase pageFunAuth = new PageFunAuthViewBase();
+
+                #region 页面功能权限处理
+
+                pageFunAuth = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
+
+                #endregion
+
+                if (pageFunAuth.DeleteAuth == 0)
                 {
-                    return Ok(JsonView(false, "参数不能为空!"));
+                    return Ok(JsonView(false, "您没有当前页面删除权限!"));
                 }
 
+
                 Result _result = await _paymentRefundAndOtherMoneyRep._Del(dto);
 
                 if (_result.Code != 0)
@@ -1044,9 +1056,33 @@ namespace OASystem.API.Controllers
         {
             try
             {
-                if (dto == null)
+                if (dto == null) return Ok(JsonView(false, "参数不能为空!"));
+                if (dto.PageId <= 0) return Ok(JsonView(false, "请传入正确的的页面Id!"));
+                if (dto.UserId <= 0) return Ok(JsonView(false, "请传入正确的的员工Id!"));
+
+                #region 页面功能权限处理
+                PageFunAuthViewBase pageFunAuth = new PageFunAuthViewBase();
+                pageFunAuth = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
+
+                #endregion
+
+                if (dto.Status == 1) //add
                 {
-                    return Ok(JsonView(false, "参数不能为空!"));
+                    if (pageFunAuth.AddAuth == 0)
+                    {
+                        return Ok(JsonView(false, "您没有当前页面添加权限!"));
+                    }
+                }
+                else if (dto.Status == 2) //edit
+                {
+                    if (pageFunAuth.EditAuth == 0)
+                    {
+                        return Ok(JsonView(false, "您没有当前页面编辑权限!"));
+                    }
+                }
+                else
+                {
+                    return Ok(JsonView(false, "请输入正确的操作状态! 1 添加 2 修改!"));
                 }
 
                 Result _result = await _paymentRefundAndOtherMoneyRep._AddOrEdit(dto);

+ 53 - 1
OASystem/OASystem.Api/appsettings.json

@@ -129,5 +129,57 @@
   "WageSheetExcelFptPath": "C:/Server/File/OA2023/Office/WageSheetFile/",
 
   "WageSheetTaxExcelBaseUrl": "http://132.232.92.186:24/",
-  "WageSheetTaxExcelFptPath": "C:/Server/File/OA2023/Office/Excel/WageSheetTaxFile/"
+  "WageSheetTaxExcelFptPath": "C:/Server/File/OA2023/Office/Excel/WageSheetTaxFile/",
+
+  "CTableCorrelationPageDatas": [
+    {
+      "CTableId": 76, //CtableId 酒店预订
+      "PageIdDatas": [ //页面Id
+      ]
+
+    },
+    {
+      "CTableId": 77, //CtableId  行程
+      "PageIdDatas": [ //页面Id
+      ]
+    },
+    {
+      "CTableId": 79, //CtableId 车/导游地接
+      "PageIdDatas": [ //页面Id
+      ]
+
+    },
+    {
+      "CTableId": 80, //CtableId  签证
+      "PageIdDatas": [ //页面Id
+      ]
+    },
+    {
+      "CTableId": 81, //CtableId 邀请/公务活动
+      "PageIdDatas": [ //页面Id
+      ]
+    },
+    {
+      "CTableId": 82, //CtableId 团组客户保险
+      "PageIdDatas": [ //页面Id
+      ]
+    },
+    {
+      "CTableId": 85, //CtableId 机票预订
+      "PageIdDatas": [ //页面Id
+      ]
+    },
+    {
+      "CTableId": 98, //CtableId 其他款项
+      "PageIdDatas": [ //页面Id
+        69
+      ]
+    },
+    {
+      "CTableId": 751, //CtableId 酒店早餐
+      "PageIdDatas": [ //页面Id
+      ]
+    }
+  ]
+
 }

+ 6 - 14
OASystem/OASystem.Domain/Dtos/Financial/PaymentRefundAndOtherMoneyDto.cs

@@ -1,4 +1,6 @@
-using System;
+using OASystem.Domain.Dtos.System;
+using OASystem.Domain.ViewModels;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -22,17 +24,12 @@ namespace OASystem.Domain.Dtos.Financial
     /// 收款退还与其他款项
     /// Del Dto
     /// </summary>
-    public class PaymentRefundAndOtherMoneyDelDto
+    public class PaymentRefundAndOtherMoneyDelDto:UserPageFuncDtoBase
     {
         /// <summary>
-        /// Id 
+        ///  Id 
         /// </summary>
         public int Id { get; set; }
-
-        /// <summary>
-        /// 用户Id
-        /// </summary>
-        public int UserId { get; set; }
     }
 
     /// <summary>
@@ -51,7 +48,7 @@ namespace OASystem.Domain.Dtos.Financial
     /// 收款退还与其他款项
     /// 操作(Add Or Update) Dto
     /// </summary>
-    public class PaymentRefundAndOtherMoneyAddOrEditDto : PortDtoBase
+    public class PaymentRefundAndOtherMoneyAddOrEditDto : UserPageFuncDtoBase
     {
         /// <summary>
         /// 操作状态
@@ -60,11 +57,6 @@ namespace OASystem.Domain.Dtos.Financial
         /// </summary>
         public int Status { get; set; }
 
-        /// <summary>
-        /// 用户Id
-        /// </summary>
-        public int UserId { get; set; }
-
         /// <summary>
         /// Id
         /// </summary>

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

@@ -82,6 +82,9 @@ namespace OASystem.Domain.Dtos.Financial
         /// <summary>
         /// 业务类型Id
         /// 酒店预定,机票预定,等等
+        /// 76	酒店预订 77	行程           79  车/导游地接
+        /// 80	签证     81	邀请/公务活动  82  团组客户保险
+        /// 85	机票预订 98	其他款项       751 酒店早餐
         /// </summary>
         public int CTbale { get; set; }
     }

+ 5 - 0
OASystem/OASystem.Domain/Dtos/System/PageFunDto.cs

@@ -65,4 +65,9 @@ namespace OASystem.Domain.Dtos.System
         public int Id { get; set; }
         public int DeleteUserId { get; set; }
     }
+
+    public class PageLinkCTableDto
+    {
+        public int PageId { get; set; }
+    }
 }

+ 16 - 0
OASystem/OASystem.Domain/ViewModels/System/PageFunctionPermissionView.cs

@@ -26,4 +26,20 @@ namespace OASystem.Domain.ViewModels.System
         public int IsEnable { get; set; }
 
     }
+
+    /// <summary>
+    /// Ctable 关联 Page
+    /// </summary>
+    public class CTableCorrelationPageDatas
+    {
+        /// <summary>
+        /// CTable Id
+        /// </summary>
+        public int CTableId { get; set; }
+
+        /// <summary>
+        /// pageId Data 
+        /// </summary>
+        public List<int> PageIdDatas { get; set; }
+    }
 }

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

@@ -56,7 +56,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
 				                         From Fin_PaymentRefundAndOtherMoney prom
 				                         Left Join Sys_Users u On u.Id = prom.CreateUserId 
 				                         Left Join Sys_SetData sd On prom.CurrencyId = sd.Id
-					                     Left Join Grp_CreditCardPayment ccp On ccp.CTable = 285 And ccp.CId = prom.Id
+					                     Left Join Grp_CreditCardPayment ccp On ccp.CTable = 98 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);
 
@@ -194,7 +194,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 string sql = string.Format(@"Select prom.Id,ccp.Id CcpId,prom.DiId,prom.PriceName,prom.Price,prom.CurrencyId,ccp.Payee,ccp.PayDId,
 										 ccp.OrbitalPrivateTransfer,ccp.ConsumptionPatterns,prom.PayType,prom.Remark
 										 From Fin_PaymentRefundAndOtherMoney prom 
-										 Left Join Grp_CreditCardPayment ccp On ccp.CId = prom.id And ccp.CTable = 79 And ccp.IsDel = 0
+										 Left Join Grp_CreditCardPayment ccp On ccp.CId = prom.id And ccp.CTable = 98 And ccp.IsDel = 0
 										 Where prom.IsDel = 0 And prom.Id = {0}", dto.Id);
                 var data = await _sqlSugar.SqlQueryable<Fin_PaymentRefundAndOtherMoneyInfoView>(sql).ToListAsync();
 
@@ -262,7 +262,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
                         return _result;
                     }
 
-                    var teamReteData1 = teamReteDatas.Where(it => it.CTableId == 285).FirstOrDefault();
+                    var teamReteData1 = teamReteDatas.Where(it => it.CTableId == 98).FirstOrDefault();
                     if (teamReteData1 == null)
                     {
                         _result.Msg = "该团下的“其他款项”未设置团组汇率,请先设置!";
@@ -286,7 +286,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
                     //Id = dto.CcpId,
                     //CId = dto.CcpId,
                     DIId = dto.DiId,
-                    CTable = 285,
+                    CTable = 98,
                     PayDId = dto.PayDId,
                     ConsumptionPatterns = dto.ConsumptionPatterns,
                     ConsumptionDate = string.Empty,
@@ -357,13 +357,12 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 }
                 else if (dto.Status == 2) //修改
                 {
-                    _PaymentRefundAndOtherMoney.Id = dto.Id;
                     _CreditCardPayment.Id = dto.CcpId;
                     _CreditCardPayment.CId = dto.Id;
 
                     _sqlSugar.BeginTran();
 
-                    var prom_update = await _sqlSugar.Updateable(_PaymentRefundAndOtherMoney)
+                    var prom_update = await _sqlSugar.Updateable(_CreditCardPayment)
                                                      .IgnoreColumns(it => new { it.CreateUserId, it.CreateTime, it.DeleteUserId, it.DeleteTime, it.IsDel })
                                                      .WhereColumns(it => new { it.Id })
                                                      .ExecuteCommandAsync();
@@ -400,7 +399,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 }
                 else
                 {
-                    _result.Msg = "请输入正确的状态! 1 添加 2 修改;";
+                    _result.Msg = "请输入正确的操作状态! 1 添加 2 修改;";
                 }
 
             }