From ca43793c990dd161e59694d1e0622c1f8ce9108b Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 8 May 2023 11:34:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=8F=B0=E8=B4=A6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskManagePlat/TaskManageService.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index 500249ef..d3cdffbc 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -98,6 +98,7 @@ namespace Myshipping.Application private readonly IDjyWebsiteAccountConfigService _webAccountConfig; private readonly ISysCacheService _cache; private readonly ILogger _logger; + private readonly ISysDataUserMenu _sysDataUserMenuService; private readonly INamedServiceProvider _namedBookingOrderServiceProvider; @@ -138,6 +139,7 @@ namespace Myshipping.Application INamedServiceProvider namedBookingOrderServiceProvider, IDjyWebsiteAccountConfigService webAccountConfig, ISysCacheService cache, + ISysDataUserMenu sysDataUserMenuService, ILogger logger) { _taskBaseInfoRepository = taskBaseInfoRepository; @@ -166,6 +168,8 @@ namespace Myshipping.Application _namedBookingOrderServiceProvider = namedBookingOrderServiceProvider; + _sysDataUserMenuService = sysDataUserMenuService; + _webAccountConfig = webAccountConfig; _cache = cache; @@ -643,10 +647,15 @@ namespace Myshipping.Application //var statList = _taskStatManageInfoRepository.AsQueryable().Where(t => (t.USER_ID == userTendInfo.User.Id //&& t.STAT_TYPE == TaskStatLevelEnum.PERSON.ToString()) || (t.COMP_ID == userTendInfo.Tend.Id && t.STAT_TYPE == TaskStatLevelEnum.PUBLIC.ToString())).ToList(); + //菜单375504048771141=我的任务台账 + List userlist = await _sysDataUserMenuService.GetDataScopeList(375504048771141); + + if (userlist == null || userlist.Count == 0) + userlist = new List { UserManager.UserId }; //任务列表分组统计 var groupList = _taskBaseInfoRepository.AsQueryable() - .Where(t => (t.CreatedUserId == UserManager.UserId && t.IS_PUBLIC == 0) || (t.TenantId == userTendInfo.Tend.Id && t.IS_PUBLIC == 1)) + .Where(t => (userlist.Contains(t.CreatedUserId) && t.IS_PUBLIC == 0) || (t.TenantId == userTendInfo.Tend.Id && t.IS_PUBLIC == 1)) .GroupBy(p => new { p.TASK_TYPE, p.STATUS, p.IS_EXCEPT, p.IS_PUBLIC }) .Select(p => new { @@ -892,8 +901,14 @@ namespace Myshipping.Application if (!string.IsNullOrWhiteSpace(QuerySearch.SortField)) entityOrderCol = MapsterExtHelper.GetAdaptProperty(QuerySearch.SortField); + //菜单375504048771141=我的任务台账 + List userlist = await _sysDataUserMenuService.GetDataScopeList(375504048771141); + + if (userlist == null || userlist.Count == 0) + userlist = new List { UserManager.UserId }; + var entities = await _taskBaseInfoRepository.AsQueryable() - .Where(t=> t.CreatedUserId == UserManager.UserId) + .Where(t=> userlist.Contains(t.CreatedUserId)) .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), t => mblList.Any(p => p.Contains(t.MBL_NO, StringComparison.OrdinalIgnoreCase))) .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), t => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim(), StringComparison.OrdinalIgnoreCase)) .WhereIF(etdBegin != DateTime.MinValue, t => t.ETD.HasValue && t.ETD.Value >= etdBegin)