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)