Aggiunto parallel stream in retrieve items dalla cache

This commit is contained in:
2025-12-10 18:47:22 +01:00
parent bb47dd458e
commit 7c036172d8
2 changed files with 6 additions and 2 deletions

View File

@@ -152,7 +152,7 @@ public class EntityCacheComponent implements ApplicationListener {
snapshot = entityCache.get(customerDB) snapshot = entityCache.get(customerDB)
.get(tableName) .get(tableName)
.values() .values()
.stream() .parallelStream()
.map(x -> (T) x.clone()); .map(x -> (T) x.clone());
if (filterPredicate != null) if (filterPredicate != null)

View File

@@ -581,10 +581,14 @@ public class WMSUtility {
public static List<MtbAart> getArticoliByCodMarts(List<String> codMarts, Connection connection) throws Exception { public static List<MtbAart> getArticoliByCodMarts(List<String> codMarts, Connection connection) throws Exception {
if (codMarts == null || codMarts.isEmpty()) return null; if (codMarts == null || codMarts.isEmpty()) return null;
codMarts.replaceAll(String::toUpperCase);
Thread.sleep(5000);
final EntityCacheComponent entityCacheComponent = ApplicationContextProvider.getApplicationContext().getBean(EntityCacheComponent.class); final EntityCacheComponent entityCacheComponent = ApplicationContextProvider.getApplicationContext().getBean(EntityCacheComponent.class);
List<MtbAart> listMtbAart = entityCacheComponent.getCachedEntitiesList( List<MtbAart> listMtbAart = entityCacheComponent.getCachedEntitiesList(
connection.getIntegryCustomerDB(), MtbAart.ENTITY, x -> codMarts.parallelStream().anyMatch(y -> y.equalsIgnoreCase(x.getCodMart()))); connection.getIntegryCustomerDB(), MtbAart.ENTITY, x -> codMarts.contains(x.getCodMart().toUpperCase()));
List<MtbAartBarCode> barCodeFromCod = getAlternativeMtbAartBarCodes(codMarts, connection); List<MtbAartBarCode> barCodeFromCod = getAlternativeMtbAartBarCodes(codMarts, connection);