diff --git a/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/RoomModule.java b/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/RoomModule.java index b4a214e2..2c1e84dd 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/RoomModule.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/RoomModule.java @@ -54,13 +54,12 @@ public class RoomModule { } - - @Singleton @Provides RawDao providesRawDao(AppDatabase appDatabase) { return appDatabase.rawDao(); } + @Singleton @Provides ArticoloGrigliaDao providesArticoloGrigliaDao(AppDatabase appDatabase) { @@ -110,12 +109,6 @@ public class RoomModule { } - - - - - - @Singleton @Provides InventarioRowMapper providesInventarioRowMapper() { @@ -129,62 +122,50 @@ public class RoomModule { } - @Singleton @Provides InventarioLocalDataSource providesInventarioLocalDataSource(ExecutorService executorService, InventarioDao inventarioDao) { return new InventarioLocalDataSource(executorService, inventarioDao); } - - @Singleton @Provides InventarioRowLocalDataSource providesInventarioRowLocalDataSource(ExecutorService executorService, InventarioRowDao inventarioRowDao) { return new InventarioRowLocalDataSource(executorService, inventarioRowDao); } - - - - - - @Singleton @Provides ArticoloGrigliaRepository providesArticoloGrigliaRepository(ExecutorService executorService, Handler handler, ArticoloGrigliaDao articoloGrigliaDao) { return new ArticoliGrigliaDataSource(executorService, handler, articoloGrigliaDao); } - @Singleton + @Provides ArticoliOrdineRepository providesArticoliOrdineRepository(ExecutorService executorService, Handler handler, ArticoloOrdineDao articoloOrdineDao) { return new ArticoliOrdineDataSource(executorService, handler, articoloOrdineDao); } - @Singleton + @Provides GrigliaRepository providesGrigliaRepository(ExecutorService executorService, Handler handler, GrigliaDao grigliaDao) { return new GrigliaDataSource(executorService, handler, grigliaDao); } - @Singleton + @Provides OrdineRepository providesOrdineRepository(ExecutorService executorService, Handler handler, OrdineDao ordineDao) { return new OrdineDataSource(executorService, handler, ordineDao); } - @Singleton @Provides MtbColtRepository providesMtbColtRepository(ExecutorService executorService, Handler handler, MtbColtDao mtbColtDao) { return new SqlMtbColtDataSource(executorService, handler, mtbColtDao); } - @Singleton @Provides MtbColrDataSource providesMtbColrRepository(ExecutorService executorService, Handler handler, MtbColrDao mtbColrDao) { return new SqlMtbColrDataSource(executorService, handler, mtbColrDao); } - @Singleton @Provides InventarioRepository providesInventarioRepository(ExecutorService executorService, Handler handler, InventarioLocalDataSource inventarioLocalDataSource, @@ -193,7 +174,6 @@ public class RoomModule { return new InventarioRepository(inventarioLocalDataSource, inventarioRESTConsumer, inventarioMapper, handler, executorService); } - @Singleton @Provides InventarioRowRepository providesInventarioRowRepository(ExecutorService executorService, Handler handler, InventarioRowLocalDataSource inventarioRowLocalDataSource, diff --git a/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/respository_new/InventarioRepository.java b/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/respository_new/InventarioRepository.java index 98973c42..a29c470e 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/respository_new/InventarioRepository.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/respository_new/InventarioRepository.java @@ -62,7 +62,7 @@ public class InventarioRepository extends _BaseRepository(); diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/inventario/picking/PickingInventarioViewModel.java b/app/src/main/java/it/integry/integrywmsnative/gest/inventario/picking/PickingInventarioViewModel.java index 5e2e7f64..524ceb33 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/inventario/picking/PickingInventarioViewModel.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/inventario/picking/PickingInventarioViewModel.java @@ -169,7 +169,7 @@ public class PickingInventarioViewModel extends ViewModel { private List searchArtInAlreadyScannedItems(InventarioArtDTO inventarioArtDTO) { final List inventarioRows = this.currentInventarioRows.getValue(); - if (inventarioRows == null) return null; + if (inventarioRows == null || inventarioRows.isEmpty()) return null; return Stream.of(inventarioRows).filter(x -> x.getCodMart() != null ? x.getCodMart().equalsIgnoreCase(inventarioArtDTO.getCodMart()) : inventarioArtDTO.getBarcode().contains(x.getScanCodBarre())).toList(); }