public async Task <ObjectResultModule> OrderTimeoutReminderList([FromBody] OrderTimeoutReminderIn OrderTimeoutReminderList) { if (!Commons.CheckSecret(OrderTimeoutReminderList.Secret)) { this.ObjectResultModule.StatusCode = 422; this.ObjectResultModule.Message = "Wrong Secret"; this.ObjectResultModule.Object = ""; return(this.ObjectResultModule); } var userid = _IabpSession.UserId > 0 ? (int)_IabpSession.UserId : 0; OrderTimeoutReminderList.AndAlso(t => !t.IsDelete); var value = await _OrderTimeoutReminderService.OrderTimeoutReminderList(OrderTimeoutReminderList); if (value.Count() == 0) { this.ObjectResultModule.StatusCode = 204; this.ObjectResultModule.Message = "NoContent"; this.ObjectResultModule.Object = ""; } else { this.ObjectResultModule.Object = value; this.ObjectResultModule.Message = "sucess"; this.ObjectResultModule.StatusCode = 200; } #region 操作日志 var CreateYaeherOperList = new YaeherOperList() { OperExplain = "OrderTimeoutReminderList", OperContent = JsonHelper.ToJson(OrderTimeoutReminderList), OperType = "OrderTimeoutReminderList", CreatedBy = userid, CreatedOn = DateTime.Now }; var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList); #endregion return(this.ObjectResultModule); }
public async Task <IList <OrderTimeoutReminder> > OrderTimeoutReminderList(OrderTimeoutReminderIn OrderTimeoutReminderInfo) { var OrderTimeoutReminders = await _repository.GetAllListAsync(OrderTimeoutReminderInfo.Expression); return(OrderTimeoutReminders.ToList()); }
public async Task <PagedResultDto <OrderTimeoutReminder> > OrderTimeoutReminderPage(OrderTimeoutReminderIn OrderTimeoutReminderInfo) { //初步过滤 var query = _repository.GetAll().OrderByDescending(a => a.CreatedOn).Where(OrderTimeoutReminderInfo.Expression); //获取总数 var tasksCount = query.Count(); //获取总数 var totalpage = tasksCount / OrderTimeoutReminderInfo.MaxResultCount; var OrderTimeoutReminderList = await query.PageBy(OrderTimeoutReminderInfo.SkipTotal, OrderTimeoutReminderInfo.MaxResultCount).ToListAsync(); return(new PagedResultDto <OrderTimeoutReminder>(tasksCount, OrderTimeoutReminderList.MapTo <List <OrderTimeoutReminder> >())); }
/// <summary> /// 输出模型 /// </summary> /// <param name="OrderTimeoutReminderDto"></param> /// <param name="OrderTimeoutReminderInfo"></param> public OrderTimeoutReminderOut(PagedResultDto <OrderTimeoutReminder> OrderTimeoutReminderDto, OrderTimeoutReminderIn OrderTimeoutReminderInfo) { Items = OrderTimeoutReminderDto.Items; TotalCount = OrderTimeoutReminderDto.TotalCount; TotalPage = OrderTimeoutReminderDto.TotalCount / OrderTimeoutReminderInfo.MaxResultCount; SkipCount = OrderTimeoutReminderInfo.SkipCount; MaxResultCount = OrderTimeoutReminderInfo.MaxResultCount; }