yuanrf недель назад: 2
Родитель
Сommit
c374138774

+ 1 - 1
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -3885,7 +3885,7 @@ FROM
                     */
                     string auditOperatorName = " - ";
 
-                    if (entity.IsAuditGM != 0 )
+                    if (entity.IsAuditGM != 0)
                     {
                         if (entity.AuditGMOperate == 0) auditOperatorName = " - ";
                         else if (entity.AuditGMOperate == 4) auditOperatorName = "自动审核";

+ 0 - 1
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -40,7 +40,6 @@ namespace OASystem.API.Controllers
         private readonly List<int> _taskTypeList = new() { 6 };//任务通知 TaskNotification
         private readonly ApprovalProcessRepository _approvalProcessRep;
 
-
         public SystemController(
             CompanyRepository syscom,
             DepartmentRepository sysDepRep,

+ 32 - 4
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostDraftRepository.cs

@@ -1,16 +1,17 @@
-using OASystem.Domain.Dtos.Groups;
+using AutoMapper;
+using EyeSoft.Collections.Generic;
+using OASystem.Domain;
+using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Groups;
-using OASystem.Domain;
 using OASystem.Infrastructure.Repositories.System;
 using OASystem.Infrastructure.Tools;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;
-using AutoMapper;
-using EyeSoft.Collections.Generic;
 
 namespace OASystem.Infrastructure.Repositories.Groups
 {
@@ -111,6 +112,33 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 feeBasePermIds.AddRange(intlDplmcyBasePerm.Select(x => x.Id).ToList());
             }
 
+            /*
+             * 市场部 朱姝 默认添加贵州、重庆、云南的出入境费用查看权限
+             */
+            if (currUserId == 380)
+            {
+                var cityPerm = new List<string>()
+                {
+                    "贵州", "重庆", "云南"
+                };
+                var draftInfo = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().FirstAsync(x => x.Id == draftId && x.IsDel == 0);
+                if (draftInfo != null)
+                {
+                    //1.通过团组名称判断是否包含城市
+                    if (cityPerm.Any(x => draftInfo.DraftName.Contains(x)))
+                    {
+                        feeBasePermIds.Add(currUserId);
+                    }
+                    //2.通过城市Id判断是否包含城市
+                    else
+                    {
+                        var draftProvince = await _sqlSugar.Queryable<Sys_Cities>()
+                                .FirstAsync(x => x.Id == draftInfo.ProvinceId && cityPerm.Contains(x.Name_CN) && x.IsDel == 0);
+                        if (draftProvince != null) feeBasePermIds.Add(currUserId);
+                    }
+                }
+            }
+
             if (feeBasePermIds.Any())
             {
                 var permissions = new List<Grp_EnterExitCostDraftPermission>();

+ 31 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs

@@ -118,6 +118,37 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 feeBasePermIds.AddRange(intlDplmcyBasePerm.Select(x => x.Id).ToList());
             }
 
+            /*
+             * 市场部 朱姝 默认添加贵州、重庆、云南的出入境费用查看权限
+             */
+            if (currUserId == 380)
+            {
+                var cityPerm = new List<string>()
+                {
+                    "贵州", "重庆", "云南"
+                };
+                var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().FirstAsync(x => x.Id == groupId && x.IsDel == 0);
+                if (groupInfo != null)
+                {
+                    //1.通过团组名称判断是否包含城市
+                    if (cityPerm.Any(x => groupInfo.TeamName.Contains(x)))
+                    {
+                        feeBasePermIds.Add(currUserId);
+                    }
+                    //2.通过城市Id判断是否包含城市
+                    else 
+                    {
+                        var groupCity = await _sqlSugar.Queryable<Sys_Cities>().FirstAsync(x => x.Id == groupInfo.CityId && x.IsDel == 0);
+                        if (groupCity != null)
+                        {
+                            var groupProvince = await _sqlSugar.Queryable<Sys_Cities>()
+                                .FirstAsync(x => x.Id == groupCity.ParentId && cityPerm.Contains(x.Name_CN) && x.IsDel == 0);
+                            if (groupProvince != null) feeBasePermIds.Add(currUserId);
+                        }
+                    }    
+                }
+            }
+
             if (feeBasePermIds.Any())
             {
                 var permissions = new List<Grp_EnterExitCostPermission>();