Исправлены мелкие неточности.

This commit is contained in:
Danil Kislov
2019-09-13 09:36:38 +03:00
parent 61e53c3698
commit 6e4e34f44c
6 changed files with 45 additions and 39 deletions
+1 -1
View File
@@ -1 +1 @@
1.0.62
1.0.63
+31 -31
View File
@@ -1,31 +1,31 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("JiraTimeBot")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("JiraTimeBot")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.62")]
[assembly: AssemblyFileVersion("1.0.62")]
[assembly: AssemblyInformationalVersion("1.0.62")]
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("JiraTimeBot")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("JiraTimeBot")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.63")]
[assembly: AssemblyFileVersion("1.0.63")]
[assembly: AssemblyInformationalVersion("1.0.63")]
@@ -25,5 +25,13 @@ namespace JiraTimeBot.TaskTime.Objects
FilesAffected = filesAffected;
Type = type;
}
public void MergeWith(TaskTimeItem toMerge)
{
Commits += toMerge.Commits;
TimeSpent += toMerge.TimeSpent;
Description += "\r\n" + toMerge.Description;
Type |= toMerge.Type;
}
}
}
@@ -20,7 +20,7 @@ namespace JiraTimeBot.TaskTime
_spreadHelper = spreadHelper;
}
public List<TaskTimeItem> CalculateTaskTime(List<TaskTimeItem> commits, Settings settings, CancellationToken cancellationToken = default(CancellationToken))
public List<TaskTimeItem> CalculateTaskTime(List<TaskTimeItem> commits, Settings settings, CancellationToken cancellationToken = default)
{
int minutesPerWorkDay = settings.MinuterPerWorkDay + GetRandomMinutes(settings);
int workHours = (settings.MinuterPerWorkDay / 60);
@@ -59,12 +59,10 @@ namespace JiraTimeBot.TaskTime
var workTasks = _spreadHelper.SpreadTime(taskCommits, remainMinutes, settings.RoundToMinutes);
foreach (var workTask in workTasks)
{
var existingItem = workTimeItems.FirstOrDefault(f => f.Branch == workTask.Branch);
TaskTimeItem existingItem = workTimeItems.FirstOrDefault(f => f.Branch == workTask.Branch);
if (existingItem != null)
{
existingItem.TimeSpent += workTask.TimeSpent;
existingItem.Description += "\r\n" + workTask.Description;
existingItem.Type |= CommitType.Task;
existingItem.MergeWith(workTask);
continue;
}
+1 -1
View File
@@ -26,7 +26,7 @@ namespace JiraTimeBot.TaskTime
{
int currentTaskCommits = taskGroup.Count();
int currentTaskTime = (int)RoundTo(minutes / source.Count * currentTaskCommits, roundToMinutes, roundUp);
remainMinutes = remainMinutes - currentTaskTime;
remainMinutes -= currentTaskTime;
var orderedTasks = taskGroup.OrderBy(f => f.StartTime).ToArray();
StringBuilder sb = new StringBuilder();
@@ -19,7 +19,7 @@ namespace JiraTimeBot.TasksProcessors
_jiraApi = jiraApi;
}
public void Process(DateTime setForDate, DateTime realDate, List<TaskTimeItem> taskTimes, Settings settings, bool dummyMode, CancellationToken cancellationToken = default(CancellationToken))
public void Process(DateTime setForDate, DateTime realDate, List<TaskTimeItem> taskTimes, Settings settings, bool dummyMode, CancellationToken cancellationToken = default)
{
_log.Trace($"На реальную дату {realDate:dd.MM.yyyy} распределение по задачам:");