修改任务台账查询

optimize
jianghaiqing 2 years ago
parent 0fe0b1ef62
commit 1b3247cf80

@ -939,10 +939,16 @@ namespace Myshipping.Application
//菜单375504048771141=我的任务台账 //菜单375504048771141=我的任务台账
List<long> userlist = await _sysDataUserMenuService.GetDataScopeList(375504048771141); List<long> userlist = await _sysDataUserMenuService.GetDataScopeList(375504048771141);
if (userlist == null)
userlist = new List<long> { UserManager.UserId };
if (userlist.Count > 0)
userlist = userlist.Distinct().ToList();
_logger.LogInformation("任务台账权限范围 {list}", userlist); _logger.LogInformation("任务台账权限范围 {list}", userlist);
var entities = await _taskBaseInfoRepository.AsQueryable() 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.MBlNo), t => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), t => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), t => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, t => t.ETD.HasValue && t.ETD.Value >= etdBegin) .WhereIF(etdBegin != DateTime.MinValue, t => t.ETD.HasValue && t.ETD.Value >= etdBegin)

Loading…
Cancel
Save