Compare commits
10 Commits
4bc8b1597f
...
fff3c273d7
| Author | SHA1 | Date | |
|---|---|---|---|
| fff3c273d7 | |||
| 11d4700c01 | |||
|
|
7e732fe778 | ||
| b157f50921 | |||
| 94bc4a303e | |||
|
|
5757cd1aee | ||
|
|
63fc5b0f6a | ||
|
|
10f7958811 | ||
| 14d48aa3f2 | |||
|
|
6479b5ea43 |
@ -31,6 +31,9 @@ namespace ApiSoftway.Controllers
|
||||
private readonly IConfiguration? _configuration;
|
||||
private readonly GESA_GIRICONSEGNEDACREARE_DbContext _daCreare_context;
|
||||
private readonly GESA_CONSEGNE_M_DbContext _consegne_m_context;
|
||||
private readonly GESA_PI_GIRI_SERIALI_DbContext _giriseriali_context;
|
||||
private readonly GESA_GIRICONSEGNEDACREARE_DESTINAZIONI_DbContext _daCreareDest_context;
|
||||
private readonly GESA_DESTINAZIONI_WEB_DbContext _destinazioni_web_context;
|
||||
|
||||
private DbSet<Giri>? _giri;
|
||||
private DbSet<GiriConsegna>? _giriCons;
|
||||
@ -42,10 +45,12 @@ namespace ApiSoftway.Controllers
|
||||
private DbSet<Automezzi>? _automezzi;
|
||||
private DbSet<GiriConsegnaDaCreare>? _GiriDaCreare;
|
||||
private DbSet<Consegna_m>? _testate;
|
||||
private DbSet<GiriConsegnaDaCreareDest>? _GiriDaCreareDest;
|
||||
public GiriController(ILogger<LoginController> logger, IConfiguration? configuration, GESA_GIRI_DbContext giri_context, GESA_DESTINAZIONI_DbContext destinazioni_context
|
||||
, GESA_CONSEGNE_DbContext consegne_context, GESA_GIRICONSEGNE_DbContext giricons_context, GESA_GIRICONSEGNEVISTA_DbContext consegnevista_context, GESA_SBR_ORD_DbContext sbrord_context
|
||||
, GESA_PERSONALE_DbContext personale_context, GESA_AUTOMEZZI_DbContext automezzi_context, GESA_GIRICONSEGNEDACREARE_DbContext daCreare_context
|
||||
, GESA_CONSEGNE_M_DbContext consegne_m_context)
|
||||
, GESA_CONSEGNE_M_DbContext consegne_m_context, GESA_PI_GIRI_SERIALI_DbContext giriseriali_context, GESA_GIRICONSEGNEDACREARE_DESTINAZIONI_DbContext daCreareDest_context
|
||||
, GESA_DESTINAZIONI_WEB_DbContext destinazioni_web_context)
|
||||
{
|
||||
_logger = logger;
|
||||
_configuration = configuration;
|
||||
@ -59,6 +64,9 @@ namespace ApiSoftway.Controllers
|
||||
_automezzi_context = automezzi_context;
|
||||
_daCreare_context = daCreare_context;
|
||||
_consegne_m_context = consegne_m_context;
|
||||
_giriseriali_context = giriseriali_context;
|
||||
_daCreareDest_context = daCreareDest_context;
|
||||
_destinazioni_web_context = destinazioni_web_context;
|
||||
}
|
||||
|
||||
[HttpGet("listaGiri")]
|
||||
@ -91,6 +99,16 @@ namespace ApiSoftway.Controllers
|
||||
return gc;
|
||||
}
|
||||
|
||||
[HttpGet("listaGiriDaCreareByData")]
|
||||
public async Task<ActionResult<IEnumerable<GiriConsegnaDaCreare>>> listaGiriDaCreareByData(DateTime dt)
|
||||
{
|
||||
List<GiriConsegnaDaCreare> lst = new List<GiriConsegnaDaCreare>();
|
||||
_GiriDaCreare = _daCreare_context.GiriDaCreare;
|
||||
var gc = await _GiriDaCreare.Where(t=>t.DataGiro.Equals(dt)).OrderByDescending(t => t.DataGiro).ToListAsync();
|
||||
|
||||
return gc;
|
||||
}
|
||||
|
||||
[HttpGet("listaAutisti")]
|
||||
public async Task<ActionResult<IEnumerable<Personale>>> listaAutisti()
|
||||
{
|
||||
@ -201,22 +219,48 @@ namespace ApiSoftway.Controllers
|
||||
}
|
||||
|
||||
//step 3 aggiorno con il seriale le righe delle destinazioni
|
||||
_destinazioni = _destinazioni_context.Destinazioni;
|
||||
var dest = await _destinazioni.Where(t => t.CodAutista != null && t.CodAutista.Equals(model.CodAutista)
|
||||
&& t.DataCarico != null && t.DataCarico == model.DataGiro
|
||||
&& t.serialeGiro == null
|
||||
&& t.CodAutomezzo!=null && t.CodAutomezzo.Equals(model.CodMezzo)).OrderByDescending(t => t.DataCarico).ToListAsync();
|
||||
|
||||
//_destinazioni = _destinazioni_context.Destinazioni;
|
||||
//var dest = await _destinazioni.Where(t => t.CodAutista != null && t.CodAutista.Equals(model.CodAutista)
|
||||
//&& t.DataCarico != null && t.DataCarico == model.DataGiro
|
||||
////&& t.serialeGiro == null
|
||||
//&& t.CodAutomezzo!=null && t.CodAutomezzo.Equals(model.CodMezzo)).OrderByDescending(t => t.DataCarico).ToListAsync();
|
||||
|
||||
|
||||
|
||||
_destinazioni = _daCreareDest_context.GiriDaCreare;
|
||||
var dest = await _destinazioni.Where(t => t.CodAutista != null && t.CodAutista.Equals(model.CodAutista)
|
||||
&& t.DataCarico != null && t.DataCarico == model.DataGiro
|
||||
//&& t.serialeGiro == null
|
||||
&& t.CodAutomezzo != null && t.CodAutomezzo.Equals(model.CodMezzo)).OrderByDescending(t => t.DataCarico).ToListAsync();
|
||||
|
||||
foreach (Destinazioni d in dest)
|
||||
{
|
||||
//20241018: cambiato sistema inserisco in tabella di raccordo GESAPI_GIRI_SERIALI
|
||||
GiriSeriali g =new GiriSeriali();
|
||||
g.Brserial = d.Brserial;
|
||||
g.Pisergir = newSer;
|
||||
using (var transactionDest = _giriseriali_context.Database.BeginTransaction())
|
||||
{
|
||||
await _giriseriali_context.Cons.AddAsync(g);
|
||||
await _giriseriali_context.SaveChangesAsync();
|
||||
transactionDest.Commit();
|
||||
}
|
||||
/*
|
||||
Sbr_ord sbr_Ord = new Sbr_ord();
|
||||
sbr_Ord.Brserial = d.Brserial;
|
||||
sbr_Ord.Pisergir = newSer;
|
||||
//ATTENZIONE!! fa l'aggiornamento su tutti i campi dell'oggetto
|
||||
|
||||
using (var transactionDest = _sbrord_context.Database.BeginTransaction())
|
||||
{
|
||||
_sbrord_context.Entry(sbr_Ord).State = EntityState.Modified;
|
||||
//_sbrord_context.Entry(sbr_Ord).State = EntityState.Modified;
|
||||
_sbrord_context.Entry(sbr_Ord).Property(x => x.Pisergir).IsModified = true;
|
||||
|
||||
await _sbrord_context.SaveChangesAsync();
|
||||
transactionDest.Commit();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
var giro = await _giriConsView.Where(t => t.SerialeGiro.Equals(newSer)).ToListAsync();
|
||||
@ -433,6 +477,7 @@ namespace ApiSoftway.Controllers
|
||||
_destinazioni = _destinazioni_context.Destinazioni;
|
||||
var r = await _destinazioni.Where(t => t.CodAutista != null && t.CodAutista.Equals(usr) && t.DataCarico != null && t.DataCarico == data
|
||||
&& !string.IsNullOrEmpty(t.serialeGiro)
|
||||
|
||||
).OrderBy(t => t.serialeGiro).ToListAsync();
|
||||
|
||||
|
||||
@ -599,6 +644,176 @@ namespace ApiSoftway.Controllers
|
||||
return lst;
|
||||
}
|
||||
|
||||
[HttpGet("listaDestinazioniByAutistaDataMezzoWeb")]
|
||||
public async Task<ActionResult<IEnumerable<Destinazioni_out>>> listaDestinazioniByAutistaDataWeb(string autista, DateTime? dataGiro, string mezzo)
|
||||
{
|
||||
|
||||
List<Destinazioni_out> lst = new List<Destinazioni_out>();
|
||||
_destinazioni = _destinazioni_web_context.Destinazioni;
|
||||
var r = await _destinazioni.Where(t => t.CodAutista != null && t.CodAutista.Equals(autista) && t.DataCarico != null && t.DataCarico == dataGiro && t.CodAutomezzo != null && t.CodAutomezzo.Equals(mezzo)).OrderByDescending(t => t.DataCarico).ThenBy(t => t.Seq).ToListAsync();
|
||||
foreach (Destinazioni d in r)
|
||||
{
|
||||
Destinazioni_out o = new Destinazioni_out();
|
||||
string _aut = !string.IsNullOrEmpty(d.Autista) ? d.Autista.Trim() : string.Empty;
|
||||
o.Autista = _aut;
|
||||
|
||||
string _autCod = !string.IsNullOrEmpty(d.CodAutista) ? d.CodAutista.Trim() : string.Empty;
|
||||
o.CodAutista = _autCod;
|
||||
|
||||
string _automezzo = !string.IsNullOrEmpty(d.DescAutomezzo) ? d.DescAutomezzo.Trim() : string.Empty;
|
||||
o.DescAutomezzo = _automezzo;
|
||||
|
||||
string _automezzoCod = !string.IsNullOrEmpty(d.CodAutomezzo) ? d.CodAutomezzo.Trim() : string.Empty;
|
||||
o.CodAutomezzo = d.CodAutomezzo;
|
||||
|
||||
o.DataCarico = d.DataCarico;
|
||||
o.Brserial = d.Brserial;
|
||||
o.Brmerce = d.Brmerce;
|
||||
o.Brnote = d.Brnote;
|
||||
o.Cproword = d.Cproword;
|
||||
o.Cprownum = d.Cprownum;
|
||||
|
||||
string _sedeInd = !string.IsNullOrEmpty(d.IndirizzoSede) ? d.IndirizzoSede.Trim() : string.Empty;
|
||||
o.IndirizzoSede = _sedeInd;
|
||||
|
||||
string _sede = !string.IsNullOrEmpty(d.Sede) ? d.Sede.Trim() : string.Empty;
|
||||
o.Sede = _sede;
|
||||
o.CodCommittente = d.CodCommittente;
|
||||
|
||||
string _committente = !string.IsNullOrEmpty(d.Committente) ? d.Committente.Trim() : string.Empty;
|
||||
o.Committente = _committente;
|
||||
|
||||
o.CodSede = d.CodSede;
|
||||
o.ItemList = formattaDestinazione(d);
|
||||
o.ImportoDaRitirare = d.ImportoDaRitirare;
|
||||
o.serialeGiro = d.serialeGiro;
|
||||
o.Casse = d.Casse;
|
||||
o.Trasf = d.Trasf;
|
||||
o.Colli = d.Colli;
|
||||
o.num_cons = d.num_cons;
|
||||
o.Uova = d.Uova;
|
||||
o.Cist = d.Cist;
|
||||
o.Note = d.Note;
|
||||
o.Seq = d.Seq;
|
||||
o.Prog = d.Prog;
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(d.consFattaSerial))
|
||||
{
|
||||
ConsegnaFatta cf = new ConsegnaFatta();
|
||||
cf.consFattaSerial = d.consFattaSerial;
|
||||
cf.consFattaRow = d.consFattaRow;
|
||||
cf.consFattaAut = d.consFattaAut;
|
||||
cf.consFattaBanSca = d.consFattaBanSca;
|
||||
cf.consFattaBanCar = d.consFattaBanCar;
|
||||
string nota = !string.IsNullOrEmpty(d.consFattaNotBan) ? d.consFattaNotBan.Trim() : string.Empty;
|
||||
cf.consFattaNotBan = nota;
|
||||
cf.consFattaImpor = d.consFattaImpor;
|
||||
cf.consFattaMezzo = d.consFattaMezzo;
|
||||
string nota2 = !string.IsNullOrEmpty(d.consFattaNotImp) ? d.consFattaNotImp.Trim() : string.Empty;
|
||||
cf.consFattaNotImp = nota2;
|
||||
cf.consFattaFlagCons = d.consFattaFlagCons;
|
||||
cf.consFattaDataOra = d.consFattaDataOra;
|
||||
|
||||
o.ConsFatta = cf;
|
||||
}
|
||||
|
||||
lst.Add(o);
|
||||
}
|
||||
return lst;
|
||||
}
|
||||
|
||||
[HttpGet("listaDestinazioniByAutistaDataMezzoNonValidate")]
|
||||
public async Task<ActionResult<IEnumerable<Destinazioni_out>>> listaDestinazioniByAutistaDataMezzoNonValidate(string autista, DateTime? dataGiro, string mezzo)
|
||||
{
|
||||
|
||||
List<Destinazioni_out> lst = new List<Destinazioni_out>();
|
||||
//_destinazioni = _destinazioni_context.Destinazioni;
|
||||
//var r = await _destinazioni.Where(t => t.CodAutista != null && t.CodAutista.Equals(autista) && t.DataCarico != null && t.DataCarico == dataGiro && t.CodAutomezzo != null && t.CodAutomezzo.Equals(mezzo)).OrderByDescending(t => t.DataCarico).ThenBy(t => t.Seq).ToListAsync();
|
||||
|
||||
_destinazioni = _daCreareDest_context.GiriDaCreare;
|
||||
var dest = await _destinazioni.Where(t => t.CodAutista != null && t.CodAutista.Equals(autista)
|
||||
&& t.DataCarico != null && t.DataCarico == dataGiro
|
||||
//&& t.serialeGiro == null
|
||||
&& t.CodAutomezzo != null && t.CodAutomezzo.Equals(mezzo)).OrderByDescending(t => t.DataCarico).ToListAsync();
|
||||
|
||||
|
||||
foreach (Destinazioni d in dest)
|
||||
{
|
||||
Destinazioni_out o = new Destinazioni_out();
|
||||
string _aut = !string.IsNullOrEmpty(d.Autista) ? d.Autista.Trim() : string.Empty;
|
||||
o.Autista = _aut;
|
||||
|
||||
string _autCod = !string.IsNullOrEmpty(d.CodAutista) ? d.CodAutista.Trim() : string.Empty;
|
||||
o.CodAutista = _autCod;
|
||||
|
||||
string _automezzo = !string.IsNullOrEmpty(d.DescAutomezzo) ? d.DescAutomezzo.Trim() : string.Empty;
|
||||
o.DescAutomezzo = _automezzo;
|
||||
|
||||
string _automezzoCod = !string.IsNullOrEmpty(d.CodAutomezzo) ? d.CodAutomezzo.Trim() : string.Empty;
|
||||
o.CodAutomezzo = _automezzoCod;
|
||||
|
||||
o.DataCarico = d.DataCarico;
|
||||
o.Brserial = d.Brserial;
|
||||
|
||||
//step 1: leggo da sbr_ord con seriale
|
||||
|
||||
|
||||
o.Brmerce = d.Brmerce;
|
||||
o.Brnote = d.Brnote;
|
||||
o.Cproword = d.Cproword;
|
||||
o.Cprownum = d.Cprownum;
|
||||
|
||||
string _sedeInd = !string.IsNullOrEmpty(d.IndirizzoSede) ? d.IndirizzoSede.Trim() : string.Empty;
|
||||
o.IndirizzoSede = _sedeInd;
|
||||
|
||||
string _sede = !string.IsNullOrEmpty(d.Sede) ? d.Sede.Trim() : string.Empty;
|
||||
o.Sede = _sede;
|
||||
o.CodCommittente = d.CodCommittente;
|
||||
|
||||
string _committente = !string.IsNullOrEmpty(d.Committente) ? d.Committente.Trim() : string.Empty;
|
||||
o.Committente = _committente;
|
||||
|
||||
o.CodSede = d.CodSede;
|
||||
o.ItemList = formattaDestinazione(d);
|
||||
o.ImportoDaRitirare = d.ImportoDaRitirare;
|
||||
o.serialeGiro = d.serialeGiro;
|
||||
o.Casse = d.Casse;
|
||||
o.Trasf = d.Trasf;
|
||||
o.Colli = d.Colli;
|
||||
o.num_cons = d.num_cons;
|
||||
o.Uova = d.Uova;
|
||||
o.Cist = d.Cist;
|
||||
o.Note = d.Note;
|
||||
o.Seq = d.Seq;
|
||||
o.Prog = d.Prog;
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(d.consFattaSerial))
|
||||
{
|
||||
ConsegnaFatta cf = new ConsegnaFatta();
|
||||
cf.consFattaSerial = d.consFattaSerial;
|
||||
cf.consFattaRow = d.consFattaRow;
|
||||
cf.consFattaAut = d.consFattaAut;
|
||||
cf.consFattaBanSca = d.consFattaBanSca;
|
||||
cf.consFattaBanCar = d.consFattaBanCar;
|
||||
string nota = !string.IsNullOrEmpty(d.consFattaNotBan) ? d.consFattaNotBan.Trim() : string.Empty;
|
||||
cf.consFattaNotBan = nota;
|
||||
cf.consFattaImpor = d.consFattaImpor;
|
||||
cf.consFattaMezzo = d.consFattaMezzo;
|
||||
string nota2 = !string.IsNullOrEmpty(d.consFattaNotImp) ? d.consFattaNotImp.Trim() : string.Empty;
|
||||
cf.consFattaNotImp = nota2;
|
||||
cf.consFattaFlagCons = d.consFattaFlagCons;
|
||||
cf.consFattaDataOra = d.consFattaDataOra;
|
||||
|
||||
o.ConsFatta = cf;
|
||||
}
|
||||
|
||||
lst.Add(o);
|
||||
}
|
||||
return lst;
|
||||
}
|
||||
|
||||
[HttpGet("listaDestinazioneBySerial")]
|
||||
public async Task<ActionResult<Destinazioni_out>> listaDestinazioneBySerial(string seriale)
|
||||
{
|
||||
@ -695,32 +910,17 @@ namespace ApiSoftway.Controllers
|
||||
DateTime dateTime = DateTime.Now;
|
||||
ConsegnaTable t = fillConsegna(model, token, dateTime);
|
||||
|
||||
/*
|
||||
//Step 1: mi calcolo il nuovo seriale
|
||||
|
||||
_consegne = _consegne_context.Cons;
|
||||
var ser = await _consegne.Take(1).OrderByDescending(t => t.Pisergir).ToListAsync();
|
||||
string ultSer = "0";
|
||||
if (ser != null && ser.Count > 0)
|
||||
{
|
||||
ultSer = ser.First().Pisergir;
|
||||
}
|
||||
|
||||
string newSer = calcolaNuovoSeriale(ultSer);
|
||||
t.Pisergir = newSer;
|
||||
*/
|
||||
|
||||
//Step 1: il seriale è quello della PIGIRCON che ho scritto nelle righe di SBR_ORD
|
||||
// lo leggo da li passando il seriale della destinazione. contemporaneamente mi ricavo anche gli altri valori
|
||||
//Step 1: il seriale è quello della GESAPI_GIRI_SERIALI che ho scritto in validazione
|
||||
// lo leggo dalle destinazioni filtrando per il seriale della destinazione. contemporaneamente mi ricavo anche gli altri valori
|
||||
//che devo scrivere successivamente
|
||||
_destinazioni = _destinazioni_context.Destinazioni;
|
||||
var ti = await _destinazioni.Where(t => t.Brserial.Equals(model.Serial)).FirstAsync();
|
||||
|
||||
_sbrord = _sbrord_context.Cons;
|
||||
var ti = await _sbrord.Where(t => t.Brserial.Equals(model.Serial)).FirstAsync();
|
||||
string _committente = ti.Brcodcom;
|
||||
string _cliFatturazione = ti.Brclifat;
|
||||
string _codSede = ti.Brcodsed;
|
||||
string _pisergir = ti.Pisergir;
|
||||
int _seque = ti.Brnumseq.Value;
|
||||
string _committente = ti.CodCommittente;
|
||||
string _cliFatturazione = ti.CliFatt;
|
||||
string _codSede = ti.CodSede;
|
||||
string _pisergir = ti.serialeGiro;
|
||||
int _seque = ti.Seq.Value;
|
||||
t.Cca = _committente;
|
||||
t.Ccda=_cliFatturazione;
|
||||
t.Cprownum = _seque;
|
||||
@ -790,29 +990,17 @@ namespace ApiSoftway.Controllers
|
||||
DateTime dateTime = DateTime.Now;
|
||||
ConsegnaTable t = fillConsegnaNonEffettuata(model, token);
|
||||
|
||||
////Step 1: mi calcolo il nuovo seriale
|
||||
//_consegne = _consegne_context.Cons;
|
||||
//var ser = await _consegne.Take(1).OrderByDescending(t => t.Pisergir).ToListAsync();
|
||||
//string ultSer = "0";
|
||||
//if (ser != null && ser.Count > 0)
|
||||
//{
|
||||
// ultSer = ser.First().Pisergir;
|
||||
//}
|
||||
|
||||
//string newSer = calcolaNuovoSeriale(ultSer);
|
||||
//t.Pisergir = newSer;
|
||||
|
||||
//Step 1: il seriale è quello della PIGIRCON che ho scritto nelle righe di SBR_ORD
|
||||
// lo leggo da li passando il seriale della destinazione. contemporaneamente mi ricavo anche gli altri valori
|
||||
//Step 1: il seriale è quello della GESAPI_GIRI_SERIALI che ho scritto in validazione
|
||||
// lo leggo dalle destinazioni filtrando per il seriale della destinazione. contemporaneamente mi ricavo anche gli altri valori
|
||||
//che devo scrivere successivamente
|
||||
_destinazioni = _destinazioni_context.Destinazioni;
|
||||
var ti = await _destinazioni.Where(t => t.Brserial.Equals(model.Serial)).FirstAsync();
|
||||
|
||||
_sbrord = _sbrord_context.Cons;
|
||||
var ti = await _sbrord.Where(t => t.Brserial.Equals(model.Serial)).FirstAsync();
|
||||
string _committente = ti.Brcodcom;
|
||||
string _cliFatturazione = ti.Brclifat;
|
||||
string _codSede = ti.Brcodsed;
|
||||
string _pisergir = ti.Pisergir;
|
||||
int _seque = ti.Brnumseq.Value;
|
||||
string _committente = ti.CodCommittente;
|
||||
string _cliFatturazione = ti.CliFatt;
|
||||
string _codSede = ti.CodSede;
|
||||
string _pisergir = ti.serialeGiro;
|
||||
int _seque = ti.Seq.Value;
|
||||
t.Cca = _committente;
|
||||
t.Ccda = _cliFatturazione;
|
||||
t.Cprownum = _seque;
|
||||
|
||||
@ -33,7 +33,7 @@ namespace ApiSoftway.Controllers
|
||||
|
||||
//step 0: se esiste un record con quel seriale, prima cancello e poi inserisco di nuovo
|
||||
_modgir = _modgiri_context.Mod;
|
||||
List<Modgir> lst = _modgir.Where(t => t.Piserial.Equals(model.Piserial)).ToList();
|
||||
List<Modgir> lst = _modgir.Where(t => t.Piserial.Equals(model.Piserial) && !t.Pitiprec.Equals("A")).ToList();
|
||||
foreach (Modgir item in lst)
|
||||
{
|
||||
using (var transaction = _modgiri_context.Database.BeginTransaction())
|
||||
@ -67,6 +67,14 @@ namespace ApiSoftway.Controllers
|
||||
gc.Piautist = model.Piautist;
|
||||
gc.Pitiprec = model.Pitiprec;
|
||||
gc.Pisergir = model.Pisergir;
|
||||
gc.Picasse = model.Picasse;
|
||||
gc.Pitrasf = model.Pitrasf;
|
||||
gc.Picolli = model.Picolli;
|
||||
gc.Pinumcons = model.Pinumcons;
|
||||
gc.Piuova = model.Piuova;
|
||||
gc.Picist = model.Picist;
|
||||
gc.Piseq = model.Piseq;
|
||||
gc.Pinote = model.Pinote;
|
||||
|
||||
using (var transactionGiri = _modgiri_context.Database.BeginTransaction())
|
||||
{
|
||||
|
||||
@ -54,5 +54,9 @@ namespace ApiSoftway.Models
|
||||
|
||||
//progressivo- chiave tabella pimodgir
|
||||
public string? Prog { get; set; }
|
||||
public string? CliFatt { get; set; }
|
||||
public int? BancaliIniziali { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
17
Models/Gesa_DbContext/GESA_DESTINAZIONI_WEB_DbContext.cs
Normal file
17
Models/Gesa_DbContext/GESA_DESTINAZIONI_WEB_DbContext.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ApiSoftway.Models.Gesa_DbContext
|
||||
{
|
||||
public class GESA_DESTINAZIONI_WEB_DbContext : DbContext
|
||||
{
|
||||
public DbSet<Destinazioni>? Destinazioni { get; set; }
|
||||
public GESA_DESTINAZIONI_WEB_DbContext(DbContextOptions<GESA_DESTINAZIONI_WEB_DbContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Destinazioni>().ToView("API_DESTINAZIONI_WEB");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ApiSoftway.Models.Gesa_DbContext
|
||||
{
|
||||
public class GESA_GIRICONSEGNEDACREARE_DESTINAZIONI_DbContext:DbContext
|
||||
{
|
||||
public DbSet<Destinazioni>? GiriDaCreare { get; set; }
|
||||
public GESA_GIRICONSEGNEDACREARE_DESTINAZIONI_DbContext(DbContextOptions<GESA_GIRICONSEGNEDACREARE_DESTINAZIONI_DbContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Destinazioni>().ToView("API_GIRICONSEGNA_DA_CREARE_DESTINAZIONI");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
23
Models/Gesa_DbContext/GESA_PI_GIRI_SERIALI_DbContext.cs
Normal file
23
Models/Gesa_DbContext/GESA_PI_GIRI_SERIALI_DbContext.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ApiSoftway.Models.Gesa_DbContext
|
||||
{
|
||||
public class GESA_PI_GIRI_SERIALI_DbContext:DbContext
|
||||
{
|
||||
public DbSet<GiriSeriali>? Cons { get; set; }
|
||||
|
||||
/// <summary></summary>
|
||||
public GESA_PI_GIRI_SERIALI_DbContext(DbContextOptions<GESA_PI_GIRI_SERIALI_DbContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary></summary>
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<GiriSeriali>().ToTable("GESAPI_GIRI_SERIALI");
|
||||
modelBuilder.Entity<GiriSeriali>().HasKey(table => new {
|
||||
table.Brserial,table.Pisergir
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -10,5 +10,6 @@ namespace ApiSoftway.Models
|
||||
public string? Autista { get; set; }
|
||||
public string? Automezzo { get; set; }
|
||||
public DateTime? DataGiro { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
15
Models/GiriConsegnaDaCreareDest.cs
Normal file
15
Models/GiriConsegnaDaCreareDest.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ApiSoftway.Models
|
||||
{
|
||||
[Keyless]
|
||||
public class GiriConsegnaDaCreareDest
|
||||
{
|
||||
public string? CodMezzo { get; set; }
|
||||
public string? CodAutista { get; set; }
|
||||
public string? Autista { get; set; }
|
||||
public string? Automezzo { get; set; }
|
||||
public DateTime? DataGiro { get; set; }
|
||||
public string? Seriale { get; set; }
|
||||
}
|
||||
}
|
||||
13
Models/GiriSeriali.cs
Normal file
13
Models/GiriSeriali.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ApiSoftway.Models
|
||||
{
|
||||
public class GiriSeriali
|
||||
{
|
||||
[Key]
|
||||
public string? Brserial { get; set; }
|
||||
|
||||
[Key]
|
||||
public string? Pisergir { get; set; }
|
||||
}
|
||||
}
|
||||
@ -6,6 +6,7 @@ namespace ApiSoftway.Models
|
||||
{
|
||||
[Key]
|
||||
public string? Piprogre { get; set; }
|
||||
|
||||
public string? Piserial { get; set; }
|
||||
public DateTime? Pidata { get; set; }
|
||||
public string? Picommit { get; set; }
|
||||
@ -15,5 +16,13 @@ namespace ApiSoftway.Models
|
||||
public string? Pitiprec { get; set; }
|
||||
public string? Pirigele { get; set; }
|
||||
public string ? Pisergir { get; set; }
|
||||
public decimal? Picasse { get; set; }
|
||||
public decimal? Pitrasf { get; set; }
|
||||
public decimal? Picolli { get; set; }
|
||||
public int? Pinumcons { get; set; }
|
||||
public decimal? Piuova { get; set; }
|
||||
public decimal? Picist { get; set; }
|
||||
public int? Piseq { get; set; }
|
||||
public string? Pinote { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,16 @@ namespace ApiSoftway.Models
|
||||
public string? Pitiprec { get; set; }
|
||||
public string? Pirigele { get; set; }
|
||||
public string? Pisergir { get; set; }
|
||||
public decimal? Picasse { get; set; }
|
||||
public decimal? Pitrasf { get; set; }
|
||||
public decimal? Picolli { get; set; }
|
||||
public int? Pinumcons { get; set; }
|
||||
public decimal? Piuova { get; set; }
|
||||
public decimal? Picist { get; set; }
|
||||
public int? Piseq { get; set; }
|
||||
public string? Pinote { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>errore titolo</summary>
|
||||
public string? err_title { get; set; }
|
||||
|
||||
34
Program.cs
34
Program.cs
@ -2,6 +2,7 @@ using ApiSoftway.Models.Gesa_DbContext;
|
||||
using ApiSoftway.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.OpenApi.Models;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@ -54,13 +55,40 @@ builder.Services.AddDbContext<GESA_CONSEGNE_M_DbContext>(options => options.UseS
|
||||
builder.Services.AddDbContext<GESA_SEDECONSEGNA_DbContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("GESA")
|
||||
, options => { options.CommandTimeout(commandTimeoutInSeconds); }
|
||||
));
|
||||
builder.Services.AddDbContext<GESA_PI_GIRI_SERIALI_DbContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("GESA")
|
||||
, options => { options.CommandTimeout(commandTimeoutInSeconds); }
|
||||
));
|
||||
builder.Services.AddDbContext<GESA_GIRICONSEGNEDACREARE_DESTINAZIONI_DbContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("GESA")
|
||||
, options => { options.CommandTimeout(commandTimeoutInSeconds); }
|
||||
));
|
||||
builder.Services.AddDbContext<GESA_DESTINAZIONI_WEB_DbContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("GESA")
|
||||
, options => { options.CommandTimeout(commandTimeoutInSeconds); }
|
||||
));
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
builder.Services.AddSwaggerGen(gen =>
|
||||
{
|
||||
|
||||
gen.ResolveConflictingActions(apiDescription => apiDescription.First());
|
||||
//gen.SwaggerDoc("v1", new OpenApiInfo { Title = "POLO API WS2016", Version = "v3.3" });
|
||||
DateTime oggi = DateTime.Now;
|
||||
string dt = oggi.ToString();
|
||||
gen.SwaggerDoc("v1", new OpenApiInfo { Title = "GESA API - v.app 1.1", Version = dt });
|
||||
|
||||
|
||||
});
|
||||
|
||||
builder.Services.AddLogging(opt =>
|
||||
{
|
||||
opt.AddConsole(c =>
|
||||
{
|
||||
c.TimestampFormat = "[yyyy-MM-dd HH:mm:ss] ";
|
||||
});
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
@ -71,8 +99,8 @@ if (app.Environment.IsDevelopment() || app.Environment.IsProduction())
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
//app.UseHttpsRedirection();
|
||||
app.UseRouting();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
|
||||
"GESA": "Data Source=10.0.0.10;Initial Catalog=AHRGESA;User Id=sa; Password=p0l01nf.;Integrated Security=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
|
||||
"GESA": "Data Source=windowstest.polo;Initial Catalog=AHRGESA;User Id=sa; Password=p0l01nf.;Integrated Security=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
|
||||
//"GESA": "Data Source=10.0.0.10;Initial Catalog=AHR80_GESA;User Id=sa; Password=p0l01nf.;Integrated Security=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
|
||||
"ApiStr": "Data Source=10.0.0.10;Initial Catalog=API_POLO;User Id=sa; Password=p0l01nf.;Integrated Security=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"
|
||||
"ApiStr": "Data Source=windowstest.polo;Initial Catalog=API_POLO;User Id=sa; Password=p0l01nf.;Integrated Security=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"
|
||||
},
|
||||
"JWT": {
|
||||
"ValidAudience": "http://localhost:4200",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user