Implementata retrieve inventari
This commit is contained in:
parent
4882645311
commit
e964220655
@ -2,7 +2,7 @@
|
|||||||
"formatVersion": 1,
|
"formatVersion": 1,
|
||||||
"database": {
|
"database": {
|
||||||
"version": 13,
|
"version": 13,
|
||||||
"identityHash": "bc3841159bac7a7731fe39a5fa4f0f4e",
|
"identityHash": "bef89b513f0a4d5ecd9c2111e2e614a4",
|
||||||
"entities": [
|
"entities": [
|
||||||
{
|
{
|
||||||
"tableName": "articoli_griglia",
|
"tableName": "articoli_griglia",
|
||||||
@ -112,10 +112,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"primaryKey": {
|
"primaryKey": {
|
||||||
|
"autoGenerate": true,
|
||||||
"columnNames": [
|
"columnNames": [
|
||||||
"articolo_griglia_id"
|
"articolo_griglia_id"
|
||||||
],
|
]
|
||||||
"autoGenerate": true
|
|
||||||
},
|
},
|
||||||
"indices": [
|
"indices": [
|
||||||
{
|
{
|
||||||
@ -172,10 +172,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"primaryKey": {
|
"primaryKey": {
|
||||||
|
"autoGenerate": true,
|
||||||
"columnNames": [
|
"columnNames": [
|
||||||
"griglia_id"
|
"griglia_id"
|
||||||
],
|
]
|
||||||
"autoGenerate": true
|
|
||||||
},
|
},
|
||||||
"indices": [
|
"indices": [
|
||||||
{
|
{
|
||||||
@ -262,10 +262,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"primaryKey": {
|
"primaryKey": {
|
||||||
|
"autoGenerate": true,
|
||||||
"columnNames": [
|
"columnNames": [
|
||||||
"ordine_id"
|
"ordine_id"
|
||||||
],
|
]
|
||||||
"autoGenerate": true
|
|
||||||
},
|
},
|
||||||
"indices": [],
|
"indices": [],
|
||||||
"foreignKeys": []
|
"foreignKeys": []
|
||||||
@ -366,10 +366,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"primaryKey": {
|
"primaryKey": {
|
||||||
|
"autoGenerate": true,
|
||||||
"columnNames": [
|
"columnNames": [
|
||||||
"articolo_ordine_id"
|
"articolo_ordine_id"
|
||||||
],
|
]
|
||||||
"autoGenerate": true
|
|
||||||
},
|
},
|
||||||
"indices": [
|
"indices": [
|
||||||
{
|
{
|
||||||
@ -580,10 +580,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"primaryKey": {
|
"primaryKey": {
|
||||||
|
"autoGenerate": true,
|
||||||
"columnNames": [
|
"columnNames": [
|
||||||
"id"
|
"id"
|
||||||
],
|
]
|
||||||
"autoGenerate": true
|
|
||||||
},
|
},
|
||||||
"indices": [
|
"indices": [
|
||||||
{
|
{
|
||||||
@ -829,10 +829,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"primaryKey": {
|
"primaryKey": {
|
||||||
|
"autoGenerate": true,
|
||||||
"columnNames": [
|
"columnNames": [
|
||||||
"id"
|
"id"
|
||||||
],
|
]
|
||||||
"autoGenerate": true
|
|
||||||
},
|
},
|
||||||
"indices": [
|
"indices": [
|
||||||
{
|
{
|
||||||
@ -874,7 +874,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"tableName": "inventari",
|
"tableName": "inventari",
|
||||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `id_inventario` INTEGER, `cod_mdep` TEXT NOT NULL, `data_inventario` INTEGER, `data_reg` INTEGER, `data_ver` INTEGER, `filtro` TEXT, `flag_stato` TEXT, `flag_operazione` TEXT, `cod_anag` TEXT, `cod_dtip` TEXT, `inserito_da` TEXT, `registrato_da` TEXT, `verificato_da` TEXT, `data_ora_inizio` INTEGER, `data_ora_fine` INTEGER, `causale` TEXT, `zona` TEXT, `remote_sync_date` INTEGER)",
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `id_inventario` INTEGER, `cod_mdep` TEXT NOT NULL, `data_inventario` INTEGER, `data_reg` INTEGER, `data_ver` INTEGER, `filtro` TEXT, `flag_stato` TEXT, `flag_operazione` TEXT, `cod_anag` TEXT, `cod_dtip` TEXT, `inserito_da` TEXT, `registrato_da` TEXT, `verificato_da` TEXT, `data_ora_inizio` INTEGER, `data_ora_fine` INTEGER, `causale` TEXT, `zona` TEXT, `new` INTEGER, `remote_sync_date` INTEGER)",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"fieldPath": "id",
|
"fieldPath": "id",
|
||||||
@ -984,6 +984,12 @@
|
|||||||
"affinity": "TEXT",
|
"affinity": "TEXT",
|
||||||
"notNull": false
|
"notNull": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "isNew",
|
||||||
|
"columnName": "new",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldPath": "remoteSyncDate",
|
"fieldPath": "remoteSyncDate",
|
||||||
"columnName": "remote_sync_date",
|
"columnName": "remote_sync_date",
|
||||||
@ -992,10 +998,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"primaryKey": {
|
"primaryKey": {
|
||||||
|
"autoGenerate": true,
|
||||||
"columnNames": [
|
"columnNames": [
|
||||||
"_id"
|
"_id"
|
||||||
],
|
]
|
||||||
"autoGenerate": true
|
|
||||||
},
|
},
|
||||||
"indices": [
|
"indices": [
|
||||||
{
|
{
|
||||||
@ -1107,10 +1113,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"primaryKey": {
|
"primaryKey": {
|
||||||
|
"autoGenerate": true,
|
||||||
"columnNames": [
|
"columnNames": [
|
||||||
"_id"
|
"_id"
|
||||||
],
|
]
|
||||||
"autoGenerate": true
|
|
||||||
},
|
},
|
||||||
"indices": [
|
"indices": [
|
||||||
{
|
{
|
||||||
@ -1150,7 +1156,7 @@
|
|||||||
"views": [],
|
"views": [],
|
||||||
"setupQueries": [
|
"setupQueries": [
|
||||||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'bc3841159bac7a7731fe39a5fa4f0f4e')"
|
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'bef89b513f0a4d5ecd9c2111e2e614a4')"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -40,7 +40,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
|||||||
InventarioRoomDTO.class,
|
InventarioRoomDTO.class,
|
||||||
InventarioRowRoomDTO.class
|
InventarioRowRoomDTO.class
|
||||||
},
|
},
|
||||||
version = 13,
|
version = 14,
|
||||||
exportSchema = true)
|
exportSchema = true)
|
||||||
@TypeConverters({
|
@TypeConverters({
|
||||||
DateConverter.class,
|
DateConverter.class,
|
||||||
@ -66,7 +66,8 @@ public abstract class AppDatabase extends RoomDatabase {
|
|||||||
AppDatabase.class, "integry_wms")
|
AppDatabase.class, "integry_wms")
|
||||||
.addMigrations(MIGRATION_10_11)
|
.addMigrations(MIGRATION_10_11)
|
||||||
.addMigrations(MIGRATION_11_12)
|
.addMigrations(MIGRATION_11_12)
|
||||||
.addMigrations(MIGRATION_12_13);
|
.addMigrations(MIGRATION_12_13)
|
||||||
|
.addMigrations(MIGRATION_13_14);
|
||||||
|
|
||||||
sInstance = builder.build();
|
sInstance = builder.build();
|
||||||
}
|
}
|
||||||
@ -126,4 +127,12 @@ public abstract class AppDatabase extends RoomDatabase {
|
|||||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__parent_id ON inventario_rows (parent_id)");
|
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__parent_id ON inventario_rows (parent_id)");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static final Migration MIGRATION_13_14 = new Migration(13, 14) {
|
||||||
|
@Override
|
||||||
|
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||||
|
database.execSQL("ALTER TABLE inventari"
|
||||||
|
+ " ADD COLUMN new INTEGER");
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -184,7 +184,7 @@ public class RoomModule {
|
|||||||
InventarioLocalDataSource inventarioLocalDataSource,
|
InventarioLocalDataSource inventarioLocalDataSource,
|
||||||
InventarioRESTConsumer inventarioRESTConsumer,
|
InventarioRESTConsumer inventarioRESTConsumer,
|
||||||
InventarioMapper inventarioMapper) {
|
InventarioMapper inventarioMapper) {
|
||||||
return new InventarioRepository(inventarioLocalDataSource, inventarioRESTConsumer, inventarioMapper, handler);
|
return new InventarioRepository(inventarioLocalDataSource, inventarioRESTConsumer, inventarioMapper, handler, executorService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|||||||
@ -35,6 +35,7 @@ public class InventarioRoomDTO extends BaseSyncDTO implements EntityModelInterfa
|
|||||||
public static final String DATA_ORA_FINE = "data_ora_fine";
|
public static final String DATA_ORA_FINE = "data_ora_fine";
|
||||||
public static final String CAUSALE = "causale";
|
public static final String CAUSALE = "causale";
|
||||||
public static final String ZONA = "zona";
|
public static final String ZONA = "zona";
|
||||||
|
public static final String IS_NEW = "new";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The unique ID of the cheese. */
|
/** The unique ID of the cheese. */
|
||||||
@ -95,6 +96,9 @@ public class InventarioRoomDTO extends BaseSyncDTO implements EntityModelInterfa
|
|||||||
@ColumnInfo(name = Columns.ZONA)
|
@ColumnInfo(name = Columns.ZONA)
|
||||||
private String zona;
|
private String zona;
|
||||||
|
|
||||||
|
@ColumnInfo(name = Columns.IS_NEW)
|
||||||
|
private Boolean isNew;
|
||||||
|
|
||||||
@Ignore
|
@Ignore
|
||||||
private List<InventarioRowRoomDTO> inventarioRowList;
|
private List<InventarioRowRoomDTO> inventarioRowList;
|
||||||
|
|
||||||
@ -235,6 +239,14 @@ public class InventarioRoomDTO extends BaseSyncDTO implements EntityModelInterfa
|
|||||||
this.zona = zona;
|
this.zona = zona;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean isNew() {
|
||||||
|
return isNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNew(Boolean aNew) {
|
||||||
|
isNew = aNew;
|
||||||
|
}
|
||||||
|
|
||||||
public List<InventarioRowRoomDTO> getInventarioRowList() {
|
public List<InventarioRowRoomDTO> getInventarioRowList() {
|
||||||
return inventarioRowList;
|
return inventarioRowList;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,16 @@
|
|||||||
package it.integry.integrywmsnative.core.data_store.db.respository_new;
|
package it.integry.integrywmsnative.core.data_store.db.respository_new;
|
||||||
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.lifecycle.LiveData;
|
import androidx.lifecycle.LiveData;
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@ -17,9 +21,12 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|||||||
import it.integry.integrywmsnative.core.mapper.InventarioMapper;
|
import it.integry.integrywmsnative.core.mapper.InventarioMapper;
|
||||||
import it.integry.integrywmsnative.core.model.MtbInvent;
|
import it.integry.integrywmsnative.core.model.MtbInvent;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.InventarioRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.InventarioRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityLiveData;
|
||||||
|
|
||||||
public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioRoomDTO, InventarioMapper, InventarioLocalDataSource, InventarioRESTConsumer> {
|
public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioRoomDTO, InventarioMapper, InventarioLocalDataSource, InventarioRESTConsumer> {
|
||||||
|
|
||||||
|
private final ExecutorService executorService;
|
||||||
|
|
||||||
private final Handler handler;
|
private final Handler handler;
|
||||||
|
|
||||||
private final MutableLiveData<List<InventarioRoomDTO>> internalLiveData = new MutableLiveData<>();
|
private final MutableLiveData<List<InventarioRoomDTO>> internalLiveData = new MutableLiveData<>();
|
||||||
@ -28,22 +35,49 @@ public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioR
|
|||||||
public InventarioRepository(InventarioLocalDataSource localDataSource,
|
public InventarioRepository(InventarioLocalDataSource localDataSource,
|
||||||
InventarioRESTConsumer remoteDataSource,
|
InventarioRESTConsumer remoteDataSource,
|
||||||
InventarioMapper dataMapper,
|
InventarioMapper dataMapper,
|
||||||
Handler handler) {
|
Handler handler,
|
||||||
|
ExecutorService executorService) {
|
||||||
super(dataMapper, localDataSource, remoteDataSource);
|
super(dataMapper, localDataSource, remoteDataSource);
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
|
this.executorService = executorService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public LiveData<List<InventarioRoomDTO>> retrieve() {
|
public LiveData<List<InventarioRoomDTO>> retrieve(Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||||
localDataSource.makeSynchronousRetrieveAllLive(false)
|
localDataSource.makeSynchronousRetrieveAllLive(false)
|
||||||
.observeOn(Schedulers.io())
|
.observeOn(Schedulers.io())
|
||||||
.subscribe(internalLiveData::postValue);
|
.subscribe(internalLiveData::postValue);
|
||||||
// refresh(onComplete, onError);
|
|
||||||
|
UtilityLiveData.observeOnce(internalLiveData, inventories -> {
|
||||||
|
refresh(onComplete, onError);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
return internalLiveData;
|
return internalLiveData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void refresh(Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||||
|
executorService.execute(() -> {
|
||||||
|
try {
|
||||||
|
var startRetrieve = new Date();
|
||||||
|
var remoteData = remoteDataSource.makeSynchronousRetrieveRequest();
|
||||||
|
Log.d("Timing [INVENTORIES RETRIEVE]", ((new Date().getTime() - startRetrieve.getTime()) / 1000) + " secs");
|
||||||
|
|
||||||
|
if (remoteData == null) remoteData = new ArrayList<>();
|
||||||
|
|
||||||
|
resolveFetch(remoteData, internalLiveData.getValue(),
|
||||||
|
(remoteItem, localItem) -> Objects.equals(remoteItem.getIdInventario(), localItem.getIdInventario()),
|
||||||
|
(remoteItem, localItem) -> {
|
||||||
|
remoteItem.setNew(true);
|
||||||
|
}, onComplete, onError);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
onError.run(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void insert(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
public void insert(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||||
localDataSource.makeInsertRequest(inventarioDTO, localResult -> {
|
localDataSource.makeInsertRequest(inventarioDTO, localResult -> {
|
||||||
if (onComplete != null) handler.post(onComplete);
|
if (onComplete != null) handler.post(onComplete);
|
||||||
@ -60,7 +94,7 @@ public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioR
|
|||||||
}, onError);
|
}, onError);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError){
|
public void delete(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||||
localDataSource.makeDeleteRequest(inventarioDTO, onComplete, onError);
|
localDataSource.makeDeleteRequest(inventarioDTO, onComplete, onError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,9 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||||
@ -19,9 +16,6 @@ import retrofit2.http.Query;
|
|||||||
|
|
||||||
public interface ColliMagazzinoRESTConsumerService {
|
public interface ColliMagazzinoRESTConsumerService {
|
||||||
|
|
||||||
@POST("wms/distribuzioneRigheCollo")
|
|
||||||
Call<ServiceRESTResponse<JsonObject>> distribuisciCollo(@Body DistribuzioneColloDTO distribuzioneCollo);
|
|
||||||
|
|
||||||
@POST("getColloByBarcode")
|
@POST("getColloByBarcode")
|
||||||
Call<ServiceRESTResponse<MtbColt>> getColloByBarcode(@Query("codBarreCollo") String sscc, @Query("onlyResiduo") boolean onlyResiduo, @Query("throwExcIfNull") boolean throwExcIfNull);
|
Call<ServiceRESTResponse<MtbColt>> getColloByBarcode(@Query("codBarreCollo") String sscc, @Query("onlyResiduo") boolean onlyResiduo, @Query("throwExcIfNull") boolean throwExcIfNull);
|
||||||
|
|
||||||
|
|||||||
@ -20,12 +20,10 @@ import retrofit2.Response;
|
|||||||
public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
public void getValue(String gestName, String sectionName, String keySection, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getValue(String gestName, String sectionName, String keySection, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
getValueStatic(gestName, sectionName, keySection, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void getValueStatic(String gestName, String sectionName, String keySection, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
||||||
service.getGestSetupValue(gestName, sectionName, keySection).enqueue(new Callback<ServiceRESTResponse<GestSetupDTO>>() {
|
|
||||||
|
service.getGestSetupValue(gestName, sectionName, keySection)
|
||||||
|
.enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
|
||||||
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
||||||
@ -40,8 +38,8 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void getBooleanValue(String gestName, String sectionName, String keySection, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getBooleanValue(String gestName, String sectionName, String keySection, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
getValueStatic(gestName, sectionName, keySection, value -> {
|
getValue(gestName, sectionName, keySection, value -> {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
onComplete.run("S".equalsIgnoreCase(value.value));
|
onComplete.run("S".equalsIgnoreCase(value.value));
|
||||||
} else onComplete.run(false);
|
} else onComplete.run(false);
|
||||||
@ -50,7 +48,7 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void getValueStatic(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
||||||
service.getGestSetupValue(gestName, sectionName, keySection, codMdep).enqueue(new Callback<ServiceRESTResponse<GestSetupDTO>>() {
|
service.getGestSetupValue(gestName, sectionName, keySection, codMdep).enqueue(new Callback<ServiceRESTResponse<GestSetupDTO>>() {
|
||||||
@Override
|
@Override
|
||||||
@ -67,8 +65,8 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void getBooleanValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getBooleanValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
getValueStatic(gestName, sectionName, keySection, codMdep, value -> {
|
getValue(gestName, sectionName, keySection, codMdep, value -> {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
onComplete.run("S".equalsIgnoreCase(value.value));
|
onComplete.run("S".equalsIgnoreCase(value.value));
|
||||||
} else onComplete.run(false);
|
} else onComplete.run(false);
|
||||||
|
|||||||
@ -2,6 +2,8 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
@ -52,6 +54,16 @@ public class InventarioRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<MtbInvent> makeSynchronousRetrieveRequest() throws Exception {
|
||||||
|
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class, 120);
|
||||||
|
|
||||||
|
var response = inventarioRESTConsumerService.retrieve()
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
var data = analyzeAnswer(response, "retrieveInventario");
|
||||||
|
return data.getInventories();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void makeInsertRequest(MtbInvent inventarioToInsert, final Runnable onComplete, final RunnableArgs<Exception> onFailed) {
|
public void makeInsertRequest(MtbInvent inventarioToInsert, final Runnable onComplete, final RunnableArgs<Exception> onFailed) {
|
||||||
var request = new InsertInventarioRequestDTO()
|
var request = new InsertInventarioRequestDTO()
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.inventario.InsertInventarioRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.inventario.InsertInventarioRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventariResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioArtsResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioArtsResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioResponseDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
@ -12,6 +13,9 @@ import retrofit2.http.Path;
|
|||||||
|
|
||||||
public interface InventarioRESTConsumerService {
|
public interface InventarioRESTConsumerService {
|
||||||
|
|
||||||
|
@GET("wms/inventario/")
|
||||||
|
Call<ServiceRESTResponse<RetrieveInventariResponseDTO>> retrieve();
|
||||||
|
|
||||||
@GET("wms/inventario/{inventoryId}")
|
@GET("wms/inventario/{inventoryId}")
|
||||||
Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> retrieve(
|
Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> retrieve(
|
||||||
@Path("inventoryId") long inventoryId);
|
@Path("inventoryId") long inventoryId);
|
||||||
|
|||||||
@ -15,41 +15,48 @@ import retrofit2.Response;
|
|||||||
|
|
||||||
public abstract class _BaseRESTConsumer {
|
public abstract class _BaseRESTConsumer {
|
||||||
|
|
||||||
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed) {
|
public static <T> T analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle) throws Exception {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
if (response.body() != null) {
|
if (response.body() != null) {
|
||||||
if (response.body().getEsito() == EsitoType.OK) {
|
if (response.body().getEsito() == EsitoType.OK) {
|
||||||
if (!UtilityString.isNullOrEmpty(response.body().getErrorMessage())) {
|
if (!UtilityString.isNullOrEmpty(response.body().getErrorMessage())) {
|
||||||
onFailed.run(new Exception(response.body().getErrorMessage()));
|
throw new Exception(response.body().getErrorMessage());
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
T dataObj = response.body().getDto() != null ?
|
T dataObj = response.body().getDto() != null ?
|
||||||
response.body().getDto() :
|
response.body().getDto() :
|
||||||
response.body().getEntity();
|
response.body().getEntity();
|
||||||
|
|
||||||
onComplete.run(dataObj);
|
return dataObj;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String errorMessage = UtilityString.isNull(response.body().getErrorMessage(), "Empty message");
|
String errorMessage = UtilityString.isNull(response.body().getErrorMessage(), "Empty message");
|
||||||
Log.e(logTitle, errorMessage);
|
Log.e(logTitle, errorMessage);
|
||||||
onFailed.run(CommonRESTException.tryRecognizeException(errorMessage));
|
throw CommonRESTException.tryRecognizeException(errorMessage);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(logTitle, response.message());
|
Log.e(logTitle, response.message());
|
||||||
onFailed.run(new Exception(response.message()));
|
throw new Exception(response.message());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (response.code() == 404) {
|
if (response.code() == 404) {
|
||||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url().toString() + ")");
|
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url() + ")");
|
||||||
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
throw new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")");
|
||||||
} else if (response.code() == 550)
|
} else if (response.code() == 550)
|
||||||
onFailed.run(new InvalidLicenseException());
|
throw new InvalidLicenseException();
|
||||||
else {
|
else {
|
||||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||||
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
throw new Exception("Status " + response.code() + ": " + response.message());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
try {
|
||||||
|
var data = analyzeAnswer(response, logTitle);
|
||||||
|
onComplete.run(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,84 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.model;
|
|
||||||
|
|
||||||
public class DistribuzioneColloDTO {
|
|
||||||
|
|
||||||
private String gestione;
|
|
||||||
private String dataCollo;
|
|
||||||
private Integer numCollo;
|
|
||||||
private String serCollo;
|
|
||||||
private String criterioDistribuzione;
|
|
||||||
|
|
||||||
public String getGestione() {
|
|
||||||
return gestione;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DistribuzioneColloDTO setGestione(String gestione) {
|
|
||||||
this.gestione = gestione;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDataCollo() {
|
|
||||||
return dataCollo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DistribuzioneColloDTO setDataCollo(String dataCollo) {
|
|
||||||
this.dataCollo = dataCollo;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getNumCollo() {
|
|
||||||
return numCollo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DistribuzioneColloDTO setNumCollo(Integer numCollo) {
|
|
||||||
this.numCollo = numCollo;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSerCollo() {
|
|
||||||
return serCollo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DistribuzioneColloDTO setSerCollo(String serCollo) {
|
|
||||||
this.serCollo = serCollo;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCriterioDistribuzione() {
|
|
||||||
return criterioDistribuzione;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CriterioDistribuzione getCriterioDistribuzioneEnum() {
|
|
||||||
return CriterioDistribuzione.fromString(criterioDistribuzione);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DistribuzioneColloDTO setCriterioDistribuzione(String criterioDistribuzione) {
|
|
||||||
this.criterioDistribuzione = criterioDistribuzione;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DistribuzioneColloDTO setCriterioDistribuzione(CriterioDistribuzione criterioDistribuzione) {
|
|
||||||
this.criterioDistribuzione = criterioDistribuzione != null ? criterioDistribuzione.getText() : null;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum CriterioDistribuzione {
|
|
||||||
UPDATE("U"), //UPDATE COLLO GIA' ESISTENTE
|
|
||||||
SPLIT_ORDINE("O"); //UPDATE COLLO GIA' ESISTENTE
|
|
||||||
|
|
||||||
private String text;
|
|
||||||
CriterioDistribuzione(String text) {
|
|
||||||
this.text = text;
|
|
||||||
}
|
|
||||||
public String getText() {
|
|
||||||
return this.text;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CriterioDistribuzione fromString(String text) {
|
|
||||||
for (CriterioDistribuzione b : CriterioDistribuzione.values()) {
|
|
||||||
if (b.text.equalsIgnoreCase(text)) return b;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model.inventario;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbInvent;
|
||||||
|
|
||||||
|
public class RetrieveInventariResponseDTO {
|
||||||
|
|
||||||
|
private List<MtbInvent> inventories;
|
||||||
|
|
||||||
|
public List<MtbInvent> getInventories() {
|
||||||
|
return inventories;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -7,7 +7,6 @@ import it.integry.integrywmsnative.core.model.Azienda;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
|
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
|
||||||
|
|
||||||
public class DBSettingsModel {
|
public class DBSettingsModel {
|
||||||
|
|
||||||
@ -22,7 +21,6 @@ public class DBSettingsModel {
|
|||||||
private boolean flagMultiClienteOrdV;
|
private boolean flagMultiClienteOrdV;
|
||||||
private boolean flagUseCodAnagAziendale;
|
private boolean flagUseCodAnagAziendale;
|
||||||
private String defaultCausaleRettificaGiacenze;
|
private String defaultCausaleRettificaGiacenze;
|
||||||
private DistribuzioneColloDTO.CriterioDistribuzione defaultCriterioDistribuzione;
|
|
||||||
private boolean flagAskClienteInPickingLibero;
|
private boolean flagAskClienteInPickingLibero;
|
||||||
private boolean flagPickLiberoAllowEmptyCliente;
|
private boolean flagPickLiberoAllowEmptyCliente;
|
||||||
|
|
||||||
@ -136,15 +134,6 @@ public class DBSettingsModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DistribuzioneColloDTO.CriterioDistribuzione getDefaultCriterioDistribuzione() {
|
|
||||||
return defaultCriterioDistribuzione;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DBSettingsModel setDefaultCriterioDistribuzione(String defaultCriterioDistribuzione) {
|
|
||||||
this.defaultCriterioDistribuzione = DistribuzioneColloDTO.CriterioDistribuzione.fromString(defaultCriterioDistribuzione);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isFlagAskClienteInPickingLibero() {
|
public boolean isFlagAskClienteInPickingLibero() {
|
||||||
return flagAskClienteInPickingLibero;
|
return flagAskClienteInPickingLibero;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -355,7 +355,6 @@ public class SettingsManager {
|
|||||||
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(getValueFromList(list, "SETUP", "ENABLE_CHECK_PARTITA_MAG_PICKING_V", Boolean.class));
|
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(getValueFromList(list, "SETUP", "ENABLE_CHECK_PARTITA_MAG_PICKING_V", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagMultiClienteOrdV(getValueFromList(list, "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", Boolean.class));
|
dbSettingsModelIstance.setFlagMultiClienteOrdV(getValueFromList(list, "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagUseCodAnagAziendale(getValueFromList(list, "SETUP", "FLAG_USE_COD_ANAG_AZIENDALE", Boolean.class));
|
dbSettingsModelIstance.setFlagUseCodAnagAziendale(getValueFromList(list, "SETUP", "FLAG_USE_COD_ANAG_AZIENDALE", Boolean.class));
|
||||||
dbSettingsModelIstance.setDefaultCriterioDistribuzione(getValueFromList(list, "SETUP", "DEFAULT_CRITERIO_DISTRIBUZIONE", String.class));
|
|
||||||
dbSettingsModelIstance.setFlagAskClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ASK_CLIENTE", Boolean.class));
|
dbSettingsModelIstance.setFlagAskClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ASK_CLIENTE", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyCliente(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_CLIENTE", Boolean.class));
|
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyCliente(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_CLIENTE", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagCanAddExtraItemSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_ITEMS", Boolean.class));
|
dbSettingsModelIstance.setFlagCanAddExtraItemSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_ITEMS", Boolean.class));
|
||||||
|
|||||||
@ -70,6 +70,11 @@ public class ElencoInventariFragment extends BaseFragment implements ITitledFrag
|
|||||||
mBinding.setLifecycleOwner(this);
|
mBinding.setLifecycleOwner(this);
|
||||||
mBinding.setViewmodel(mViewModel);
|
mBinding.setViewmodel(mViewModel);
|
||||||
|
|
||||||
|
mBinding.swiperefresh.setRefreshing(true);
|
||||||
|
mBinding.swiperefresh.setOnRefreshListener(() -> {
|
||||||
|
mViewModel.loadData();
|
||||||
|
});
|
||||||
|
|
||||||
mViewModel.loadData();
|
mViewModel.loadData();
|
||||||
this.initRecyclerView();
|
this.initRecyclerView();
|
||||||
|
|
||||||
@ -143,6 +148,22 @@ public class ElencoInventariFragment extends BaseFragment implements ITitledFrag
|
|||||||
startPicking(inventarioRoomDTO, listaArts);
|
startPicking(inventarioRoomDTO, listaArts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInventoriesLoadingStarted() {
|
||||||
|
mBinding.swiperefresh.setRefreshing(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInventoriesLoadingEnded() {
|
||||||
|
mBinding.swiperefresh.setRefreshing(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInventoriesLoadingError(Exception ex) {
|
||||||
|
mBinding.swiperefresh.setRefreshing(false);
|
||||||
|
this.onError(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void startPicking(InventarioRoomDTO inventarioRoomDTO, List<InventarioArtDTO> listArts) {
|
private void startPicking(InventarioRoomDTO inventarioRoomDTO, List<InventarioArtDTO> listArts) {
|
||||||
PickingInventarioActivity.startActivity(requireContext(), inventarioRoomDTO, listArts);
|
PickingInventarioActivity.startActivity(requireContext(), inventarioRoomDTO, listArts);
|
||||||
|
|||||||
@ -40,7 +40,10 @@ public class ElencoInventariViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void loadData() {
|
public void loadData() {
|
||||||
inventarioList = inventarioRepository.retrieve();
|
inventarioList = inventarioRepository.retrieve(
|
||||||
|
this::sendOnInventoriesLoadingEnded,
|
||||||
|
this::sendOnInventoriesLoadingError
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroyData() {
|
public void destroyData() {
|
||||||
@ -146,16 +149,34 @@ public class ElencoInventariViewModel {
|
|||||||
if (this.listener != null) listener.onLoadingEnded();
|
if (this.listener != null) listener.onLoadingEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendOnInventoriesLoadingStarted() {
|
||||||
|
if (this.listener != null) listener.onInventoriesLoadingStarted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnInventoriesLoadingEnded() {
|
||||||
|
if (this.listener != null) listener.onInventoriesLoadingEnded();
|
||||||
|
}
|
||||||
|
|
||||||
private void sendOnError(Exception ex) {
|
private void sendOnError(Exception ex) {
|
||||||
if (this.listener != null) listener.onError(ex);
|
if (this.listener != null) listener.onError(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendOnInventoriesLoadingError(Exception ex) {
|
||||||
|
if (this.listener != null) listener.onInventoriesLoadingError(ex);
|
||||||
|
}
|
||||||
|
|
||||||
public interface Listener extends ILoadingListener {
|
public interface Listener extends ILoadingListener {
|
||||||
|
|
||||||
void onInventarioInfoRequest(RunnableArgss<Long, String> onComplete);
|
void onInventarioInfoRequest(RunnableArgss<Long, String> onComplete);
|
||||||
|
|
||||||
void onInventarioLoaded(InventarioRoomDTO inventarioRoomDTO, List<InventarioArtDTO> listaArts);
|
void onInventarioLoaded(InventarioRoomDTO inventarioRoomDTO, List<InventarioArtDTO> listaArts);
|
||||||
|
|
||||||
|
void onInventoriesLoadingStarted();
|
||||||
|
|
||||||
|
void onInventoriesLoadingEnded();
|
||||||
|
|
||||||
|
void onInventoriesLoadingError(Exception ex);
|
||||||
|
|
||||||
void onCreateInventarioRequest(long inventoryId, String zone);
|
void onCreateInventarioRequest(long inventoryId, String zone);
|
||||||
|
|
||||||
void onError(Exception ex);
|
void onError(Exception ex);
|
||||||
|
|||||||
@ -587,7 +587,7 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
private void executeMagazzinoAutomatico(MtbDepoPosizione mtbDepoPosizione, Runnable onComplete) {
|
private void executeMagazzinoAutomatico(MtbDepoPosizione mtbDepoPosizione, Runnable onComplete) {
|
||||||
var magazzinoAutomaticoPickableArts = Stream.of(Objects.requireNonNull(this.mPickingList.getValue()))
|
var magazzinoAutomaticoPickableArts = Stream.of(Objects.requireNonNull(this.mPickingList.getValue()))
|
||||||
.filter(x -> Stream.of(x.getMtbColts()).anyMatch(y -> y.getPosizione().equalsIgnoreCase(mtbDepoPosizione.getPosizione())))
|
.filter(x -> Stream.of(x.getMtbColts()).anyMatch(y -> y.getPosizione() != null && y.getPosizione().equalsIgnoreCase(mtbDepoPosizione.getPosizione())))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
var mtbAarts = Stream.of(magazzinoAutomaticoPickableArts)
|
var mtbAarts = Stream.of(magazzinoAutomaticoPickableArts)
|
||||||
|
|||||||
@ -70,28 +70,34 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
android:id="@+id/swiperefresh"
|
||||||
android:id="@+id/inventario_list"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fadeScrollbars="true"
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
tools:itemCount="8"
|
|
||||||
tools:listitem="@layout/fragment_elenco_inventario_list_single_item" />
|
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/inventario_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fadeScrollbars="true"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
tools:itemCount="8"
|
||||||
|
tools:listitem="@layout/fragment_elenco_inventario_list_single_item" />
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
style="?attr/floatingActionButtonPrimaryStyle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom|end"
|
android:layout_gravity="bottom|end"
|
||||||
android:layout_margin="16dp"
|
android:layout_margin="16dp"
|
||||||
app:srcCompat="@drawable/ic_add_24dp"
|
|
||||||
app:singleClick="@{() -> viewmodel.openInventario()}"
|
app:singleClick="@{() -> viewmodel.openInventario()}"
|
||||||
style="?attr/floatingActionButtonPrimaryStyle" />
|
app:srcCompat="@drawable/ic_add_24dp" />
|
||||||
|
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|||||||
@ -53,7 +53,7 @@
|
|||||||
android:layout_toEndOf="@+id/badge1"
|
android:layout_toEndOf="@+id/badge1"
|
||||||
android:text="@string/new_item"
|
android:text="@string/new_item"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:visibility="gone"
|
android:visibility="@{item.isNew() ? View.VISIBLE : View.GONE}"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
kotlin_version = '1.8.0'
|
kotlin_version = '1.8.0'
|
||||||
agp_version = '8.1.0-alpha04'
|
agp_version = '8.1.0-alpha05'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user