diff --git a/app/schemas/it.integry.integrywmsnative.core.data_store.db.AppDatabase/20.json b/app/schemas/it.integry.integrywmsnative.core.data_store.db.AppDatabase/20.json index ed949ccb..1d0786ab 100644 --- a/app/schemas/it.integry.integrywmsnative.core.data_store.db.AppDatabase/20.json +++ b/app/schemas/it.integry.integrywmsnative.core.data_store.db.AppDatabase/20.json @@ -2,7 +2,7 @@ "formatVersion": 1, "database": { "version": 20, - "identityHash": "cc9ce7a63656299270eb6f768d6c0a5b", + "identityHash": "4f475ef508f955bf14cf0c9807add68e", "entities": [ { "tableName": "articoli_griglia", @@ -1196,7 +1196,7 @@ }, { "tableName": "trasferimento_pedane", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`cod_mdep_dest` TEXT NOT NULL, `descrizione_depo_dest` TEXT NOT NULL, `status` INTEGER NOT NULL, `created_at` INTEGER DEFAULT CURRENT_TIMESTAMP, `_id` INTEGER PRIMARY KEY AUTOINCREMENT, `remote_sync_date` INTEGER)", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`cod_mdep_dest` TEXT NOT NULL, `descrizione_depo_dest` TEXT NOT NULL, `status` INTEGER NOT NULL, `document_cod_anag` TEXT, `document_cod_dtip` TEXT, `document_num` INTEGER, `document_ser` TEXT, `document_data` INTEGER, `created_at` INTEGER DEFAULT CURRENT_TIMESTAMP, `_id` INTEGER PRIMARY KEY AUTOINCREMENT, `remote_sync_date` INTEGER)", "fields": [ { "fieldPath": "codMdepDest", @@ -1216,6 +1216,31 @@ "affinity": "INTEGER", "notNull": true }, + { + "fieldPath": "documentCodAnag", + "columnName": "document_cod_anag", + "affinity": "TEXT" + }, + { + "fieldPath": "documentCodDtip", + "columnName": "document_cod_dtip", + "affinity": "TEXT" + }, + { + "fieldPath": "documentNum", + "columnName": "document_num", + "affinity": "INTEGER" + }, + { + "fieldPath": "documentSer", + "columnName": "document_ser", + "affinity": "TEXT" + }, + { + "fieldPath": "documentData", + "columnName": "document_data", + "affinity": "INTEGER" + }, { "fieldPath": "createdAt", "columnName": "created_at", @@ -1340,7 +1365,7 @@ ], "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, 'cc9ce7a63656299270eb6f768d6c0a5b')" + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '4f475ef508f955bf14cf0c9807add68e')" ] } } \ No newline at end of file diff --git a/app/schemas/it.integry.integrywmsnative.core.data_store.db.AppDatabase/21.json b/app/schemas/it.integry.integrywmsnative.core.data_store.db.AppDatabase/21.json new file mode 100644 index 00000000..337e9203 --- /dev/null +++ b/app/schemas/it.integry.integrywmsnative.core.data_store.db.AppDatabase/21.json @@ -0,0 +1,1371 @@ +{ + "formatVersion": 1, + "database": { + "version": 21, + "identityHash": "4f475ef508f955bf14cf0c9807add68e", + "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" + }, + { + "fieldPath": "codMart", + "columnName": "cod_mart", + "affinity": "TEXT" + }, + { + "fieldPath": "descrizione", + "columnName": "descrizione", + "affinity": "TEXT" + }, + { + "fieldPath": "untMis", + "columnName": "unt_mis", + "affinity": "TEXT" + }, + { + "fieldPath": "qtaCnf", + "columnName": "qta_cnf", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "barCode", + "columnName": "bar_code", + "affinity": "TEXT" + }, + { + "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" + }, + { + "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": { + "autoGenerate": true, + "columnNames": [ + "articolo_griglia_id" + ] + }, + "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" + }, + { + "fieldPath": "descrLisa", + "columnName": "descr_lisa", + "affinity": "TEXT" + }, + { + "fieldPath": "descrDepo", + "columnName": "descr_depo", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "griglia_id" + ] + }, + "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`)" + } + ] + }, + { + "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, `cod_alis` TEXT)", + "fields": [ + { + "fieldPath": "ordineId", + "columnName": "ordine_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dataIns", + "columnName": "data_ins", + "affinity": "INTEGER" + }, + { + "fieldPath": "annotazioni", + "columnName": "annotazioni", + "affinity": "TEXT" + }, + { + "fieldPath": "transmitted", + "columnName": "transmitted", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "transmissionDate", + "columnName": "transmission_date", + "affinity": "INTEGER" + }, + { + "fieldPath": "gestione", + "columnName": "gestione", + "affinity": "TEXT" + }, + { + "fieldPath": "dataOrd", + "columnName": "data_ord", + "affinity": "INTEGER" + }, + { + "fieldPath": "numOrd", + "columnName": "num_ord", + "affinity": "INTEGER" + }, + { + "fieldPath": "codMdep", + "columnName": "cod_mdep", + "affinity": "TEXT" + }, + { + "fieldPath": "idGriglia", + "columnName": "id_griglia", + "affinity": "INTEGER" + }, + { + "fieldPath": "codAlis", + "columnName": "cod_alis", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "ordine_id" + ] + } + }, + { + "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, `cod_alis` 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" + }, + { + "fieldPath": "codMart", + "columnName": "cod_mart", + "affinity": "TEXT" + }, + { + "fieldPath": "descrizione", + "columnName": "descrizione", + "affinity": "TEXT" + }, + { + "fieldPath": "untMis", + "columnName": "unt_mis", + "affinity": "TEXT" + }, + { + "fieldPath": "qtaCnf", + "columnName": "qta_cnf", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "barCode", + "columnName": "bar_code", + "affinity": "TEXT" + }, + { + "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" + }, + { + "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" + }, + { + "fieldPath": "newNoPromo", + "columnName": "new_no_promo", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "systemNote", + "columnName": "system_note", + "affinity": "TEXT" + }, + { + "fieldPath": "codAlis", + "columnName": "cod_alis", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "articolo_ordine_id" + ] + }, + "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" + }, + { + "fieldPath": "gestione", + "columnName": "gestione", + "affinity": "TEXT" + }, + { + "fieldPath": "dataCollo", + "columnName": "data_collo", + "affinity": "INTEGER" + }, + { + "fieldPath": "serCollo", + "columnName": "ser_collo", + "affinity": "TEXT" + }, + { + "fieldPath": "numCollo", + "columnName": "num_collo", + "affinity": "INTEGER" + }, + { + "fieldPath": "rifOrd", + "columnName": "rif_ord", + "affinity": "TEXT" + }, + { + "fieldPath": "codAnag", + "columnName": "cod_anag", + "affinity": "TEXT" + }, + { + "fieldPath": "codVdes", + "columnName": "cod_vdes", + "affinity": "TEXT" + }, + { + "fieldPath": "codMdep", + "columnName": "cod_mdep", + "affinity": "TEXT" + }, + { + "fieldPath": "codVlis", + "columnName": "cod_vlis", + "affinity": "TEXT" + }, + { + "fieldPath": "codDtip", + "columnName": "cod_dtip", + "affinity": "TEXT" + }, + { + "fieldPath": "codTcol", + "columnName": "cod_tcol", + "affinity": "TEXT" + }, + { + "fieldPath": "serDoc", + "columnName": "ser_doc", + "affinity": "TEXT" + }, + { + "fieldPath": "annotazioni", + "columnName": "annotazioni", + "affinity": "TEXT" + }, + { + "fieldPath": "posizione", + "columnName": "posizione", + "affinity": "TEXT" + }, + { + "fieldPath": "codDtipProvv", + "columnName": "cod_dtip_provv", + "affinity": "TEXT" + }, + { + "fieldPath": "serDocProvv", + "columnName": "ser_doc_provv", + "affinity": "TEXT" + }, + { + "fieldPath": "codJfas", + "columnName": "cod_jfas", + "affinity": "TEXT" + }, + { + "fieldPath": "dataOrd", + "columnName": "data_ord", + "affinity": "INTEGER" + }, + { + "fieldPath": "dataDoc", + "columnName": "data_doc", + "affinity": "INTEGER" + }, + { + "fieldPath": "dataDocProvv", + "columnName": "data_doc_provv", + "affinity": "INTEGER" + }, + { + "fieldPath": "codMgrp", + "columnName": "cod_mgrp", + "affinity": "TEXT" + }, + { + "fieldPath": "dataVers", + "columnName": "data_vers", + "affinity": "INTEGER" + }, + { + "fieldPath": "segno", + "columnName": "segno", + "affinity": "INTEGER" + }, + { + "fieldPath": "numOrd", + "columnName": "num_ord", + "affinity": "INTEGER" + }, + { + "fieldPath": "numDoc", + "columnName": "num_doc", + "affinity": "INTEGER" + }, + { + "fieldPath": "numDocProvv", + "columnName": "num_doc_provv", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "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`)" + } + ] + }, + { + "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" + }, + { + "fieldPath": "gestione", + "columnName": "gestione", + "affinity": "TEXT" + }, + { + "fieldPath": "serCollo", + "columnName": "ser_collo", + "affinity": "TEXT" + }, + { + "fieldPath": "descrizione", + "columnName": "descrizione", + "affinity": "TEXT" + }, + { + "fieldPath": "numCollo", + "columnName": "num_collo", + "affinity": "INTEGER" + }, + { + "fieldPath": "riga", + "columnName": "riga", + "affinity": "INTEGER" + }, + { + "fieldPath": "rigaOrd", + "columnName": "riga_ord", + "affinity": "INTEGER" + }, + { + "fieldPath": "codMart", + "columnName": "cod_mart", + "affinity": "TEXT" + }, + { + "fieldPath": "codBarre", + "columnName": "cod_barre", + "affinity": "TEXT" + }, + { + "fieldPath": "codCol", + "columnName": "cod_col", + "affinity": "TEXT" + }, + { + "fieldPath": "codTagl", + "columnName": "cod_tagl", + "affinity": "TEXT" + }, + { + "fieldPath": "partitaMag", + "columnName": "partita_mag", + "affinity": "TEXT" + }, + { + "fieldPath": "gestioneRif", + "columnName": "gestione_rif", + "affinity": "TEXT" + }, + { + "fieldPath": "serColloRif", + "columnName": "ser_collo_rif", + "affinity": "TEXT" + }, + { + "fieldPath": "note", + "columnName": "note", + "affinity": "TEXT" + }, + { + "fieldPath": "dataOrd", + "columnName": "data_ord", + "affinity": "INTEGER" + }, + { + "fieldPath": "dataColloRif", + "columnName": "data_collo_rif", + "affinity": "INTEGER" + }, + { + "fieldPath": "qtaCnf", + "columnName": "qta_cnf", + "affinity": "REAL" + }, + { + "fieldPath": "qtaCol", + "columnName": "qta_col", + "affinity": "REAL" + }, + { + "fieldPath": "numOrd", + "columnName": "num_ord", + "affinity": "INTEGER" + }, + { + "fieldPath": "numEtich", + "columnName": "num_etich", + "affinity": "INTEGER" + }, + { + "fieldPath": "numColloRif", + "columnName": "num_collo_rif", + "affinity": "INTEGER" + }, + { + "fieldPath": "datetimeRow", + "columnName": "datetime_row", + "affinity": "INTEGER" + }, + { + "fieldPath": "codJcom", + "columnName": "cod_jcom", + "affinity": "TEXT" + }, + { + "fieldPath": "numCnf", + "columnName": "num_cnf", + "affinity": "REAL" + }, + { + "fieldPath": "causale", + "columnName": "causale", + "affinity": "TEXT" + }, + { + "fieldPath": "utente", + "columnName": "utente", + "affinity": "TEXT" + }, + { + "fieldPath": "codAnagDoc", + "columnName": "cod_anag_doc", + "affinity": "TEXT" + }, + { + "fieldPath": "codDtipDoc", + "columnName": "cod_dtip_doc", + "affinity": "TEXT" + }, + { + "fieldPath": "dataDoc", + "columnName": "data_doc", + "affinity": "INTEGER" + }, + { + "fieldPath": "serDoc", + "columnName": "ser_doc", + "affinity": "TEXT" + }, + { + "fieldPath": "numDoc", + "columnName": "num_doc", + "affinity": "INTEGER" + }, + { + "fieldPath": "idRigaDoc", + "columnName": "id_riga_doc", + "affinity": "INTEGER" + }, + { + "fieldPath": "untMis", + "columnName": "unt_mis", + "affinity": "TEXT" + }, + { + "fieldPath": "dataScad", + "columnName": "data_scad", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "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, `new` INTEGER, `remote_sync_date` INTEGER)", + "fields": [ + { + "fieldPath": "id", + "columnName": "_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "idInventario", + "columnName": "id_inventario", + "affinity": "INTEGER" + }, + { + "fieldPath": "codMdep", + "columnName": "cod_mdep", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "dataInventario", + "columnName": "data_inventario", + "affinity": "INTEGER" + }, + { + "fieldPath": "dataReg", + "columnName": "data_reg", + "affinity": "INTEGER" + }, + { + "fieldPath": "dataVer", + "columnName": "data_ver", + "affinity": "INTEGER" + }, + { + "fieldPath": "filtro", + "columnName": "filtro", + "affinity": "TEXT" + }, + { + "fieldPath": "flagStato", + "columnName": "flag_stato", + "affinity": "TEXT" + }, + { + "fieldPath": "flagOperazione", + "columnName": "flag_operazione", + "affinity": "TEXT" + }, + { + "fieldPath": "codAnag", + "columnName": "cod_anag", + "affinity": "TEXT" + }, + { + "fieldPath": "codDtip", + "columnName": "cod_dtip", + "affinity": "TEXT" + }, + { + "fieldPath": "inseritoDa", + "columnName": "inserito_da", + "affinity": "TEXT" + }, + { + "fieldPath": "registratoDa", + "columnName": "registrato_da", + "affinity": "TEXT" + }, + { + "fieldPath": "verificatoDa", + "columnName": "verificato_da", + "affinity": "TEXT" + }, + { + "fieldPath": "dataOraInizio", + "columnName": "data_ora_inizio", + "affinity": "INTEGER" + }, + { + "fieldPath": "dataOraFine", + "columnName": "data_ora_fine", + "affinity": "INTEGER" + }, + { + "fieldPath": "causale", + "columnName": "causale", + "affinity": "TEXT" + }, + { + "fieldPath": "zona", + "columnName": "zona", + "affinity": "TEXT" + }, + { + "fieldPath": "isNew", + "columnName": "new", + "affinity": "INTEGER" + }, + { + "fieldPath": "remoteSyncDate", + "columnName": "remote_sync_date", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "_id" + ] + }, + "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`)" + } + ] + }, + { + "tableName": "inventario_rows", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`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, `_id` INTEGER PRIMARY KEY AUTOINCREMENT, `remote_sync_date` INTEGER, FOREIGN KEY(`parent_id`) REFERENCES `inventari`(`_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "parentId", + "columnName": "parent_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "codMart", + "columnName": "cod_mart", + "affinity": "TEXT" + }, + { + "fieldPath": "partitaMag", + "columnName": "partita_mag", + "affinity": "TEXT" + }, + { + "fieldPath": "descrizione", + "columnName": "descrizione", + "affinity": "TEXT" + }, + { + "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" + }, + { + "fieldPath": "scanCodBarre", + "columnName": "scan_cod_barre", + "affinity": "TEXT" + }, + { + "fieldPath": "zona", + "columnName": "zona", + "affinity": "TEXT" + }, + { + "fieldPath": "id", + "columnName": "_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "remoteSyncDate", + "columnName": "remote_sync_date", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "_id" + ] + }, + "indices": [ + { + "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`)" + }, + { + "name": "index_inventario_rows__id", + "unique": false, + "columnNames": [ + "_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_inventario_rows__id` ON `${TABLE_NAME}` (`_id`)" + } + ], + "foreignKeys": [ + { + "table": "inventari", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "parent_id" + ], + "referencedColumns": [ + "_id" + ] + } + ] + }, + { + "tableName": "verifica_giacenze", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`cod_mdep` TEXT NOT NULL, `data` INTEGER, `_id` INTEGER PRIMARY KEY AUTOINCREMENT, `remote_sync_date` INTEGER)", + "fields": [ + { + "fieldPath": "codMdep", + "columnName": "cod_mdep", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "data", + "columnName": "data", + "affinity": "INTEGER" + }, + { + "fieldPath": "id", + "columnName": "_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "remoteSyncDate", + "columnName": "remote_sync_date", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "_id" + ] + }, + "indices": [ + { + "name": "index_verifica_giacenze__id", + "unique": false, + "columnNames": [ + "_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_verifica_giacenze__id` ON `${TABLE_NAME}` (`_id`)" + } + ] + }, + { + "tableName": "verifica_giacenze_rows", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`parent_id` INTEGER, `created_at` INTEGER DEFAULT CURRENT_TIMESTAMP, `cod_mart` TEXT, `partita_mag` TEXT, `descrizione` TEXT, `qta_in_giacenza` REAL NOT NULL DEFAULT 0, `qta` REAL NOT NULL DEFAULT 0, `num_cnf` REAL NOT NULL DEFAULT 0, `qta_cnf` REAL NOT NULL DEFAULT 0, `scan_cod_barre` TEXT, `_id` INTEGER PRIMARY KEY AUTOINCREMENT, `remote_sync_date` INTEGER, FOREIGN KEY(`parent_id`) REFERENCES `verifica_giacenze`(`_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "parentId", + "columnName": "parent_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "INTEGER", + "defaultValue": "CURRENT_TIMESTAMP" + }, + { + "fieldPath": "codMart", + "columnName": "cod_mart", + "affinity": "TEXT" + }, + { + "fieldPath": "partitaMag", + "columnName": "partita_mag", + "affinity": "TEXT" + }, + { + "fieldPath": "descrizione", + "columnName": "descrizione", + "affinity": "TEXT" + }, + { + "fieldPath": "qtaInGiacenza", + "columnName": "qta_in_giacenza", + "affinity": "REAL", + "notNull": true, + "defaultValue": "0" + }, + { + "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": "scanCodBarre", + "columnName": "scan_cod_barre", + "affinity": "TEXT" + }, + { + "fieldPath": "id", + "columnName": "_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "remoteSyncDate", + "columnName": "remote_sync_date", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "_id" + ] + }, + "indices": [ + { + "name": "index_verifica_giacenze_rows_parent_id", + "unique": false, + "columnNames": [ + "parent_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_verifica_giacenze_rows_parent_id` ON `${TABLE_NAME}` (`parent_id`)" + }, + { + "name": "index_verifica_giacenze_rows__id", + "unique": false, + "columnNames": [ + "_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_verifica_giacenze_rows__id` ON `${TABLE_NAME}` (`_id`)" + } + ], + "foreignKeys": [ + { + "table": "verifica_giacenze", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "parent_id" + ], + "referencedColumns": [ + "_id" + ] + } + ] + }, + { + "tableName": "trasferimento_pedane", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`cod_mdep_dest` TEXT NOT NULL, `descrizione_depo_dest` TEXT NOT NULL, `status` INTEGER NOT NULL, `document_cod_anag` TEXT, `document_cod_dtip` TEXT, `document_num` INTEGER, `document_ser` TEXT, `document_data` INTEGER, `created_at` INTEGER DEFAULT CURRENT_TIMESTAMP, `_id` INTEGER PRIMARY KEY AUTOINCREMENT, `remote_sync_date` INTEGER)", + "fields": [ + { + "fieldPath": "codMdepDest", + "columnName": "cod_mdep_dest", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "descrizioneDepoDest", + "columnName": "descrizione_depo_dest", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "documentCodAnag", + "columnName": "document_cod_anag", + "affinity": "TEXT" + }, + { + "fieldPath": "documentCodDtip", + "columnName": "document_cod_dtip", + "affinity": "TEXT" + }, + { + "fieldPath": "documentNum", + "columnName": "document_num", + "affinity": "INTEGER" + }, + { + "fieldPath": "documentSer", + "columnName": "document_ser", + "affinity": "TEXT" + }, + { + "fieldPath": "documentData", + "columnName": "document_data", + "affinity": "INTEGER" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "INTEGER", + "defaultValue": "CURRENT_TIMESTAMP" + }, + { + "fieldPath": "id", + "columnName": "_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "remoteSyncDate", + "columnName": "remote_sync_date", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "_id" + ] + }, + "indices": [ + { + "name": "index_trasferimento_pedane__id", + "unique": false, + "columnNames": [ + "_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_trasferimento_pedane__id` ON `${TABLE_NAME}` (`_id`)" + } + ] + }, + { + "tableName": "trasferimento_pedane_rows", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`parent_id` INTEGER NOT NULL, `barcode_ul` TEXT NOT NULL, `progressivo_ul` INTEGER NOT NULL, `flag_inconsistent` INTEGER NOT NULL DEFAULT 0, `created_at` INTEGER DEFAULT CURRENT_TIMESTAMP, `_id` INTEGER PRIMARY KEY AUTOINCREMENT, `remote_sync_date` INTEGER, FOREIGN KEY(`parent_id`) REFERENCES `trasferimento_pedane`(`_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "parentId", + "columnName": "parent_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "barcodeUl", + "columnName": "barcode_ul", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "progressivoUl", + "columnName": "progressivo_ul", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "flagInconsistent", + "columnName": "flag_inconsistent", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "createdAt", + "columnName": "created_at", + "affinity": "INTEGER", + "defaultValue": "CURRENT_TIMESTAMP" + }, + { + "fieldPath": "id", + "columnName": "_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "remoteSyncDate", + "columnName": "remote_sync_date", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "_id" + ] + }, + "indices": [ + { + "name": "index_trasferimento_pedane_rows_parent_id", + "unique": false, + "columnNames": [ + "parent_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_trasferimento_pedane_rows_parent_id` ON `${TABLE_NAME}` (`parent_id`)" + }, + { + "name": "index_trasferimento_pedane_rows__id", + "unique": false, + "columnNames": [ + "_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_trasferimento_pedane_rows__id` ON `${TABLE_NAME}` (`_id`)" + } + ], + "foreignKeys": [ + { + "table": "trasferimento_pedane", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "parent_id" + ], + "referencedColumns": [ + "_id" + ] + } + ] + } + ], + "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, '4f475ef508f955bf14cf0c9807add68e')" + ] + } +} \ 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 d7239df1..50c13300 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 @@ -53,7 +53,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.VerificaGiacenzeRow TrasferimentoPedaneEntity.class, TrasferimentoPedaneRowEntity.class }, - version = 20) + version = 21) @TypeConverters({ DateConverter.class, BigDecimalConverter.class, @@ -85,7 +85,8 @@ public abstract class AppDatabase extends RoomDatabase { .addMigrations(MIGRATION_16_17) .addMigrations(MIGRATION_17_18) .addMigrations(MIGRATION_18_19) - .addMigrations(MIGRATION_19_20); + .addMigrations(MIGRATION_19_20) + .addMigrations(MIGRATION_20_21); sInstance = builder.build(); } @@ -276,4 +277,24 @@ public abstract class AppDatabase extends RoomDatabase { database.execSQL("CREATE INDEX IF NOT EXISTS index_trasferimento_pedane_rows_parent_id ON trasferimento_pedane_rows (parent_id)"); } }; + + static final Migration MIGRATION_20_21 = new Migration(20, 21) { + @Override + public void migrate(@NonNull SupportSQLiteDatabase database) { + database.execSQL("ALTER TABLE trasferimento_pedane" + + " ADD COLUMN document_cod_anag TEXT;"); + + database.execSQL("ALTER TABLE trasferimento_pedane" + + " ADD COLUMN document_cod_dtip TEXT"); + + database.execSQL("ALTER TABLE trasferimento_pedane" + + " ADD COLUMN document_num INTEGER"); + + database.execSQL("ALTER TABLE trasferimento_pedane" + + " ADD COLUMN document_ser TEXT"); + + database.execSQL("ALTER TABLE trasferimento_pedane" + + " ADD COLUMN document_data INTEGER"); + } + }; } diff --git a/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/entity/TrasferimentoPedaneEntity.java b/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/entity/TrasferimentoPedaneEntity.java index 0c186f61..a973b10e 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/entity/TrasferimentoPedaneEntity.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/data_store/db/entity/TrasferimentoPedaneEntity.java @@ -5,6 +5,7 @@ import androidx.room.ColumnInfo; import androidx.room.Entity; import androidx.room.Ignore; +import java.time.LocalDate; import java.time.LocalDateTime; import java.util.List; @@ -23,6 +24,12 @@ public class TrasferimentoPedaneEntity extends BaseSyncDTO implements EntityMode public static final String COD_MDEP_DEST = "cod_mdep_dest"; public static final String DESCRIZIONE_DEPO_DEST = "descrizione_depo_dest"; public static final String STATUS = "status"; + public static final String DOCUMENT_COD_ANAG = "document_cod_anag"; + public static final String DOCUMENT_COD_DTIP = "document_cod_dtip"; + public static final String DOCUMENT_NUM = "document_num"; + public static final String DOCUMENT_SER = "document_ser"; + public static final String DOCUMENT_DATA = "document_data"; + public static final String CREATED_AT = "created_at"; } @@ -38,6 +45,21 @@ public class TrasferimentoPedaneEntity extends BaseSyncDTO implements EntityMode @ColumnInfo(name = Columns.STATUS) private short status = TrasferimentoPedaneStatusEnum.APERTO.getValue(); + @ColumnInfo(name = Columns.DOCUMENT_COD_ANAG) + private String documentCodAnag; + + @ColumnInfo(name = Columns.DOCUMENT_COD_DTIP) + private String documentCodDtip; + + @ColumnInfo(name = Columns.DOCUMENT_NUM) + private Integer documentNum; + + @ColumnInfo(name = Columns.DOCUMENT_SER) + private String documentSer; + + @ColumnInfo(name = Columns.DOCUMENT_DATA) + private LocalDate documentData; + @ColumnInfo(name = TrasferimentoPedaneEntity.Columns.CREATED_AT, defaultValue = "CURRENT_TIMESTAMP") private LocalDateTime createdAt = LocalDateTime.now(); @@ -70,6 +92,46 @@ public class TrasferimentoPedaneEntity extends BaseSyncDTO implements EntityMode this.status = status; } + public String getDocumentCodAnag() { + return documentCodAnag; + } + + public void setDocumentCodAnag(String documentCodAnag) { + this.documentCodAnag = documentCodAnag; + } + + public String getDocumentCodDtip() { + return documentCodDtip; + } + + public void setDocumentCodDtip(String documentCodDtip) { + this.documentCodDtip = documentCodDtip; + } + + public Integer getDocumentNum() { + return documentNum; + } + + public void setDocumentNum(Integer documentNum) { + this.documentNum = documentNum; + } + + public String getDocumentSer() { + return documentSer; + } + + public void setDocumentSer(String documentSer) { + this.documentSer = documentSer; + } + + public LocalDate getDocumentData() { + return documentData; + } + + public void setDocumentData(LocalDate documentData) { + this.documentData = documentData; + } + public LocalDateTime getCreatedAt() { return createdAt; } diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/TrasferimentoPedaneRESTConsumer.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/TrasferimentoPedaneRESTConsumer.java index a56382b3..6a39693e 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/TrasferimentoPedaneRESTConsumer.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/TrasferimentoPedaneRESTConsumer.java @@ -6,6 +6,7 @@ import java.util.concurrent.ExecutorService; import javax.inject.Inject; import javax.inject.Singleton; +import it.integry.integrywmsnative.core.model.MtbColt; import it.integry.integrywmsnative.core.rest.RESTBuilder; import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse; import it.integry.integrywmsnative.core.rest.model.trasferimento_pedane.SaveTrasferimentoPedaneRequestDTO; @@ -24,15 +25,17 @@ public class TrasferimentoPedaneRESTConsumer extends _BaseRESTConsumer { this.executorService = executorService; } - public void makeSynchronousSaveRequest(String codMdepDest, List barcodeUlList) throws Exception { + public MtbColt makeSynchronousSaveRequest(String codMdepDest, List barcodeUlList) throws Exception { var service = restBuilder.getService(TrasferimentoPedaneRESTConsumerService.class); - Response> response = service.save(new SaveTrasferimentoPedaneRequestDTO() {{ + Response> response = service.save(new SaveTrasferimentoPedaneRequestDTO() {{ setCodMdepDest(codMdepDest); setBarcodeUlList(barcodeUlList); }}) .execute(); - analyzeAnswer(response, "save-trasferimento-pedane"); + var data = analyzeAnswer(response, "save-trasferimento-pedane"); + + return data; } } diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/TrasferimentoPedaneRESTConsumerService.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/TrasferimentoPedaneRESTConsumerService.java index a53f4075..4ed43105 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/TrasferimentoPedaneRESTConsumerService.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/TrasferimentoPedaneRESTConsumerService.java @@ -1,5 +1,6 @@ package it.integry.integrywmsnative.core.rest.consumers; +import it.integry.integrywmsnative.core.model.MtbColt; import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse; import it.integry.integrywmsnative.core.rest.model.trasferimento_pedane.SaveTrasferimentoPedaneRequestDTO; import retrofit2.Call; @@ -9,7 +10,7 @@ import retrofit2.http.POST; public interface TrasferimentoPedaneRESTConsumerService { @POST("wms/trasferimento/save") - Call> save(@Body SaveTrasferimentoPedaneRequestDTO requestData); + Call> save(@Body SaveTrasferimentoPedaneRequestDTO requestData); } diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/trasferimento_pedane/edit/TrasferimentoPedaneEditActivity.java b/app/src/main/java/it/integry/integrywmsnative/gest/trasferimento_pedane/edit/TrasferimentoPedaneEditActivity.java index 236c3597..35521dce 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/trasferimento_pedane/edit/TrasferimentoPedaneEditActivity.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/trasferimento_pedane/edit/TrasferimentoPedaneEditActivity.java @@ -206,6 +206,11 @@ public class TrasferimentoPedaneEditActivity extends BaseActivity implements Tra } + + public void printDocument() { + String tmp = ""; + } + @Override public void onTrasferimentoCompleted() { handler.post(this::finish); diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/trasferimento_pedane/edit/TrasferimentoPedaneEditViewModel.java b/app/src/main/java/it/integry/integrywmsnative/gest/trasferimento_pedane/edit/TrasferimentoPedaneEditViewModel.java index de289c82..da1f4854 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/trasferimento_pedane/edit/TrasferimentoPedaneEditViewModel.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/trasferimento_pedane/edit/TrasferimentoPedaneEditViewModel.java @@ -41,6 +41,7 @@ public class TrasferimentoPedaneEditViewModel { private TrasferimentoPedaneEntity currentTrasferimentoPedane; private MutableLiveData> rowsLiveData = new MutableLiveData<>(); private MutableLiveData canBeModifiedLiveData = new MutableLiveData<>(false); + private MutableLiveData canBePrintedLiveData = new MutableLiveData<>(false); private Listener listener; @@ -68,6 +69,7 @@ public class TrasferimentoPedaneEditViewModel { executorService.execute(() -> { this.currentTrasferimentoPedane = trasferimentoPedaneRepository.retrieve(trasferimentoPedaneId); canBeModifiedLiveData.postValue(this.currentTrasferimentoPedane.getStatusEnum() == TrasferimentoPedaneStatusEnum.APERTO); + canBePrintedLiveData.postValue(this.currentTrasferimentoPedane.getDocumentCodDtip() != null); var tmpLiveData = trasferimentoPedaneRowRepository.retrieve(trasferimentoPedaneId); @@ -210,7 +212,17 @@ public class TrasferimentoPedaneEditViewModel { .map(TrasferimentoPedaneRowEntity::getBarcodeUl) .collect(Collectors.toUnmodifiableList()); - trasferimentoPedaneRESTConsumer.makeSynchronousSaveRequest(currentTrasferimentoPedane.getCodMdepDest(), barcodes); + var generatedMovement = trasferimentoPedaneRESTConsumer.makeSynchronousSaveRequest(currentTrasferimentoPedane.getCodMdepDest(), barcodes); + + var documentKey = generatedMovement.getDocumentKey(); + + if(documentKey != null) { + currentTrasferimentoPedane.setDocumentCodAnag(documentKey.getCodAnag()); + currentTrasferimentoPedane.setDocumentCodDtip(documentKey.getCodDtip()); + currentTrasferimentoPedane.setDocumentData(documentKey.getDataDoc()); + currentTrasferimentoPedane.setDocumentNum(documentKey.getNumDoc()); + currentTrasferimentoPedane.setDocumentSer(documentKey.getSerDoc()); + } currentTrasferimentoPedane.setStatus(TrasferimentoPedaneStatusEnum.COMPLETATO.getValue()); currentTrasferimentoPedane.setRemoteSyncDate(LocalDateTime.now()); @@ -231,6 +243,10 @@ public class TrasferimentoPedaneEditViewModel { return canBeModifiedLiveData; } + public LiveData canBePrintedLiveData() { + return canBePrintedLiveData; + } + public void setListener(Listener listener) { this.listener = listener; } diff --git a/app/src/main/res/layout/activity_traferimento_pedane_edit.xml b/app/src/main/res/layout/activity_traferimento_pedane_edit.xml index 8bb00a0a..2e4cde7d 100644 --- a/app/src/main/res/layout/activity_traferimento_pedane_edit.xml +++ b/app/src/main/res/layout/activity_traferimento_pedane_edit.xml @@ -126,6 +126,19 @@ app:layout_constraintRight_toRightOf="parent" app:layout_constraintBottom_toBottomOf="parent" style="?attr/floatingActionButtonPrimaryStyle" /> + +