This commit is contained in:
michele 2025-02-27 09:59:53 +01:00
commit a798cbe061
5 changed files with 52 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -12600,6 +12600,7 @@ namespace ApiPolo.Controllers
string ten = getClaimValueByToken(token, "tenant");
string ten2 = getClaimValueByToken(token, "tenant2");
string tenConf = getClaimValueByToken(token, "tenantConfigurazioni");
string tecnico = getClaimValueByToken(token, "tccodice");
if (string.IsNullOrEmpty(ten))
{
ten = tenConf;
@ -12652,6 +12653,53 @@ namespace ApiPolo.Controllers
st = StatusCodes.Status200OK;
}
else if(ten.Equals(Clienti.Marrocco))
{
// qui devo filtrare per tecnico capoogruppo come faccio nella ricerca commesse del timesheet
_comm = getCommesseByTenant(ten);
var l = await _comm.OrderByDescending(t => t.ladatchi).ToListAsync();
List<Commessa> commesse_filtrate = new List<Commessa>();
_commDesc = _Marro_commDesc.Commdesc;
var commesse_tecnico = _commDesc.Where((t => t.latecsup != null && t.latecsup.Equals(tecnico))).ToList();
foreach (CommessaDesc c in commesse_tecnico)
{
var co = _comm.Where(t => t.laserial.Equals(c.laserial)).ToList();
if (co != null && co.Count > 0)
{
commesse_filtrate.Add(co.First());
}
}
if(commesse_filtrate.Count()==0)
{
commesse_filtrate = l;
}
if (!string.IsNullOrEmpty(codimp))
{
commesse_filtrate = commesse_filtrate.Where(t => t.imcodimp != null && t.imcodimp.ToUpper().Contains(codimp.ToUpper())).ToList();
}
if (!string.IsNullOrEmpty(indirizzo_imp))
{
commesse_filtrate = commesse_filtrate.Where(t => t.imindiri2 != null && t.imindiri2.ToUpper().Contains(indirizzo_imp.ToUpper())).ToList();
}
if (!string.IsNullOrEmpty(cli))
{
commesse_filtrate = commesse_filtrate.Where(t => t.andescri != null && t.andescri.ToUpper().Contains(cli.ToUpper())).ToList();
}
if (!string.IsNullOrEmpty(comm))
{
commesse_filtrate = commesse_filtrate.Where(t => t.lacodcom != null && t.lacodcom.ToUpper().Contains(comm.ToUpper())).ToList();
}
commesse_filtrate = commesse_filtrate.Take(300).ToList();
foreach (Commessa i in commesse_filtrate)
{
Output_Ricerca o = new Output_Ricerca();
o = fillOutputRicerca(i);
lis.Add(o);
}
st = StatusCodes.Status200OK;
}
else
{
//string ten = getClaimValueByToken(token, "tenant");
@ -13159,7 +13207,10 @@ namespace ApiPolo.Controllers
if (!string.IsNullOrEmpty(i.andescri))
{
string appoCli = i.andescri;
appoCli = appoCli.Substring(0, 25);
if(appoCli.Length>25)
{
appoCli = appoCli.Substring(0, 25);
}
sb.AppendLine("<b>Cli <b>" + appoCli);
}
r.itemList = sb.ToString();