Kaynağa Gözat

邀请公务费用设置 149可以选择全部团组

yuanrf 1 ay önce
ebeveyn
işleme
92973d3736

+ 5 - 15
OASystem/OASystem.Api/appsettings.json

@@ -141,23 +141,18 @@
   "ExcelFtpPath": "Office/Excel/",
   "OfficeBaseUrl": "http://132.232.92.186:24/",
   "OfficeTempBasePath": "D:/FTP/File/OA2023/Office/",
-
   "WordBaseUrl": "http://132.232.92.186:24/",
   "WordBasePath": "D:/FTP/File/OA2023/Office/Word/",
   "WordFtpPath": "Office/Word/",
-
   "GrpFileBaseUrl": "http://132.232.92.186:24/",
   "GrpFileBasePath": "D:/FTP/File/OA2023/Office/GrpFile/",
   "GrpFileFtpPath": "Office/GrpFile/",
-
   "ShareFileBaseUrl": "http://132.232.92.186:24/",
   "ShareFileBasePath": "D:/FTP/File/OA2023/Office/ShareFile/",
   "ShareFileFtpPath": "Office/ShareFile/",
-
   "TaskFileBaseUrl": "http://132.232.92.186:24/",
   "TaskFileBasePath": "D:/FTP/File/OA2023/Office/TaskFile/",
   "TaskFileFtpPath": "Office/TaskFile/",
-
   "ExcelTempPath": "D:/FTP/File/OA2023/Office/Excel/Template/",
   "GrpListFileBasePath": "D:/FTP/File/OA2023/Office/GrpFile/GroupList/",
   "GrpListFileFtpPath": "Office/GrpFile/GroupList/",
@@ -165,13 +160,10 @@
   "VisaProgressImageBaseUrl": "http://132.232.92.186:24/",
   "VisaProgressImageBasePath": "D:/FTP/File/OA2023/Image/Visa/",
   "VisaProgressImageFtpPath": "Image/Visa/",
-
   "WageSheetExcelBaseUrl": "http://132.232.92.186:24/",
   "WageSheetExcelFptPath": "D:/FTP/File/OA2023/Office/WageSheetFile/",
-
   "WageSheetTaxExcelBaseUrl": "http://132.232.92.186:24/",
   "WageSheetTaxExcelFptPath": "D:/FTP/File/OA2023/Office/Excel/WageSheetTaxFile/",
-
   "CTableCorrelationPageDatas": [
     {
       "CTableId": 76, //CtableId 酒店预订
@@ -234,7 +226,6 @@
       ]
     }
   ],
-
   //消息通知类型
   "MessageNotificationType": [
     {
@@ -259,8 +250,6 @@
       ]
     }
   ],
-
-
   //职位默认页面权限
   "DefaultPostPageData": [
     {
@@ -406,10 +395,8 @@
       ]
     }
   ],
-
   //日付类型Data
   "Dailypayment": "666,667",
-
   //出入境费用明细权限特定基础人员
   "FeeBasePerm": [
     {
@@ -517,5 +504,8 @@
     "MaxFileSizeMB": 50,
     "ExcelTemplatesPath": "Templates/Excel"
   },
-  "AllowedHosts": "*"
-}
+  "AllowedHosts": "*",
+  "DecreasePaymentsSelectIsGm": [
+    149
+  ]
+}

+ 54 - 25
OASystem/OASystem.Infrastructure/Repositories/Groups/DecreasePaymentsRepository.cs

@@ -12,6 +12,7 @@ using OASystem.Domain.ViewModels.Groups;
 using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Domain.ViewModels.Resource;
 using OASystem.Infrastructure.Repositories.System;
+using OASystem.Infrastructure.Tools;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -62,25 +63,54 @@ namespace OASystem.Infrastructure.Repositories.Groups
         {
 
             #region 团组下拉框
-
-            List<Grp_GroupsTaskAssignment> grp_GroupsTaskAssignment = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == dto.CTId).ToList();
-
-            string DiId = "";
-
+            var isGm = AppSettingsHelper
+                        .Get<int>("DecreasePaymentsSelectIsGm")
+                        .Contains(dto.UserId);
             List<DecreasePaymentGroupView> _Delegations = new List<DecreasePaymentGroupView>();
