/// <summary> /// 加载列表 /// </summary> public async Task <TableData> Load(QueryWmsInboundOrderDtblListReq request) { var loginContext = _auth.GetCurrentUser(); if (loginContext == null) { throw new CommonException("登录已过期", Define.INVALID_TOKEN); } //todo:普通账号如何分配明细的字段????先写死😰 var properties = _dbExtension.GetProperties("WmsInboundOrderDtbl"); var result = new TableData(); var objs = UnitWork.Find <WmsInboundOrderDtbl>(null); if (!string.IsNullOrEmpty(request.InboundOrderId)) { objs = objs.Where(u => u.OrderId == request.InboundOrderId); } if (!string.IsNullOrEmpty(request.key)) { objs = objs.Where(u => u.GoodsId.Contains(request.key)); } var propertyStr = string.Join(',', properties.Select(u => u.Key)); result.columnHeaders = properties; result.data = objs.OrderBy(u => u.Id) .Skip((request.page - 1) * request.limit) .Take(request.limit).Select($"new ({propertyStr})"); result.count = objs.Count(); return(result); }
/// <summary> /// 获取用户可访问的字段列表 /// </summary> /// <param name="moduleCode">模块的code</param> /// <returns></returns> public List <KeyDescription> GetProperties(string moduleCode) { var allprops = _dbExtension.GetProperties(moduleCode); var props = UnitWork.Find <Relevance>(u => u.Key == Define.ROLEDATAPROPERTY && _userRoleIds.Contains(u.FirstId) && u.SecondId == moduleCode) .Select(u => u.ThirdId); return(allprops.Where(u => props.Contains(u.Key)).ToList()); }
public List <KeyDescription> GetProperties(string moduleCode) { return(_dbExtension.GetProperties(moduleCode)); }