/// <summary> /// 获取首页项目的数据统计 /// </summary> /// <returns></returns> public async Task <GetDashboardTaskOutput> GeDashboardTask() { CurrentUnitOfWork.DisableFilter(AbpDataFilters.MayHaveTenant); var query = _taskItemAssignmentManager.GetAll().Where(q => q.UserId == GetSessionUserId()); return(new GetDashboardTaskOutput { MyTaskCount = await query.Where(v => !v.LastModificationTime.HasValue && !v.IsForwarded).CountAsync(), MyCommentCount = await query.Where(v => !v.LastModificationTime.HasValue && v.IsForwarded).CountAsync(), AvailableCount = 0 }); }
/// <summary> /// 获取某个模板里面可以下载和预览的任务,通过subProjectId筛选 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <PagedResultDto <TaskItemAssignmentDto> > GetStatementAssignments(GenerateStatementInput input) { var ptIds = await _statementManager.GetAll().Where(v => v.FileItemId == input.FileItemId) .Select(v => v.ProcedureStepTaskItemId).ToListAsync(); var assignments = _taskItemAssignmentManager.GetAll() .Where(v => ptIds.Contains(v.ProcedureStepTaskItemId) && v.Id == v.RootAssignmentId && v.SubProjectId == input.SubProjectId) .Include(v => v.TaskItem).Include(v => v.User); return(new PagedResultDto <TaskItemAssignmentDto>(await assignments.CountAsync(), await assignments.Select(v => v.MapTo <TaskItemAssignmentDto>()).ToListAsync())); }