From d86fc2b623394668e899fc67f1f6a32dc539745e Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 8 May 2023 16:39:28 +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=E6=95=B0=E6=8D=AE=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TaskManagePlat/TaskManageService.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index d3cdffbc..f0d207a2 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -650,12 +650,10 @@ namespace Myshipping.Application //菜单375504048771141=我的任务台账 List userlist = await _sysDataUserMenuService.GetDataScopeList(375504048771141); - if (userlist == null || userlist.Count == 0) - userlist = new List { UserManager.UserId }; - + bool isAdmin = userlist == null; //任务列表分组统计 var groupList = _taskBaseInfoRepository.AsQueryable() - .Where(t => (userlist.Contains(t.CreatedUserId) && t.IS_PUBLIC == 0) || (t.TenantId == userTendInfo.Tend.Id && t.IS_PUBLIC == 1)) + .Where(t => isAdmin || (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 { @@ -904,11 +902,8 @@ namespace Myshipping.Application //菜单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=> userlist.Contains(t.CreatedUserId)) + .Where(t=> userlist == null || 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)