aggiunta migration descrizione righe inv
This commit is contained in:
parent
9b5beeb028
commit
b127130bc7
@ -39,7 +39,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
InventarioRoomDTO.class,
|
||||
InventarioRowRoomDTO.class
|
||||
},
|
||||
version = 14,
|
||||
version = 15,
|
||||
exportSchema = true)
|
||||
@TypeConverters({
|
||||
DateConverter.class,
|
||||
@ -66,7 +66,8 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
.addMigrations(MIGRATION_10_11)
|
||||
.addMigrations(MIGRATION_11_12)
|
||||
.addMigrations(MIGRATION_12_13)
|
||||
.addMigrations(MIGRATION_13_14);
|
||||
.addMigrations(MIGRATION_13_14)
|
||||
.addMigrations(MIGRATION_14_15);
|
||||
|
||||
sInstance = builder.build();
|
||||
}
|
||||
@ -97,7 +98,7 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventari__id ON inventari (_id)");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static final Migration MIGRATION_11_12 = new Migration(11, 12) {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase database) {
|
||||
@ -105,14 +106,14 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventari_id_inventario ON inventari (id_inventario)");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static final Migration MIGRATION_12_13 = new Migration(12, 13) {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase database) {
|
||||
database.execSQL("ALTER TABLE inventari ADD COLUMN zona TEXT");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static final Migration MIGRATION_13_14 = new Migration(13, 14) {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase database) {
|
||||
@ -121,6 +122,12 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__parent_id ON inventario_rows (parent_id)");
|
||||
}
|
||||
};
|
||||
static final Migration MIGRATION_14_15 = new Migration(14, 15) {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase database) {
|
||||
database.execSQL("ALTER TABLE inventario_rows ADD COLUMN descrizione TEXT");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -9,10 +9,10 @@ import it.integry.integrywmsnative.core.data_store.db.respository_new.Inventario
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.InventarioRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.inventario.InventarioArtDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.InventarioRESTConsumer;
|
||||
|
||||
public class ElencoInventariViewModel {
|
||||
|
||||
@ -56,7 +56,8 @@ public class ElencoInventariViewModel {
|
||||
inventarioRESTConsumer.loadInventario(inventoryId, loadedInventario -> {
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
if(loadedInventario == null || loadedInventario.getMtbInvent() == null) this.sendCreateInventarioRequest(inventoryId, zone);
|
||||
if (loadedInventario == null || loadedInventario.getMtbInvent() == null)
|
||||
this.sendCreateInventarioRequest(inventoryId, zone);
|
||||
else this.createNewInventario(inventoryId, zone, (inventarioRoom, listaArts) -> {
|
||||
|
||||
});
|
||||
@ -65,7 +66,6 @@ public class ElencoInventariViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void loadInventarioData(long inventoryId, RunnableArgs<List<InventarioArtDTO>> onComplete) {
|
||||
this.sendOnLoadingStarted();
|
||||
inventarioRESTConsumer.loadInventarioArts(inventoryId, inventarioArts -> {
|
||||
@ -76,7 +76,6 @@ public class ElencoInventariViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void createNewInventario(long inventoryId, String zone, RunnableArgss<InventarioRoomDTO, List<InventarioArtDTO>> onComplete) {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
@ -97,13 +96,6 @@ public class ElencoInventariViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setListener(Listener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user