修改马士基订舱台账

master
jianghaiqing 8 months ago
parent bf41b71ee8
commit 334809922a

@ -990,7 +990,14 @@ namespace Myshipping.Application.Service.BookingOrder
//菜单375504048771141=我的任务台账
List<long> userlist = await _sysDataUserMenuService.GetDataScopeList(MenuConst.MenuMSKApi);
if (userlist.Count > 0)
bool isAdmin = false;
if(userlist == null)
{
isAdmin = true;
userlist = new List<long>();
}
else if (userlist != null && userlist.Count > 0)
{
userlist.Add(UserManager.UserId);
userlist = userlist.Distinct().ToList();
@ -999,7 +1006,7 @@ namespace Myshipping.Application.Service.BookingOrder
_logger.LogInformation("任务台账权限范围 {list}", userlist);
var entities = await _bookingDeliveryRecordRep.AsQueryable()
.Where(t => userlist == null || (userlist.Count > 0 && userlist.Contains(t.CreatedUserId.Value)))
.Where(t => isAdmin || userlist.Contains(t.CreatedUserId.Value))
.WhereIF(createBegin != DateTime.MinValue, t => t.CreatedTime.HasValue && t.CreatedTime.Value >= createBegin)
.WhereIF(createEnd != DateTime.MinValue, t => t.CreatedTime.HasValue && t.CreatedTime.Value < createEnd)
.WhereIF(updateBegin != DateTime.MinValue, t => t.UpdatedTime.HasValue && t.UpdatedTime.Value >= updateBegin)

Loading…
Cancel
Save