perf: отключил должности для экономии памяти
Create and publish a Docker image / Publish image (push) Successful in 1m30s
Create and publish a Docker image / Publish image (push) Successful in 1m30s
This commit is contained in:
@@ -3,7 +3,7 @@ using System.Text.Json;
|
|||||||
|
|
||||||
namespace SfeduSchedule.Services;
|
namespace SfeduSchedule.Services;
|
||||||
|
|
||||||
public class ModeusEmployeeService(ISchedulerFactory schedulerFactory)
|
public class ModeusEmployeeService
|
||||||
: IHostedService
|
: IHostedService
|
||||||
{
|
{
|
||||||
private Dictionary<string, (string, List<string>)> _employees = []; // ФИО (ИД, Список должностей)
|
private Dictionary<string, (string, List<string>)> _employees = []; // ФИО (ИД, Список должностей)
|
||||||
|
|||||||
@@ -233,21 +233,22 @@ public class ModeusService(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var position = (e.GroupName ?? string.Empty).Trim();
|
// Отключено так как информация нигде не используется
|
||||||
|
// var position = (e.GroupName ?? string.Empty).Trim();
|
||||||
static string FormatDateRange(string? dateIn, string? dateOut)
|
//
|
||||||
{
|
// static string FormatDateRange(string? dateIn, string? dateOut)
|
||||||
var start = (dateIn ?? string.Empty).Trim();
|
// {
|
||||||
if (string.IsNullOrEmpty(start)) start = "?";
|
// var start = (dateIn ?? string.Empty).Trim();
|
||||||
|
// if (string.IsNullOrEmpty(start)) start = "?";
|
||||||
var end = (dateOut ?? string.Empty).Trim();
|
//
|
||||||
if (string.IsNullOrEmpty(end)) end = "по наст.вр.";
|
// var end = (dateOut ?? string.Empty).Trim();
|
||||||
|
// if (string.IsNullOrEmpty(end)) end = "по наст.вр.";
|
||||||
return $"{start}–{end}";
|
//
|
||||||
}
|
// return $"{start}–{end}";
|
||||||
|
// }
|
||||||
var dateRange = FormatDateRange(e.DateIn, e.DateOut);
|
//
|
||||||
var positionWithDates = string.IsNullOrEmpty(position) ? $"({dateRange})" : $"{position} ({dateRange})";
|
// var dateRange = FormatDateRange(e.DateIn, e.DateOut);
|
||||||
|
// var positionWithDates = string.IsNullOrEmpty(position) ? $"({dateRange})" : $"{position} ({dateRange})"; // Место работы с датой
|
||||||
|
|
||||||
if (!grouped.TryGetValue(fullName, out var entry))
|
if (!grouped.TryGetValue(fullName, out var entry))
|
||||||
{
|
{
|
||||||
@@ -261,10 +262,10 @@ public class ModeusService(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entry.Positions.Contains(positionWithDates))
|
// if (!entry.Positions.Contains(positionWithDates))
|
||||||
{
|
// {
|
||||||
entry.Positions.Add(positionWithDates);
|
// entry.Positions.Add(positionWithDates);
|
||||||
}
|
// }
|
||||||
|
|
||||||
grouped[fullName] = entry;
|
grouped[fullName] = entry;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user