From 1b3247cf8060aa3d4da5750732807ceb826efb49 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 31 May 2023 12:46:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TaskManagePlat/TaskManageService.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)