2024-07-22 12:43:26 +05:00
|
|
|
|
using AsbCloudApp.Data.SAUB;
|
|
|
|
|
using AsbCloudApp.Data.WITS;
|
|
|
|
|
using AsbCloudApp.Repositories;
|
|
|
|
|
using AsbCloudApp.Requests;
|
|
|
|
|
using AsbCloudApp.Services;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Services.SAUB
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Сервис по работе с данными телеметрии
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class TelemetryDataEditorService : ITelemetryDataEditorService
|
|
|
|
|
{
|
2024-07-23 17:26:23 +05:00
|
|
|
|
private readonly ITelemetryDataEditorService[] repositories;
|
2024-07-22 12:43:26 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dataSaubService"></param>
|
|
|
|
|
/// <param name="dataSpinService"></param>
|
|
|
|
|
/// <param name="dataSaubStatRepository"></param>
|
|
|
|
|
/// <param name="messageService"></param>
|
|
|
|
|
/// <param name="drillTestRepository"></param>
|
|
|
|
|
/// <param name="limitingParameterRepository"></param>
|
|
|
|
|
/// <param name="detectedOperationRepository"></param>
|
|
|
|
|
/// <param name="witsRecord1Repository"></param>
|
|
|
|
|
/// <param name="witsRecord7Repository"></param>
|
|
|
|
|
/// <param name="witsRecord8Repository"></param>
|
|
|
|
|
/// <param name="witsRecord50Repository"></param>
|
|
|
|
|
/// <param name="witsRecord60Repository"></param>
|
|
|
|
|
/// <param name="witsRecord61Repository"></param>
|
|
|
|
|
/// <param name="gtrRepository"></param>
|
|
|
|
|
public TelemetryDataEditorService(
|
|
|
|
|
ITelemetryDataSaubService dataSaubService,
|
|
|
|
|
ITelemetryDataService<TelemetryDataSpinDto> dataSpinService,
|
|
|
|
|
IDataSaubStatRepository dataSaubStatRepository,
|
|
|
|
|
IMessageService messageService,
|
|
|
|
|
IDrillTestRepository drillTestRepository,
|
|
|
|
|
ILimitingParameterRepository limitingParameterRepository,
|
|
|
|
|
IDetectedOperationRepository detectedOperationRepository,
|
|
|
|
|
IWitsRecordRepository<Record1Dto> witsRecord1Repository,
|
|
|
|
|
IWitsRecordRepository<Record7Dto> witsRecord7Repository,
|
|
|
|
|
IWitsRecordRepository<Record8Dto> witsRecord8Repository,
|
|
|
|
|
IWitsRecordRepository<Record50Dto> witsRecord50Repository,
|
|
|
|
|
IWitsRecordRepository<Record60Dto> witsRecord60Repository,
|
|
|
|
|
IWitsRecordRepository<Record61Dto> witsRecord61Repository,
|
|
|
|
|
IGtrRepository gtrRepository
|
|
|
|
|
)
|
|
|
|
|
{
|
2024-07-23 17:26:23 +05:00
|
|
|
|
repositories =
|
|
|
|
|
[
|
|
|
|
|
dataSaubService,
|
|
|
|
|
dataSpinService,
|
|
|
|
|
dataSaubStatRepository,
|
|
|
|
|
messageService,
|
|
|
|
|
drillTestRepository,
|
|
|
|
|
limitingParameterRepository,
|
|
|
|
|
detectedOperationRepository,
|
|
|
|
|
witsRecord1Repository,
|
|
|
|
|
witsRecord7Repository,
|
|
|
|
|
witsRecord8Repository,
|
|
|
|
|
witsRecord50Repository,
|
|
|
|
|
witsRecord60Repository,
|
|
|
|
|
witsRecord61Repository,
|
|
|
|
|
gtrRepository,
|
|
|
|
|
];
|
2024-07-22 12:43:26 +05:00
|
|
|
|
}
|
|
|
|
|
|
2024-07-23 17:26:23 +05:00
|
|
|
|
public async Task<int> DeleteAsync(TelemetryPartDeleteRequest request, CancellationToken token)
|
2024-07-22 12:43:26 +05:00
|
|
|
|
{
|
2024-07-24 15:23:25 +05:00
|
|
|
|
var result = 0;
|
2024-07-23 17:26:23 +05:00
|
|
|
|
foreach (var repository in repositories)
|
|
|
|
|
{
|
|
|
|
|
result += await repository.DeleteAsync(request, token);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
2024-07-22 12:43:26 +05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|