Change events args

This commit is contained in:
2025-11-05 18:17:19 +09:00
parent 8fd7d4a571
commit e58221c430
11 changed files with 96 additions and 65 deletions

View File

@ -8,16 +8,21 @@ namespace Hcs.WebApp.BackgroundServices.ResultGetters.NsiCommon
{
public class ExportNsiItemGetter_15_7_0_1(IClient client, IServiceScope scope, Operation operation) : ResultGetterBase(client, scope, operation)
{
public override async Task<bool> GetAsync()
public override async Task<ResultGetterResponse> GetAsync()
{
var result = await client.NsiCommon.GetExportNsiItemResultAsync(operation.MessageGuid!);
if (!result.Ready)
{
return false;
return new ResultGetterResponse()
{
success = false
};
}
if (result.Success)
{
DateTime endedAt = default;
var headquartersService = scope.ServiceProvider.GetRequiredService<HeadquartersService>();
var registryService = scope.ServiceProvider.GetRequiredService<RegistryService>();
@ -47,7 +52,8 @@ namespace Hcs.WebApp.BackgroundServices.ResultGetters.NsiCommon
}
await context.SaveChangesAsync();
await headquartersService.SetOperationEndedAsync(context, operation.Id);
endedAt = DateTime.UtcNow;
await headquartersService.SetOperationEndedAsync(context, operation.Id, endedAt);
await transaction.CommitAsync();
}
@ -59,7 +65,11 @@ namespace Hcs.WebApp.BackgroundServices.ResultGetters.NsiCommon
}
});
return true;
return new ResultGetterResponse()
{
success = true,
endedAt = endedAt
};
}
throw Failure(result.ErrorMessage);