Browse Source

收款退还与其他款项
新增
验证 del,add,edit 页面功能权限

leiy 1 year ago
parent
commit
fbed4cb98f

+ 50 - 4
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -900,11 +900,8 @@ namespace OASystem.API.Controllers
                     return Ok(JsonView(false, "参数不能为空!"));
                 }
 
-
-                PageFunAuthViewBase pageFunAuth = new PageFunAuthViewBase();
-
                 #region 页面功能权限处理
-
+                PageFunAuthViewBase pageFunAuth = new PageFunAuthViewBase();
                 pageFunAuth = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
 
                 if (pageFunAuth.CheckAuth == 0)
@@ -959,6 +956,25 @@ 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
+
+                if (pageFunAuth.DeleteAuth == 0)
+                {
+                    return Ok(JsonView(false, "您没有当前页面删除权限!"));
+                }
+
+
                 Result _result = await _paymentRefundAndOtherMoneyRep._Del(dto);
 
                 if (_result.Code != 0)
@@ -1050,6 +1066,36 @@ namespace OASystem.API.Controllers
                     return Ok(JsonView(false, "参数不能为空!"));
                 }
 
+                #region 页面功能权限处理
+                PageFunAuthViewBase pageFunAuth = new PageFunAuthViewBase();
+                pageFunAuth = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
+
+                if (pageFunAuth.CheckAuth == 0)
+                {
+                    return Ok(JsonView(false, "您没有当前页面查询权限!"));
+                }
+
+                #endregion
+
+                if (dto.Status == 1) //add
+                {
+                    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);
 
                 if (_result.Code != 0)

+ 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>

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Financial/PaymentRefundAndOtherMoneyRepository.cs

@@ -399,7 +399,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 }
                 else
                 {
-                    _result.Msg = "请输入正确的状态! 1 添加 2 修改;";
+                    _result.Msg = "请输入正确的操作状态! 1 添加 2 修改;";
                 }
 
             }