[CARELLI - INVENTARIO]
- risolto problema caricamento dati da inventario precedente
This commit is contained in:
parent
d3804a4601
commit
386d51ffd7
@ -54,13 +54,12 @@ public class RoomModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Provides
|
@Provides
|
||||||
RawDao providesRawDao(AppDatabase appDatabase) {
|
RawDao providesRawDao(AppDatabase appDatabase) {
|
||||||
return appDatabase.rawDao();
|
return appDatabase.rawDao();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Provides
|
@Provides
|
||||||
ArticoloGrigliaDao providesArticoloGrigliaDao(AppDatabase appDatabase) {
|
ArticoloGrigliaDao providesArticoloGrigliaDao(AppDatabase appDatabase) {
|
||||||
@ -110,12 +109,6 @@ public class RoomModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Provides
|
@Provides
|
||||||
InventarioRowMapper providesInventarioRowMapper() {
|
InventarioRowMapper providesInventarioRowMapper() {
|
||||||
@ -129,62 +122,50 @@ public class RoomModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
InventarioLocalDataSource providesInventarioLocalDataSource(ExecutorService executorService, InventarioDao inventarioDao) {
|
InventarioLocalDataSource providesInventarioLocalDataSource(ExecutorService executorService, InventarioDao inventarioDao) {
|
||||||
return new InventarioLocalDataSource(executorService, inventarioDao);
|
return new InventarioLocalDataSource(executorService, inventarioDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
InventarioRowLocalDataSource providesInventarioRowLocalDataSource(ExecutorService executorService, InventarioRowDao inventarioRowDao) {
|
InventarioRowLocalDataSource providesInventarioRowLocalDataSource(ExecutorService executorService, InventarioRowDao inventarioRowDao) {
|
||||||
return new InventarioRowLocalDataSource(executorService, inventarioRowDao);
|
return new InventarioRowLocalDataSource(executorService, inventarioRowDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
ArticoloGrigliaRepository providesArticoloGrigliaRepository(ExecutorService executorService, Handler handler, ArticoloGrigliaDao articoloGrigliaDao) {
|
ArticoloGrigliaRepository providesArticoloGrigliaRepository(ExecutorService executorService, Handler handler, ArticoloGrigliaDao articoloGrigliaDao) {
|
||||||
return new ArticoliGrigliaDataSource(executorService, handler, articoloGrigliaDao);
|
return new ArticoliGrigliaDataSource(executorService, handler, articoloGrigliaDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
ArticoliOrdineRepository providesArticoliOrdineRepository(ExecutorService executorService, Handler handler, ArticoloOrdineDao articoloOrdineDao) {
|
ArticoliOrdineRepository providesArticoliOrdineRepository(ExecutorService executorService, Handler handler, ArticoloOrdineDao articoloOrdineDao) {
|
||||||
return new ArticoliOrdineDataSource(executorService, handler, articoloOrdineDao);
|
return new ArticoliOrdineDataSource(executorService, handler, articoloOrdineDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
GrigliaRepository providesGrigliaRepository(ExecutorService executorService, Handler handler, GrigliaDao grigliaDao) {
|
GrigliaRepository providesGrigliaRepository(ExecutorService executorService, Handler handler, GrigliaDao grigliaDao) {
|
||||||
return new GrigliaDataSource(executorService, handler, grigliaDao);
|
return new GrigliaDataSource(executorService, handler, grigliaDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
OrdineRepository providesOrdineRepository(ExecutorService executorService, Handler handler, OrdineDao ordineDao) {
|
OrdineRepository providesOrdineRepository(ExecutorService executorService, Handler handler, OrdineDao ordineDao) {
|
||||||
return new OrdineDataSource(executorService, handler, ordineDao);
|
return new OrdineDataSource(executorService, handler, ordineDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
MtbColtRepository providesMtbColtRepository(ExecutorService executorService, Handler handler, MtbColtDao mtbColtDao) {
|
MtbColtRepository providesMtbColtRepository(ExecutorService executorService, Handler handler, MtbColtDao mtbColtDao) {
|
||||||
return new SqlMtbColtDataSource(executorService, handler, mtbColtDao);
|
return new SqlMtbColtDataSource(executorService, handler, mtbColtDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
MtbColrDataSource providesMtbColrRepository(ExecutorService executorService, Handler handler, MtbColrDao mtbColrDao) {
|
MtbColrDataSource providesMtbColrRepository(ExecutorService executorService, Handler handler, MtbColrDao mtbColrDao) {
|
||||||
return new SqlMtbColrDataSource(executorService, handler, mtbColrDao);
|
return new SqlMtbColrDataSource(executorService, handler, mtbColrDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
InventarioRepository providesInventarioRepository(ExecutorService executorService, Handler handler,
|
InventarioRepository providesInventarioRepository(ExecutorService executorService, Handler handler,
|
||||||
InventarioLocalDataSource inventarioLocalDataSource,
|
InventarioLocalDataSource inventarioLocalDataSource,
|
||||||
@ -193,7 +174,6 @@ public class RoomModule {
|
|||||||
return new InventarioRepository(inventarioLocalDataSource, inventarioRESTConsumer, inventarioMapper, handler, executorService);
|
return new InventarioRepository(inventarioLocalDataSource, inventarioRESTConsumer, inventarioMapper, handler, executorService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
InventarioRowRepository providesInventarioRowRepository(ExecutorService executorService, Handler handler,
|
InventarioRowRepository providesInventarioRowRepository(ExecutorService executorService, Handler handler,
|
||||||
InventarioRowLocalDataSource inventarioRowLocalDataSource,
|
InventarioRowLocalDataSource inventarioRowLocalDataSource,
|
||||||
|
|||||||
@ -62,7 +62,7 @@ public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioR
|
|||||||
try {
|
try {
|
||||||
var startRetrieve = new Date();
|
var startRetrieve = new Date();
|
||||||
var remoteData = remoteDataSource.makeSynchronousRetrieveRequest();
|
var remoteData = remoteDataSource.makeSynchronousRetrieveRequest();
|
||||||
Log.d("Timing [INVENTORIES RETRIEVE]", ((new Date().getTime() - startRetrieve.getTime()) / 1000) + " secs");
|
Log.d("Time INVENTORY RETRIEVE", ((new Date().getTime() - startRetrieve.getTime()) / 1000) + " secs");
|
||||||
|
|
||||||
if (remoteData == null) remoteData = new ArrayList<>();
|
if (remoteData == null) remoteData = new ArrayList<>();
|
||||||
|
|
||||||
|
|||||||
@ -169,7 +169,7 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
private List<InventarioRowRoomDTO> searchArtInAlreadyScannedItems(InventarioArtDTO inventarioArtDTO) {
|
private List<InventarioRowRoomDTO> searchArtInAlreadyScannedItems(InventarioArtDTO inventarioArtDTO) {
|
||||||
final List<InventarioRowRoomDTO> inventarioRows = this.currentInventarioRows.getValue();
|
final List<InventarioRowRoomDTO> 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();
|
return Stream.of(inventarioRows).filter(x -> x.getCodMart() != null ? x.getCodMart().equalsIgnoreCase(inventarioArtDTO.getCodMart()) : inventarioArtDTO.getBarcode().contains(x.getScanCodBarre())).toList();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user