public async Task <PagedResultDto <VW_DispatchBill_List> > GetAll(ICMODispBillGetAllInput input) { #region 废弃代码,并未被调用 //var query = JIT_VW_ICMODispBill_By_Date.GetAll() // .Where(p => p.FMOBillNo == input.FMOBillNo ); //query = input.FDate == null ? query : query.Where(p => p.日期 == input.FDate); //var count = await query.CountAsync(); //try //{ // var data = await query.ToListAsync(); // var list = data.MapTo<List<ICMODispBillListDto>>(); // return new PagedResultDto<ICMODispBillListDto>(count, list); //} //catch (Exception e) //{ // Console.WriteLine(e); // throw; //} #endregion var query = V_Repository.GetAll().Where(input.Where); var count = await query.CountAsync(); var list = await query.OrderByDescending(p => p.FBillTime).PageBy(input).ToListAsync(); return(new PagedResultDto <VW_DispatchBill_List>(count, list)); }
//public IRepository<ICMOSchedule, string> SRepository { get; set; } /// <summary> /// 任务派工界面数据 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <PagedResultDto <ICMODispBillListDto> > GetAll(ICMODispBillGetAllInput input) { var query = VRepository.GetAll() .Where(p => p.FMOBillNo == input.FMOBillNo && p.FMOInterID == input.FMOInterID); query = input.FDate == null?query: query.Where(p => p.日期 == input.FDate); var count = await query.CountAsync(); try { var data = await query.ToListAsync(); var list = data.MapTo(new List <ICMODispBillListDto>()); return(new PagedResultDto <ICMODispBillListDto>(count, list)); } catch (Exception e) { Console.WriteLine(e); throw; } }