...
This commit is contained in:
@@ -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}")]
|
||||
|
@@ -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())
|
||||
//{
|
||||
|
10
Back/Data/Models/rptQueue.cs
Normal file
10
Back/Data/Models/rptQueue.cs
Normal 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; }
|
||||
|
||||
}
|
||||
}
|
@@ -12,5 +12,6 @@
|
||||
"Fixedvalues": {
|
||||
"Jwt_Lifetime_Minutes": "144000"
|
||||
},
|
||||
"CreateReportFileName": "E:\\CreateReport\\CreateReport.exe"
|
||||
"CreateReportFileName": "E:\\CreateReport\\CreateReport.exe",
|
||||
"rptQueue": "E:\\Report\\ResponseQueue"
|
||||
}
|
||||
|
Reference in New Issue
Block a user