diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index 8bc25961..508d31c0 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -939,10 +939,16 @@ namespace Myshipping.Application //菜单375504048771141=我的任务台账 List userlist = await _sysDataUserMenuService.GetDataScopeList(375504048771141); + if (userlist == null) + userlist = new List { UserManager.UserId }; + + if (userlist.Count > 0) + userlist = userlist.Distinct().ToList(); + _logger.LogInformation("任务台账权限范围 {list}", userlist); var entities = await _taskBaseInfoRepository.AsQueryable() - .Where(t=> userlist == null || userlist.Contains(t.CreatedUserId)) + .Where(t=> userlist.Contains(t.CreatedUserId)) .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), t => mblList.Contains(t.MBL_NO)) .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), t => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim())) .WhereIF(etdBegin != DateTime.MinValue, t => t.ETD.HasValue && t.ETD.Value >= etdBegin)