Синхронизация данных АИХ ИТ с ПАРР
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations
|
||||
{
|
||||
internal class ApplicationInHostService : BaseService<V1_ApplicationInHost>, IApplicationInHostService
|
||||
internal class ApplicationInHostService : BaseService<ApplicationInHost>, IApplicationInHostService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
private readonly ILogger<ApplicationInHostService> logger;
|
||||
@@ -18,7 +18,7 @@ namespace PARR.DAL.Services.Implementations
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
protected override DbSet<V1_ApplicationInHost> EntitySet => dataContext.ApplicationsInHosts;
|
||||
protected override DbSet<ApplicationInHost> EntitySet => dataContext.ApplicationsInHosts;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations
|
||||
{
|
||||
internal class ApplicationService : BaseService<V1_Application>, IApplicationService
|
||||
internal class ApplicationService : BaseService<Application>, IApplicationService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
private readonly ILogger<ApplicationService> logger;
|
||||
@@ -18,11 +18,11 @@ namespace PARR.DAL.Services.Implementations
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
protected override DbSet<V1_Application> EntitySet => dataContext.Applications;
|
||||
protected override DbSet<Application> EntitySet => dataContext.Applications;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
|
||||
public async Task<V1_Application?> GetByNameAsync(string appName)
|
||||
public async Task<Application?> GetByNameAsync(string appName)
|
||||
{
|
||||
return await EntitySet.FirstOrDefaultAsync(t => t.Name.ToLower() == appName.Trim().ToLower());
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations
|
||||
namespace PARR.DAL.Services.Implementation
|
||||
{
|
||||
internal class ApplicationTypeService : BaseService<V1_ApplicationType>, IApplicationTypeService
|
||||
internal class ApplicationTypeService : BaseService<ApplicationType>, IApplicationTypeService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
private readonly ILogger<ApplicationTypeService> logger;
|
||||
@@ -18,7 +18,7 @@ namespace PARR.DAL.Services.Implementations
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
protected override DbSet<V1_ApplicationType> EntitySet => dataContext.ApplicationTypes;
|
||||
protected override DbSet<ApplicationType> EntitySet => dataContext.ApplicationTypes;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations
|
||||
{
|
||||
internal class HostService : BaseService<V1_Host>, IHostService
|
||||
internal class HostService : BaseService<Host>, IHostService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
private readonly ILogger<HostService> logger;
|
||||
|
||||
protected override DbSet<V1_Host> EntitySet => dataContext.Hosts;
|
||||
protected override DbSet<Host> EntitySet => dataContext.Hosts;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
public HostService(DataContext dataContext, ILogger<HostService> logger) : base(logger)
|
||||
@@ -21,7 +21,7 @@ namespace PARR.DAL.Services.Implementations
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public async Task<V1_Host?> GetHostWithAppsAsync(string IP, string RegionalEK)
|
||||
public async Task<Host?> GetHostWithAppsAsync(string IP)
|
||||
{
|
||||
|
||||
//try
|
||||
@@ -37,21 +37,7 @@ namespace PARR.DAL.Services.Implementations
|
||||
return await EntitySet
|
||||
.Include(t => t.ApplicationsInHosts).ThenInclude(a => a.Application).ThenInclude(t => t.ApplicationType)
|
||||
.AsSplitQuery()
|
||||
.FirstOrDefaultAsync(h => h.IP == IP && h.RegionalEK == RegionalEK);
|
||||
}
|
||||
|
||||
public async Task<V1_Host?> GetHostWithAppsAsync(string IP, string linkEK, string regionalEK)
|
||||
{
|
||||
return await EntitySet
|
||||
.Include(t => t.ApplicationsInHosts).ThenInclude(a => a.Application).ThenInclude(t => t.ApplicationType)
|
||||
.AsSplitQuery()
|
||||
.FirstOrDefaultAsync(h => h.IP == IP && h.LinkEK == linkEK && h.RegionalEK == regionalEK);
|
||||
}
|
||||
|
||||
|
||||
public async Task<V1_Host?> GetHostByIPAndRegionalEKAsync(string IP, string RegionalEK)
|
||||
{
|
||||
return await EntitySet.FirstOrDefaultAsync(h => h.IP == IP && h.RegionalEK == RegionalEK);
|
||||
.FirstOrDefaultAsync(h => h.IP == IP);
|
||||
}
|
||||
|
||||
//public async Task<Host?> GetHostByRegionalEKAsync(string RegionalEK)И
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations
|
||||
{
|
||||
internal class JobCategoryService : BaseService<V1_JobCategory>, IJobCategoryService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
private readonly ILogger<JobCategoryService> logger;
|
||||
|
||||
public JobCategoryService(DataContext dataContext, ILogger<JobCategoryService> logger) : base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
this.logger = logger;
|
||||
}
|
||||
protected override DbSet<V1_JobCategory> EntitySet => dataContext.JobCategories;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Extensions;
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations
|
||||
{
|
||||
internal class JobJournalService : BaseService<V1_JobJournal>, IJobJournalService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
private readonly ILogger<JobJournalService> logger;
|
||||
|
||||
public JobJournalService(DataContext dataContext, ILogger<JobJournalService> logger) : base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
this.logger = logger;
|
||||
}
|
||||
protected override DbSet<V1_JobJournal> EntitySet => dataContext.JobJournals;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
|
||||
public async Task<V1_JobJournal?> GetLastAsync(Guid jobId, Guid hostId, DateTimeOffset date)
|
||||
{
|
||||
//var n=DateTimeOffset.UtcNow;
|
||||
//var opers = await EntitySet
|
||||
// .Where(j => j.JobId == jobId && j.HostId == hostId && (j.DateOper!=DateTimeOffset.MinValue))/*date.StartOfDay()*/// && j.DateOper < date.EndOfDay()))
|
||||
// .OrderBy(t => t.DateOper)
|
||||
// .LastOrDefaultAsync();
|
||||
|
||||
var opers = await EntitySet
|
||||
.Where(j => j.JobId == jobId && j.HostId == hostId && j.DateOper.DateTime.Date == date.DateTime.Date)
|
||||
.OrderBy(t => t.DateOper)
|
||||
.LastOrDefaultAsync();
|
||||
|
||||
return opers;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations
|
||||
{
|
||||
internal class JobModeService : BaseService<V1_JobMode>, IJobModeService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
private readonly ILogger<JobModeService> logger;
|
||||
|
||||
public JobModeService(DataContext dataContext, ILogger<JobModeService> logger) : base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
this.logger = logger;
|
||||
}
|
||||
protected override DbSet<V1_JobMode> EntitySet => dataContext.JobModes;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations
|
||||
{
|
||||
internal class JobService : BaseService<V1_Job>, IJobService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
private readonly ILogger<JobService> logger;
|
||||
|
||||
public JobService(DataContext dataContext,ILogger<JobService> logger):base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
this.logger = logger;
|
||||
}
|
||||
protected override DbSet<V1_Job> EntitySet => dataContext.Jobs;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations
|
||||
{
|
||||
internal class JobStatusService : BaseService<V1_JobStatus>, IJobStatusService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
private readonly ILogger<JobStatusService> logger;
|
||||
|
||||
public JobStatusService(DataContext dataContext, ILogger<JobStatusService> logger) : base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
this.logger = logger;
|
||||
}
|
||||
protected override DbSet<V1_JobStatus> EntitySet => dataContext.JobStatuses;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
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 SchedulerService : BaseService<Scheduler>, ISchedulerService
|
||||
//{
|
||||
// private readonly DataContext dataContext;
|
||||
|
||||
// public SchedulerService(DataContext dataContext, ILogger<SchedulerService> logger) : base(logger)
|
||||
// {
|
||||
// this.dataContext = dataContext;
|
||||
// }
|
||||
// protected override DbSet<Scheduler> EntitySet => dataContext.Schedulers;
|
||||
|
||||
// protected override DataContext EntitiContext => dataContext;
|
||||
//}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
public interface IApplicationInHostService : IBaseService<V1_ApplicationInHost>
|
||||
public interface IApplicationInHostService : IBaseService<ApplicationInHost>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
public interface IApplicationService : IBaseService<V1_Application>
|
||||
public interface IApplicationService : IBaseService<Application>
|
||||
{
|
||||
Task<V1_Application?> GetByNameAsync(string appName);
|
||||
Task<Application?> GetByNameAsync(string appName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
public interface IApplicationTypeService : IBaseService<V1_ApplicationType>
|
||||
public interface IApplicationTypeService : IBaseService<ApplicationType>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
public interface IHostService : IBaseService<V1_Host>
|
||||
public interface IHostService : IBaseService<Host>
|
||||
{
|
||||
Task<V1_Host?> GetHostByIPAndRegionalEKAsync(string IP, string RegionalEK);
|
||||
Task<V1_Host?> GetHostWithAppsAsync(string IP, string linkEK, string regionalEK);
|
||||
//Task<Host?> GetHostByRegionalEKAsync(string LinkEK);
|
||||
//Task<bool> UpdateAsync(Host host);
|
||||
Task<Host?> GetHostWithAppsAsync(string IP);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
internal interface IJobCategoryService : IBaseService<V1_JobCategory>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using PARR.DAL.Models.V1;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
public interface IJobJournalService
|
||||
{
|
||||
Task<V1_JobJournal?> GetLastAsync(Guid jobId, Guid hostId, DateTimeOffset date);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
internal interface IJobModeService : IBaseService<V1_JobMode>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
public interface IJobService : IBaseService<V1_Job>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
internal interface IJobStatusService : IBaseService<V1_JobStatus>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
//public interface ISchedulerService : IBaseService<Scheduler>
|
||||
//{
|
||||
//}
|
||||
}
|
||||
Reference in New Issue
Block a user