feat(aihitRelationshipsSyncer): Реализована логика синхронизации связей между Unit+CI/CD
This commit is contained in:
@@ -3,6 +3,7 @@ variables:
|
||||
PROD_NAME_API: "parr/parr-api"
|
||||
PROD_NAME_AIHIT_LOADER: "parr/parr-aihit-loader"
|
||||
PROD_NAME_AIHIT_SYNCER: "parr/parr-aihit-syncer"
|
||||
PROD_NAME_AIHIT_RELATIONSHIPS_SYNCER: "parr/parr-aihit-relationships-syncer"
|
||||
PROD_NAME_ESPP_TEMPLATE: "parr/parr-espp-template-sync"
|
||||
PROD_NAME_ESPP_SCHEDULE: "parr/parr-espp-schedule-sync"
|
||||
PROD_NAME_GENERATOR_TEMPLATES: "parr/parr-generator-templates"
|
||||
@@ -170,6 +171,55 @@ prod_aihit_syncer_deploy:
|
||||
tags:
|
||||
- ${RUNNER}
|
||||
|
||||
### AIHIT RELATIONSHPS SYNCER PROD ###
|
||||
prod_aihit_relationships_syncer_build:
|
||||
stage: build
|
||||
only:
|
||||
- /^ars[0-9]+\.[0-9]+\.[0-9]+$/
|
||||
except:
|
||||
- branches
|
||||
services:
|
||||
- name: docker:20.10.21-dind
|
||||
command: [
|
||||
"--insecure-registry=10.99.253.167:8090",
|
||||
"--registry-mirror=http://c:8090",
|
||||
"--insecure-registry=10.99.253.167:8088",
|
||||
"--registry-mirror=http://10.99.253.167:8088",
|
||||
"--insecure-registry=harbor.dvgd.rzd",
|
||||
"--tls=false"
|
||||
]
|
||||
variables:
|
||||
DOCKER_HOST: tcp://docker:2375
|
||||
DOCKER_DRIVER: overlay2
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
script:
|
||||
- APP_VERSION=$(echo $CI_COMMIT_TAG | tr -d ars)
|
||||
- IMAGE_VERSION=$(echo $CI_COMMIT_TAG | sed 's/ars/v/g')
|
||||
- docker build -t $REPO/$PROD_NAME_AIHIT_RELATIONSHIPS_SYNCER:$IMAGE_VERSION -t $REPO/$PROD_NAME_AIHIT_RELATIONSHIPS_SYNCER:latest -t $PROD_NAME_AIHIT_RELATIONSHIPS_SYNCER:$IMAGE_VERSION -t $PROD_NAME_AIHIT_RELATIONSHIPS_SYNCER:latest --build-arg app_version=$APP_VERSION -f PARR.AIHITrelationshipsSyncerWorker/Dockerfile .
|
||||
- docker login -u $HARBOR_PUSH_USER -p $HARBOR_PUSH_PASS $REPO
|
||||
- docker push --all-tags $REPO/$PROD_NAME_AIHIT_RELATIONSHIPS_SYNCER
|
||||
tags:
|
||||
- docker
|
||||
|
||||
|
||||
prod_aihit_relationships_syncer_deploy:
|
||||
stage: deploy
|
||||
environment:
|
||||
name: parr-aihit-relationships-syncer
|
||||
only:
|
||||
- /^ars[0-9]+\.[0-9]+\.[0-9]+$/
|
||||
except:
|
||||
- branches
|
||||
script:
|
||||
- IMAGE_VERSION=$(echo $CI_COMMIT_TAG | sed 's/ars/v/g')
|
||||
- docker login -u $HARBOR_PULL_USER -p $HARBOR_PULL_PASS $REPO
|
||||
- tag=$IMAGE_VERSION docker compose -f docker-compose.aihit-relationships-syncer.yml up -d
|
||||
parallel:
|
||||
matrix:
|
||||
- RUNNER: shell-as-1
|
||||
tags:
|
||||
- ${RUNNER}
|
||||
|
||||
|
||||
### ESPP TEMPLATE PROD ###
|
||||
prod_espp-template_build:
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using PARR.AIHITRelationshipsSyncer.Context;
|
||||
using PARR.AIHITRelationshipsSyncer.Services.Implementations;
|
||||
using PARR.AIHITRelationshipsSyncer.Services.Interfaces;
|
||||
using PARR.AIHITRelationshipsSyncer.Settings;
|
||||
using PARR.BLL;
|
||||
using PARR.DAL;
|
||||
|
||||
namespace PARR.AIHITRelationshipsSyncer
|
||||
{
|
||||
public static class AihitRelationshpsSyncerInstaller
|
||||
{
|
||||
public static void InstallAihitRelationshpsSyncerServices(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.InstallBllServices(configuration);
|
||||
services.InstallDalServices(configuration);
|
||||
|
||||
var settings = new WorkerSettings();
|
||||
configuration.GetSection(nameof(WorkerSettings)).Bind(settings);
|
||||
services.AddSingleton(settings);
|
||||
|
||||
services.AddDbContext<AIHITContext>(options =>
|
||||
options.UseSqlServer(
|
||||
configuration.GetConnectionString("AihitConnection"),
|
||||
sqlServerOptions => sqlServerOptions.CommandTimeout(1800)
|
||||
));
|
||||
|
||||
services.AddTransient<IRelationshipsSyncer, RelationshipsSyncer>();
|
||||
services.AddTransient<IAihitService, AihitService>();
|
||||
services.AddTransient<IRelationshipsSyncService, RelationshipsSyncSrevice>();
|
||||
}
|
||||
|
||||
|
||||
public static IConfigurationBuilder AddAihitRelationshpsSyncerConfigurations(this IConfigurationBuilder builder, IServiceCollection services)
|
||||
{
|
||||
builder.AddDalConfigurations(services);
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
||||
public static void AddAihitRelationshpsSyncerSettings(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddDallSettings(configuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
13
PARR.AIHITRelationshipsSyncer/Context/AIHITContext.cs
Normal file
13
PARR.AIHITRelationshipsSyncer/Context/AIHITContext.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.AIHITRelationshipsSyncer.Models;
|
||||
|
||||
namespace PARR.AIHITRelationshipsSyncer.Context
|
||||
{
|
||||
internal class AIHITContext : DbContext
|
||||
{
|
||||
public AIHITContext(DbContextOptions<AIHITContext> options) : base(options) { }
|
||||
|
||||
|
||||
public DbSet<AihitData> AihitDatas { get; set; }
|
||||
}
|
||||
}
|
||||
7
PARR.AIHITRelationshipsSyncer/IRelationshipsSyncer.cs
Normal file
7
PARR.AIHITRelationshipsSyncer/IRelationshipsSyncer.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace PARR.AIHITRelationshipsSyncer
|
||||
{
|
||||
public interface IRelationshipsSyncer
|
||||
{
|
||||
Task StartAsync();
|
||||
}
|
||||
}
|
||||
26
PARR.AIHITRelationshipsSyncer/Models/AihitData.cs
Normal file
26
PARR.AIHITRelationshipsSyncer/Models/AihitData.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.AIHITRelationshipsSyncer.Models
|
||||
{
|
||||
[PrimaryKey(nameof(EKFindCode), nameof(ChildEk))]
|
||||
public class AihitData
|
||||
{
|
||||
[Column("КОД_ПОИСКА_ЭК")]
|
||||
public string? EKFindCode { get; set; }
|
||||
|
||||
//[Column("СТАТУС")]
|
||||
//public string? Status { get; set; }
|
||||
|
||||
//[Column("ЗОНА_ОТВЕТСТВЕННОСТИ")]
|
||||
//public string? ResponseArea { get; set; }
|
||||
|
||||
//[Column("ПОДКАТЕГОРИЯ_ЭК")]
|
||||
//public string? EKSubCategory { get; set; }
|
||||
|
||||
//[Column("ТИП_ЭК")]
|
||||
//public string? EKType { get; set; }
|
||||
[Column("Дочерний ЭК")]
|
||||
public string? ChildEk { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.20" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PARR.BLL\PARR.BLL.csproj" />
|
||||
<ProjectReference Include="..\PARR.DAL\PARR.DAL.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
71
PARR.AIHITRelationshipsSyncer/RelationshipsSyncer.cs
Normal file
71
PARR.AIHITRelationshipsSyncer/RelationshipsSyncer.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.AIHITRelationshipsSyncer.Services.Interfaces;
|
||||
using PARR.AIHITRelationshipsSyncer.Settings;
|
||||
using PARR.BLL.Services.Interfaces;
|
||||
|
||||
namespace PARR.AIHITRelationshipsSyncer
|
||||
{
|
||||
internal class RelationshipsSyncer : IRelationshipsSyncer
|
||||
{
|
||||
private readonly ILogger<RelationshipsSyncer> logger;
|
||||
private readonly IIntervalService intervalService;
|
||||
private readonly IAihitService aihitService;
|
||||
private readonly IRelationshipsSyncService relationshipsSyncService;
|
||||
private readonly WorkerSettings workerSettings;
|
||||
|
||||
public RelationshipsSyncer(
|
||||
ILogger<RelationshipsSyncer> logger,
|
||||
IIntervalService intervalService,
|
||||
IAihitService aihitService,
|
||||
IRelationshipsSyncService relationshipsSyncService,
|
||||
WorkerSettings workerSettings
|
||||
)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.intervalService = intervalService;
|
||||
this.aihitService = aihitService;
|
||||
this.relationshipsSyncService = relationshipsSyncService;
|
||||
this.workerSettings = workerSettings;
|
||||
}
|
||||
|
||||
|
||||
public async Task StartAsync()
|
||||
{
|
||||
logger.LogInformation("Запуск сервиса синхронизации связей иерархии ЭК из АИХ ИТ в ПАРР");
|
||||
|
||||
await intervalService.IntervalInitAsync(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
logger.LogInformation($"Начата загрузка иерархических связей между ЭК из АИХ ИТ");
|
||||
|
||||
var aihitdata = aihitService.GetData();
|
||||
|
||||
var aihitDataCount = aihitdata?.Count();
|
||||
|
||||
if (aihitdata == null || aihitDataCount == 0)
|
||||
{
|
||||
logger.LogInformation("АИХ ИТ вернул пустые данные");
|
||||
return;
|
||||
}
|
||||
|
||||
//File.WriteAllText("MockData.json", aihitdata.ToJson());
|
||||
//string text = File.OpenText("MockData.json").ReadToEnd();
|
||||
//var aihitdata = JsonSerializer.Deserialize<List<AihitData>>(text);
|
||||
|
||||
await relationshipsSyncService.SyncAsync(aihitdata.ToList());
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError(ex, "Ошибка синхронизации иерархических данных Unit из АИХ ИТ в ПАРР");
|
||||
}
|
||||
finally
|
||||
{
|
||||
logger.LogInformation($"Завершена загрузка иерархических связей между ЭК из АИХ ИТ");
|
||||
}
|
||||
|
||||
}, workerSettings.RepeatEvery);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.AIHITRelationshipsSyncer.Context;
|
||||
using PARR.AIHITRelationshipsSyncer.Models;
|
||||
using PARR.AIHITRelationshipsSyncer.Services.Interfaces;
|
||||
|
||||
namespace PARR.AIHITRelationshipsSyncer.Services.Implementations
|
||||
{
|
||||
internal class AihitService : IAihitService
|
||||
{
|
||||
private readonly ILogger<AihitService> logger;
|
||||
private readonly AIHITContext context;
|
||||
|
||||
public AihitService(
|
||||
ILogger<AihitService> logger,
|
||||
AIHITContext context
|
||||
)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Получение данных из АИХ ИТ вызовом хранимой процедуры в базе данных
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<AihitData>? GetData()
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = context.AihitDatas.FromSqlRaw($"EXEC mao2.dbo.sp_IPP_PARR_PTK_get_Relationships").ToList();
|
||||
|
||||
if (result == null || !result.Any())
|
||||
{
|
||||
logger.LogWarning($"Процедура sp_IPP_PARR_PTK_get_Relationships вернула пустой список ЭК");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError(ex, $"Ошибка при выполнении ХП sp_IPP_PARR_PTK_get_Relationships");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.AIHITRelationshipsSyncer.Models;
|
||||
using PARR.AIHITRelationshipsSyncer.Services.Interfaces;
|
||||
using PARR.DAL.Models.Unit;
|
||||
using PARR.DAL.Services.Interfaces.Unit;
|
||||
|
||||
namespace PARR.AIHITRelationshipsSyncer.Services.Implementations
|
||||
{
|
||||
internal class RelationshipsSyncSrevice : IRelationshipsSyncService
|
||||
{
|
||||
private readonly ILogger<RelationshipsSyncSrevice> logger;
|
||||
private readonly IUnitService unitService;
|
||||
|
||||
public RelationshipsSyncSrevice(ILogger<RelationshipsSyncSrevice> logger,
|
||||
IUnitService unitService
|
||||
)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.unitService = unitService;
|
||||
}
|
||||
|
||||
|
||||
public async Task SyncAsync(List<AihitData> aihitdata)
|
||||
{
|
||||
var groupedData = aihitdata.GroupBy(ad => ad.EKFindCode);
|
||||
|
||||
var units = await GetUnitsWithChildrens();
|
||||
|
||||
//Перебираем сгруппированные по родительскому ЭК данные
|
||||
foreach (var item in groupedData)
|
||||
{
|
||||
//Получаем имя родителя
|
||||
var parentName = item.Select(t => t.EKFindCode).First();
|
||||
if (parentName == null)
|
||||
continue;
|
||||
|
||||
//if (parentName.ToLower() != "ас-рп-рцку-гор")
|
||||
// continue;
|
||||
|
||||
//По имени получаем экземпляр Unit со всеми дочерними связями
|
||||
var unit = await GetUnitByNameAsync(parentName);
|
||||
|
||||
//Из данных АИХ ИТ получаем имена всех дочерних ЭК
|
||||
var childsName = item.Select(t => t.ChildEk).ToList();
|
||||
if (childsName == null || childsName.Count == 0)
|
||||
continue;
|
||||
|
||||
//Проходим циклом по полученному списку для актуализации связей в полученном нами экземпляре Unit
|
||||
foreach (var childName in childsName)
|
||||
{
|
||||
if (childName == null)
|
||||
continue;
|
||||
|
||||
//if (childName.ToLower() != "рпа-робин-рцку-спиуи-прочее-26-гор")
|
||||
// continue;
|
||||
//Ищем детей по имени
|
||||
var child = unit.ChildUnits.FirstOrDefault(t => t.ChildUnit?.Name.ToLower() == childName.ToLower().Trim());
|
||||
|
||||
//не нашли создаём и сразу пишем в базу, чтобы если попадуться дубликаты в списке они были созданы
|
||||
if (child == null)
|
||||
{
|
||||
var childUnit = await GetUnitByNameAsync(childName!);
|
||||
unit.ChildUnits.Add(
|
||||
new UnitInUnit
|
||||
{
|
||||
ParentUnitId = unit.Id,
|
||||
ChildUnitId = childUnit.Id,
|
||||
DateCreated = DateTimeOffset.UtcNow,
|
||||
DateSynced = DateTimeOffset.UtcNow
|
||||
}
|
||||
);
|
||||
|
||||
if (!await unitService.CommitAsync())
|
||||
logger.LogError($"Не удалось создать связь Unit {unit.Name} с {childUnit.Name}");
|
||||
else
|
||||
logger.LogDebug($"----- Изменене связи Unit: {unit.Name} -----");
|
||||
}
|
||||
//Для всех обновляем дату синхронизации
|
||||
else
|
||||
child.DateSynced = DateTimeOffset.UtcNow;
|
||||
}
|
||||
|
||||
//После проверки пришедших к нам из АИХ ИТ дочерних связей удаляем лишние/уже не существующие в базе
|
||||
var childsToDelete = unit.ChildUnits.Where(t => childsName.All(a => t.ChildUnit?.Name != a)).ToList();
|
||||
if (childsToDelete != null && childsToDelete.Count() > 0)
|
||||
DeleteChilds(unit, childsToDelete);
|
||||
|
||||
//применяем изменения в базе данных
|
||||
if (!await unitService.CommitAsync())
|
||||
logger.LogError($"Не удалось изменить связи Unit {unit.Name}");
|
||||
else
|
||||
logger.LogDebug($"----- Изменены связи Unit: {unit.Name} -----");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Удаление дочерних связей у ЭК
|
||||
/// </summary>
|
||||
/// <param name="unit"></param>
|
||||
/// <param name="unitToDeleteChilds"></param>
|
||||
private void DeleteChilds(Unit unit, List<UnitInUnit> unitToDeleteChilds)
|
||||
{
|
||||
foreach (var childUnit in unitToDeleteChilds)
|
||||
{
|
||||
logger.LogInformation($"----- Удаление связи Unit: {childUnit.ParentUnit!.Name} - {childUnit.ChildUnit!.Name} -----");
|
||||
unit.ChildUnits.Remove(childUnit);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Получение списка ЭК с дочерними связями
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task<List<Unit>> GetUnitsWithChildrens()
|
||||
{
|
||||
return await unitService.Get()
|
||||
.Include(t => t.ChildUnits).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Создать новый ЭК по имени
|
||||
/// </summary>
|
||||
/// <param name="ekName"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<Unit> CreateUnit(string ekName)
|
||||
{
|
||||
var unit = new Unit
|
||||
{
|
||||
Name = ekName.Trim()
|
||||
};
|
||||
|
||||
if (!await unitService.CreateAsync(unit) || !await unitService.CommitAsync())
|
||||
logger.LogError($"Не удалось создать Unit {unit.Name}");
|
||||
else
|
||||
logger.LogDebug($"----- Создан Unit: {unit.Name} -----");
|
||||
|
||||
return unit;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Получить ЭК с дочерними связями по имени, если такого ещё нет создать
|
||||
/// </summary>
|
||||
/// <param name="ekName"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<Unit> GetUnitByNameAsync(string ekName)
|
||||
{
|
||||
if (!unitService.Get().AsNoTracking().Any(u => u.Name.ToLower() == ekName.ToLower().Trim()))
|
||||
{
|
||||
return await CreateUnit(ekName);
|
||||
}
|
||||
|
||||
return await unitService.Get()
|
||||
.Include(u => u.ChildUnits)
|
||||
.FirstAsync(u => u.Name.ToLower() == ekName.ToLower().Trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using PARR.AIHITRelationshipsSyncer.Models;
|
||||
|
||||
namespace PARR.AIHITRelationshipsSyncer.Services.Interfaces
|
||||
{
|
||||
public interface IAihitService
|
||||
{
|
||||
IEnumerable<AihitData>? GetData();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using PARR.AIHITRelationshipsSyncer.Models;
|
||||
|
||||
namespace PARR.AIHITRelationshipsSyncer.Services.Interfaces
|
||||
{
|
||||
public interface IRelationshipsSyncService
|
||||
{
|
||||
Task SyncAsync(List<AihitData> aihitdata);
|
||||
}
|
||||
}
|
||||
7
PARR.AIHITRelationshipsSyncer/Settings/WorkerSettings.cs
Normal file
7
PARR.AIHITRelationshipsSyncer/Settings/WorkerSettings.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace PARR.AIHITRelationshipsSyncer.Settings
|
||||
{
|
||||
internal class WorkerSettings
|
||||
{
|
||||
public TimeSpan RepeatEvery { get; set; }
|
||||
}
|
||||
}
|
||||
34
PARR.AIHITRelationshipsSyncerWorker/Dockerfile
Normal file
34
PARR.AIHITRelationshipsSyncerWorker/Dockerfile
Normal file
@@ -0,0 +1,34 @@
|
||||
# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
# This stage is used when running from VS in fast mode (Default for Debug configuration)
|
||||
FROM 10.99.253.167:8090/dotnet/runtime:7.0 AS base
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
# This stage is used to build the service project
|
||||
FROM 10.99.253.167:8090/dotnet/sdk:7.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["NuGet.config", "."]
|
||||
COPY ["PARR.AIHITRelationshipsSyncerWorker/PARR.AIHITRelationshipsSyncerWorker.csproj", "PARR.AIHITRelationshipsSyncerWorker/"]
|
||||
COPY ["PARR.AIHITRelationshipsSyncer/PARR.AIHITRelationshipsSyncer.csproj", "PARR.AIHITRelationshipsSyncer/"]
|
||||
COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
|
||||
COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
|
||||
COPY ["PARR.Constants/PARR.Constants.csproj", "PARR.Constants/"]
|
||||
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
|
||||
RUN dotnet restore "./PARR.AIHITRelationshipsSyncerWorker/PARR.AIHITRelationshipsSyncerWorker.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/PARR.AIHITRelationshipsSyncerWorker"
|
||||
RUN dotnet build "./PARR.AIHITRelationshipsSyncerWorker.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
# This stage is used to publish the service project to be copied to the final stage
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
ARG app_version=0.0.0-default
|
||||
RUN dotnet publish "./PARR.AIHITRelationshipsSyncerWorker.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false /p:Version=$app_version
|
||||
|
||||
# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "PARR.AIHITRelationshipsSyncerWorker.dll"]
|
||||
@@ -0,0 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Worker">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>dotnet-PARR.AIHITRelationshipsSyncerWorker-529ba045-500b-4aca-9aad-871e85ded4d6</UserSecretsId>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Elastic.CommonSchema.Serilog" Version="8.6.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1-Preview.1" />
|
||||
<PackageReference Include="Serilog.Extensions.Hosting" Version="7.0.0" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="7.0.1" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PARR.AIHITRelationshipsSyncer\PARR.AIHITRelationshipsSyncer.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
31
PARR.AIHITRelationshipsSyncerWorker/Program.cs
Normal file
31
PARR.AIHITRelationshipsSyncerWorker/Program.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Elastic.CommonSchema.Serilog;
|
||||
using PARR.AIHITRelationshipsSyncer;
|
||||
using PARR.AIHITRelationshipsSyncerWorker;
|
||||
using Serilog;
|
||||
|
||||
var builder = Host.CreateApplicationBuilder();
|
||||
|
||||
builder.Services.AddLogging(config =>
|
||||
{
|
||||
config.ClearProviders();
|
||||
|
||||
var logger = new LoggerConfiguration();
|
||||
|
||||
if (builder.Environment.IsProduction())
|
||||
logger.WriteTo.Console(new EcsTextFormatter());
|
||||
else
|
||||
logger.WriteTo.Console();
|
||||
|
||||
logger.ReadFrom.Configuration(builder.Configuration);
|
||||
|
||||
config.AddSerilog(logger.CreateLogger());
|
||||
});
|
||||
|
||||
builder.Services.InstallAihitRelationshpsSyncerServices(builder.Configuration);
|
||||
builder.Configuration.AddAihitRelationshpsSyncerConfigurations(builder.Services);
|
||||
builder.Services.AddAihitRelationshpsSyncerSettings(builder.Configuration);
|
||||
|
||||
builder.Services.AddHostedService<Worker>();
|
||||
|
||||
var host = builder.Build();
|
||||
host.Run();
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"profiles": {
|
||||
"PARR.AIHITRelationshipsSyncerWorker": {
|
||||
"commandName": "Project",
|
||||
"environmentVariables": {
|
||||
"DOTNET_ENVIRONMENT": "Development"
|
||||
},
|
||||
"dotnetRunMessages": true
|
||||
},
|
||||
"Container (Dockerfile)": {
|
||||
"commandName": "Docker"
|
||||
}
|
||||
}
|
||||
}
|
||||
27
PARR.AIHITRelationshipsSyncerWorker/Worker.cs
Normal file
27
PARR.AIHITRelationshipsSyncerWorker/Worker.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using PARR.AIHITRelationshipsSyncer;
|
||||
|
||||
namespace PARR.AIHITRelationshipsSyncerWorker;
|
||||
|
||||
public class Worker : BackgroundService
|
||||
{
|
||||
private readonly IServiceProvider serviceProvider;
|
||||
|
||||
public Worker(IServiceProvider serviceProvider)
|
||||
{
|
||||
this.serviceProvider = serviceProvider;
|
||||
}
|
||||
|
||||
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
using (var scope = serviceProvider.CreateScope())
|
||||
{
|
||||
var relationshipsSyncer = scope.ServiceProvider.GetService<IRelationshipsSyncer>();
|
||||
|
||||
if (relationshipsSyncer == null)
|
||||
throw new Exception($"<22><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> {nameof(IRelationshipsSyncer)}");
|
||||
|
||||
await relationshipsSyncer.StartAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
15
PARR.AIHITRelationshipsSyncerWorker/appsettings.json
Normal file
15
PARR.AIHITRelationshipsSyncerWorker/appsettings.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"AihitConnection": "Data Source=10.248.19.97; Initial Catalog=mao2;User ID=awhit-ipp-parr;pwd=ET3h$9y1LH#D;TrustServerCertificate=true;",
|
||||
"DefaultConnection": "Server=10.99.253.184;Database=parr;User Id=app_parr; Password=PosdfkhT&)%sdfligL&%5546;"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"WorkerSettings": {
|
||||
"RepeatEvery": "12:00:00"
|
||||
}
|
||||
}
|
||||
12
PARR.API.sln
12
PARR.API.sln
@@ -86,6 +86,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PARR.AIHITMainLoader", "PAR
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PARR.AIHITMainSyncer", "PARR.AIHITMainSyncer\PARR.AIHITMainSyncer.csproj", "{173E33B2-A10B-4FE9-802C-B22940326DEB}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PARR.AIHITRelationshipsSyncer", "PARR.AIHITRelationshipsSyncer\PARR.AIHITRelationshipsSyncer.csproj", "{45974F9B-FB99-4EFA-BE32-88EA0FAD1B9D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PARR.AIHITRelationshipsSyncerWorker", "PARR.AIHITRelationshipsSyncerWorker\PARR.AIHITRelationshipsSyncerWorker.csproj", "{64010D07-4053-4EA9-B0F0-E773B5749DBD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -238,6 +242,14 @@ Global
|
||||
{173E33B2-A10B-4FE9-802C-B22940326DEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{173E33B2-A10B-4FE9-802C-B22940326DEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{173E33B2-A10B-4FE9-802C-B22940326DEB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{45974F9B-FB99-4EFA-BE32-88EA0FAD1B9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{45974F9B-FB99-4EFA-BE32-88EA0FAD1B9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{45974F9B-FB99-4EFA-BE32-88EA0FAD1B9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{45974F9B-FB99-4EFA-BE32-88EA0FAD1B9D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{64010D07-4053-4EA9-B0F0-E773B5749DBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{64010D07-4053-4EA9-B0F0-E773B5749DBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{64010D07-4053-4EA9-B0F0-E773B5749DBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{64010D07-4053-4EA9-B0F0-E773B5749DBD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
|
||||
public const string IsWorkDay = Base + "/tests/is-work-day/";
|
||||
|
||||
public const string TestHandler = Base + "/tests/test/";
|
||||
|
||||
public const string GetWorkDay = Base + "/tests/get-work-day/{date}";
|
||||
|
||||
public const string paramDate = "{lastRunDate}";
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.API.Contracts.V1;
|
||||
using PARR.API.Contracts.V1.Responses.Base;
|
||||
using PARR.API.Controllers.V1.Base;
|
||||
using PARR.API.Services.Interfaces;
|
||||
using PARR.DAL.CacheServices;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
using PARR.DAL.Services.Interfaces.Unit;
|
||||
using PARR.DAL.TransformServices;
|
||||
|
||||
namespace PARR.API.Controllers.V1
|
||||
@@ -17,18 +19,21 @@ namespace PARR.API.Controllers.V1
|
||||
private readonly IEsppScheduleTransformService esppScheduleTransformService;
|
||||
private readonly IRedisCacheService redisCacheService;
|
||||
private readonly IWeekendDayService weekendDayService;
|
||||
private readonly IUnitService unitService;
|
||||
|
||||
public TestController(
|
||||
IClientService clientService,
|
||||
IEsppScheduleTransformService esppScheduleTransformService,
|
||||
IRedisCacheService redisCacheService,
|
||||
IWeekendDayService weekendDayService
|
||||
IWeekendDayService weekendDayService,
|
||||
IUnitService unitService
|
||||
)
|
||||
{
|
||||
this.clientService = clientService;
|
||||
this.esppScheduleTransformService = esppScheduleTransformService;
|
||||
this.redisCacheService = redisCacheService;
|
||||
this.weekendDayService = weekendDayService;
|
||||
this.unitService = unitService;
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +108,22 @@ namespace PARR.API.Controllers.V1
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Тестовый метод
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet(ApiRoutes.Test.TestHandler)]
|
||||
public async Task<IActionResult> Test()
|
||||
{
|
||||
//var unit = await unitService.Get().Include(t => t.Parents).Include(t => t.Childs).FirstOrDefaultAsync(t => t.Id == Guid.Parse("01fda0bd-3423-4b12-965b-2947153d1d87"));
|
||||
|
||||
//var parent = unit?.Parents;
|
||||
//var child = unit?.Childs;
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
|
||||
//[HttpGet(ApiRoutes.Test.GetWorkDay)]
|
||||
//public async Task<IActionResult> GetWorkDay([FromRoute] DateTimeOffset date)
|
||||
//{
|
||||
|
||||
@@ -78,6 +78,8 @@ namespace PARR.DAL.Context
|
||||
|
||||
public DbSet<UnitFieldInUnitFieldValue> UnitFieldInUnitFieldValues { get; set; }
|
||||
|
||||
public DbSet<UnitInUnit> UnitInUnits { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
3534
PARR.DAL/Migrations/20250522042529_tblUnitInUnits.Designer.cs
generated
Normal file
3534
PARR.DAL/Migrations/20250522042529_tblUnitInUnits.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
59
PARR.DAL/Migrations/20250522042529_tblUnitInUnits.cs
Normal file
59
PARR.DAL/Migrations/20250522042529_tblUnitInUnits.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tblUnitInUnits : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "UnitInUnits",
|
||||
schema: "unit",
|
||||
columns: table => new
|
||||
{
|
||||
ParentUnitId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ChildUnitId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||
DateSynced = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_UnitInUnits", x => new { x.ParentUnitId, x.ChildUnitId });
|
||||
table.ForeignKey(
|
||||
name: "FK_UnitInUnits_Units_ChildUnitId",
|
||||
column: x => x.ChildUnitId,
|
||||
principalSchema: "unit",
|
||||
principalTable: "Units",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_UnitInUnits_Units_ParentUnitId",
|
||||
column: x => x.ParentUnitId,
|
||||
principalSchema: "unit",
|
||||
principalTable: "Units",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Таблица связей иерархии между ЭК");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UnitInUnits_ChildUnitId",
|
||||
schema: "unit",
|
||||
table: "UnitInUnits",
|
||||
column: "ChildUnitId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "UnitInUnits",
|
||||
schema: "unit");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2651,6 +2651,30 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInUnit", b =>
|
||||
{
|
||||
b.Property<Guid>("ParentUnitId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("ChildUnitId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTimeOffset?>("DateSynced")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.HasKey("ParentUnitId", "ChildUnitId");
|
||||
|
||||
b.HasIndex("ChildUnitId");
|
||||
|
||||
b.ToTable("UnitInUnits", "unit", t =>
|
||||
{
|
||||
t.HasComment("Таблица связей иерархии между ЭК");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInValue", b =>
|
||||
{
|
||||
b.Property<Guid>("UnitId")
|
||||
@@ -3213,6 +3237,25 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("UnitField");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInUnit", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.Unit.Unit", "Child")
|
||||
.WithMany("Parents")
|
||||
.HasForeignKey("ChildUnitId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.Unit.Unit", "Parent")
|
||||
.WithMany("Childs")
|
||||
.HasForeignKey("ParentUnitId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Child");
|
||||
|
||||
b.Navigation("Parent");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInValue", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.Unit.UnitField", "Field")
|
||||
@@ -3441,6 +3484,10 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Unit.Unit", b =>
|
||||
{
|
||||
b.Navigation("Childs");
|
||||
|
||||
b.Navigation("Parents");
|
||||
|
||||
b.Navigation("UnitFields");
|
||||
|
||||
b.Navigation("UnitValues");
|
||||
|
||||
@@ -31,5 +31,18 @@ namespace PARR.DAL.Models.Unit
|
||||
public ICollection<UnitInField> UnitFields { get; set; } = new HashSet<UnitInField>();
|
||||
|
||||
public ICollection<UnitInValue> UnitValues { get; set; } = new HashSet<UnitInValue>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Получить всех родителей
|
||||
/// </summary>
|
||||
[InverseProperty(nameof(UnitInUnit.ChildUnit))]
|
||||
public ICollection<UnitInUnit> ParentUnits { get; set; } = new HashSet<UnitInUnit>();
|
||||
|
||||
/// <summary>
|
||||
/// Получить детей
|
||||
/// </summary>
|
||||
[InverseProperty(nameof(UnitInUnit.ParentUnit))]
|
||||
public ICollection<UnitInUnit> ChildUnits { get; set; } = new HashSet<UnitInUnit>();
|
||||
}
|
||||
}
|
||||
|
||||
30
PARR.DAL/Models/Unit/UnitInUnit.cs
Normal file
30
PARR.DAL/Models/Unit/UnitInUnit.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.DAL.Context;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.DAL.Models.Unit
|
||||
{
|
||||
/// <summary>
|
||||
/// Связи иерархии между ЭК
|
||||
/// </summary>
|
||||
[Table("UnitInUnits", Schema = DataContextSettings.Unit)]
|
||||
[Comment("Таблица связей иерархии между ЭК")]
|
||||
[PrimaryKey(nameof(ParentUnitId), nameof(ChildUnitId))]
|
||||
public class UnitInUnit
|
||||
{
|
||||
public Guid ParentUnitId { get; set; }
|
||||
|
||||
public Guid ChildUnitId { get; set; }
|
||||
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
|
||||
public DateTimeOffset? DateSynced { get; set; }
|
||||
|
||||
|
||||
[ForeignKey(nameof(ParentUnitId))]
|
||||
public Unit? ParentUnit { get; set; }
|
||||
|
||||
[ForeignKey(nameof(ChildUnitId))]
|
||||
public Unit? ChildUnit { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,10 @@ using PARR.TemplateDistributor;
|
||||
IHost host = Host.CreateDefaultBuilder(args)
|
||||
.ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
services.InstallEsppApiServices(hostContext.Configuration);
|
||||
services.InstallBllServices(hostContext.Configuration);
|
||||
//services.InstallEsppApiServices(hostContext.Configuration);
|
||||
//services.InstallBllServices(hostContext.Configuration);
|
||||
services.InstallDalServices(hostContext.Configuration);
|
||||
services.InstallTemplateDistributorSerivces(hostContext.Configuration);
|
||||
//services.InstallTemplateDistributorSerivces(hostContext.Configuration);
|
||||
|
||||
services.AddHostedService<Worker>();
|
||||
})
|
||||
|
||||
@@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using PARR.BLL.Services.Interfaces;
|
||||
using PARR.Constants;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
using PARR.DAL.Services.Interfaces.Unit;
|
||||
using PARR.EsppApi;
|
||||
using PARR.EsppApi.Constants;
|
||||
using PARR.EsppApi.Models.Query;
|
||||
@@ -42,6 +43,23 @@ namespace PARR.Test
|
||||
|
||||
#endregion
|
||||
|
||||
#region unit
|
||||
|
||||
|
||||
//using (var scope = serviceProvider.CreateScope())
|
||||
//{
|
||||
// var service = scope.ServiceProvider.GetService<IUnitService>();
|
||||
|
||||
|
||||
// var unit = await service.Get().Include(t => t.Parents).Include(t => t.Childs).FirstOrDefaultAsync(t => t.Id == Guid.Parse("0f89e2ec-0e4d-4de6-b990-c55e8308accf"));
|
||||
|
||||
// var parent = unit?.Parents;
|
||||
|
||||
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Calendar
|
||||
|
||||
//var testCalendar = new BLL.Services.Implementations.Test(calendarService);
|
||||
|
||||
@@ -8,9 +8,11 @@
|
||||
|
||||
- ~~PARR.AIHIT - логика синхронизации АИХ ИТ с БД PARR~~
|
||||
- ~~PARR.AIHITWorker - worker для PARR.AIHIT~~
|
||||
- PARR.AIHITLoader - загрузка из АИХ ИТ в очередь по расписанию
|
||||
~~- PARR.AIHITLoader - загрузка из АИХ ИТ в очередь по расписанию~~
|
||||
- PARR.AIHITMainLoader - загрузка из АИХ ИТ в очередь по расписанию
|
||||
- PARR.AIHITLoaderWorker
|
||||
- PARR.AIHITSyncer - синхронизация АИХ ИТ из очереди в ПАРР
|
||||
~~- PARR.AIHITSyncer - синхронизация АИХ ИТ из очереди в ПАРР~~
|
||||
- PARR.AIHITMainSyncer - синхронизация АИХ ИТ из очереди в ПАРР
|
||||
- PARR.AIHITSyncerWorker
|
||||
- PARR.API - API
|
||||
- PARR.BLL - общие методы и настройки для проектов
|
||||
|
||||
20
docker-compose.aihit-relationship-syncer.yml
Normal file
20
docker-compose.aihit-relationship-syncer.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
version: '3.4'
|
||||
|
||||
#AIHIT RELATIONSHIPS SYNCER
|
||||
services:
|
||||
aihit-loader:
|
||||
image: harbor.dvgd.rzd/parr/parr-aihit-relationships-syncer:${tag:-latest}
|
||||
container_name: parr-aihit-relationships-syncer
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Production
|
||||
- TZ=Europe/Moscow
|
||||
volumes:
|
||||
- /var/log/parr-aihit-relationships-syncer:/app/log
|
||||
logging:
|
||||
driver: fluentd
|
||||
options:
|
||||
fluentd-address: dvgd-efk-01.dvgd.oao.rzd:24224
|
||||
fluentd-retry-wait: '30s'
|
||||
fluentd-max-retries: '30'
|
||||
tag: parr.aihit-relationships-syncer.serilog
|
||||
@@ -10,6 +10,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="docker-compose.aihit-loader.yml" />
|
||||
<None Include="docker-compose.aihit-relationship-syncer.yml" />
|
||||
<None Include="docker-compose.aihit-syncer.yml" />
|
||||
<None Include="docker-compose.espp-order-loader.yml" />
|
||||
<None Include="docker-compose.espp-order-manager.yml" />
|
||||
|
||||
Reference in New Issue
Block a user