From feb79ff95db8b10bcf0aafb1ded2fc4d2006c410 Mon Sep 17 00:00:00 2001 From: GiuseppeS Date: Fri, 9 Dec 2022 19:26:23 +0100 Subject: [PATCH 1/6] Modifiche per inventario --- .../it/integry/integrywmsnative/SplashActivity.java | 9 +++++---- .../core/rest/consumers/_BaseRESTConsumer.java | 7 ++++--- .../inventario/picking/PickingInventarioActivity.java | 3 ++- .../picking/PickingInventarioViewModel.java | 4 ++-- .../gest/spedizione/SpedizioneViewModel.java | 11 ++++++----- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/it/integry/integrywmsnative/SplashActivity.java b/app/src/main/java/it/integry/integrywmsnative/SplashActivity.java index 4af69432..e38e3df1 100644 --- a/app/src/main/java/it/integry/integrywmsnative/SplashActivity.java +++ b/app/src/main/java/it/integry/integrywmsnative/SplashActivity.java @@ -83,12 +83,13 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener private void initPermissions(Runnable onComplete) { PermissionsHelper.askPermissions(this, onComplete, permanentlyDenied -> { - if (permanentlyDenied) { + if (permanentlyDenied) onError(new SpannableString(getText(R.string.permissions_permanently_denied))); - } else { - initPermissions(onComplete); - } + +// else { +// initPermissions(onComplete); +// } }); } diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/_BaseRESTConsumer.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/_BaseRESTConsumer.java index 02b7194b..ed399da0 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/_BaseRESTConsumer.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/_BaseRESTConsumer.java @@ -39,9 +39,10 @@ public abstract class _BaseRESTConsumer { } } else { if (response.code() == 404) { - Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url().toString() + ")"); - onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")")); - } else if (response.code() == 550) + Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url() + ")"); + onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url() + ")")); + } + else if (response.code() == 550) onFailed.run(new NotValidLicenseException()); else { Log.e(logTitle, "Status " + response.code() + ": " + response.message()); diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/inventario/picking/PickingInventarioActivity.java b/app/src/main/java/it/integry/integrywmsnative/gest/inventario/picking/PickingInventarioActivity.java index 509a59d2..7fc13d3a 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/inventario/picking/PickingInventarioActivity.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/inventario/picking/PickingInventarioActivity.java @@ -206,7 +206,8 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn .setDataScad(dataScad) .setCanOverflowOrderQuantity(canOverflowOrderQuantity) .setCanPartitaMagBeChanged(canPartitaMagBeChanged) - .setCanLUBeClosed(canLUBeClosed); + .setCanLUBeClosed(canLUBeClosed) + .setNumCnfEditable(false); if (!mDialogInputQuantityV2View.isVisible()) mDialogInputQuantityV2View.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO) 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 7c7de7b5..7a4792b5 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 @@ -252,9 +252,9 @@ public class PickingInventarioViewModel extends ViewModel { this.sendOnItemDispatched( pickingObjectDTO, pickingObjectDTO.getMtbAart(), - initialNumCnf, + null, //initialNumCnf, initialQtaCnf, - initialQtaTot, + null, //initialQtaTot, null, null, null, diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java b/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java index d660632b..e1473094 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java @@ -1652,11 +1652,12 @@ public class SpedizioneViewModel { onOrderClosedPrintingDone(); return; } - List closedOrders = Stream.of(this.mTestateOrdini).map(ord -> { - DtbOrdt ordV = new DtbOrdt(); - ordV.setDataOrd(ord.getDataOrdS()).setNumOrd(ord.getNumOrd()).setGestione(ord.getGestione()).setCodAnag(ord.getCodAnagOrd()); - return ordV; - }).toList(); + List closedOrders = Stream.of(this.mTestateOrdini) + .map(ord -> { + DtbOrdt ordV = new DtbOrdt(); + ordV.setDataOrd(ord.getDataOrdS()).setNumOrd(ord.getNumOrd()).setGestione(ord.getGestione()).setCodAnag(ord.getCodAnagOrd()); + return ordV; + }).toList(); dto.setPrintList(closedOrders); printClosedOrders(dto, this::onOrderClosedPrintingDone, ex -> this.sendLUPrintError(ex, this::sendOnLoadingEnded)); From f50400bcb73dbe1cddadf52b81f76a7be14e009b Mon Sep 17 00:00:00 2001 From: GiuseppeS Date: Fri, 9 Dec 2022 19:32:40 +0100 Subject: [PATCH 2/6] -> v1.30.0 (318) --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ffaa4f0d..0a945a5c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services' android { - def appVersionCode = 317 - def appVersionName = '1.29.13' + def appVersionCode = 318 + def appVersionName = '1.30.0' signingConfigs { release { From d4fbd7b45ffaaebe58e62635614ee044737de7d6 Mon Sep 17 00:00:00 2001 From: GiuseppeS Date: Mon, 12 Dec 2022 16:52:54 +0100 Subject: [PATCH 3/6] Fix su fab in accettazione, ripristinato onClick --- .idea/deploymentTargetDropDown.xml | 17 +++++++++++++++++ .../res/layout/fragment_main_accettazione.xml | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 .idea/deploymentTargetDropDown.xml diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 00000000..039e6190 --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_main_accettazione.xml b/app/src/main/res/layout/fragment_main_accettazione.xml index a968f396..e4d68b69 100644 --- a/app/src/main/res/layout/fragment_main_accettazione.xml +++ b/app/src/main/res/layout/fragment_main_accettazione.xml @@ -89,7 +89,9 @@ android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="16dp" + android:onClick="@{() -> view.dispatchOrders()}" app:srcCompat="@drawable/ic_check_black_24dp" + app:visibility="@{view.fabVisible}" style="?attr/floatingActionButtonPrimaryStyle" /> From 2e90c33854560f9a4daefb7d3404ed609aa0ab9f Mon Sep 17 00:00:00 2001 From: GiuseppeS Date: Mon, 12 Dec 2022 16:53:52 +0100 Subject: [PATCH 4/6] -> v1.30.01(319) --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0a945a5c..2ea373c2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services' android { - def appVersionCode = 318 - def appVersionName = '1.30.0' + def appVersionCode = 319 + def appVersionName = '1.30.01' signingConfigs { release { From c72037783faf24b0e4e6880acd81c5bf62148d4b Mon Sep 17 00:00:00 2001 From: GiuseppeS Date: Tue, 13 Dec 2022 15:40:10 +0100 Subject: [PATCH 5/6] Completate ultime modifiche inventario --- .../13.json | 1156 +++++++++++++++++ .../core/data_store/db/AppDatabase.java | 19 +- .../db/entity/InventarioRowRoomDTO.java | 46 +- .../model/inventario/InventarioArtDTO.java | 5 +- .../picking/PickingInventarioActivity.java | 7 +- .../picking/PickingInventarioViewModel.java | 141 +- .../DialogInputQuantityV2ViewModel.java | 2 +- ...activity_picking_inventario__list_item.xml | 17 +- 8 files changed, 1300 insertions(+), 93 deletions(-) create mode 100644 app/schemas/it.integry.integrywmsnative.core.data_store.db.AppDatabase/13.json diff --git a/app/schemas/it.integry.integrywmsnative.core.data_store.db.AppDatabase/13.json b/app/schemas/it.integry.integrywmsnative.core.data_store.db.AppDatabase/13.json new file mode 100644 index 00000000..960fed8f --- /dev/null +++ b/app/schemas/it.integry.integrywmsnative.core.data_store.db.AppDatabase/13.json @@ -0,0 +1,1156 @@ +{ + "formatVersion": 1, + "database": { + "version": 13, + "identityHash": "bc3841159bac7a7731fe39a5fa4f0f4e", + "entities": [ + { + "tableName": "articoli_griglia", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`articolo_griglia_id` INTEGER PRIMARY KEY AUTOINCREMENT, `cod_mart` TEXT, `descrizione` TEXT, `unt_mis` TEXT, `qta_cnf` REAL NOT NULL, `bar_code` TEXT, `merce_da_ric` REAL NOT NULL, `media_sett` REAL NOT NULL, `flag_qta_multipla` TEXT, `qta_min_ordinabile` REAL NOT NULL, `gg_scadenza` INTEGER NOT NULL, `giacenza` REAL NOT NULL, `qta_prevista_vendita` REAL NOT NULL, `qta_proposta` REAL NOT NULL, `qta_ord` REAL NOT NULL, `id_griglia` INTEGER NOT NULL, `new_no_promo` INTEGER NOT NULL, FOREIGN KEY(`id_griglia`) REFERENCES `griglie`(`griglia_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "articoloGrigliaId", + "columnName": "articolo_griglia_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "codMart", + "columnName": "cod_mart", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "descrizione", + "columnName": "descrizione", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "untMis", + "columnName": "unt_mis", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "qtaCnf", + "columnName": "qta_cnf", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "barCode", + "columnName": "bar_code", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "merceDaRic", + "columnName": "merce_da_ric", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "mediaSett", + "columnName": "media_sett", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "flagQtaMultipla", + "columnName": "flag_qta_multipla", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "qtaMinOrdinabile", + "columnName": "qta_min_ordinabile", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "ggScadenza", + "columnName": "gg_scadenza", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "giacenza", + "columnName": "giacenza", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "qtaPrevistaVendita", + "columnName": "qta_prevista_vendita", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "qtaProposta", + "columnName": "qta_proposta", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "qtaOrd", + "columnName": "qta_ord", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "idGriglia", + "columnName": "id_griglia", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "newNoPromo", + "columnName": "new_no_promo", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "articolo_griglia_id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_articoli_griglia_id_griglia", + "unique": false, + "columnNames": [ + "id_griglia" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_articoli_griglia_id_griglia` ON `${TABLE_NAME}` (`id_griglia`)" + } + ], + "foreignKeys": [ + { + "table": "griglie", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "id_griglia" + ], + "referencedColumns": [ + "griglia_id" + ] + } + ] + }, + { + "tableName": "griglie", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`griglia_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `cod_alis` TEXT, `descr_lisa` TEXT, `descr_depo` TEXT)", + "fields": [ + { + "fieldPath": "grigliaId", + "columnName": "griglia_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "codAlis", + "columnName": "cod_alis", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "descrLisa", + "columnName": "descr_lisa", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "descrDepo", + "columnName": "descr_depo", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "griglia_id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_griglie_cod_alis", + "unique": true, + "columnNames": [ + "cod_alis" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_griglie_cod_alis` ON `${TABLE_NAME}` (`cod_alis`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "ordini", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`ordine_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `data_ins` INTEGER, `annotazioni` TEXT, `transmitted` INTEGER NOT NULL, `transmission_date` INTEGER, `gestione` TEXT, `data_ord` INTEGER, `num_ord` INTEGER, `cod_mdep` TEXT, `id_griglia` INTEGER NOT NULL, `cod_alis` TEXT NOT NULL)", + "fields": [ + { + "fieldPath": "ordineId", + "columnName": "ordine_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dataIns", + "columnName": "data_ins", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "annotazioni", + "columnName": "annotazioni", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "transmitted", + "columnName": "transmitted", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "transmissionDate", + "columnName": "transmission_date", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "gestione", + "columnName": "gestione", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dataOrd", + "columnName": "data_ord", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "numOrd", + "columnName": "num_ord", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "codMdep", + "columnName": "cod_mdep", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "idGriglia", + "columnName": "id_griglia", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "codAlis", + "columnName": "cod_alis", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "ordine_id" + ], + "autoGenerate": true + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "articoli_ordine", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`articolo_ordine_id` INTEGER PRIMARY KEY AUTOINCREMENT, `cod_mart` TEXT, `descrizione` TEXT, `unt_mis` TEXT, `qta_cnf` REAL NOT NULL, `bar_code` TEXT, `merce_da_ric` REAL NOT NULL, `media_sett` REAL NOT NULL, `flag_qta_multipla` TEXT, `qta_min_ordinabile` REAL NOT NULL, `id_ordine` INTEGER NOT NULL, `qta_ord` REAL NOT NULL, `data_ins` INTEGER, `new_no_promo` INTEGER NOT NULL, `system_note` TEXT, FOREIGN KEY(`id_ordine`) REFERENCES `ordini`(`ordine_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "articoloOrdineId", + "columnName": "articolo_ordine_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "codMart", + "columnName": "cod_mart", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "descrizione", + "columnName": "descrizione", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "untMis", + "columnName": "unt_mis", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "qtaCnf", + "columnName": "qta_cnf", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "barCode", + "columnName": "bar_code", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "merceDaRic", + "columnName": "merce_da_ric", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "mediaSett", + "columnName": "media_sett", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "flagQtaMultipla", + "columnName": "flag_qta_multipla", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "qtaMinOrdinabile", + "columnName": "qta_min_ordinabile", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "idOrdine", + "columnName": "id_ordine", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "qtaOrd", + "columnName": "qta_ord", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "dataIns", + "columnName": "data_ins", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "newNoPromo", + "columnName": "new_no_promo", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "systemNote", + "columnName": "system_note", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "articolo_ordine_id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_articoli_ordine_id_ordine", + "unique": false, + "columnNames": [ + "id_ordine" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_articoli_ordine_id_ordine` ON `${TABLE_NAME}` (`id_ordine`)" + }, + { + "name": "index_articoli_ordine_id_ordine_cod_mart", + "unique": true, + "columnNames": [ + "id_ordine", + "cod_mart" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_articoli_ordine_id_ordine_cod_mart` ON `${TABLE_NAME}` (`id_ordine`, `cod_mart`)" + } + ], + "foreignKeys": [ + { + "table": "ordini", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "id_ordine" + ], + "referencedColumns": [ + "ordine_id" + ] + } + ] + }, + { + "tableName": "mtb_colt", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `username` TEXT, `gestione` TEXT, `data_collo` INTEGER, `ser_collo` TEXT, `num_collo` INTEGER, `rif_ord` TEXT, `cod_anag` TEXT, `cod_vdes` TEXT, `cod_mdep` TEXT, `cod_vlis` TEXT, `cod_dtip` TEXT, `cod_tcol` TEXT, `ser_doc` TEXT, `annotazioni` TEXT, `posizione` TEXT, `cod_dtip_provv` TEXT, `ser_doc_provv` TEXT, `cod_jfas` TEXT, `data_ord` INTEGER, `data_doc` INTEGER, `data_doc_provv` INTEGER, `cod_mgrp` TEXT, `data_vers` INTEGER, `segno` INTEGER, `num_ord` INTEGER, `num_doc` INTEGER, `num_doc_provv` INTEGER)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "username", + "columnName": "username", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "gestione", + "columnName": "gestione", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dataCollo", + "columnName": "data_collo", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "serCollo", + "columnName": "ser_collo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "numCollo", + "columnName": "num_collo", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "rifOrd", + "columnName": "rif_ord", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codAnag", + "columnName": "cod_anag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codVdes", + "columnName": "cod_vdes", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codMdep", + "columnName": "cod_mdep", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codVlis", + "columnName": "cod_vlis", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codDtip", + "columnName": "cod_dtip", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codTcol", + "columnName": "cod_tcol", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "serDoc", + "columnName": "ser_doc", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "annotazioni", + "columnName": "annotazioni", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "posizione", + "columnName": "posizione", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codDtipProvv", + "columnName": "cod_dtip_provv", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "serDocProvv", + "columnName": "ser_doc_provv", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codJfas", + "columnName": "cod_jfas", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dataOrd", + "columnName": "data_ord", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "dataDoc", + "columnName": "data_doc", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "dataDocProvv", + "columnName": "data_doc_provv", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "codMgrp", + "columnName": "cod_mgrp", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dataVers", + "columnName": "data_vers", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "segno", + "columnName": "segno", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "numOrd", + "columnName": "num_ord", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "numDoc", + "columnName": "num_doc", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "numDocProvv", + "columnName": "num_doc_provv", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_mtb_colt_data_collo_ser_collo_num_collo_gestione", + "unique": true, + "columnNames": [ + "data_collo", + "ser_collo", + "num_collo", + "gestione" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_mtb_colt_data_collo_ser_collo_num_collo_gestione` ON `${TABLE_NAME}` (`data_collo`, `ser_collo`, `num_collo`, `gestione`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "mtb_colr", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `id_collo` INTEGER NOT NULL, `data_collo` INTEGER, `gestione` TEXT, `ser_collo` TEXT, `descrizione` TEXT, `num_collo` INTEGER, `riga` INTEGER, `riga_ord` INTEGER, `cod_mart` TEXT, `cod_barre` TEXT, `cod_col` TEXT, `cod_tagl` TEXT, `partita_mag` TEXT, `gestione_rif` TEXT, `ser_collo_rif` TEXT, `note` TEXT, `data_ord` INTEGER, `data_collo_rif` INTEGER, `qta_cnf` REAL, `qta_col` REAL, `num_ord` INTEGER, `num_etich` INTEGER, `num_collo_rif` INTEGER, `datetime_row` INTEGER, `cod_jcom` TEXT, `num_cnf` REAL, `causale` TEXT, `utente` TEXT, `cod_anag_doc` TEXT, `cod_dtip_doc` TEXT, `data_doc` INTEGER, `ser_doc` TEXT, `num_doc` INTEGER, `id_riga_doc` INTEGER, `unt_mis` TEXT, `data_scad` INTEGER, FOREIGN KEY(`id_collo`) REFERENCES `mtb_colt`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "idCollo", + "columnName": "id_collo", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dataCollo", + "columnName": "data_collo", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "gestione", + "columnName": "gestione", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "serCollo", + "columnName": "ser_collo", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "descrizione", + "columnName": "descrizione", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "numCollo", + "columnName": "num_collo", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "riga", + "columnName": "riga", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "rigaOrd", + "columnName": "riga_ord", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "codMart", + "columnName": "cod_mart", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codBarre", + "columnName": "cod_barre", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codCol", + "columnName": "cod_col", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codTagl", + "columnName": "cod_tagl", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "partitaMag", + "columnName": "partita_mag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "gestioneRif", + "columnName": "gestione_rif", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "serColloRif", + "columnName": "ser_collo_rif", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "note", + "columnName": "note", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dataOrd", + "columnName": "data_ord", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "dataColloRif", + "columnName": "data_collo_rif", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "qtaCnf", + "columnName": "qta_cnf", + "affinity": "REAL", + "notNull": false + }, + { + "fieldPath": "qtaCol", + "columnName": "qta_col", + "affinity": "REAL", + "notNull": false + }, + { + "fieldPath": "numOrd", + "columnName": "num_ord", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "numEtich", + "columnName": "num_etich", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "numColloRif", + "columnName": "num_collo_rif", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "datetimeRow", + "columnName": "datetime_row", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "codJcom", + "columnName": "cod_jcom", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "numCnf", + "columnName": "num_cnf", + "affinity": "REAL", + "notNull": false + }, + { + "fieldPath": "causale", + "columnName": "causale", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "utente", + "columnName": "utente", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codAnagDoc", + "columnName": "cod_anag_doc", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codDtipDoc", + "columnName": "cod_dtip_doc", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dataDoc", + "columnName": "data_doc", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "serDoc", + "columnName": "ser_doc", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "numDoc", + "columnName": "num_doc", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "idRigaDoc", + "columnName": "id_riga_doc", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "untMis", + "columnName": "unt_mis", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dataScad", + "columnName": "data_scad", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_mtb_colr_data_collo_ser_collo_num_collo_gestione_riga", + "unique": true, + "columnNames": [ + "data_collo", + "ser_collo", + "num_collo", + "gestione", + "riga" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_mtb_colr_data_collo_ser_collo_num_collo_gestione_riga` ON `${TABLE_NAME}` (`data_collo`, `ser_collo`, `num_collo`, `gestione`, `riga`)" + }, + { + "name": "index_mtb_colr_id_collo", + "unique": false, + "columnNames": [ + "id_collo" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_mtb_colr_id_collo` ON `${TABLE_NAME}` (`id_collo`)" + } + ], + "foreignKeys": [ + { + "table": "mtb_colt", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "id_collo" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "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)", + "fields": [ + { + "fieldPath": "id", + "columnName": "_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "idInventario", + "columnName": "id_inventario", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "codMdep", + "columnName": "cod_mdep", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dataInventario", + "columnName": "data_inventario", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "dataReg", + "columnName": "data_reg", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "dataVer", + "columnName": "data_ver", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "filtro", + "columnName": "filtro", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "flagStato", + "columnName": "flag_stato", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "flagOperazione", + "columnName": "flag_operazione", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codAnag", + "columnName": "cod_anag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "codDtip", + "columnName": "cod_dtip", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "inseritoDa", + "columnName": "inserito_da", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "registratoDa", + "columnName": "registrato_da", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "verificatoDa", + "columnName": "verificato_da", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "dataOraInizio", + "columnName": "data_ora_inizio", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "dataOraFine", + "columnName": "data_ora_fine", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "causale", + "columnName": "causale", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "zona", + "columnName": "zona", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "remoteSyncDate", + "columnName": "remote_sync_date", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "_id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_inventari__id", + "unique": false, + "columnNames": [ + "_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_inventari__id` ON `${TABLE_NAME}` (`_id`)" + }, + { + "name": "index_inventari_id_inventario", + "unique": false, + "columnNames": [ + "id_inventario" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_inventari_id_inventario` ON `${TABLE_NAME}` (`id_inventario`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "inventario_rows", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `parent_id` INTEGER, `cod_mart` TEXT, `partita_mag` TEXT, `descrizione` TEXT, `qta` REAL NOT NULL DEFAULT 0, `num_cnf` REAL NOT NULL DEFAULT 0, `qta_cnf` REAL NOT NULL DEFAULT 0, `unt_mis` TEXT NOT NULL DEFAULT '0', `data_ora_inv` INTEGER, `scan_cod_barre` TEXT, `zona` TEXT, `remote_sync_date` INTEGER, FOREIGN KEY(`parent_id`) REFERENCES `inventari`(`_id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "parentId", + "columnName": "parent_id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "codMart", + "columnName": "cod_mart", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "partitaMag", + "columnName": "partita_mag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "descrizione", + "columnName": "descrizione", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "qta", + "columnName": "qta", + "affinity": "REAL", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "numConf", + "columnName": "num_cnf", + "affinity": "REAL", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "qtaConf", + "columnName": "qta_cnf", + "affinity": "REAL", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "untMis", + "columnName": "unt_mis", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "'0'" + }, + { + "fieldPath": "dataOraInv", + "columnName": "data_ora_inv", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "scanCodBarre", + "columnName": "scan_cod_barre", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "zona", + "columnName": "zona", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "remoteSyncDate", + "columnName": "remote_sync_date", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "_id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_inventario_rows__id", + "unique": false, + "columnNames": [ + "_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_inventario_rows__id` ON `${TABLE_NAME}` (`_id`)" + }, + { + "name": "index_inventario_rows_parent_id", + "unique": false, + "columnNames": [ + "parent_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_inventario_rows_parent_id` ON `${TABLE_NAME}` (`parent_id`)" + } + ], + "foreignKeys": [ + { + "table": "inventari", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "parent_id" + ], + "referencedColumns": [ + "_id" + ] + } + ] + } + ], + "views": [], + "setupQueries": [ + "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')" + ] + } +} \ No newline at end of file diff --git a/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/AppDatabase.java b/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/AppDatabase.java index 9317a702..661fbdb9 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/AppDatabase.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/AppDatabase.java @@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.data_store.db; import android.content.Context; +import androidx.annotation.NonNull; import androidx.room.Database; import androidx.room.Room; import androidx.room.RoomDatabase; @@ -39,7 +40,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt; InventarioRoomDTO.class, InventarioRowRoomDTO.class }, - version = 12, + version = 13, exportSchema = true) @TypeConverters({ DateConverter.class, @@ -64,7 +65,8 @@ public abstract class AppDatabase extends RoomDatabase { var builder = Room.databaseBuilder(applicationContext, AppDatabase.class, "integry_wms") .addMigrations(MIGRATION_10_11) - .addMigrations(MIGRATION_11_12); + .addMigrations(MIGRATION_11_12) + .addMigrations(MIGRATION_12_13); sInstance = builder.build(); } @@ -101,6 +103,7 @@ 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_11_12 = new Migration(11, 12) { @Override public void migrate(SupportSQLiteDatabase database) { @@ -111,4 +114,16 @@ public abstract class AppDatabase extends RoomDatabase { database.execSQL("ALTER TABLE ordini_tmp RENAME TO ordini;"); } }; + + static final Migration MIGRATION_12_13 = new Migration(12, 13) { + @Override + public void migrate(@NonNull SupportSQLiteDatabase database) { + database.execSQL("CREATE TABLE IF NOT EXISTS inventario_rows_tmp (_id INTEGER PRIMARY KEY AUTOINCREMENT, parent_id INTEGER, cod_mart TEXT, descrizione TEXT, partita_mag TEXT, qta REAL NOT NULL DEFAULT 0, num_cnf REAL NOT NULL DEFAULT 0, qta_cnf REAL NOT NULL DEFAULT 0, unt_mis TEXT NOT NULL DEFAULT '0', data_ora_inv INTEGER, scan_cod_barre TEXT, zona TEXT, remote_sync_date INTEGER, FOREIGN KEY(parent_id) REFERENCES inventari(_id) ON UPDATE NO ACTION ON DELETE NO ACTION )"); + database.execSQL("INSERT INTO inventario_rows_tmp SELECT * FROM inventario_rows"); + database.execSQL("DROP TABLE inventario_rows;"); + database.execSQL("ALTER TABLE inventario_rows_tmp RENAME TO inventario_rows;"); + database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__id ON inventario_rows (_id)"); + database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__parent_id ON inventario_rows (parent_id)"); + } + }; } diff --git a/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/entity/InventarioRowRoomDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/entity/InventarioRowRoomDTO.java index a4c3c5eb..3e4e851e 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/entity/InventarioRowRoomDTO.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/entity/InventarioRowRoomDTO.java @@ -49,7 +49,6 @@ public class InventarioRowRoomDTO extends BaseSyncDTO implements EntityModelInte @ColumnInfo(index = true, name = Columns.PARENT_ID) private Long parentId; - @NonNull @ColumnInfo(name = Columns.COD_MART) private String codMart; @@ -93,7 +92,6 @@ public class InventarioRowRoomDTO extends BaseSyncDTO implements EntityModelInte this.parentId = parentId; } - @NonNull public String getCodMart() { return codMart; } @@ -177,4 +175,48 @@ public class InventarioRowRoomDTO extends BaseSyncDTO implements EntityModelInte public void setZona(String zona) { this.zona = zona; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + InventarioRowRoomDTO that = (InventarioRowRoomDTO) o; + + if (getId() != null ? !getId().equals(that.getId()) : that.getId() != null) return false; + if (getParentId() != null ? !getParentId().equals(that.getParentId()) : that.getParentId() != null) + return false; + if (getCodMart() != null ? !getCodMart().equals(that.getCodMart()) : that.getCodMart() != null) + return false; + if (getPartitaMag() != null ? !getPartitaMag().equals(that.getPartitaMag()) : that.getPartitaMag() != null) + return false; + if (getDescrizione() != null ? !getDescrizione().equals(that.getDescrizione()) : that.getDescrizione() != null) + return false; + if (!getQta().equals(that.getQta())) return false; + if (!getNumConf().equals(that.getNumConf())) return false; + if (!getQtaConf().equals(that.getQtaConf())) return false; + if (!getUntMis().equals(that.getUntMis())) return false; + if (getDataOraInv() != null ? !getDataOraInv().equals(that.getDataOraInv()) : that.getDataOraInv() != null) + return false; + if (getScanCodBarre() != null ? !getScanCodBarre().equals(that.getScanCodBarre()) : that.getScanCodBarre() != null) + return false; + return getZona() != null ? getZona().equals(that.getZona()) : that.getZona() == null; + } + + @Override + public int hashCode() { + int result = getId() != null ? getId().hashCode() : 0; + result = 31 * result + (getParentId() != null ? getParentId().hashCode() : 0); + result = 31 * result + (getCodMart() != null ? getCodMart().hashCode() : 0); + result = 31 * result + (getPartitaMag() != null ? getPartitaMag().hashCode() : 0); + result = 31 * result + (getDescrizione() != null ? getDescrizione().hashCode() : 0); + result = 31 * result + getQta().hashCode(); + result = 31 * result + getNumConf().hashCode(); + result = 31 * result + getQtaConf().hashCode(); + result = 31 * result + getUntMis().hashCode(); + result = 31 * result + (getDataOraInv() != null ? getDataOraInv().hashCode() : 0); + result = 31 * result + (getScanCodBarre() != null ? getScanCodBarre().hashCode() : 0); + result = 31 * result + (getZona() != null ? getZona().hashCode() : 0); + return result; + } } diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/inventario/InventarioArtDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/inventario/InventarioArtDTO.java index d6561e6d..7254a0da 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/inventario/InventarioArtDTO.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/inventario/InventarioArtDTO.java @@ -1,6 +1,7 @@ package it.integry.integrywmsnative.core.rest.model.inventario; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; import it.integry.integrywmsnative.core.model.MtbAart; @@ -11,7 +12,7 @@ public class InventarioArtDTO { private String descrizione; private String untMis; private BigDecimal qtaCnf; - private List barcode; + private ArrayList barcode; private boolean flagTracciabilita; private boolean flagQtaCnfFissa; private BigDecimal giacenza; @@ -58,7 +59,7 @@ public class InventarioArtDTO { return barcode; } - public InventarioArtDTO setBarcode(List barcode) { + public InventarioArtDTO setBarcode(ArrayList barcode) { this.barcode = barcode; return this; } diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/inventario/picking/PickingInventarioActivity.java b/app/src/main/java/it/integry/integrywmsnative/gest/inventario/picking/PickingInventarioActivity.java index 7fc13d3a..4669b879 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/inventario/picking/PickingInventarioActivity.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/inventario/picking/PickingInventarioActivity.java @@ -12,7 +12,6 @@ import com.ravikoradiya.liveadapter.LiveAdapter; import com.ravikoradiya.liveadapter.Type; import java.math.BigDecimal; -import java.util.Date; import java.util.List; import java.util.Objects; @@ -133,7 +132,7 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn var itemType = new Type(R.layout.activity_picking_inventario__list_item, BR.item); itemType.areItemSame((oldItem, newItem) -> Objects.equals(oldItem.getId(), newItem.getId())); - itemType.areContentsTheSame((oldItem, newItem) -> Objects.equals(oldItem.getId(), newItem.getId())); + itemType.areContentsTheSame(InventarioRowRoomDTO::equals); itemType.onClick(x -> { new BottomSheetInventarioRowActionsView(x.getBinding().getItem()) .setListener(new BottomSheetInventarioRowActionsView.Listener() { @@ -190,7 +189,7 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn } @Override - public void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, String partitaMag, Date dataScad, boolean canOverflowOrderQuantity, boolean canPartitaMagBeChanged, boolean canLUBeClosed, RunnableArgss onComplete) { + public void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, boolean canOverflowOrderQuantity, boolean canPartitaMagBeChanged, boolean canLUBeClosed, RunnableArgss onComplete) { DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO() .setMtbAart(mtbAart) .setInitialNumCnf(initialNumCnf) @@ -202,8 +201,6 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn .setTotalQtaToBeTaken(totalQtaToBeTaken) .setTotalNumCnfToBeTaken(totalNumCnfToBeTaken) .setQtaCnfToBeTaken(qtaCnfToBeTaken) - .setPartitaMag(partitaMag) - .setDataScad(dataScad) .setCanOverflowOrderQuantity(canOverflowOrderQuantity) .setCanPartitaMagBeChanged(canPartitaMagBeChanged) .setCanLUBeClosed(canLUBeClosed) 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 7a4792b5..9743b815 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 @@ -7,10 +7,7 @@ import androidx.lifecycle.ViewModel; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.ArrayList; -import java.util.Date; import java.util.List; -import java.util.Random; -import java.util.stream.Collectors; import it.integry.barcode_base_android_library.model.BarcodeScanDTO; import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRoomDTO; @@ -66,27 +63,6 @@ public class PickingInventarioViewModel extends ViewModel { this.sendOnLoadingEnded(); } - private void generateRandomItems() { - for (int i = 0; i < 500; i++) { - Random r = new Random(); - int randomIndex = r.nextInt(availableInventarioArts.size()); - - - var item = getAvailableArts().get(randomIndex); - var itemMtbAart = item.toMtbAart(); - - var fakePickingObjectDto = new PickingObjectDTO() - .setMtbAart(itemMtbAart); - - var qta = BigDecimal.valueOf(r.nextInt(50)); - var numCnf = UtilityBigDecimal.multiply(qta, itemMtbAart.getQtaCnf()); - - saveNewRow(fakePickingObjectDto, qta, itemMtbAart.getQtaCnf(), numCnf, null, null); - } - - - } - public LiveData getCurrentInventario() { return currentInventario; } @@ -110,10 +86,18 @@ public class PickingInventarioViewModel extends ViewModel { } public void updateRow(InventarioRowRoomDTO itemToUpdate) { + var barcodeList = new ArrayList(); + barcodeList.add(itemToUpdate.getScanCodBarre()); + var matchedArt = availableInventarioArts.stream() - .filter(x -> x.getCodMart().contains(itemToUpdate.getCodMart())) + .filter(x -> itemToUpdate.getCodMart() != null && x.getCodMart().contains(itemToUpdate.getCodMart())) .findFirst() - .orElse(null); + .orElse(new InventarioArtDTO() + .setBarcode(barcodeList) + .setFlagQtaCnfFissa(true) + .setPlu(false) + .setUntMis(itemToUpdate.getUntMis()) + .setQtaCnf(itemToUpdate.getQtaConf())); var articolo = matchedArt.toMtbAart(); articolo.setFlagTracciabilita("N"); @@ -147,21 +131,29 @@ public class PickingInventarioViewModel extends ViewModel { } private void loadArticolo(String barcodeProd, Ean128Model ean128Model, Runnable onComplete) { - var matchedArts = availableInventarioArts.stream() + var barcodeList = new ArrayList(); + barcodeList.add(barcodeProd); + + var matchedArt = availableInventarioArts.stream() .filter(x -> x.getBarcode().contains(barcodeProd)) - .collect(Collectors.toList()); + .findFirst() + .orElse(new InventarioArtDTO() + .setBarcode(barcodeList) + .setFlagQtaCnfFissa(true) + .setPlu(false) + .setUntMis("PZ") + .setQtaCnf(BigDecimal.ONE)); - if (matchedArts.size() > 0) { - this.dispatchRowInsert(matchedArts.get(0), ean128Model); + if (matchedArt != null) { + this.dispatchRowInsert(barcodeProd, matchedArt, ean128Model); onComplete.run(); - - } else { + } else this.sendError(new NoResultFromBarcodeException(barcodeProd)); - } + } - private void dispatchRowInsert(InventarioArtDTO inventarioArtDTO, Ean128Model ean128Model) { + private void dispatchRowInsert(String barcode, InventarioArtDTO inventarioArtDTO, Ean128Model ean128Model) { var mtbAart = inventarioArtDTO.toMtbAart(); mtbAart.setFlagTracciabilita("N"); @@ -177,9 +169,6 @@ public class PickingInventarioViewModel extends ViewModel { BigDecimal initialQtaCnf; BigDecimal initialQtaTot; - String partitaMag = null; - Date dataScad = null; - if (pickingObjectDTO.getTempPickData() != null && pickingObjectDTO.getTempPickData().getManualPickDTO() != null) { //Oppure le info del barcode scansionato PickDataDTO.ManualPickDTO manualPickDTO = pickingObjectDTO.getTempPickData().getManualPickDTO(); @@ -228,11 +217,6 @@ public class PickingInventarioViewModel extends ViewModel { qtaColDaPrelevare = UtilityBigDecimal.multiply(numCnfDaPrelevare, qtaCnfDaPrelevare); } - if (manualPickDTO.getMtbPartitaMag() != null) { - partitaMag = manualPickDTO.getMtbPartitaMag().getPartitaMag(); - dataScad = manualPickDTO.getMtbPartitaMag().getDataScadD(); - } - initialNumCnf = numCnfDaPrelevare; initialQtaCnf = qtaCnfDaPrelevare; initialQtaTot = qtaColDaPrelevare; @@ -248,32 +232,39 @@ public class PickingInventarioViewModel extends ViewModel { initialQtaTot = UtilityBigDecimal.multiply(initialNumCnf, initialQtaCnf); } + if (inventarioArtDTO.isPlu()) { + this.saveNewRow(pickingObjectDTO, + initialNumCnf, + initialQtaCnf, + initialQtaTot, + null, + barcode); + } else { - this.sendOnItemDispatched( - pickingObjectDTO, - pickingObjectDTO.getMtbAart(), - null, //initialNumCnf, - initialQtaCnf, - null, //initialQtaTot, - null, - null, - null, - null, - null, - null, - partitaMag, - dataScad, - false, - true, - false, - (pickedQuantityDTO, shouldCloseLU) -> { - this.saveNewRow(pickingObjectDTO, - pickedQuantityDTO.getNumCnf(), - pickedQuantityDTO.getQtaCnf(), - pickedQuantityDTO.getQtaTot(), - pickedQuantityDTO.getPartitaMag(), - pickedQuantityDTO.getDataScad()); - }); + this.sendOnItemDispatched( + pickingObjectDTO, + pickingObjectDTO.getMtbAart(), + null, //initialNumCnf, + initialQtaCnf, + null, //initialQtaTot, + null, + null, + null, + null, + null, + null, + false, + true, + false, + (pickedQuantityDTO, shouldCloseLU) -> { + this.saveNewRow(pickingObjectDTO, + pickedQuantityDTO.getNumCnf(), + pickedQuantityDTO.getQtaCnf(), + pickedQuantityDTO.getQtaTot(), + pickedQuantityDTO.getPartitaMag(), + barcode); + }); + } } private void dispatchRowEdit(MtbAart mtbAart, InventarioRowRoomDTO inventarioRowRoomDTO) { @@ -290,8 +281,6 @@ public class PickingInventarioViewModel extends ViewModel { inventarioRowRoomDTO.getQta(), null, null, null, null, null, null, - inventarioRowRoomDTO.getPartitaMag(), - null, false, false, false, @@ -301,14 +290,13 @@ public class PickingInventarioViewModel extends ViewModel { pickedQuantityDTO.getNumCnf(), pickedQuantityDTO.getQtaCnf(), pickedQuantityDTO.getQtaTot(), - pickedQuantityDTO.getPartitaMag(), - pickedQuantityDTO.getDataScad()); + pickedQuantityDTO.getPartitaMag()); }); } - private void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad) { + private void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, String scanCodBarre) { final InventarioRowRoomDTO inventarioRow = new InventarioRowRoomDTO(); inventarioRow.setCodMart(pickingObjectDTO.getMtbAart().getCodMart()); inventarioRow.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa()); @@ -320,12 +308,13 @@ public class PickingInventarioViewModel extends ViewModel { inventarioRow.setDataOraInv(UtilityDate.getNowTime()); inventarioRow.setZona(currentInventario.getValue().getZona()); inventarioRow.setParentId(currentInventario.getValue().getId()); + inventarioRow.setScanCodBarre(scanCodBarre); inventarioRowRepository.insert(inventarioRow, () -> { }, this::sendError); } - private void saveEditedRow(InventarioRowRoomDTO inventarioRowRoomDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad) { + private void saveEditedRow(InventarioRowRoomDTO inventarioRowRoomDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag) { inventarioRowRoomDTO.setPartitaMag(partitaMag); inventarioRowRoomDTO.setQta(qtaTot); inventarioRowRoomDTO.setNumConf(numCnf); @@ -360,8 +349,6 @@ public class PickingInventarioViewModel extends ViewModel { BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, - String partitaMag, - Date dataScad, boolean canOverflowOrderQuantity, boolean canPartitaMagBeChanged, boolean canLUBeClosed, @@ -377,8 +364,6 @@ public class PickingInventarioViewModel extends ViewModel { totalQtaToBeTaken, totalNumCnfToBeTaken, qtaCnfToBeTaken, - partitaMag, - dataScad, canOverflowOrderQuantity, canPartitaMagBeChanged, canLUBeClosed, @@ -405,8 +390,6 @@ public class PickingInventarioViewModel extends ViewModel { BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, - String partitaMag, - Date dataScad, boolean canOverflowOrderQuantity, boolean canPartitaMagBeChanged, boolean canLUBeClosed, diff --git a/app/src/main/java/it/integry/integrywmsnative/view/dialogs/input_quantity_v2/DialogInputQuantityV2ViewModel.java b/app/src/main/java/it/integry/integrywmsnative/view/dialogs/input_quantity_v2/DialogInputQuantityV2ViewModel.java index e7d07115..75f3a5ab 100644 --- a/app/src/main/java/it/integry/integrywmsnative/view/dialogs/input_quantity_v2/DialogInputQuantityV2ViewModel.java +++ b/app/src/main/java/it/integry/integrywmsnative/view/dialogs/input_quantity_v2/DialogInputQuantityV2ViewModel.java @@ -107,7 +107,7 @@ public class DialogInputQuantityV2ViewModel { } else { this.internalNumCnf = totalNumCnfOrd; - this.internalQtaCnf = qtaCnfOrd; + this.internalQtaCnf = qtaCnfOrd != null ? qtaCnfOrd : initialQtaCnf; this.internalQtaTot = totalQtaOrd; } diff --git a/app/src/main/res/layout/activity_picking_inventario__list_item.xml b/app/src/main/res/layout/activity_picking_inventario__list_item.xml index 07248401..d79129ad 100644 --- a/app/src/main/res/layout/activity_picking_inventario__list_item.xml +++ b/app/src/main/res/layout/activity_picking_inventario__list_item.xml @@ -72,16 +72,29 @@ android:ellipsize="end" android:maxLines="2" android:text="@{item.descrizione}" + android:visibility="@{UtilityString.isNullOrEmpty(item.descrizione) ? View.GONE : View.VISIBLE}" tools:text="Descrizione lunga articolo" /> + + + From 04772057c165cd352cc468131d609d9fd4cd40ff Mon Sep 17 00:00:00 2001 From: GiuseppeS Date: Tue, 13 Dec 2022 15:41:45 +0100 Subject: [PATCH 6/6] -> v1.30.02 (320) --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 2ea373c2..4c940085 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services' android { - def appVersionCode = 319 - def appVersionName = '1.30.01' + def appVersionCode = 320 + def appVersionName = '1.30.02' signingConfigs { release {