Корректировка имен колонок в АИХ ИТ
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
<add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" />
|
<add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
<disabledPackageSources>
|
<disabledPackageSources>
|
||||||
<add key="nuget.org" value="true" />
|
|
||||||
<add key="Microsoft Visual Studio Offline Packages" value="true" />
|
<add key="Microsoft Visual Studio Offline Packages" value="true" />
|
||||||
</disabledPackageSources>
|
</disabledPackageSources>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -3,5 +3,6 @@
|
|||||||
public interface ISyncher
|
public interface ISyncher
|
||||||
{
|
{
|
||||||
Task InvokeAsync();
|
Task InvokeAsync();
|
||||||
|
Task InvokeFromDatabase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
|
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.10" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,11 @@ using MailKit.Search;
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using MimeKit;
|
using MimeKit;
|
||||||
|
using PARR.AIHIT.Context;
|
||||||
using PARR.AIHIT.Settings;
|
using PARR.AIHIT.Settings;
|
||||||
using PARR.DAL.Contracts;
|
using PARR.DAL.Contracts;
|
||||||
using PARR.DAL.Extensions;
|
using PARR.DAL.Extensions;
|
||||||
using PARR.DAL.Models;
|
using PARR.DAL.Models.V1;
|
||||||
using PARR.DAL.Services.Interfaces;
|
using PARR.DAL.Services.Interfaces;
|
||||||
using PARR.Mail.Services;
|
using PARR.Mail.Services;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -209,6 +210,31 @@ namespace PARR.AIHIT
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task InvokeFromDatabase()
|
||||||
|
{
|
||||||
|
//call procedure
|
||||||
|
using (AIHContext db = new AIHContext())
|
||||||
|
{
|
||||||
|
var zo = new Microsoft.Data.SqlClient.SqlParameter
|
||||||
|
{
|
||||||
|
ParameterName = "@зо",
|
||||||
|
SqlDbType = System.Data.SqlDbType.NVarChar,
|
||||||
|
Direction = System.Data.ParameterDirection.Input,
|
||||||
|
Size = 60,
|
||||||
|
Value = "96-ДВС"
|
||||||
|
};
|
||||||
|
//.EKs.FromSql("exec sp_IPP_PARR_PTK_get_EK '88-КРАСН'");
|
||||||
|
//.ToList();
|
||||||
|
//db.Database.ExecuteSqlRaw("mao2.dbo.sp_IPP_PARR_PTK_get_EK @userName", param);
|
||||||
|
//var isConExist = db.ex
|
||||||
|
//var result = await db.Database.ExecuteSqlRawAsync("mao2.dbo.sp_IPP_PARR_PTK_get_EK @зо", zo);
|
||||||
|
//WORK!!!!db.EKs.FromSql($"EXEC mao2.dbo.sp_IPP_PARR_PTK_get_EK '88-КРАСН'").ToList();
|
||||||
|
var result = db.EKs.FromSqlRaw($"EXEC mao2.dbo.sp_IPP_PARR_PTK_get_EK @зо", zo).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
//get raw data
|
||||||
|
//save data
|
||||||
|
}
|
||||||
private async Task SyncApplicationAndHostAsync(V1_Host? host, List<V1_Application> hostApplications, bool isUpdateDateModified = false)
|
private async Task SyncApplicationAndHostAsync(V1_Host? host, List<V1_Application> hostApplications, bool isUpdateDateModified = false)
|
||||||
{
|
{
|
||||||
var isUpdated = false;
|
var isUpdated = false;
|
||||||
@@ -346,7 +372,7 @@ namespace PARR.AIHIT
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var app = new DAL.Models.V1_Application
|
var app = new DAL.Models.V1.V1_Application
|
||||||
{
|
{
|
||||||
Id = Guid.NewGuid(),
|
Id = Guid.NewGuid(),
|
||||||
Name = appName.Trim(),
|
Name = appName.Trim(),
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using PARR.AIHIT.Context;
|
||||||
using PARR.AIHIT.Settings;
|
using PARR.AIHIT.Settings;
|
||||||
|
|
||||||
namespace PARR.AIHIT
|
namespace PARR.AIHIT
|
||||||
@@ -15,6 +17,11 @@ namespace PARR.AIHIT
|
|||||||
services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
|
services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
|
||||||
|
|
||||||
services.AddTransient<ISyncher, Syncher>();
|
services.AddTransient<ISyncher, Syncher>();
|
||||||
|
|
||||||
|
//services.AddDbContext <AIHContext> (options =>
|
||||||
|
//{
|
||||||
|
// options.UseSqlServer("server=(10.248.19.97);uid=awhit-ipp-parr;pwd=ET3h$9y1LH#D");
|
||||||
|
//});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using PARR.DAL.Contracts;
|
using PARR.DAL.Contracts;
|
||||||
using PARR.DAL.Models;
|
using PARR.DAL.Models.V1;
|
||||||
|
|
||||||
namespace PARR.DAL.Context
|
namespace PARR.DAL.Context
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using PARR.DAL.Context;
|
using PARR.DAL.Context;
|
||||||
using PARR.DAL.Models;
|
using PARR.DAL.Models.V1;
|
||||||
using PARR.DAL.Services.Abstracts;
|
using PARR.DAL.Services.Abstracts;
|
||||||
using PARR.DAL.Services.Interfaces;
|
using PARR.DAL.Services.Interfaces;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using PARR.DAL.Models;
|
using PARR.DAL.Models.V1;
|
||||||
using PARR.DAL.Services.Interfaces.Base;
|
using PARR.DAL.Services.Interfaces.Base;
|
||||||
|
|
||||||
namespace PARR.DAL.Services.Interfaces
|
namespace PARR.DAL.Services.Interfaces
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
using PARR.AIHIT;
|
using PARR.AIHIT;
|
||||||
using PARR.DAL;
|
using PARR.DAL;
|
||||||
using PARR.Mail;
|
using PARR.Mail;
|
||||||
@@ -15,7 +16,6 @@ IHost host = Host.CreateDefaultBuilder(args)
|
|||||||
hostContext.Configuration.GetSection(nameof(WorkerSettings)).Bind(workerSettings);
|
hostContext.Configuration.GetSection(nameof(WorkerSettings)).Bind(workerSettings);
|
||||||
services.AddSingleton(workerSettings);
|
services.AddSingleton(workerSettings);
|
||||||
|
|
||||||
|
|
||||||
services.InstallMailServices(hostContext.Configuration);
|
services.InstallMailServices(hostContext.Configuration);
|
||||||
services.InstallDalServices(hostContext.Configuration);
|
services.InstallDalServices(hostContext.Configuration);
|
||||||
services.InstallerSyncerServices(hostContext.Configuration);
|
services.InstallerSyncerServices(hostContext.Configuration);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace PARR.Worker
|
|||||||
var services = scope.ServiceProvider;
|
var services = scope.ServiceProvider;
|
||||||
var syncer = services.GetService<ISyncher>();
|
var syncer = services.GetService<ISyncher>();
|
||||||
|
|
||||||
if (syncer != null) await syncer.InvokeAsync();
|
if (syncer != null) await syncer.InvokeFromDatabase();
|
||||||
|
|
||||||
//var hosts = await hostService.Get().ToListAsync();
|
//var hosts = await hostService.Get().ToListAsync();
|
||||||
//foreach ( var host in hosts ) { logger.LogInformation($"{host.HostName}"); }
|
//foreach ( var host in hosts ) { logger.LogInformation($"{host.HostName}"); }
|
||||||
|
|||||||
Reference in New Issue
Block a user