diff --git a/.vs/ApiPolo/v17/.futdcache.v2 b/.vs/ApiPolo/v17/.futdcache.v2 index f96a246..a05431e 100644 Binary files a/.vs/ApiPolo/v17/.futdcache.v2 and b/.vs/ApiPolo/v17/.futdcache.v2 differ diff --git a/.vs/ApiPolo/v17/.suo b/.vs/ApiPolo/v17/.suo index 199ed24..5b1aad0 100644 Binary files a/.vs/ApiPolo/v17/.suo and b/.vs/ApiPolo/v17/.suo differ diff --git a/.vs/ProjectEvaluation/apipolo.metadata.v7.bin b/.vs/ProjectEvaluation/apipolo.metadata.v7.bin index 418a986..2a9a03b 100644 Binary files a/.vs/ProjectEvaluation/apipolo.metadata.v7.bin and b/.vs/ProjectEvaluation/apipolo.metadata.v7.bin differ diff --git a/.vs/ProjectEvaluation/apipolo.projects.v7.bin b/.vs/ProjectEvaluation/apipolo.projects.v7.bin index 7a7f404..3b2df3f 100644 Binary files a/.vs/ProjectEvaluation/apipolo.projects.v7.bin and b/.vs/ProjectEvaluation/apipolo.projects.v7.bin differ diff --git a/ApiPolo/Controllers/PoloController.cs b/ApiPolo/Controllers/PoloController.cs index 471795a..393486a 100644 --- a/ApiPolo/Controllers/PoloController.cs +++ b/ApiPolo/Controllers/PoloController.cs @@ -12444,6 +12444,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; @@ -12496,6 +12497,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 commesse_filtrate = new List(); + _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"); @@ -13003,7 +13051,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("Cli " + appoCli); } r.itemList = sb.ToString();