/// <summary> /// 获取用户待审核列表(待修正) /// </summary> /// <param name="userId"></param> /// <param name="condition"></param> /// <param name="cancellationToken"></param> /// <returns></returns> public async Task <PagingResponseMessage <ExamineFlowListResponse> > GetUserWaitingExamineFlowList(string userId, UserWaitingExamineFlowListCondition condition, CancellationToken cancellationToken = default(CancellationToken)) { PagingResponseMessage <ExamineFlowListResponse> pagingResponse = new PagingResponseMessage <ExamineFlowListResponse>(); if (condition == null) { throw new ArgumentNullException(nameof(condition)); } var q = Store.GetRecordQuery().Where(a => a.ExamineUserId == userId && a.RecordStstus == RecordStatus.Waiting); pagingResponse.TotalCount = await q.CountAsync(cancellationToken); var qlist = await q.OrderByDescending(a => a.RecordTime).Skip(condition.PageIndex * condition.PageSize).Take(condition.PageSize).ToListAsync(cancellationToken); var resulte = qlist.Select(a => new ExamineFlowListResponse() { ContentId = a.ExamineFlow.ContentId, ContentName = a.ExamineFlow.ContentName, ContentType = a.ExamineFlow.ContentType, Desc = a.ExamineFlow.Desc, ExamineStatus = a.ExamineFlow.ExamineStatus, Id = a.ExamineFlow.Id, SubmitOrganizationId = a.ExamineFlow.SubmitOrganizationId, SubmitOrganizationName = a.ExamineFlow.SubmitOrganizationName, SubmitTime = a.ExamineFlow.SubmitTime, SubmitUserId = a.ExamineFlow.SubmitUserId, SubmitUserName = a.ExamineFlow.SubmitUserName, TaskName = a.ExamineFlow.TaskName, Ext1 = a.ExamineFlow.Ext1, Ext2 = a.ExamineFlow.Ext2, Ext3 = a.ExamineFlow.Ext3, Ext4 = a.ExamineFlow.Ext4, Ext5 = a.ExamineFlow.Ext5, Ext6 = a.ExamineFlow.Ext6, Ext7 = a.ExamineFlow.Ext7, Ext8 = a.ExamineFlow.Ext8 }); pagingResponse.PageIndex = condition.PageIndex; pagingResponse.PageSize = condition.PageSize; pagingResponse.Extension = resulte.ToList(); return(pagingResponse); }
public async Task <PagingResponseMessage <ExamineFlowListResponse> > GetUserWaitingExamineFlowList(UserInfo user, [FromBody] UserWaitingExamineFlowListCondition condition) { PagingResponseMessage <ExamineFlowListResponse> pagingResponse = new PagingResponseMessage <ExamineFlowListResponse>(); if (!ModelState.IsValid) { pagingResponse.Code = ResponseCodeDefines.ModelStateInvalid; pagingResponse.Message = ModelState.GetAllErrors(); Logger.Error($"用户{user?.UserName ?? ""}({user?.Id ?? ""})获取待审核列表(GetUserWaitingExamineFlowList)模型验证失败:\r\n{pagingResponse.Message},请求参数为:\r\n" + (condition != null ? JsonHelper.ToJson(condition) : "")); return(pagingResponse); } try { return(await _examineFlowManager.GetUserWaitingExamineFlowList(user.Id, condition, HttpContext.RequestAborted)); } catch (Exception e) { pagingResponse.Code = ResponseCodeDefines.ServiceError; pagingResponse.Message = e.ToString(); Logger.Error($"用户{user?.UserName ?? ""}({user?.Id ?? ""})获取待审核列表(GetUserWaitingExamineFlowList)报错:\r\n{e.ToString()},请求参数为:\r\n" + (condition != null ? JsonHelper.ToJson(condition) : "")); } return(pagingResponse); }