This commit is contained in:
mmrbnjd
2024-07-04 18:49:11 +03:30
parent 73fe6a0992
commit d4410ea328
4 changed files with 33 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
using Back.Common;
using Back.Data.Contracts;
using Back.Data.Models;
using Back.Services;
using Back.Validations;
@@ -22,15 +23,18 @@ namespace Back.Controllers
private readonly servUser _servUser;
private readonly AddOrUpdateInvoiceValidation _validationInvoice;
private readonly servTaxPayer _servTaxPayer;
private readonly IAsyncRepository<rptQueue> _rptQueueRepository;
public InvoiceController(servInvoice servInvoice, servUser servUser
, AddOrUpdateInvoiceValidation validationInvoice
, servTaxPayer servTaxPayer, IConfiguration configuration)
, servTaxPayer servTaxPayer, IConfiguration configuration
, IAsyncRepository<rptQueue> rptQueueRepository)
{
_servInvoice = servInvoice;
_servUser = servUser;
_validationInvoice = validationInvoice;
_configuration=configuration;
_servTaxPayer = servTaxPayer;
_rptQueueRepository = rptQueueRepository;
}
[HttpPost("GetAll")]
@@ -458,7 +462,19 @@ namespace Back.Controllers
if (!await _servInvoice.ExistInvoiceByInvoiceID(CompanyID.Value, InvoiceID))
return NotFound();
//if( await _rptQueueRepository.AddBoolResultAsync(new rptQueue
// {
// CompanyID= CompanyID.Value,InvoicID= InvoiceID,
//}))
// {
// Thread.Sleep(2000);
// if(System.IO.File.Exists(_configuration["rptQueue"].ToString()+ InvoiceID + ".txt"))
// {
// output= System.IO.File.ReadAllText(_configuration["rptQueue"].ToString() + InvoiceID + ".txt");
// }
// }
// Start the child process.
Process p = new Process();
@@ -468,8 +484,8 @@ namespace Back.Controllers
p.StartInfo.FileName = _configuration["CreateReportFileName"].ToString();
p.StartInfo.Arguments = $"{CompanyID} {InvoiceID}";
p.Start();
output =await p.StandardOutput.ReadToEndAsync();
await p.WaitForExitAsync();
output = await p.StandardOutput.ReadToEndAsync();
await p.WaitForExitAsync();
return Ok(output);
}
[HttpPut("SetExternalAccessCode/{InvoiceID}")]