2024-07-04 11:02:45 +05:00
|
|
|
|
using AsbCloudApp.Data;
|
2024-02-08 17:33:38 +05:00
|
|
|
|
using AsbCloudApp.Data.DetectedOperation;
|
2024-02-05 10:47:00 +05:00
|
|
|
|
using AsbCloudApp.Data.SAUB;
|
2024-02-01 13:44:27 +05:00
|
|
|
|
using AsbCloudApp.Repositories;
|
|
|
|
|
using AsbCloudApp.Requests;
|
2024-02-08 17:33:38 +05:00
|
|
|
|
using AsbCloudApp.Services;
|
2024-02-01 13:44:27 +05:00
|
|
|
|
using AsbCloudDb.Model;
|
2024-02-08 17:33:38 +05:00
|
|
|
|
using AsbCloudInfrastructure.Services.DetectOperations;
|
2024-01-29 11:51:09 +05:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using System;
|
2024-02-01 13:44:27 +05:00
|
|
|
|
using System.Collections.Generic;
|
2024-01-29 11:51:09 +05:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Background.PeriodicWorks
|
|
|
|
|
{
|
2024-01-31 15:20:14 +05:00
|
|
|
|
/// <summary>
|
2024-08-01 09:53:31 +05:00
|
|
|
|
/// задача по добавлению данных в таблицу DataSaubStat, которая используется для построения РТК-отчета
|
2024-01-31 15:20:14 +05:00
|
|
|
|
/// </summary>
|
|
|
|
|
internal class WorkDataSaubStat : Work
|
2024-01-29 11:51:09 +05:00
|
|
|
|
{
|
2024-08-02 15:22:04 +05:00
|
|
|
|
private int Gap = 60;
|
2024-01-31 15:20:14 +05:00
|
|
|
|
|
2024-01-31 15:25:16 +05:00
|
|
|
|
public WorkDataSaubStat() : base("Generate DataSaubStat entries and save them into Db")
|
2024-01-29 11:51:09 +05:00
|
|
|
|
{
|
2024-01-29 12:50:31 +05:00
|
|
|
|
Timeout = TimeSpan.FromMinutes(10);
|
2024-01-29 11:51:09 +05:00
|
|
|
|
}
|
|
|
|
|
|
2024-02-01 13:44:27 +05:00
|
|
|
|
protected override async Task Action(string id, IServiceProvider services, Action<string, double?> onProgressCallback, CancellationToken token)
|
2024-01-29 11:51:09 +05:00
|
|
|
|
{
|
2024-08-01 09:53:31 +05:00
|
|
|
|
var dataSaubStatService = services.GetService<IDataSaubStatService>();
|
2024-02-05 10:47:00 +05:00
|
|
|
|
|
2024-08-01 09:53:31 +05:00
|
|
|
|
if (dataSaubStatService != null )
|
2024-08-05 10:20:48 +05:00
|
|
|
|
await dataSaubStatService.CreateStatAsync(Gap, onProgressCallback, token);
|
2024-02-01 13:44:27 +05:00
|
|
|
|
|
2024-08-01 09:53:31 +05:00
|
|
|
|
}
|
2024-01-29 11:51:09 +05:00
|
|
|
|
}
|
|
|
|
|
}
|