ApplicationInWorkService начало
This commit is contained in:
@@ -3,8 +3,6 @@ using PARR.DAL.Contracts;
|
|||||||
using PARR.DAL.Models;
|
using PARR.DAL.Models;
|
||||||
using PARR.DAL.Models.AIHIT;
|
using PARR.DAL.Models.AIHIT;
|
||||||
using PARR.DAL.Models.V1;
|
using PARR.DAL.Models.V1;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace PARR.DAL.Context
|
namespace PARR.DAL.Context
|
||||||
{
|
{
|
||||||
@@ -118,7 +116,8 @@ namespace PARR.DAL.Context
|
|||||||
f.HasData(
|
f.HasData(
|
||||||
new { Name = nameof(SettingsFromDb.Initiator), Description = "Инициатор регламентной работы, указывается при создании шаблона в ЕСПП.", Value = "КУЗНЕЦОВ МИХАИЛ ВАЛЕРЬЕВИЧ (IVC_KUZNETSOVMV@DVGD.OAO.RZD)" },
|
new { Name = nameof(SettingsFromDb.Initiator), Description = "Инициатор регламентной работы, указывается при создании шаблона в ЕСПП.", Value = "КУЗНЕЦОВ МИХАИЛ ВАЛЕРЬЕВИЧ (IVC_KUZNETSOVMV@DVGD.OAO.RZD)" },
|
||||||
new { Name = nameof(SettingsFromDb.ClosingCode), Description = "Код закрытия регламентной работы, указывается при создании шаблона в ЕСПП.", Value = "выполнен" },
|
new { Name = nameof(SettingsFromDb.ClosingCode), Description = "Код закрытия регламентной работы, указывается при создании шаблона в ЕСПП.", Value = "выполнен" },
|
||||||
new { Name = nameof(SettingsFromDb.Category), Description = "Категория создаваемого объекта в ЕСПП", Value = "регламентная работа" }
|
new { Name = nameof(SettingsFromDb.Category), Description = "Категория создаваемого объекта в ЕСПП", Value = "регламентная работа" },
|
||||||
|
new { Name = nameof(SettingsFromDb.TemplatePrefixName), Description = "Префикс имени шаблона в ЕСПП", Value = "ПАРР-ДВС-ПТК__" }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -22,5 +22,10 @@
|
|||||||
/// Категория создаваемого объекта в ЕСПП
|
/// Категория создаваемого объекта в ЕСПП
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Category { get; set; } = string.Empty;
|
public string Category { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Префикс имени шаблона в ЕСПП
|
||||||
|
/// </summary>
|
||||||
|
public string TemplatePrefixName { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ namespace PARR.DAL
|
|||||||
services.AddTransient<IApplicationService, ApplicationService>();
|
services.AddTransient<IApplicationService, ApplicationService>();
|
||||||
services.AddTransient<IApplicationTypeService, ApplicationTypeService>();
|
services.AddTransient<IApplicationTypeService, ApplicationTypeService>();
|
||||||
services.AddTransient<IApplicationInHostService, ApplicationInHostService>();
|
services.AddTransient<IApplicationInHostService, ApplicationInHostService>();
|
||||||
|
services.AddTransient<IApplicationInWorkService,ApplicationInWorkService>();
|
||||||
services.AddTransient<V1_IApplicationService, V1_ApplicationService>();
|
services.AddTransient<V1_IApplicationService, V1_ApplicationService>();
|
||||||
services.AddTransient<V1_IApplicationTypeService, V1_ApplicationTypeService>();
|
services.AddTransient<V1_IApplicationTypeService, V1_ApplicationTypeService>();
|
||||||
services.AddTransient<V1_IApplicationInHostService, V1_ApplicationInHostService>();
|
services.AddTransient<V1_IApplicationInHostService, V1_ApplicationInHostService>();
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using PARR.DAL.Context;
|
||||||
|
using PARR.DAL.Models;
|
||||||
|
using PARR.DAL.Services.Abstracts;
|
||||||
|
using PARR.DAL.Services.Interfaces;
|
||||||
|
|
||||||
|
namespace PARR.DAL.Services.Implementations
|
||||||
|
{
|
||||||
|
internal class ApplicationInWorkService : BaseService<ApplicationsInWork>, IApplicationInWorkService
|
||||||
|
{
|
||||||
|
private readonly DataContext dataContext;
|
||||||
|
private readonly ILogger<ApplicationInWorkService> logger;
|
||||||
|
|
||||||
|
public ApplicationInWorkService(DataContext dataContext, ILogger<ApplicationInWorkService> logger) : base(logger)
|
||||||
|
{
|
||||||
|
this.dataContext = dataContext;
|
||||||
|
this.logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected override DbSet<ApplicationsInWork> EntitySet => dataContext.ApplicationsInWorks;
|
||||||
|
|
||||||
|
protected override DataContext EntitiContext => dataContext;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using PARR.DAL.Models;
|
||||||
|
using PARR.DAL.Services.Interfaces.Base;
|
||||||
|
|
||||||
|
namespace PARR.DAL.Services.Interfaces
|
||||||
|
{
|
||||||
|
public interface IApplicationInWorkService : IBaseService<ApplicationsInWork>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -103,13 +103,13 @@ namespace PARR.EsppTemplateSync.Services
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var isChanged = false;
|
var isChanged = false;
|
||||||
var ignoreTemplateFieldsList = globalSettings.IgnoreTemplateFields?.Split(",").ToList().Select(t => t.Trim().ToLower());
|
//var ignoreTemplateFieldsList = globalSettings.IgnoreTemplateFields?.Split(",").ToList().Select(t => t.Trim().ToLower());
|
||||||
|
|
||||||
foreach (var prop in template.GetType().GetProperties())
|
foreach (var prop in template.GetType().GetProperties())
|
||||||
{
|
{
|
||||||
if (prop == null) continue;
|
if (prop == null) continue;
|
||||||
|
|
||||||
if (ignoreTemplateFieldsList != null && ignoreTemplateFieldsList.Contains(prop.Name.Trim().ToLower())) continue;
|
if (globalSettings.IgnoreTemplateFields != null && globalSettings.IgnoreTemplateFields.Contains(prop.Name)) continue;
|
||||||
//if (prop.Name == "Id" ||
|
//if (prop.Name == "Id" ||
|
||||||
// prop.Name == "Status" ||
|
// prop.Name == "Status" ||
|
||||||
// prop.Name == "DateCreated" ||
|
// prop.Name == "DateCreated" ||
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
public MqSettings? MqSettings { get; set; }
|
public MqSettings? MqSettings { get; set; }
|
||||||
|
|
||||||
public StorageSettings? StorageSettings { get; set; }
|
public StorageSettings? StorageSettings { get; set; }
|
||||||
public string? IgnoreTemplateFields { get; set; }
|
public List<string>? IgnoreTemplateFields { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class MqSettings
|
internal class MqSettings
|
||||||
|
|||||||
@@ -44,6 +44,6 @@
|
|||||||
"StorageSettings": {
|
"StorageSettings": {
|
||||||
"CheckIntervalSeconds": 30
|
"CheckIntervalSeconds": 30
|
||||||
},
|
},
|
||||||
"IgnoreTemplateFields": "Id,Status,DateCreated,DateModified,StatusCode"
|
"IgnoreTemplateFields": [ "Id","Status","DateCreated","DateModified","StatusCode" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,10 @@ namespace PARR.MockData.Services
|
|||||||
private readonly ILogger<TemplatesInitializer> logger;
|
private readonly ILogger<TemplatesInitializer> logger;
|
||||||
private readonly ITemplateService templateService;
|
private readonly ITemplateService templateService;
|
||||||
|
|
||||||
public TemplatesInitializer(ILogger<TemplatesInitializer> logger, ITemplateService templateService)
|
public TemplatesInitializer(
|
||||||
|
ILogger<TemplatesInitializer> logger,
|
||||||
|
ITemplateService templateService
|
||||||
|
)
|
||||||
{
|
{
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
this.templateService = templateService;
|
this.templateService = templateService;
|
||||||
@@ -18,28 +21,30 @@ namespace PARR.MockData.Services
|
|||||||
public async Task InitAsync()
|
public async Task InitAsync()
|
||||||
{
|
{
|
||||||
var templates = new List<Template>() {
|
var templates = new List<Template>() {
|
||||||
//new Template{
|
new Template{
|
||||||
// Id=Guid.NewGuid(),
|
Id=Guid.NewGuid(),
|
||||||
// DateCreated=DateTimeOffset.Parse("2023-09-15 00:14:39.004502+00"),
|
DateCreated=DateTimeOffset.UtcNow,
|
||||||
// EK="ВРТ-VMWARE-ДВС",
|
//EK="ВРТ-VMWARE-ДВС",
|
||||||
// IsActive=true,
|
IsActive=true,
|
||||||
// WorkGroup="СМЕНА-ПТК-ДВС",
|
//WorkGroup="СМЕНА-ПТК-ДВС",
|
||||||
// ShortDescription="ДВС-ПТК СМЕНА-Установка обновлений ОС",
|
//ShortDescription="ПАРР-ДВС-ПТК СМЕНА-УСТАНОВКА ОБНОВЛЕНИЙ ОС",
|
||||||
// Category="регламентная работа",
|
//Category="регламентная работа",
|
||||||
// Process="ЦВК Выполнение регламентных работ (О3.2.2.3)",
|
//Process="ЦВК Выполнение регламентных работ (О3.2.2.3)",
|
||||||
// SubProcess="ЦВК Выполнение регламентных работ (О3.2.2.3)",
|
//SubProcess="ЦВК Выполнение регламентных работ (О3.2.2.3)",
|
||||||
// ClosingCode="выполнен",
|
//ClosingCode="выполнен",
|
||||||
// Duration="3 00:00:00",
|
//Duration="3 00:00:00",
|
||||||
// FullDescription="Установка обновлений ОС серверов средней и низ-кой критичности.",
|
//FullDescription="Установка обновлений ОС серверов средней и низ-кой критичности.",
|
||||||
// Initiator="ГУСЬКОВ АНДРЕЙ СЕРГЕЕВИЧ (IVC_GUSKOVAS@DVGD.OAO.RZD)",
|
//Initiator="ГУСЬКОВ АНДРЕЙ СЕРГЕЕВИЧ (IVC_GUSKOVAS@DVGD.OAO.RZD)",
|
||||||
// Name="ПАРР-ДВС-ПТК СМЕНА-УСТАНОВКА ОБНОВЛЕНИЙ ОС",
|
Name="ПАРР-ДВС-ПТК СМЕНА-УСТАНОВКА ОБНОВЛЕНИЙ ОС",
|
||||||
// ResponseArea="96-ДВС",
|
//ResponseArea="96-ДВС",
|
||||||
// Solution="Установка обновлений ОС серверов средней и низкой критичности.",
|
//Solution="Установка обновлений ОС серверов средней и низкой критичности.",
|
||||||
// TNK="",
|
//TNK="",
|
||||||
// Work="",
|
//Work="",
|
||||||
// Worker="",
|
//Worker="",
|
||||||
// StatusCode = (int)StatusTemplateEnum.Creating
|
StatusCode = (int)StatusTemplateEnum.Creating,
|
||||||
//},
|
//ApplicationInWorkId=ApplicationsInWork.
|
||||||
|
|
||||||
|
},
|
||||||
//new Template{
|
//new Template{
|
||||||
// Id=Guid.NewGuid(),
|
// Id=Guid.NewGuid(),
|
||||||
// DateCreated=DateTimeOffset.Parse("2023-09-15 00:14:38.992903+00"),
|
// DateCreated=DateTimeOffset.Parse("2023-09-15 00:14:38.992903+00"),
|
||||||
|
|||||||
@@ -1,8 +1,43 @@
|
|||||||
{
|
{
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"DefaultConnection": "Server=10.99.253.184;Database=parr;User Id=app_parr; Password=PosdfkhT&)%sdfligL&%5546;",
|
||||||
|
"AihitConnection": "Data Source=10.248.19.97; Initial Catalog=mao2;User ID=awhit-ipp-parr;pwd=ET3h$9y1LH#D;TrustServerCertificate=true;"
|
||||||
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Microsoft.Hosting.Lifetime": "Information"
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Serilog": {
|
||||||
|
"MinimumLevel": {
|
||||||
|
"Default": "Debug",
|
||||||
|
"Override": {
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Debug"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"WriteTo": [
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "log/log-.txt",
|
||||||
|
"rollingInterval": "Day"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"MailSettings": {
|
||||||
|
"Host": "uc.dvgd.rzd",
|
||||||
|
"Password": "Robin123",
|
||||||
|
"Port": 143,
|
||||||
|
"SSL": false,
|
||||||
|
"UserName": "IVC_Robot"
|
||||||
|
},
|
||||||
|
"SyncherSettings": {
|
||||||
|
"IncludeAddresses": "aihit@gvc.rzd"
|
||||||
|
},
|
||||||
|
"WorkerSettings": {
|
||||||
|
"OccursEvery": "12:00:00.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user