public async Task <PagedResultDto <SupplyBackSubDto> > GetSub(PageSubDto input) { var query = from a in _supplyBackSubRepository.GetAll() join b in _supplyBaseRepository.GetAll() on a.SupplyId equals b.Id join u in _userRepository.GetAll() on a.CreatorUserId equals u.Id select new SupplyBackSubDto() { Code = b.Code, EndTime = a.CreationTime, Id = a.Id, MainId = a.MainId, Money = b.Money, Name = b.Name, StartTime = b.CreationTime, Status = a.Status, SupplyId = a.SupplyId, Type = b.Type, TypeName = ((SupplyType)b.Type).ToString(), UserId = a.CreatorUserId.Value, UserId_Name = u.Name, Version = b.Version, StatusTitle = ((SupplyBackSubStatus)a.Status).ToString() }; var count = await query.CountAsync(); var model = await query.OrderByDescending(ite => ite.EndTime).OrderBy(ite => ite.Status).PageBy(input).ToListAsync(); return(new PagedResultDto <SupplyBackSubDto>(count, model)); }
/// <summary> /// 行政获取报废申请列表 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <PagedResultDto <SupplyScrapSubDto> > GetSub(PageSubDto input) { var strflowid = input.FlowId.ToString(); var query = from a in _supplyScrapSubRepository.GetAll() join b in _supplyBaseRepository.GetAll() on a.SupplyId equals b.Id join u in _userRepository.GetAll() on a.CreatorUserId equals u.Id let openModel = (from c in _workFlowTaskRepository.GetAll().Where(x => x.FlowID == input.FlowId && x.InstanceID == a.Id.ToString() && x.ReceiveID == AbpSession.UserId.Value && x.Type != 6 && strflowid.GetFlowContainHideTask(x.Status)) select c).Any() select new SupplyScrapSubDto() { Code = b.Code, CreationTime = a.CreationTime, ExpiryDate = b.ExpiryDate, ProductDate = b.CreationTime, Id = a.Id, MainId = a.MainId, Money = b.Money, Name = b.Name, Status = a.Status, SupplyId = a.SupplyId, Type = b.Type, TypeName = ((SupplyType)b.Type).ToString(), UserId = a.CreatorUserId.Value, UserId_Name = u.Name, Version = b.Version, Reason = a.Reason, OpenModel = openModel ? 1 : 2, }; var count = await query.CountAsync(); var model = await query.OrderBy(ite => ite.OpenModel).ThenByDescending(ite => ite.CreationTime).PageBy(input).ToListAsync(); var retdata = new List <SupplyScrapSubDto>(); foreach (var item in model) { item.InstanceId = item.Id.ToString(); _workFlowBusinessTaskManager.SupplementWorkFlowBusinessList(input.FlowId, item as SupplyScrapSubDto); retdata.Add(item); } return(new PagedResultDto <SupplyScrapSubDto>(count, retdata)); }