-            if (grp_GroupsTaskAssignment.Count > 0)
-            {
 
+            if (isGm && dto.CTId != 81)
+            {
+                isGm = false;
+            }
 
-                foreach (var item in grp_GroupsTaskAssignment)
-                {
-                    DiId += item.DIId + ",";
-                }
-                if (DiId != "0")
+            if (!isGm)
+            {
+                List<Grp_GroupsTaskAssignment> grp_GroupsTaskAssignment = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == dto.CTId).ToList();
+                string DiId = "";
+                if (grp_GroupsTaskAssignment.Count > 0)
                 {
-                    DiId = DiId.Substring(0, DiId.Length - 1);
+                    foreach (var item in grp_GroupsTaskAssignment)
+                    {
+                        DiId += item.DIId + ",";
+                    }
+                    if (DiId != "0")
+                    {
+                        DiId = DiId.Substring(0, DiId.Length - 1);
+                    }
+                    string sql = string.Format($@"Select 
+                                        (select ssd.name from Sys_SetData ssd  WHERE  ssd.id  = di.TeamLevSId) as TeamLevSId,
+                                        di.Id,
+										di.TeamName,
+										di.ClientUnit,
+										di.ClientName,
+										di.TourCode,
+										di.TeamDid,
+										sd.[Name] As TeamTypeName,
+										di.VisitCountry,
+										di.VisitStartDate,
+										di.VisitEndDate,
+										di.VisitDays,
+										di.VisitPNumber,
+										di.CreateTime
+										From Grp_DelegationInfo di With(NoLock)
+										Left Join Sys_SetData sd On di.TeamDid = sd.Id
+                                        Where di.Id in({DiId}) and di.IsDel=0 
+										Order By di.VisitStartDate Desc");
+                    _Delegations = _sqlSugar.SqlQueryable<DecreasePaymentGroupView>(sql).ToList();
                 }
-
+            }
+            else
+            {
                 string sql = string.Format($@"Select 
                                         (select ssd.name from Sys_SetData ssd  WHERE  ssd.id  = di.TeamLevSId) as TeamLevSId,
                                         di.Id,
@@ -98,10 +128,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
 										di.CreateTime
 										From Grp_DelegationInfo di With(NoLock)
 										Left Join Sys_SetData sd On di.TeamDid = sd.Id
-                                        Where di.Id in({DiId}) and di.IsDel=0 
+                                        Where di.IsDel=0 
 										Order By di.VisitStartDate Desc");
-
-                //DecreasePaymentGroupView
                 _Delegations = _sqlSugar.SqlQueryable<DecreasePaymentGroupView>(sql).ToList();
             }
             #endregion
@@ -189,7 +217,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 C.CardholderName = "";
                 C.PayMoney = grp_Decrease.FeeTotal;
                 C.PaymentCurrency = grp_Decrease.Currency;
-               
+
                 C.CompanyBankNo = "";
                 C.OtherBankName = dto.OtherBankName;
                 C.OtherSideNo = dto.OtherSideNo;
@@ -382,7 +410,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                                 //检索历史金额
                                 var histyPrice = _sqlSugar.Queryable<Grp_DecreasePayments>()
-                                    .LeftJoin<Grp_CreditCardPayment>((x, a) => a.IsDel == 0 && a.CTable == 98 && a.CId == x.Id )
+                                    .LeftJoin<Grp_CreditCardPayment>((x, a) => a.IsDel == 0 && a.CTable == 98 && a.CId == x.Id)
                                     .Where((x, a) => x.IsDel == 0 && x.PriceName == dto.PriceName && x.Id != grp_Decrease.Id)
                                     .Select((x, a) => new
                                     {
@@ -418,9 +446,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 }
                             }
 
-                            if (isAuto) {
+                            if (isAuto)
+                            {
 
-                                var execCount =  _sqlSugar.Updateable<Grp_CreditCardPayment>()
+                                var execCount = _sqlSugar.Updateable<Grp_CreditCardPayment>()
                                       .SetColumns(a => new Grp_CreditCardPayment
                                       {
                                           IsAuditGM = 3, //自动审核通过
@@ -536,7 +565,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 if (setting != null)
                                 {
                                     var dbList = _sqlSugar.Queryable<Grp_DecreasePayments>()
-                                                .LeftJoin<Grp_CreditCardPayment>((x,a) => x.Id == a.CId && a.IsDel == 0 && a.CTable == 98 && a.DIId == dto.DiId )
+                                                .LeftJoin<Grp_CreditCardPayment>((x, a) => x.Id == a.CId && a.IsDel == 0 && a.CTable == 98 && a.DIId == dto.DiId)
                                                 .Where((x, a) => x.IsDel == 0 && x.PriceName.Contains(spPriceName[0]) && x.PriceName.Contains(spPriceName[1]) && x.Id != dto.Id)
                                                 .Select((x, a) => new
                                                 {
@@ -558,7 +587,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                                     //现有金额
                                     var sumPrice = dbList.Sum(x => x.RMBPrice);
-                                    
+
                                     //现有数量
                                     //var sumCount = dbList.Sum(x => x.Quantity);
 
@@ -594,7 +623,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                     })
                                     .Where(a => a.CId == dto.Id && a.CTable == 98 && a.DIId == 2590)
                                     .ExecuteCommand();
-                                recheck = false; 
+                                recheck = false;
                             }
                         }
                         #endregion
@@ -685,7 +714,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                         CommitTran();
 
-                        var data = new { ccpId = grp_CreditCardPayment.Id, sign = 2, dataId = grp_Decrease.Id  ,recheck };
+                        var data = new { ccpId = grp_CreditCardPayment.Id, sign = 2, dataId = grp_Decrease.Id, recheck };
 
                         return new JsonView() { Code = 200, Msg = "修改成功!", Data = data };
                     }