public async Task <BoxGraphData> GetLeadTimeBoxGraphData(DateTimeOffset startDate, DateTimeOffset finishDate, bool product, bool engineering, bool unanticipated, bool assessmentsTeam, bool enterpriseTeam) { Product = product; Engineering = engineering; Unanticipated = unanticipated; AssessmentsTeam = assessmentsTeam; EnterpriseTeam = enterpriseTeam; var boxGraphData = new BoxGraphData { Entries = new List <BoxGraphDataEntry> { new BoxGraphDataEntry(), new BoxGraphDataEntry(), new BoxGraphDataEntry(), new BoxGraphDataEntry() }, Outliers = new List <object[]>() }; var taskItems = await taskItemRepository.GetTaskItemListAsync(startDate, finishDate); var taskItemsByType = new[] { new List <TaskItem>(), new List <TaskItem>(), new List <TaskItem>() }; var finalTaskItemList = new List <TaskItem>(); foreach (var item in taskItems .Where(item => taskItemHelper.TaskItemDevTeamIsSelected(AssessmentsTeam, EnterpriseTeam, item))) { taskItemsByType[(int)item.Type - 1].Add(item); if (taskItemHelper.TaskItemTypeIsSelected(Product, Engineering, Unanticipated, item)) { finalTaskItemList.Add(item); } } foreach (var itemList in taskItemsByType) { if (itemList.Count > 0) { var sortedItemList = SortByLeadTime(itemList); var index = (int)itemList[0].Type - 1; boxGraphData = CalculateBoxGraphData(sortedItemList, boxGraphData, index); } } boxGraphData = CalculateBoxGraphData(SortByLeadTime(finalTaskItemList), boxGraphData, 3); boxGraphData.Entries[3].TaskItemType = "Selected Task Items"; return(boxGraphData); }
public async Task <List <TaskItem> > GetTaskItems(DateTimeOffset startDate, DateTimeOffset endDate) { var taskItems = await taskItemRepository.GetTaskItemListAsync(startDate, endDate); var badTaskItems = taskItems.Where(taskItem => taskItem.FinishTime == null).ToList(); foreach (var badTaskItem in badTaskItems) { taskItems.Remove(badTaskItem); } return(taskItems); }
public async Task <Dictionary <TaskItemType, ScatterPlotData> > GetLeadTimeScatterPlotDataAsync(DateTimeOffset startDate, DateTimeOffset finishDate , bool product, bool engineering, bool unanticipated, bool assessmentsTeam, bool enterpriseTeam) { Product = product; Engineering = engineering; Unanticipated = unanticipated; AssessmentsTeam = assessmentsTeam; EnterpriseTeam = enterpriseTeam; var rawData = await taskItemRepository.GetTaskItemListAsync(startDate, finishDate); var taskItemTypes = GetTaskItemTypes(); return(GetCardsByType(taskItemTypes, rawData.ToArray())); }
public async Task <List <TaskItem> > GetTaskItemsAsync(DateTimeOffset startTime, DateTimeOffset finishTime) { var taskList = await taskItemRepository.GetTaskItemListAsync(startTime, finishTime); foreach (var task in taskList) { task.HistoryEvents = await historyEventRepository.GetHistoryEventsByTaskIdAsync(task.Id); } var removeList = taskList.Where(taskItem => taskItem.StartTime == null).ToList(); foreach (var removeItem in removeList) { taskList.Remove(removeItem); } return(taskList); }
public async Task <List <TaskItem> > GetTaskItemData(DateTimeOffset startDate, DateTimeOffset finishDate) { var result = await taskItemRepository.GetTaskItemListAsync(startDate, finishDate); return(result); }