public List <User> GetAllUsersById(long id) { var childs = _organizationUnitManager.FindChildren(id, true); var ids = new List <long>(); ids.Add(id); foreach (var child in childs) { ids.Add(child.Id); } var organizationUnitsServer = Abp.AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <IWorkFlowOrganizationUnitsAppService>(); var retusers = GetAllByOrganizeIDArray(ids.ToArray()); return(retusers); }
/// <summary> /// 获取统计的详情列表 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <PagedResultDto <DocmentListDto> > GetDocmentList(SearchInput input) { var userids = new List <long>(); if (input.Type == Type.用户) { userids.Add(input.Id); } else { var orgids = new List <long>(); orgids.Add(input.Id); var child = _organizationUnitManager.FindChildren(input.Id).Select(ite => ite.Id).ToList(); if (child != null && child.Count > 0) { orgids.AddRange(child); } var orguser = _userOrganizationUnitsRepository.GetAll().Where(ite => orgids.Contains(ite.OrganizationUnitId) && ite.IsMain).Select(ite => ite.UserId).Distinct().ToList(); userids.AddRange(orguser); } var query = from a in _docmentRepository.GetAll() join b in _abpDictionaryRepository.GetAll() on a.Type equals b.Id join c in _userRepository.GetAll() on a.UserId equals c.Id where userids.Contains(a.UserId.Value) select new DocmentListDto() { CreationTime = a.CreationTime, Attr = a.Attr, Attr_Name = a.Attr.ToString(), Id = a.Id, QrCodeId = a.QrCodeId, Location = a.Location, Name = a.Name, No = a.No, Type = a.Type, IsOld = a.IsOld, IsOut = a.IsOut, IsProject = a.IsProject, ArchiveId = a.ArchiveId, Type_Name = b.Title, UserId = a.UserId, Des = a.Des, Status = (int)a.Status, NeedBack = a.NeedBack, UserId_Name = c.Name, StatusTitle = ((DocmentStatus)a.Status).ToString() }; switch (input.ListType) { case ListType.资料总数: break; case ListType.发起归档: query = query.Where(ite => ite.Status > 0); break; case ListType.在外流转: query = query.Where(ite => ite.IsOut); break; case ListType.需归还档案: query = query.Where(ite => ite.NeedBack); break; } var count = query.Count(); var ret = await query.OrderByDescending(r => r.CreationTime).PageBy(input).ToListAsync(); return(new PagedResultDto <DocmentListDto>(count, ret)); }