Пример #1
0
        public static string TotalCompletedStoryCount()
        {
            var appData          = App.GetReleaseScrumData().ReleaseData;
            var completedStories = new List <Story>();

            List <SprintProxy> sprintProxyList = new List <SprintProxy>();

            foreach (var sprint in appData.Sprints)
            {
                var sprintProxy = new SprintProxy()
                {
                    CurrentSprint = sprint
                };
                sprintProxy.AnalyzeCompletedStory();
                //sprintProxy.AnalyzeFailedStory();

                sprintProxyList.Add(sprintProxy);
            }

            sprintProxyList.ForEach(t =>
            {
                completedStories.AddRange(t.CompletedStories);
            });

            return(completedStories.Count().ToString());
        }
Пример #2
0
        public static DataResult GetReleaseScrumData()
        {
            if (release5 == null || DateTime.Now.Subtract(lastUpdateTime).TotalMinutes > 1)
            {
                release5 = ReadSprintDataFromRepository();

                if (release5 != null)
                {
                    CurrentSprintProxy = new SprintProxy()
                    {
                        CurrentSprint = release5.CurrentSprint
                    };
                    CurrentSprintProxy.Analyze();
                }

                lastUpdateTime = DateTime.Now;
            }

            return(new DataResult()
            {
                ReleaseData = release5,
                CurrentSprintProxy = CurrentSprintProxy
            });
        }
Пример #3
0
        public void Analyze()
        {
            string dataPath     = @"..\..\AdministratorSite\CollectedData";
            string newdataFile  = $@"{dataPath}\{dataFile}.json";
            string lastDataFile = $@"{dataPath}\{this.lastDataFile}.json";
            string currentSprintActivityDataFile = $@"{dataPath}\{AppConfig.CurrentSprintActivityFile}.json";

            Release currentCaptureRelease = null;
            Release lastCaptureRelease    = null;

            if (File.Exists(newdataFile))
            {
                var currntContent = File.ReadAllText(newdataFile);
                currentCaptureRelease = JsonConvert.DeserializeObject <Release>(currntContent);
            }
            if (File.Exists(lastDataFile))
            {
                var lastContent = File.ReadAllText(lastDataFile);
                lastCaptureRelease = JsonConvert.DeserializeObject <Release>(lastContent);
            }

            var personActivity = GetExistingCurrentSprintActivities(currentSprintActivityDataFile, currentCaptureRelease.CurrentSprint.Name);

            if (lastCaptureRelease == null)
            {
                var curentSprintProxy = new SprintProxy()
                {
                    CurrentSprint = currentCaptureRelease.CurrentSprint
                };
                foreach (var item in curentSprintProxy.GetRecentActivity())
                {
                    personActivity.Items.Add(new PersonActivityItem()
                    {
                        Name     = item.Name,
                        Sprint   = currentCaptureRelease.CurrentSprint.Name,
                        Time     = item.ModifiedTime,
                        Activity = "Updated" + item.EventObject
                    });
                }
            }
            else
            {
                if (File.Exists(currentSprintActivityDataFile))
                {
                    if (personActivity.Items.Any(t => t.Sprint != currentCaptureRelease.CurrentSprint.Name))
                    {
                        string archiveSprintActivityDataFile = $@"{dataPath}\{personActivity.Items.First().Sprint}Activity.json";
                        File.Move(currentSprintActivityDataFile, archiveSprintActivityDataFile);

                        SaveIntoRepository(personActivity);
                    }
                }

                if (currentCaptureRelease.CurrentSprint.Name == lastCaptureRelease.CurrentSprint.Name)
                {
                    personActivity.Items.AddRange(AnalyzeSprintDiff(currentCaptureRelease.CurrentSprint, lastCaptureRelease.CurrentSprint));
                }
            }

            personActivity.Items = personActivity.Items.Where(t => t.Sprint == currentCaptureRelease.CurrentSprint.Name).OrderByDescending(t => t.Time).ToList();

            personActivity._id = currentCaptureRelease.CurrentSprint.Name;
            SaveIntoFile(currentSprintActivityDataFile, personActivity);
            SaveIntoRepository(personActivity);
        }