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}")]

View File

@@ -46,6 +46,7 @@ namespace TaxPayer.Infrastructure.Persistence
public DbSet<UserNotfi> UserNotifis { get; set; }
public DbSet<stuff> Stuffs { get; set; }
public DbSet<Ulr> Ulrs { get; set; }
public DbSet<rptQueue> rptQueue { get; set; }
#endregion
//public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken())
//{

View File

@@ -0,0 +1,10 @@
namespace Back.Data.Models
{
public class rptQueue
{
public int ID { get; set; }
public int InvoicID { get; set; }
public int CompanyID { get; set; }
}
}

View File

@@ -12,5 +12,6 @@
"Fixedvalues": {
"Jwt_Lifetime_Minutes": "144000"
},
"CreateReportFileName": "E:\\CreateReport\\CreateReport.exe"
"CreateReportFileName": "E:\\CreateReport\\CreateReport.exe",
"rptQueue": "E:\\Report\\ResponseQueue"
}