Compare commits

...

386 Commits

Author SHA1 Message Date
51f9e1f58c Finish v1.44.07(476) 2025-02-28 11:51:15 +01:00
6747ee077b -> v1.44.07 (476) 2025-02-28 11:51:11 +01:00
e11e270101 Migliorata gestione caricamenti del Picking libero. 2025-02-28 11:50:11 +01:00
bc27355ed6 Finish Release-2 2025-02-26 11:05:35 +01:00
078d9af116 Finish Release-2 2025-02-26 11:05:34 +01:00
9b14e1186e -> v1.44.06 (475) 2025-02-26 11:05:30 +01:00
779c606c2a Fix vari 2025-02-26 11:04:34 +01:00
581e56a245 Finish Release-1 2025-02-26 10:25:30 +01:00
7f468e19bd Finish Release-1 2025-02-26 10:25:29 +01:00
e8a511d49e -> v1.44.05 (474) 2025-02-26 10:25:25 +01:00
1988ad993f Implementato pulsante di verifica aggiornamenti nelle settings 2025-02-26 10:24:28 +01:00
6105c44dab Gestita installazione delle versioni beta 2025-02-26 10:04:02 +01:00
d3b7cd8cd6 Aggiunta impostazione che permette di abilitare la ricezione degli aggiornamenti beta 2025-02-25 16:52:09 +01:00
36c48f28d1 Finish v1.44.04(473) 2025-02-24 15:31:21 +01:00
93b18531ab Finish v1.44.04(473) 2025-02-24 15:31:21 +01:00
27edd84442 -> v1.44.04 (473) 2025-02-24 15:31:16 +01:00
e24e6858fb Fix su commessa nulla nel caso di picking libero 2025-02-24 15:30:34 +01:00
fa10973626 Migliorata gestione status code nel caso di UnauthorizedAccess nell'interceptor 2025-02-21 11:55:45 +01:00
521e2fe62b Finish v1.44.03(472) 2025-02-19 12:43:54 +01:00
7e7938ea1a Finish v1.44.03(472) 2025-02-19 12:43:53 +01:00
4fe48bd02a -> v1.44.03 (472) 2025-02-19 12:43:48 +01:00
f26bc28ba1 Fix su DialogProgressView 2025-02-19 12:42:58 +01:00
aaf8b96070 Finish v1.44.02(471) 2025-02-19 10:13:14 +01:00
c5720059f3 Finish v1.44.02(471) 2025-02-19 10:13:13 +01:00
361faf235d -> v1.44.02 (471) 2025-02-19 10:13:09 +01:00
f85f5d63a6 Fix su gestione access token negli interceptor 2025-02-19 10:09:10 +01:00
526bc11626 Fix su gestione rif nulla in bottomsheet 2025-02-19 09:37:09 +01:00
95d73b5bc5 Finish v1.44.01(470) 2025-02-18 13:24:11 +01:00
73e0f03886 Finish v1.44.01(470) 2025-02-18 13:24:11 +01:00
91bc82ed16 -> v1.44.01 (470) 2025-02-18 13:24:05 +01:00
c6a30588e6 Migliorata gestione di token scaduto in AuthInterceptor 2025-02-18 13:22:24 +01:00
26c09c02ab Finish v1.44.00(469) 2025-02-17 10:24:12 +01:00
c34e6723d8 Finish v1.44.00(469) 2025-02-17 10:24:11 +01:00
bf2a039700 -> v1.44.00 (469) 2025-02-17 10:24:07 +01:00
cebe5afd0a Fix di retrocompatibilità 2025-02-17 10:23:11 +01:00
2e8e4c0ccc Merge branch 'refs/heads/feature/TokenAuthentication' into develop 2025-02-17 09:54:33 +01:00
1c5c8c61cf Fix su UpdatesManager 2025-02-12 18:11:05 +01:00
726d9fd29c Fix login oauth 2025-02-12 16:28:08 +01:00
d7eeeeeac2 Merge branch 'develop' into feature/TokenAuthentication
# Conflicts:
#	.idea/deploymentTargetSelector.xml
#	app/build.gradle
#	app/src/main/java/it/integry/integrywmsnative/core/menu/MenuRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ArticoloRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/AziendaRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/DocumentRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/GestSetupRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/GiacenzaRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ImballiRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/PosizioniRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/PrinterRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/SystemRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/gest/accettazione_ordini_elenco/rest/OrdiniAccettazioneRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/gest/contab_doc_interni/rest/DocInterniRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/gest/login/rest/LoginRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/gest/prod_accettazione_ord_produzione/rest/ProdOrdineProduzioneRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/gest/prod_rientro_merce/order_detail/ProdRientroMerceOrderDetailModule.java
#	app/src/main/java/it/integry/integrywmsnative/gest/prod_rientro_merce/order_detail/rest/ProdRientroMerceOrderDetailRESTConsumer.java
2025-02-11 10:34:36 +01:00
ee72f8364e Finish v1.43.03(468) 2025-02-11 10:33:15 +01:00
a95ff0b0e5 Finish v1.43.03(468) 2025-02-11 10:33:13 +01:00
57ced048a0 -> v1.43.03 (468) 2025-02-11 10:33:06 +01:00
ca545e2d44 Vario 2025-02-11 10:31:36 +01:00
0b777137d5 Fix su DialogProgressView.
Aggiunto barcodeUl nel caso venga battezzata un'etichetta fornitore in DialogScanOrCreateLU.
2025-02-10 18:24:50 +01:00
d19f4de424 Merge remote-tracking branch 'origin/develop' into develop 2025-02-10 17:24:34 +01:00
56d509b07b In inputQuantity l'avviso partita inattiva non è più bloccante ma chiede di continuare 2025-02-10 17:24:30 +01:00
fe3a9d84d5 Fix su DialogProgressView.
Aggiunto barcodeUl nel caso venga battezzata un'etichetta anonima in DialogScanOrCreateLU.
2025-02-10 16:52:55 +01:00
dc38311125 Sostituito FBToast con snackbar nativo.
Rimosse librerie inutilizzate.
2025-02-06 15:11:21 +01:00
bce8f2a8b7 Fix visibilità posizione in rettifica giacenze 2025-02-05 12:59:35 +01:00
13ec0c745e Creato nuovo dialog per notificare gli aggiornamenti dell'app 2025-02-04 11:50:19 +01:00
b5f7e12f5a Fix post merge 2025-02-04 10:25:58 +01:00
90e8ff128c Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	app/src/main/java/it/integry/integrywmsnative/gest/accettazione_bolla_picking/AccettazioneBollaPickingViewModel.java
2025-02-04 10:08:13 +01:00
998b1057e0 Sostituiti controlli su size == 0 con isEmpty() sulle liste 2025-02-04 09:55:34 +01:00
d4a7dee121 Migrata gestione del recupero materiale in un servizio dedicato 2025-02-04 09:48:03 +01:00
e85e05a526 Aggiunto filtro commessa in Rientro Merce 2025-01-27 13:04:15 +01:00
7f953e78cf Finish v1.43.02(467) 2025-01-24 18:38:31 +01:00
8b536eb0b0 Finish v1.43.02(467) 2025-01-24 18:38:30 +01:00
f390548d66 -> v1.43.02 (467) 2025-01-24 18:38:22 +01:00
c6a2b8c6ea In accettazione bolla fatto in modo che vengono riconosciuti i kit quando leggono i componenti 2025-01-24 18:36:47 +01:00
a046e31412 Migliorati errori letti dalle chiamate REST 2025-01-24 18:09:27 +01:00
716f6d4daa Merge branch 'develop' into feature/GestioneDocumentiLavorazione 2025-01-23 11:48:12 +01:00
9b451ff1bc Merge 2025-01-22 10:30:16 +01:00
6d48182d90 Finish v1.43.01(466) 2025-01-21 13:07:14 +01:00
e3d8defa5b Finish v1.43.01(466) 2025-01-21 13:07:13 +01:00
dc24b43311 -> v1.43.01 (466) 2025-01-21 13:07:06 +01:00
75f55ebd44 Fix null point in retrieveImballiSyncronized 2025-01-21 13:05:14 +01:00
09cebb1c7e Merge branch 'develop' into feature/GestioneDocumentiLavorazione
# Conflicts:
#	app/src/main/java/it/integry/integrywmsnative/gest/prod_rientro_merce/order_detail/ProdRientroMerceOrderDetailPickedQuantityDTO.java
#	app/src/main/java/it/integry/integrywmsnative/view/dialogs/input_lu_prod/adapter/DialogInputLUProdTipoColloAdapter.java
#	build.gradle
2025-01-20 18:19:28 +01:00
9dc0935cc1 Finish v1.43.00(465) 2025-01-20 17:57:59 +01:00
5bfd695f2d Finish v1.43.00(465) 2025-01-20 17:57:58 +01:00
8e0b05b6af -> v1.43.00 (465) 2025-01-20 17:57:54 +01:00
ddc441e76e Refactoring UI di ContenutoBancale.
Refactoring del model MtbTcol, adesso è completamente observable.
2025-01-20 17:57:05 +01:00
20602cadb5 Fix sulla descrizione durante il salvataggio di un nuovo articolo 2025-01-20 12:54:54 +01:00
416ac0a2a5 Finish v1.42.04(463) 2025-01-17 13:14:36 +01:00
49933c8493 Finish v1.42.04(463) 2025-01-17 13:14:34 +01:00
b1bc72a1a5 -> v1.42.04 (464) 2025-01-17 13:14:29 +01:00
c498a373f5 Rimosso layout dialog_ask_should_print.xml non più utilizzato 2025-01-17 13:13:34 +01:00
bd04d6263e Aggiornati build.gradle
# Conflicts:
#	app/src/main/java/it/integry/integrywmsnative/MainApplicationComponent.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumerService.java
#	app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java
2025-01-17 13:12:12 +01:00
fbe9244000 Merge branch 'develop' into feature/GestioneDocumentiLavorazione
# Conflicts:
#	app/src/main/java/it/integry/integrywmsnative/MainApplicationComponent.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumerService.java
#	app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java
2025-01-17 10:20:50 +01:00
6e52a3c0c7 Finish v1.42.03(463) 2025-01-16 16:57:33 +01:00
9f92274720 Finish v1.42.03(463) 2025-01-16 16:57:33 +01:00
6d431bb251 -> v1.42.03 (463) 2025-01-16 16:57:28 +01:00
5265b949af Eliminato vecchio dialog di richiesta stampa (sostituito con DialogYesNo) 2025-01-16 16:56:40 +01:00
db875491d0 Merge remote-tracking branch 'origin/develop' into develop 2025-01-16 16:47:46 +01:00
778fdff69a Implementato cambio deposito in Spedizione (basandosi sulla prima UDC scansionata).
Aggiornata icona app.
2025-01-16 16:47:18 +01:00
4b54aa3c02 In fase di accettazione in inputQuantity proporre uno nelle confezioni non la quantità presente in bolla 2025-01-15 16:15:33 +01:00
019688a5cc In accettazione da bolla l'ultima referenza scansionata deve comparire all'inizio dell'elenco 2025-01-15 16:02:01 +01:00
00fc3a59eb Aggiunta possibilità di variare l'ordinamento avanti elenco accettazione bolla 2025-01-15 15:28:05 +01:00
e5244e75a3 Nelle righe dell'inventario aggiunto id dispositivo 2025-01-15 12:05:50 +01:00
cb77c21656 Implementato switch deposito in home page 2025-01-13 15:54:23 +01:00
7b0f7f16ba Fix after merge 2025-01-08 17:40:10 +01:00
e23446654d Finish v1.42.02(462) 2025-01-08 14:48:25 +01:00
b3641534c9 Finish v1.42.02(462) 2025-01-08 14:48:25 +01:00
a3a5f65e53 -> v1.42.02 (462) 2025-01-08 14:48:07 +01:00
d5c0f388db Ripristinato controllo su percentuale hr 2025-01-07 10:23:06 +01:00
8ae3820aa2 Merge branch 'develop' into feature/GestioneDocumentiLavorazione
# Conflicts:
#	app/build.gradle
#	app/src/main/java/it/integry/integrywmsnative/MainApplicationComponent.java
#	app/src/main/java/it/integry/integrywmsnative/core/settings/DBSettingsModel.java
#	app/src/main/java/it/integry/integrywmsnative/core/settings/SettingsManager.java
#	app/src/main/java/it/integry/integrywmsnative/gest/prod_recupero_materiale/rest/ProdRecuperMaterialeRESTConsumer.java
#	app/src/main/java/it/integry/integrywmsnative/view/dialogs/DialogProgressView.java
2025-01-07 10:06:05 +01:00
ac6f64d494 Fix cancellazione e modifica ul in Accettazione bolla 2024-12-19 10:09:42 +01:00
9d001f8896 Finish v1.42.01(461) 2024-12-10 11:02:45 +01:00
24e9cffeea Finish v1.42.01(461) 2024-12-10 11:02:44 +01:00
b0f2763a85 -> v1.42.01 (461) 2024-12-10 11:02:38 +01:00
cc343c296f Fix su null quando viene creato un nuovo articolo e deve avviare automaticamente la ricerca del nuovo articolo in Rettifica Giacenze 2024-12-10 11:02:00 +01:00
bc9b60b0ac Finish v1.42.00(460) 2024-12-09 19:20:58 +01:00
856592e1fe Finish v1.42.00(460) 2024-12-09 19:20:57 +01:00
cd28d01354 -> v1.42.00 (460) 2024-12-09 19:20:51 +01:00
653cd3fd75 Implementata creazione di un nuovo articolo da Rettifica Giacenze 2024-12-09 19:18:03 +01:00
73b1a77a12 Migliorata gestione degli Updates in modo da forzare gli aggiornamenti di default a meno che non venga specificato forced=false nel file version.txt 2024-12-06 11:37:09 +01:00
777d6a3c5b Finish v1.41.11(459) 2024-12-05 17:25:47 +01:00
98f520427e Finish v1.41.11(459) 2024-12-05 17:25:47 +01:00
403f2ec57c -> v1.41.11 (459) 2024-12-05 17:25:42 +01:00
e69d99fdf1 Merge remote-tracking branch 'origin/develop' into develop 2024-12-05 17:25:01 +01:00
b48b2fbac9 Fix su sorting partita mag nulla in Spedizione 2024-12-05 17:24:48 +01:00
00515aaf9b Merge remote-tracking branch 'origin/develop' into develop 2024-12-05 16:09:08 +01:00
e70d5697c3 aggiunto isnull su numero risorse in query recuper materiale versato 2024-12-05 16:08:48 +01:00
fb6d206203 Finish v1.41.10(456) 2024-12-04 10:26:44 +01:00
d3a9c87d14 Finish v1.41.10(456) 2024-12-04 10:26:43 +01:00
39841f6b0d -> v1.41.10 (458) 2024-12-04 10:26:38 +01:00
7ed3b421a1 Fix su setup nulla in DialogSelectDocInfoViewModel 2024-12-04 10:25:10 +01:00
3b5eb32190 Finish v1.41.09(457) 2024-11-25 11:48:21 +01:00
be31b87eac Finish v1.41.09(457) 2024-11-25 11:48:20 +01:00
3d341ac99d -> v1.41.09 (457) 2024-11-25 11:48:13 +01:00
9df1c37ee9 Fix su esportazione log 2024-11-25 11:40:13 +01:00
385a28c29b Finish v1.41.08(456) 2024-11-21 18:34:09 +01:00
e26568cdf1 Finish v1.41.08(456) 2024-11-21 18:34:09 +01:00
191953a003 -> v1.41.08 (456) 2024-11-21 18:34:04 +01:00
47143fe97d Fix sul caricamento degli ordini di acquisto 2024-11-21 18:33:20 +01:00
387ce6a555 Finish v1.41.07(455) 2024-11-18 18:31:49 +01:00
47ff01805c Finish v1.41.07(455) 2024-11-18 18:31:48 +01:00
0e24f7188c -> v1.41.07 (455) 2024-11-18 18:31:43 +01:00
8b3d1f2a2e Ulteriori fix su DialogProgressView 2024-11-18 18:31:01 +01:00
dcdc823b5f Finish v1.41.06(454) 2024-11-18 16:36:52 +01:00
7201e5c8f8 Finish v1.41.06(454) 2024-11-18 16:36:51 +01:00
929c52b94c -> v1.41.06 (454) 2024-11-18 16:36:45 +01:00
2adfda5f30 Ulteriori fix su DialogProgressView 2024-11-18 16:34:02 +01:00
421accaf15 Finish v1.41.05(453) 2024-11-18 11:39:03 +01:00
574ad6176b Finish v1.41.05(453) 2024-11-18 11:39:03 +01:00
290d737ff7 -> v1.41.05 (453) 2024-11-18 11:38:59 +01:00
4b0fbd0b6b Rimossi destinatari che non sono attivi 2024-11-15 19:14:04 +01:00
6327089a55 Finish v1.41.04(452) 2024-11-14 10:02:03 +01:00
807c3a8cde Finish v1.41.04(452) 2024-11-14 10:02:02 +01:00
665c261b9a -> v1.41.04 (452) 2024-11-14 10:01:56 +01:00
bdd6f21522 Fix su DialogProgressView 2024-11-14 09:59:39 +01:00
482243ceff Implementato CaricoProdFin in Rientro Merce 2024-11-14 09:58:40 +01:00
9890fbfec0 Merge branch 'develop' into feature/GestioneDocumentiLavorazione 2024-11-05 11:25:22 +01:00
2a0465dc0f Finish v1.41.03(451) 2024-11-05 11:24:45 +01:00
3ebe311728 Finish v1.41.03(451) 2024-11-05 11:24:44 +01:00
95a51ecc7a -> v1.41.03 (451) 2024-11-05 11:24:39 +01:00
342753aeac Migliorata gestione del loading dialog (evitate concorrenze di apertura) 2024-11-05 11:23:51 +01:00
2b467f56d7 Migliorato servizio di importColliDaProduzione 2024-11-05 10:43:32 +01:00
a27db0ab68 Merge branch 'develop' into feature/GestioneDocumentiLavorazione 2024-10-23 17:39:18 +02:00
845a4c8faa Aggiornato logo Integry 2024-10-18 11:11:51 +02:00
7b9959e68d Merge branch 'develop' into feature/GestioneDocumentiLavorazione
# Conflicts:
#	.idea/runConfigurations.xml
#	app/src/main/java/it/integry/integrywmsnative/core/settings/DBSettingsModel.java
#	build.gradle
#	gradle/wrapper/gradle-wrapper.properties
2024-10-18 10:13:22 +02:00
0328ebad85 Aggiornato Gradle Plugin 2024-10-18 10:11:08 +02:00
77c5252bf6 Finish v1.41.02(450) 2024-10-08 14:43:12 +02:00
c42a597bb4 Finish v1.41.02(450) 2024-10-08 14:43:12 +02:00
b40781db84 -> v1.41.02 (450) 2024-10-08 14:42:57 +02:00
f5a0bf67c8 In rettifica giacenze aggiunta setup per la richiesta della modifica posizione 2024-10-08 14:40:16 +02:00
044d60fb66 Finish v1.41.01(449) 2024-10-03 16:45:02 +02:00
7999e98bd9 Finish v1.41.01(449) 2024-10-03 16:45:01 +02:00
7c14688ef3 -> v1.41.01 (449) 2024-10-03 16:44:57 +02:00
8039d1942d Merge remote-tracking branch 'origin/develop' into develop 2024-10-03 16:43:44 +02:00
6c8fd2518e Stili 2024-10-03 16:43:10 +02:00
03e2f4390b Cambiato oggetto email log 2024-10-03 16:41:40 +02:00
08656ae276 Finish v1.41.00(448) 2024-09-17 18:33:30 +02:00
9f2ba56c59 Finish v1.41.00(448) 2024-09-17 18:33:29 +02:00
34e1ba8f95 -> v1.41.00 (448) 2024-09-17 18:33:22 +02:00
4e95f4f9c9 Aggiunto dialog per il suggerimento dei lotti già esistenti nei documenti interni 2024-09-17 18:32:09 +02:00
7ee59ea814 Implementata richiesta commessa in PickingLibero di Lavorazione.
Implementato servizio di spostamento arts tra UL in PickingLibero.
Implementata generazione documenti in CloseUDS in PickingLibero.
2024-09-16 10:33:59 +02:00
1463510b08 Finish v1.40.30(447) 2024-09-13 09:42:56 +02:00
a771335ff1 Finish v1.40.30(447) 2024-09-13 09:42:55 +02:00
7b1f58412a -> v1.40.30 (447) 2024-09-13 09:42:38 +02:00
d897c83165 Cambiato messaggio di warning per check documenti interni 2024-09-04 12:56:24 +02:00
44b9bc3fc1 Migliorato documento di reso quando effettuano le perdite 2024-09-03 10:19:07 +02:00
fa95ed1391 Finish v1.40.29(446) 2024-07-26 16:58:15 +02:00
26ca580ba4 Finish v1.40.29(446) 2024-07-26 16:58:15 +02:00
f65e69b745 -> v1.40.29 (446) 2024-07-26 16:58:10 +02:00
5a147fb0de Mini-improvement 2024-07-26 16:55:57 +02:00
64e38ce05a Aggiunto log eccezione in fase di ExportLog 2024-07-26 16:28:16 +02:00
6c79a1781d Finish v1.40.28(445) 2024-07-22 09:09:44 +02:00
6177d84131 Finish v1.40.28(445) 2024-07-22 09:09:43 +02:00
c6975badce -> v1.40.28 (445) 2024-07-22 09:09:27 +02:00
c548c6484f Aggiunto suggerimento data scadenza in caso di partita esistente 2024-07-19 17:55:14 +02:00
9aae16521f Finish v1.40.27(444) 2024-07-05 17:59:05 +02:00
559ff4e94c Finish v1.40.27(444) 2024-07-05 17:59:04 +02:00
7b11f503d8 -> v1.40.27 (444) 2024-07-05 17:58:49 +02:00
bc788c3a34 [DOLBO] Gestito extra quantity in duplica uds e aggiornamento quantità in elenco 2024-07-05 17:57:54 +02:00
f936c71188 Finish v1.40.26(443) 2024-06-26 16:13:52 +02:00
25a7982a87 Finish v1.40.26(443) 2024-06-26 16:13:52 +02:00
74a3749e44 -> v1.40.26 (443) 2024-06-26 16:13:43 +02:00
074fb10b44 Fix chiamata servizi duplicateUDS 2024-06-26 16:03:07 +02:00
4f490eb737 In accettazione da bolla inserita ricerca per descrizione articolo e aggiunta conferma della quantità al long click 2024-06-26 12:16:46 +02:00
2b981b6c40 Finish v1.40.25(442) 2024-06-25 09:06:17 +02:00
bec80d980f Finish v1.40.25(442) 2024-06-25 09:06:17 +02:00
8a5c8f5c94 -> v1.40.25 (442) 2024-06-25 09:06:02 +02:00
da301ec6b2 Permettere la duplicazione delle uds 2024-06-21 17:55:37 +02:00
a5a9cb1c50 Aggiunto blocco durante la lettura dell'SSCC fornitore nell'accettazione se il barcode ul è già presente in un collo 2024-06-18 16:06:02 +02:00
cef74ab71f Finish v1.40.24(441) 2024-06-18 09:52:38 +02:00
3f647952c0 Finish v1.40.24(441) 2024-06-18 09:52:37 +02:00
9bf55aae85 -> v1.40.24 (441) 2024-06-18 09:52:23 +02:00
f9a31faa78 Fix import docInterni 2024-06-18 09:49:23 +02:00
9a643837d4 Finish v1.40.23(440) 2024-06-17 17:55:25 +02:00
f458a52b18 Finish v1.40.23(440) 2024-06-17 17:55:24 +02:00
132437d134 -> v1.40.23 (440) 2024-06-17 17:55:10 +02:00
022841c195 Controllo documenti fruma 2024-06-17 17:53:46 +02:00
bdbecfb037 Finish v1.40.22(439) 2024-05-31 18:41:09 +02:00
1a501af172 Finish v1.40.22(439) 2024-05-31 18:41:08 +02:00
fe558a8be8 -> v.1.40.22 (439) 2024-05-31 18:41:02 +02:00
05d930d8f7 Aggiunta setup per "Disabilitare" il picking libero quando si spara un'etichetta cartone 2024-05-31 18:38:25 +02:00
267aa85e01 Finish v1.40.21(438) 2024-05-28 19:07:53 +02:00
89a98cac8b Finish v1.40.21(438) 2024-05-28 19:07:52 +02:00
efc052d622 -> v1.40.21 (438) 2024-05-28 19:07:48 +02:00
6f61f3af9b Fix date in recupero materiale 2024-05-28 19:07:01 +02:00
e7d06c9752 Finish v1.40.20(437) 2024-05-27 13:27:22 +02:00
81e3c70960 Finish v1.40.20(437) 2024-05-27 13:27:22 +02:00
76a0fe9b6f -> v1.40.20 (437) 2024-05-27 13:27:08 +02:00
a9bab6db56 Fix format LocalDate in recupero materiale 2024-05-27 13:26:11 +02:00
85197c1f9b Finish v1.40.19(436) 2024-05-21 12:15:37 +02:00
ece434806f Finish v1.40.19(436) 2024-05-21 12:15:36 +02:00
0962192144 -> v1.40.19 (436) 2024-05-21 12:15:29 +02:00
38139a1ec9 Merge remote-tracking branch 'origin/develop' into develop 2024-05-21 12:14:19 +02:00
56e5603256 Fix date in recupero materiale 2024-05-21 12:14:03 +02:00
b5c2efa9e2 Finish v1.40.18(435) 2024-05-14 16:57:12 +02:00
26f9f0e16c Finish v1.40.18(435) 2024-05-14 16:57:12 +02:00
9abba0ce82 -> v.1.40.18 (435) 2024-05-14 16:56:58 +02:00
c616a9d31a Fix InputQuantity in rettifica giaccenze 2024-05-14 16:55:45 +02:00
e45a980ce3 Aggiunto dateTimeRow in ArtDTO 2024-05-10 15:44:23 +02:00
91bca90e5d Fix AuthInterceptor 2024-05-07 18:35:51 +02:00
c5d09b0d8b Merge branch 'develop' into feature/TokenAuthentication 2024-05-07 18:32:48 +02:00
46c9fa184d Finish v1.40.17(434) 2024-05-07 18:22:31 +02:00
3a31fba1b4 Finish v1.40.17(434) 2024-05-07 18:22:30 +02:00
6cded1d2d1 -> v1.40.17 (434) 2024-05-07 18:22:23 +02:00
027d0e891b Fix stream in spedizione 2024-05-07 18:21:40 +02:00
0da31ef866 Aggiunto interceptor per il refresh del token 2024-05-07 18:14:05 +02:00
56f14c064e Rimosse tutte le chiamate statiche a RESTBuilder 2024-05-07 17:30:45 +02:00
09c929803f Implementata login OAuth 2024-05-06 18:39:52 +02:00
93abea0823 Merge remote-tracking branch 'origin/develop' into develop 2024-05-06 12:52:35 +02:00
5c5216e207 Aggiornato gradle plugin 8.4.0 2024-05-06 12:49:18 +02:00
7a20ff6ddc Finish v1.40.16(433) 2024-05-03 15:05:52 +02:00
048b7d7f56 Finish v1.40.16(433) 2024-05-03 15:05:51 +02:00
f009726cf0 -> v1.40.16 (433) 2024-05-03 15:05:37 +02:00
fb213cbdbb Aggiunta data delle righe dei colli nella generazione dei documenti interni 2024-05-03 11:33:12 +02:00
971dcaed87 Finish v1.40.15(432) 2024-04-30 16:46:14 +02:00
7b132def2a Finish v1.40.15(432) 2024-04-30 16:46:13 +02:00
998dc54292 -> v1.40.15 (432) 2024-04-30 16:46:08 +02:00
157eaf8760 Cambiate alcune logiche in versamento su Ordine 2024-04-29 12:08:10 +02:00
10ffcf7806 Refactoring progress views 2024-04-29 11:33:28 +02:00
392dd18338 Cambiata lettura barcode in Versamento su Ordine 2024-04-24 19:46:11 +02:00
d4c7cdf400 Fix codAnag vettore 2024-04-23 18:14:27 +02:00
cde96ae694 Fix codAnag vettore 2024-04-23 18:04:42 +02:00
e49d35fdbc Implementata gestione degli imballi in spedizione 2024-04-23 16:32:40 +02:00
55db6d362d Merge remote-tracking branch 'origin/develop' into develop 2024-04-19 17:33:03 +02:00
925cb6ae07 Implementata gestione degli imballi in accettazione 2024-04-19 17:32:32 +02:00
c4f1d53199 Finish v1.40.14(431) 2024-04-19 13:57:08 +02:00
e18ac7a390 Finish v1.40.14(431) 2024-04-19 13:57:08 +02:00
cc454aea1a -> v1.40.14 (431) 2024-04-19 13:56:55 +02:00
5cf275e43c Fix nullPoint StatoArtInventarioDto 2024-04-19 13:18:46 +02:00
53fe1db488 Finish v1.40.13(430)_2 2024-04-16 10:53:44 +02:00
64082fc5ee Finish v1.40.13(430)_2 2024-04-16 10:53:43 +02:00
f9c642ad13 Aggiornamenti librerie 2024-04-16 10:53:01 +02:00
bd7edf2357 Finish v1.40.13(430)_1 2024-04-16 10:48:05 +02:00
b7605bd28c Finish v1.40.13(430)_1 2024-04-16 10:48:04 +02:00
ad01283511 Aggiornamenti librerie 2024-04-16 10:46:56 +02:00
adeab93b17 Finish v1.40.13(430) 2024-04-16 08:56:03 +02:00
51480c2b06 Finish v1.40.13(430) 2024-04-16 08:56:03 +02:00
d04b3797ce -> v1.40.13 (430) 2024-04-16 08:55:44 +02:00
518a00becf Fix check newPartitaMag 2024-04-16 08:51:27 +02:00
c808cf7ce3 Finish v1.40.12(429) 2024-04-10 13:30:08 +02:00
8cb488d81f Finish v1.40.12(429) 2024-04-10 13:30:07 +02:00
ed3f84d0ea -> v1.40.12 (429) 2024-04-10 13:29:53 +02:00
d9b02c4402 Fix import MagazzinoRESTConsumer 2024-04-10 13:28:49 +02:00
23522c9370 Finish v1.40.11(428) 2024-04-10 13:27:26 +02:00
f79b40c574 Finish v1.40.11(428) 2024-04-10 13:27:26 +02:00
835915b46a -> v1.40.11 (428) 2024-04-10 13:27:06 +02:00
e643f25aa3 Fix response retrievePartitaMagSyncronized 2024-04-10 13:26:12 +02:00
230a32139d Aggiunto retrievePartitaMagSyncronized in MagazzinoRESTConsumer 2024-04-10 12:21:29 +02:00
b0272cd9e0 Fix thread in validation DialogInputQuantityV2 2024-04-10 12:07:41 +02:00
fa9947f22b Finish v1.40.10(427) 2024-04-09 10:06:58 +02:00
5d3bb333e1 Finish v1.40.10(427) 2024-04-09 10:06:58 +02:00
9f7085dfed -> v1.40.10 (427) 2024-04-09 10:06:32 +02:00
95f765756c Fix vari 2024-04-09 10:04:12 +02:00
a846ec00d7 Finish v1.40.09(426) 2024-04-04 12:26:54 +02:00
6edc1917e1 Finish v1.40.09(426) 2024-04-04 12:26:54 +02:00
1b864253b5 -> v1.40.09 (426) 2024-04-04 12:26:38 +02:00
f212987547 Aggiunto in UtilityString determineDateFormat 2024-04-04 12:25:25 +02:00
76f9c7030b Finish v1.40.08(425) 2024-04-04 11:54:19 +02:00
05bc6e3fbe Finish v1.40.08(425) 2024-04-04 11:54:18 +02:00
38dc5e134c -> v1.40.08 (425) 2024-04-04 11:53:56 +02:00
76cf6c7d66 Fix LocalDate deserializer 2024-04-04 11:52:24 +02:00
21100d517c Finish v1.40.07(424) 2024-03-27 18:16:12 +01:00
37f83cd642 Finish v1.40.07(424) 2024-03-27 18:16:11 +01:00
f29f832387 -> v1.40.07 (424) 2024-03-27 18:16:05 +01:00
dd523ed6d8 Rimossa apertura loading popup che causava crash 2024-03-27 18:15:11 +01:00
879cfc5f7e Fix vari 2024-03-25 12:45:21 +01:00
83a6dd29f2 Aggiornato AGP 2024-03-25 10:58:19 +01:00
cc85d83267 Finish v1.40.06(423) 2024-03-18 12:09:26 +01:00
5d427a258e Finish v1.40.06(423) 2024-03-18 12:09:26 +01:00
75e0a13f10 -> v1.40.06 (423) 2024-03-18 12:09:07 +01:00
0862727176 Fix nessun selezionato filtro gruppo merceologico 2024-03-18 12:06:58 +01:00
6c02fcc9d5 Finish v1.40.05(422) 2024-03-15 18:28:52 +01:00
cd38c1b301 Finish v1.40.05(422) 2024-03-15 18:28:51 +01:00
c822f14a10 -> v1.40.05 (422) 2024-03-15 18:28:29 +01:00
76683cb80c Fix nullPoint List<StatoArtInventarioDTO> in riposizionamento da prod 2024-03-15 18:25:48 +01:00
3041498ff1 Fix modal stato inventario 2024-03-14 16:44:39 +01:00
66e0ce15cb Fix filtro gruppo merceologico in approvvigionamento linee 2024-03-14 15:22:10 +01:00
e12da84fa3 Nel "riposizionamento da produzione" aggiunte le informazioni per "in arrivo" e "in magazzino" 2024-03-14 13:04:48 +01:00
bd4f28eb6d Fix rettifica giacenza 2024-03-13 12:59:26 +01:00
c25b2e6cb5 Aggiunto filtro per per gruppo merceologico in approvvigionamento linee 2024-03-13 11:08:55 +01:00
b86a1eb1bd Nella sezione "rettifica giacenza" aggiunto avviso nell'inserimento di una nuova della partita per articolo 2024-03-12 16:34:52 +01:00
a9b5483005 Refactor nomi varibili setup 2024-03-12 16:10:38 +01:00
29c181cff1 Refactor nomi varibili setup in settinsManager 2024-03-12 16:07:46 +01:00
614da5ec5a Refactor nomi varibili setup 2024-03-12 16:05:58 +01:00
5342f96076 Finish v1.40.04(421) 2024-03-11 17:33:45 +01:00
479950df14 Finish v1.40.04(421) 2024-03-11 17:33:44 +01:00
51fa32d48d -> v1.40.04 (421) 2024-03-11 17:33:38 +01:00
e491c56f3f Merge remote-tracking branch 'origin/develop' into develop 2024-03-11 17:32:28 +01:00
5c505e2fe1 Implementato flag per gestire la qta suggerita in accettazione bolle 2024-03-11 17:32:09 +01:00
67e88d01e7 Implementato in rettifica giacenza avviso se l'articolo che si sta inserendo è attivo o meno 2024-03-11 13:32:08 +01:00
9454614af6 Rimosso tipo report WMS_SPEDIZIONE_ETICHETTE_SSCC_ORD 2024-03-07 16:11:52 +01:00
535a095b0a Finish v1.40.03(420) 2024-03-07 12:10:19 +01:00
c6457ccf1c Finish v1.40.03(420) 2024-03-07 12:10:19 +01:00
3f470df462 -> v1.40.03 (420) 2024-03-07 12:10:04 +01:00
af5c5338b7 Fix linea di impiego in dialog in approv. linee 2024-03-07 12:03:44 +01:00
e832db3214 Finish v1.40.02(419) 2024-03-07 10:17:55 +01:00
8b432d1b19 Finish v1.40.02(419) 2024-03-07 10:17:55 +01:00
d33eb81968 -> v1.40.02 (419) 2024-03-07 10:17:50 +01:00
be60cdb971 Merge remote-tracking branch 'origin/develop' into develop 2024-03-07 10:16:46 +01:00
062f877777 Fix su folder di download degli aggiornamenti 2024-03-07 10:16:37 +01:00
5187564250 Aggiunta setup per dialog info situazione articolo in picking da ordine di lavorazione 2024-03-05 16:22:59 +01:00
fc22c119f6 Finish v1.40.01(418) 2024-03-05 11:08:45 +01:00
dd8b696862 Finish v1.40.01(418) 2024-03-05 11:08:44 +01:00
99a5e162de -> v1.40.01 (418) 2024-03-05 11:08:28 +01:00
84dcf30aac In Accettazione bolla evidenziato di un colore diverso le righe in cui è stata accettata più merce del previsto 2024-03-05 11:04:54 +01:00
388c0641cf Finish v1.40.00(417) 2024-03-04 14:51:40 +01:00
40f2c86eec Finish v1.40.00(417) 2024-03-04 14:51:39 +01:00
34bd0109c0 -> v1.40.00 (417) 2024-03-04 14:50:58 +01:00
b4199f38aa Creata gestione "Articoli in giacenza" 2024-03-04 14:45:25 +01:00
299e066436 Finish v1.39.03(416) 2024-03-01 18:01:33 +01:00
0098fdaf5a Finish v1.39.03(416) 2024-03-01 18:01:32 +01:00
76d26765ef -> v1.39.03 (416) 2024-03-01 18:01:29 +01:00
c5b6e80aaf Merge remote-tracking branch 'origin/develop' into develop 2024-03-01 18:00:46 +01:00
a1b3517b07 Fix su serializzatore GSON 2024-03-01 18:00:28 +01:00
bd3fdd9ab1 Aggiunto filtro descrizione in gestione Riposizionamento da prod 2024-02-26 13:04:31 +01:00
377950c978 Aggiunto try catch per catturare le eccezioni in caso di re-add del dialog di progress 2024-02-22 15:53:42 +01:00
d17e528158 Finish v1.39.02(415) 2024-02-22 12:34:12 +01:00
a0c9c40ab5 Finish v1.39.02(415) 2024-02-22 12:34:11 +01:00
175f9e226b -> v1.39.02 (415) 2024-02-22 12:33:54 +01:00
5f2a2d96e9 [VGALIMENTI]
Corretta lettura data scadenza in decodifica ean128
2024-02-22 12:29:54 +01:00
3a167befae Finish v1.39.01(414) 2024-02-21 11:38:50 +01:00
364c627f2d Finish v1.39.01(414) 2024-02-21 11:38:49 +01:00
c0a9477000 -> v1.39.01 (414) 2024-02-21 11:38:44 +01:00
f1f56b97d6 Aggiornato servizio di createUdc in Rettifica Giacenze 2024-02-21 11:34:16 +01:00
4a79b6c1bf Fix su logica di richiesta lotto in Spedizione nel caso di più lotti presenti in una UL 2024-02-21 10:05:28 +01:00
3fddb6bcf7 Aggiunta lettura di SSCC fornitore in accettazione merce 2024-02-20 11:40:22 +01:00
435b6d753a Aggiunto in locale decode ean128 2024-02-20 09:36:59 +01:00
f0e1cf7f0b Implementati suoni alla scansione dei barcode 2024-02-16 09:26:52 +01:00
7049552f16 In accettazione aggiunta possibilità di far sparire le righe quando si evadono completamente gli ordini 2024-02-15 10:14:29 +01:00
4e53189d56 Finish v1.39.00(413) 2024-02-07 17:13:22 +01:00
9aa38b6fca Finish v1.39.00(413) 2024-02-07 17:13:22 +01:00
5745d249f0 -> v1.39.00 (413) 2024-02-07 17:13:18 +01:00
089ca061a7 Fix null su picking senza gestione giacenza 2024-02-07 17:12:17 +01:00
725372befe Aggiunto filtro posizione in riposizionamento da prod 2024-02-07 10:07:31 +01:00
6a84828506 Implementato riposizionamento da produzione 2024-02-05 16:46:57 +01:00
1c0dc8c6f2 Finish v1.38.02(412) 2024-02-01 10:34:07 +01:00
59350f768e Finish v1.38.02(412) 2024-02-01 10:34:07 +01:00
0ebcf934ff -> v1.38.02 (412) 2024-02-01 10:34:02 +01:00
20c934a28e Aggiunto supporto ad Honeywell EDA52 2024-02-01 10:33:34 +01:00
b6abeee972 Ripristinati template 2024-01-30 10:52:07 +01:00
7ecf9e4807 Finish v1.38.01(411) 2024-01-23 18:20:57 +01:00
8030a90e8e Finish v1.38.01(411) 2024-01-23 18:20:56 +01:00
61810c44c7 -> v1.38.01 (411) 2024-01-23 18:20:52 +01:00
d64bc584f0 Merge remote-tracking branch 'origin/develop' into develop 2024-01-23 18:19:11 +01:00
4f4dea9097 Fix descrizione riga UL in ContenutoBancaleActivity 2024-01-23 18:19:03 +01:00
707c852377 Fix per fabbisogno linee 2024-01-23 16:10:54 +01:00
0ae1ac87d5 Finish v1.38.00(410) 2024-01-23 11:16:15 +01:00
f03fe78ed3 Finish v1.38.00(410) 2024-01-23 11:16:14 +01:00
77cf6ac4db -> v1.38.00 (410) 2024-01-23 11:16:08 +01:00
48d1a34c52 Merge remote-tracking branch 'origin/develop' into develop 2024-01-23 11:14:46 +01:00
258f150dbb Fix in accettazione ordini di produzione: venivano raggruppati gli ordini di lavoro sotto il primo ordine trovato 2024-01-23 11:14:15 +01:00
14783dfef5 Fix codMdep in chiusura ul 2024-01-22 15:32:40 +01:00
e62e5d11f0 Impedito prelevamento merce posizionata su depositi diversi 2024-01-19 17:27:38 +01:00
648d908e95 In rettifica giacenze passo lista mtbaart in caso di ean128 2024-01-17 12:11:44 +01:00
db3eb1b062 Aggiunto nella sezione Approvvigionamento avanti elenco degli ordini e filtro per numOrd 2024-01-17 09:14:44 +01:00
fb2bed2dbf Fix per Tuidi 2024-01-16 11:54:45 +01:00
f45010650a Finish v1.37.01(409) 2024-01-15 13:36:44 +01:00
6022cfea1f Finish v1.37.01(409) 2024-01-15 13:36:43 +01:00
1ceb8c9cf9 -> v1.37.01 (409) 2024-01-15 13:36:34 +01:00
3c86db62c0 Fix per Tuidi 2024-01-15 13:34:38 +01:00
49687efc16 Finish v1.37.00(408) 2024-01-12 13:15:31 +01:00
594 changed files with 20997 additions and 7004 deletions

View File

@@ -1,6 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AppInsightsSettings">
<option name="selectedTabId" value="Android Vitals" />
<option name="selectedTabId" value="Firebase Crashlytics" />
<option name="tabSettings">
<map>
<entry key="Android Vitals">
<value>
<InsightsFilterSettings>
<option name="connection">
<ConnectionSetting>
<option name="appId" value="it.integry.ordify.dulciar" />
</ConnectionSetting>
</option>
<option name="signal" value="SIGNAL_UNSPECIFIED" />
<option name="timeIntervalDays" value="SEVEN_DAYS" />
<option name="visibilityType" value="ALL" />
</InsightsFilterSettings>
</value>
</entry>
<entry key="Firebase Crashlytics">
<value>
<InsightsFilterSettings>
<option name="connection">
<ConnectionSetting>
<option name="appId" value="it.integry.integrywmsnative" />
<option name="mobileSdkAppId" value="1:963231271247:android:6d73ab369f33c450" />
<option name="projectId" value="wmsfirebaseproject-64854" />
<option name="projectNumber" value="963231271247" />
</ConnectionSetting>
</option>
<option name="signal" value="SIGNAL_UNSPECIFIED" />
<option name="timeIntervalDays" value="THIRTY_DAYS" />
<option name="visibilityType" value="ALL" />
</InsightsFilterSettings>
</value>
</entry>
</map>
</option>
</component>
</project>

View File

@@ -2,6 +2,9 @@
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="Prod_Android.WMS.app">
<State />
</entry>
<entry key="app">
<State />
</entry>

18
.idea/deploymentTargetSelector.xml generated Normal file
View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2025-01-27T15:42:06.256113400Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="PhysicalDevice" identifier="serial=21088B8EFD" />
</handle>
</Target>
</DropdownSelection>
<DialogSelection />
</SelectionState>
</selectionStates>
</component>
</project>

View File

@@ -0,0 +1,97 @@
#set( $regex = "([a-z])([A-Z]+)")
#set( $replacement = "$1_$2")
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
#set( $variableName = $NAME.replace($NAME.substring(0, 1), $NAME.substring(0, 1).toLowerCase()))
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.content.Intent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import javax.inject.Inject;
import it.integry.integrywmsnative.MainApplication;
import it.integry.integrywmsnative.core.expansion.BaseActivity;
public class ${NAME}Activity extends BaseActivity {
/*
- Create the following layout resource file [activity_${dashName}.xml]
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
- Create an entry in AndroidManifest.xml
Fix the android:name tag with current path
<activity
android:name="${NAME}Activity"
android:label="@string/activity_${dashName}_title"
android:screenOrientation="portrait"
android:theme="@style/Light" />
*/
@Inject
${NAME}ViewModel mViewModel;
//private Activity${NAME}Binding mBindings;
//Pass here all external parameters
public static void startActivity(Context context) {
Intent myIntent = new Intent(context, ${NAME}Activity.class);
//String keyExtraItem = DataCache.addItem(var);
//myIntent.putExtra("keyExtraItem", keyExtraItem);
context.startActivity(myIntent);
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//mBindings = DataBindingUtil.setContentView(this, R.layout.activity_${dashName});
//mBindings.setLifecycleOwner(this);
/*
- Add following lines into MainApplicationComponent
[a] into @Component
${NAME}Module.class
[b] into interface body
${NAME}Component.Factory ${variableName}Component();
*/
MainApplication.appComponent
.${variableName}Component()
.create()
.inject(this);
}
}

View File

@@ -0,0 +1,12 @@
import dagger.Module;
import dagger.Provides;
@Module(subcomponents = ${NAME}Component.class)
public class ${NAME}Module {
@Provides
${NAME}ViewModel provides${NAME}ViewModel() {
return new ${NAME}ViewModel();
}
}

View File

@@ -0,0 +1,12 @@
import dagger.Subcomponent;
@Subcomponent
public interface ${NAME}Component {
@Subcomponent.Factory
interface Factory {
${NAME}Component create();
}
void inject(${NAME}Activity ${NAME}Activity);
}

View File

@@ -0,0 +1,3 @@
public class ${NAME}ViewModel {
}

126
.idea/fileTemplates/Android Dialog.java generated Normal file
View File

@@ -0,0 +1,126 @@
#set( $regex = "([a-z])([A-Z]+)")
#set( $replacement = "$1_$2")
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import javax.inject.Inject;
import it.integry.integrywmsnative.MainApplication;
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
public class Dialog${NAME}View extends BaseDialogFragment {
/*
Create the following layout resource file [dialog_${dashName}.xml]
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:cardCornerRadius="16dp"
app:cardElevation="0dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="16dp">
<androidx.appcompat.widget.AppCompatImageView
style="@style/MaterialAlertDialog.Material3.Title.Icon.CenterStacked"
android:layout_width="36dp"
android:layout_height="36dp"
android:src="@drawable/ic_error_white_24dp"
app:tint="?colorPrimary" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/title_text"
style="@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:text="Title here" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/description_text"
style="@style/TextAppearance.Material3.BodyMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="Description here" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.cardview.widget.CardView>
</layout>
*/
@Inject
Dialog${NAME}ViewModel mViewModel;
//private Dialog${NAME}Binding mBindings;
private Context mContext;
//Pass here all external parameters
public static Dialog${NAME}View newInstance() {
return new Dialog${NAME}View();
}
private Dialog${NAME}View() {
super();
MainApplication.appComponent
.dialog${NAME}Component()
.create()
.inject(this);
}
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
this.mContext = requireContext();
//mBindings = Dialog${NAME}Binding.inflate(LayoutInflater.from(this.mContext), null, false);
//mBindings.setLifecycleOwner(this);
/*
- Add following lines into MainApplicationComponent
[a] into @Component
Dialog${NAME}Module.class
[b] into interface body
Dialog${NAME}Component.Factory dialog${NAME}Component();
*/
setCancelable(false);
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
.setView(mBindings.getRoot())
.setCancelable(isCancelable())
.create();
alertDialog.setCanceledOnTouchOutside(isCancelable());
alertDialog.setOnShowListener(this);
return alertDialog;
}
}

View File

@@ -0,0 +1,12 @@
import dagger.Module;
import dagger.Provides;
@Module(subcomponents = Dialog${NAME}Component.class)
public class Dialog${NAME}Module {
@Provides
Dialog${NAME}ViewModel providesDialog${NAME}ViewModel() {
return new Dialog${NAME}ViewModel();
}
}

View File

@@ -0,0 +1,12 @@
import dagger.Subcomponent;
@Subcomponent
public interface Dialog${NAME}Component {
@Subcomponent.Factory
interface Factory {
Dialog${NAME}Component create();
}
void inject(Dialog${NAME}View dialog${NAME}View);
}

View File

@@ -0,0 +1,3 @@
public class Dialog${NAME}ViewModel {
}

View File

@@ -0,0 +1,82 @@
#set( $regex = "([a-z])([A-Z]+)")
#set( $replacement = "$1_$2")
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
#set( $variableName = $NAME.replace($NAME.substring(0, 1), $NAME.substring(0, 1).toLowerCase()))
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import javax.inject.Inject;
import it.integry.integrywmsnative.MainApplication;
import it.integry.integrywmsnative.core.expansion.BaseFragment;
public class ${NAME}Fragment extends BaseFragment {
/*
- Create the following layout resource file [fragment_${dashName}.xml]
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
*/
@Inject
${NAME}ViewModel mViewModel;
//private Fragment${NAME}Binding mBindings;
public ${NAME}Fragment() {
// Required empty public constructor
}
public static ${NAME}Fragment newInstance() {
return new ${NAME}Fragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
setRetainInstance(true);
//mBindings = Fragment${NAME}Binding.inflate(inflater, container, false);
//mBindings.setLifecycleOwner(this);
/*
- Add following lines into MainApplicationComponent
[a] into @Component
${NAME}Module.class
[b] into interface body
${NAME}Component.Factory ${variableName}Component();
*/
MainApplication.appComponent
.${variableName}Component()
.create()
.inject(this);
return mBindings.getRoot();
}
}

View File

@@ -0,0 +1,3 @@
public class ${NAME}ViewModel {
}

View File

@@ -0,0 +1,12 @@
import dagger.Subcomponent;
@Subcomponent
public interface ${NAME}Component {
@Subcomponent.Factory
interface Factory {
${NAME}Component create();
}
void inject(${NAME}Fragment ${NAME}Fragment);
}

View File

@@ -0,0 +1,12 @@
import dagger.Module;
import dagger.Provides;
@Module(subcomponents = ${NAME}Component.class)
public class ${NAME}Module {
@Provides
${NAME}ViewModel provides${NAME}ViewModel() {
return new ${NAME}ViewModel();
}
}

2
.idea/kotlinc.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.9.0" />
<option name="version" value="1.9.25" />
</component>
</project>

17
.idea/runConfigurations.xml generated Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
</set>
</option>
</component>
</project>

View File

@@ -5,13 +5,13 @@ if (!project.hasProperty("disable-performance-plugin")) {
}
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'kotlin-android'
//apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
android {
def appVersionCode = 408
def appVersionName = '1.37.00'
def appVersionCode = 476
def appVersionName = '1.44.07'
signingConfigs {
release {
@@ -25,8 +25,8 @@ android {
}
}
applicationVariants.all { variant ->
variant.outputs.all { output ->
applicationVariants.configureEach { variant ->
variant.outputs.configureEach { output ->
output.outputFileName = "android-release.apk"
}
}
@@ -34,10 +34,10 @@ android {
defaultConfig {
applicationId "it.integry.integrywmsnative"
minSdkVersion 21
targetSdkVersion 34
targetSdkVersion 35
versionCode appVersionCode
versionName appVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.release
javaCompileOptions {
@@ -75,48 +75,59 @@ android {
build {
doLast {
delete "$projectDir/build/outputs/apk/release/version.txt"
file("$projectDir/build/outputs/apk/release/version.txt").text = appVersionCode + '\n' + appVersionName
file("$projectDir/build/outputs/apk/release/version.txt").text = appVersionCode + '\n' + appVersionName + '\n' + 'forced=true'
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile.class) {
options.compilerArgs << "-Xmaxerrs" << "10000"
tasks.withType(JavaCompile.class).tap {
configureEach {
options.compilerArgs << "-Xmaxerrs" << "10000"
}
}
}
lint {
abortOnError false
}
namespace 'it.integry.integrywmsnative'
compileSdk 34
compileSdk 35
}
configurations {
all*.exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
all*.exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// androidTestImplementation('androidx.test.espresso:espresso-core:3.6.1', {
// exclude group: 'com.android.support', module: 'support-annotations'
// })
// implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.github.lupaulus:logger:2.3.2'
//Firebase
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:29.1.0')
implementation platform('com.google.firebase:firebase-bom:33.8.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-perf'
implementation 'com.google.android.gms:play-services-basement:18.2.0'
implementation 'com.google.android.gms:play-services-basement:18.5.0'
//JJWT
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.10.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.recyclerview:recyclerview:1.4.0'
implementation('androidx.preference:preference-ktx:1.2.1') {
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
@@ -128,12 +139,12 @@ dependencies {
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.annimon:stream:1.2.2'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.7'
// implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'org.apache.commons:commons-text:1.9'
//MVVM
def dagger2_version = '2.46.1'
def dagger2_version = '2.55'
api "com.google.dagger:dagger:$dagger2_version"
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
api "com.google.dagger:dagger-android:$dagger2_version"
@@ -144,10 +155,7 @@ dependencies {
//FAB
implementation 'com.github.clans:fab:1.6.4'
//CUSTOM VIEWS
implementation 'com.github.NaimishTrivedi:FBToast:1.0'
implementation 'com.github.cachapa:ExpandableLayout:2.9.2'
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
implementation 'com.github.fede87:StatusBarAlert:1.0.1'
implementation 'com.github.zhukic:sectioned-recyclerview:1.2.3'
implementation 'com.github.pedromassango:doubleClick:3.0'
@@ -158,9 +166,6 @@ dependencies {
annotationProcessor "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-rxjava3:$room_version"
//AppUpdate
implementation 'com.github.javiersantos:AppUpdater:2.7'
//Barcode
implementation project(':pointmobilescannerlibrary')
implementation project(':zebrascannerlibrary')
@@ -178,11 +183,16 @@ dependencies {
//Bluetooth device manager
implementation 'com.github.harry1453:android-bluetooth-serial:v1.1'
implementation 'com.github.harry1453:android-bluetooth-serial:v1.1.2'
// RxJava is also required.
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'org.greenrobot:eventbus:3.3.1'
//Barcode generator
implementation group: 'com.google.zxing', name: 'core', version: '3.5.3'
}
repositories {

View File

@@ -24,8 +24,8 @@
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
@@ -33,31 +33,25 @@
android:requestLegacyExternalStorage="true">
<activity
android:name=".gest.spedizione.SpedizioneActivity"
android:theme="@style/Light"
android:windowSoftInputMode="adjustNothing"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
android:theme="@style/Light"
android:windowSoftInputMode="adjustNothing"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.prod_dettaglio_linea.ProdDettaglioLineaActivity"
android:theme="@style/Light"
android:windowSoftInputMode="adjustNothing"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
android:theme="@style/Light"
android:windowSoftInputMode="adjustNothing"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.picking_resi.PickingResiActivity"
android:theme="@style/Light"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.main.MainActivity"
android:theme="@style/Light"
android:windowSoftInputMode="adjustNothing"
android:exported="true">
<intent-filter>
@@ -68,28 +62,23 @@
</activity>
<activity
android:name=".gest.login.LoginActivity"
android:theme="@style/Light"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.accettazione_ordini_picking.AccettazioneOrdiniPickingActivity"
android:theme="@style/Light"
android:windowSoftInputMode="adjustNothing"
android:windowSoftInputMode="adjustPan"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.lista_bancali.ListaBancaliActivity"
android:label="@string/activity_lista_bancali_title"
android:theme="@style/Light"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.contenuto_bancale.ContenutoBancaleActivity"
android:label="@string/activity_contenuto_bancale_title"
android:theme="@style/Light"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.inventario.picking.PickingInventarioActivity"
android:label="@string/activity_picking_inventario_title"
android:windowSoftInputMode="adjustNothing"
android:theme="@style/Light"
android:configChanges="orientation|screenSize|keyboardHidden"/>
<meta-data
@@ -110,8 +99,7 @@
<activity
android:name=".gest.accettazione_bolla_picking.AccettazioneBollaPickingActivity"
android:screenOrientation="portrait"
android:theme="@style/Light" />
android:screenOrientation="portrait" />
<provider
android:name=".core.update.GenericFileProvider"

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -19,6 +19,8 @@ import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazi
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazioneOrdiniElencoModule;
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingComponent;
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingModule;
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaComponent;
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaModule;
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniComponent;
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniModule;
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoComponent;
@@ -27,6 +29,8 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniE
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormModule;
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsComponent;
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsModule;
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectLotti.DialogSelectLottiComponent;
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectLotti.DialogSelectLottiModule;
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
import it.integry.integrywmsnative.gest.inventario.ElencoInventariComponent;
@@ -67,6 +71,11 @@ import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMate
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeModule;
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail.ProdRientroMerceOrderDetailComponent;
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_list.ProdRientroMerceOrderListComponent;
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.ProdRiposizionamentoDaProdComponent;
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.ProdRiposizionamentoDaProdModule;
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza.DialogInfoGiacenzaComponent;
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza.DialogInfoGiacenzaModule;
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeComponent;
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeModule;
import it.integry.integrywmsnative.gest.prod_versamento_materiale_su_mag_prossimita.ProdVersamentoMaterialeInBufferComponent;
@@ -104,10 +113,15 @@ import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetM
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalModule;
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteComponent;
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteModule;
import it.integry.integrywmsnative.view.dialogs.ask_commessa.DialogAskCommessaComponent;
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaProdComponent;
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaProdModule;
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesComponent;
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesModule;
import it.integry.integrywmsnative.view.dialogs.ask_vettore.DialogAskVettoreComponent;
import it.integry.integrywmsnative.view.dialogs.ask_vettore.DialogAskVettoreModule;
import it.integry.integrywmsnative.view.dialogs.basket_lu.DialogBasketLUComponent;
import it.integry.integrywmsnative.view.dialogs.basket_lu.DialogBasketLUModule;
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageComponent;
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageModule;
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromMtbAartListComponent;
@@ -116,6 +130,8 @@ import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.Di
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.DialogChooseArtsFromMtbColrListModule;
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
import it.integry.integrywmsnative.view.dialogs.create_new_art.DialogCreateNewArtComponent;
import it.integry.integrywmsnative.view.dialogs.create_new_art.DialogCreateNewArtModule;
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUComponent;
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUModule;
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
@@ -132,6 +148,12 @@ import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtComponent;
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtModule;
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUComponent;
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUModule;
import it.integry.integrywmsnative.view.dialogs.switch_user_depo.DialogSwitchUserDepoComponent;
import it.integry.integrywmsnative.view.dialogs.switch_user_depo.DialogSwitchUserDepoModule;
import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracciamentoImballiComponent;
import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracciamentoImballiModule;
import it.integry.integrywmsnative.view.dialogs.update_available.DialogUpdateAvailableComponent;
import it.integry.integrywmsnative.view.dialogs.update_available.DialogUpdateAvailableModule;
// Definition of the Application graph
@Singleton
@@ -163,6 +185,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
DialogInputLUProdModule.class,
DialogScanArtModule.class,
DialogScanOrCreateLUModule.class,
DialogBasketLUModule.class,
ProdFabbisognoLineeProdModule.class,
VersamentoMerceModule.class,
DialogAskMagazzinoProssimitaModule.class,
@@ -176,6 +199,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
DialogSelectDocInfoModule.class,
DocInterniEditFormModule.class,
DialogSelectDocRowsModule.class,
DialogSelectLottiModule.class,
DialogAskClienteModule.class,
DialogEditArticoloModule.class,
DialogPrintOrderSSCCListModule.class,
@@ -200,7 +224,16 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
ProdVersamentoMaterialeInBufferModule.class,
DialogInputQuantityToReturnModule.class,
DialogInfoAggiuntiveLUModule.class,
DialogAskLineaProdModule.class
DialogAskLineaProdModule.class,
ProdRiposizionamentoDaProdModule.class,
DialogInfoGiacenzaModule.class,
ArticoliInGiacenzaModule.class,
DialogTracciamentoImballiModule.class,
DialogAskVettoreModule.class,
DialogAskVettoreModule.class,
DialogCreateNewArtModule.class,
DialogSwitchUserDepoModule.class,
DialogUpdateAvailableModule.class
})
public interface MainApplicationComponent {
@@ -256,6 +289,8 @@ public interface MainApplicationComponent {
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
DialogBasketLUComponent.Factory dialogBasketLUComponent();
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
VersamentoMerceComponent.Factory versamentoMerceComponent();
@@ -317,6 +352,7 @@ public interface MainApplicationComponent {
DialogInfoSituazioneArticoloComponent.Factory dialogInfoSituazioneArticoloComponent();
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsNewComponent();
DialogSelectLottiComponent.Factory dialogSelectLottiComponent();
DialogSelectArtToOrderComponent.Factory dialogSelectArtToOrderNewComponent();
@@ -336,6 +372,26 @@ public interface MainApplicationComponent {
DialogAskLineaProdComponent.Factory dialogAskLineaProdComponent();
ProdRiposizionamentoDaProdComponent.Factory prodRiposizionamentoDaprodComponent();
DialogInfoGiacenzaComponent.Factory dialogInfoGiacenzaComponent();
ArticoliInGiacenzaComponent.Factory controlloGiacenzeComponent();
DialogTracciamentoImballiComponent.Factory dialogTracciamentoImballiComponent();
DialogAskVettoreComponent.Factory dialogAskVettoreComponent();
DialogAskCommessaComponent.Factory dialogAskCommessaComponent();
DialogCreateNewArtComponent.Factory dialogCreateNewArtComponent();
DialogSwitchUserDepoComponent.Factory dialogSwitchUserDepoComponent();
ProdRientroMerceOrderListComponent.Factory prodRientroMerceOrderListComponent();
DialogUpdateAvailableComponent.Factory dialogUpdateAvailableComponent();
void inject(MainApplication mainApplication);
void inject(AppContext mainApplication);

View File

@@ -16,8 +16,11 @@ import it.integry.integrywmsnative.core.context.AppContext;
import it.integry.integrywmsnative.core.context.MainContext;
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
import it.integry.integrywmsnative.core.ean128.Ean128Service;
import it.integry.integrywmsnative.core.menu.MenuRESTConsumer;
import it.integry.integrywmsnative.core.menu.MenuService;
import it.integry.integrywmsnative.core.rest.AuthInterceptor;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.AziendaRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
@@ -31,20 +34,26 @@ import it.integry.integrywmsnative.core.rest.consumers.DocumentRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ImballiRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoBufferRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.PVOrdiniAcquistoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ProduzioneRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.VettoriRESTConsumer;
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.sound.SoundAlertService;
import it.integry.integrywmsnative.core.update.UpdatesManager;
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
import it.integry.integrywmsnative.gest.login.rest.AuthenticationRESTConsumer;
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
@@ -78,8 +87,8 @@ public class MainApplicationModule {
@Provides
@Singleton
public SettingsManager provideSettingsManager(SystemRESTConsumer systemRESTConsumer, AziendaRESTConsumer aziendaRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer, GestSetupRESTConsumer gestSetupRESTConsumer) {
return new SettingsManager(mApplication, systemRESTConsumer, aziendaRESTConsumer, gestSetupRESTConsumer, posizioniRESTConsumer);
public SettingsManager provideSettingsManager(SystemRESTConsumer systemRESTConsumer, ImballiRESTConsumer imballiRESTConsumer, AziendaRESTConsumer aziendaRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer, GestSetupRESTConsumer gestSetupRESTConsumer) {
return new SettingsManager(mApplication, systemRESTConsumer, imballiRESTConsumer, aziendaRESTConsumer, gestSetupRESTConsumer, posizioniRESTConsumer);
}
@Provides
@@ -90,8 +99,8 @@ public class MainApplicationModule {
@Provides
@Singleton
MainContext providesMainContextNew(MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer) {
return new MainContext(mApplication.getApplicationContext(), menuService, appDatabase, systemRESTConsumer);
MainContext providesMainContextNew(MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer, AuthenticationRESTConsumer authenticationRESTConsumer) {
return new MainContext(mApplication.getApplicationContext(), menuService, appDatabase, systemRESTConsumer, authenticationRESTConsumer);
}
@Provides
@@ -102,6 +111,19 @@ public class MainApplicationModule {
return colliDataRecoverService;
}
@Provides
@Singleton
Ean128Service provideEan128Service() {
return new Ean128Service();
}
@Provides
@Singleton
RESTBuilder providesRESTBuilder(AuthInterceptor authInterceptor) {
return new RESTBuilder(authInterceptor);
}
@Provides
@Singleton
MenuService provideMenuService(MenuRESTConsumer menuRESTConsumer) {
@@ -110,8 +132,8 @@ public class MainApplicationModule {
@Provides
@Singleton
UpdatesManager provideUpdatesManager() {
return new UpdatesManager();
UpdatesManager provideUpdatesManager(ExecutorService executorService, Handler handler, SystemRESTConsumer systemRESTConsumer) {
return new UpdatesManager(executorService, handler, systemRESTConsumer);
}
@Provides
@@ -128,20 +150,20 @@ public class MainApplicationModule {
@Provides
@Singleton
OrdiniRESTConsumer provideOrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
return new OrdiniRESTConsumer(systemRESTConsumer, entityRESTConsumer);
OrdiniRESTConsumer provideOrdiniRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
return new OrdiniRESTConsumer(restBuilder, systemRESTConsumer, entityRESTConsumer);
}
@Provides
@Singleton
GestSetupRESTConsumer provideGestSetupRESTConsumer() {
return new GestSetupRESTConsumer();
GestSetupRESTConsumer provideGestSetupRESTConsumer(RESTBuilder restBuilder) {
return new GestSetupRESTConsumer(restBuilder);
}
@Provides
@Singleton
ArticoloRESTConsumer provideArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
return new ArticoloRESTConsumer(systemRESTConsumer);
ArticoloRESTConsumer provideArticoloRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
return new ArticoloRESTConsumer(restBuilder, systemRESTConsumer);
}
@Provides
@@ -158,89 +180,108 @@ public class MainApplicationModule {
@Provides
@Singleton
MenuRESTConsumer provideMenuRESTConsumer() {
return new MenuRESTConsumer();
MenuRESTConsumer provideMenuRESTConsumer(RESTBuilder restBuilder) {
return new MenuRESTConsumer(restBuilder);
}
@Provides
@Singleton
MagazzinoRESTConsumer provideMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
return new MagazzinoRESTConsumer(systemRESTConsumer);
MagazzinoRESTConsumer provideMagazzinoRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService, SystemRESTConsumer systemRESTConsumer) {
return new MagazzinoRESTConsumer(restBuilder, executorService, systemRESTConsumer);
}
@Provides
@Singleton
MesRESTConsumer provideMesRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
return new MesRESTConsumer(systemRESTConsumer);
MesRESTConsumer provideMesRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
return new MesRESTConsumer(restBuilder, systemRESTConsumer);
}
@Provides
@Singleton
EntityRESTConsumer provideEntityRESTConsumer() {
return new EntityRESTConsumer();
EntityRESTConsumer provideEntityRESTConsumer(RESTBuilder restBuilder) {
return new EntityRESTConsumer(restBuilder);
}
@Provides
@Singleton
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer,
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer(RESTBuilder restBuilder,
SystemRESTConsumer systemRESTConsumer,
ArticoloRESTConsumer articoloRESTConsumer,
EntityRESTConsumer entityRESTConsumer,
SettingsManager settingsManager) {
return new ColliMagazzinoRESTConsumer(systemRESTConsumer, articoloRESTConsumer, entityRESTConsumer, settingsManager);
return new ColliMagazzinoRESTConsumer(restBuilder, systemRESTConsumer, articoloRESTConsumer, entityRESTConsumer, settingsManager);
}
@Provides
@Singleton
AziendaRESTConsumer provideAziendaRESTConsumer() {
return new AziendaRESTConsumer();
AziendaRESTConsumer provideAziendaRESTConsumer(RESTBuilder restBuilder) {
return new AziendaRESTConsumer(restBuilder);
}
@Provides
@Singleton
BarcodeRESTConsumer provideBarcodeRESTConsumer() {
return new BarcodeRESTConsumer();
ProduzioneRESTConsumer provideProduzioneRESTConsumer(RESTBuilder restBuilder) {
return new ProduzioneRESTConsumer(restBuilder);
}
@Provides
@Singleton
PrinterRESTConsumer providePrinterRESTConsumer() {
return new PrinterRESTConsumer();
BarcodeRESTConsumer provideBarcodeRESTConsumer(Ean128Service ean128Service) {
return new BarcodeRESTConsumer(ean128Service);
}
@Provides
@Singleton
SystemRESTConsumer provideSystemRESTConsumer() {
return new SystemRESTConsumer();
PrinterRESTConsumer providePrinterRESTConsumer(RESTBuilder restBuilder) {
return new PrinterRESTConsumer(restBuilder);
}
@Provides
@Singleton
PVOrdiniAcquistoRESTConsumer providesPVOrdiniAcquistoRESTConsumer(MagazzinoRESTConsumer magazzinoRESTConsumer) {
return new PVOrdiniAcquistoRESTConsumer(magazzinoRESTConsumer);
SystemRESTConsumer provideSystemRESTConsumer(ExecutorService executorService, RESTBuilder restBuilder) {
return new SystemRESTConsumer(executorService, restBuilder);
}
@Provides
@Singleton
PosizioniRESTConsumer providesPosizioniRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
return new PosizioniRESTConsumer(systemRESTConsumer);
PVOrdiniAcquistoRESTConsumer providesPVOrdiniAcquistoRESTConsumer(RESTBuilder restBuilder, MagazzinoRESTConsumer magazzinoRESTConsumer) {
return new PVOrdiniAcquistoRESTConsumer(restBuilder, magazzinoRESTConsumer);
}
@Provides
@Singleton
ProdFabbisognoLineeProdRESTConsumer providesProdFabbisognoLineeProdRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
return new ProdFabbisognoLineeProdRESTConsumer(systemRESTConsumer);
PosizioniRESTConsumer providesPosizioniRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
return new PosizioniRESTConsumer(restBuilder, systemRESTConsumer);
}
@Provides
@Singleton
DocInterniRESTConsumer provideDocInterniRESTConsumer(MagazzinoRESTConsumer magazzinoRESTConsumer) {
return new DocInterniRESTConsumer(magazzinoRESTConsumer);
ProdFabbisognoLineeProdRESTConsumer providesProdFabbisognoLineeProdRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
return new ProdFabbisognoLineeProdRESTConsumer(restBuilder, systemRESTConsumer);
}
@Provides
@Singleton
GiacenzaRESTConsumer provideGiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
return new GiacenzaRESTConsumer(systemRESTConsumer, articoloRESTConsumer);
DocInterniRESTConsumer provideDocInterniRESTConsumer(RESTBuilder restBuilder, MagazzinoRESTConsumer magazzinoRESTConsumer) {
return new DocInterniRESTConsumer(restBuilder, magazzinoRESTConsumer);
}
@Provides
@Singleton
GiacenzaRESTConsumer provideGiacenzaRESTConsumer(RESTBuilder restBuilder, ArticoloRESTConsumer articoloRESTConsumer) {
return new GiacenzaRESTConsumer(restBuilder, articoloRESTConsumer);
}
@Provides
@Singleton
ImballiRESTConsumer provideImballiRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
return new ImballiRESTConsumer(restBuilder, executorService);
}
@Provides
@Singleton
VettoriRESTConsumer provideVettoriRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
return new VettoriRESTConsumer(restBuilder, executorService);
}
@Provides
@@ -251,44 +292,58 @@ public class MainApplicationModule {
@Provides
@Singleton
ProductionLinesRESTConsumer provideProductionLinesRESTConsumer() {
return new ProductionLinesRESTConsumer();
ProductionLinesRESTConsumer provideProductionLinesRESTConsumer(RESTBuilder restBuilder) {
return new ProductionLinesRESTConsumer(restBuilder);
}
@Provides
@Singleton
DocumentRESTConsumer provideDocumentiRESTConsumer() {
return new DocumentRESTConsumer();
DocumentRESTConsumer provideDocumentiRESTConsumer(RESTBuilder restBuilder) {
return new DocumentRESTConsumer(restBuilder);
}
@Provides
@Singleton
ColliAccettazioneRESTConsumer provideColliAccettazioneRESTConsumer() {
return new ColliAccettazioneRESTConsumer();
ColliAccettazioneRESTConsumer provideColliAccettazioneRESTConsumer(RESTBuilder restBuilder) {
return new ColliAccettazioneRESTConsumer(restBuilder);
}
@Provides
@Singleton
ColliSpedizioneRESTConsumer provideColliSpedizioneRESTConsumer() {
return new ColliSpedizioneRESTConsumer();
ColliSpedizioneRESTConsumer provideColliSpedizioneRESTConsumer(RESTBuilder restBuilder) {
return new ColliSpedizioneRESTConsumer(restBuilder);
}
@Provides
@Singleton
ColliLavorazioneRESTConsumer provideColliLavorazioneRESTConsumer(SettingsManager settingsManager) {
return new ColliLavorazioneRESTConsumer(settingsManager);
ColliLavorazioneRESTConsumer provideColliLavorazioneRESTConsumer(RESTBuilder restBuilder, SettingsManager settingsManager) {
return new ColliLavorazioneRESTConsumer(restBuilder, settingsManager);
}
@Provides
@Singleton
MagazzinoAutomaticoRESTConsumer provideMagazzinoAutomaticoRESTConsumer() {
return new MagazzinoAutomaticoRESTConsumer();
MagazzinoAutomaticoRESTConsumer provideMagazzinoAutomaticoRESTConsumer(RESTBuilder restBuilder) {
return new MagazzinoAutomaticoRESTConsumer(restBuilder);
}
@Provides
@Singleton
MagazzinoBufferRESTConsumer provideMagazzinoBufferRESTConsumer() {
return new MagazzinoBufferRESTConsumer();
MagazzinoBufferRESTConsumer provideMagazzinoBufferRESTConsumer(RESTBuilder restBuilder) {
return new MagazzinoBufferRESTConsumer(restBuilder);
}
@Provides
@Singleton
MaterialiRESTConsumer provideMaterialiRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
return new MaterialiRESTConsumer(restBuilder, executorService);
}
@Provides
@Singleton
SoundAlertService provideSoundAlertService() {
SoundAlertService soundAlertService = new SoundAlertService(mApplication.getApplicationContext());
soundAlertService.init();
return soundAlertService;
}
}

View File

@@ -103,12 +103,12 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
@Override
public void onDBDataLoading(String item) {
mBinding.loadingInfoTextview.setText("Caricamento " + item);
runOnUiThread(() -> mBinding.loadingInfoTextview.setText("Caricamento " + item));
}
@Override
public void onMenuLoading() {
mBinding.loadingInfoTextview.setText("Caricamento menù");
runOnUiThread(() -> mBinding.loadingInfoTextview.setText("Caricamento menù"));
}
@Override

View File

@@ -0,0 +1,21 @@
package it.integry.integrywmsnative.core.authentication;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jws;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
public class JwtUtils {
private final static String SIGNING_KEY = "gICy3bjD56i/YFnBZZKe5ibiz3Snsp08nybGGziCV4ZcvyXBbyqWUnJ2wTrRXhOuf/xdljPXX0yBaqdAgvKthQ==";
public static Claims parseJwt(String token) {
Jws<Claims> jws = Jwts.parserBuilder()
.setSigningKey(Keys.hmacShaKeyFor(Decoders.BASE64.decode(SIGNING_KEY)))
.build()
.parseClaimsJws(token);
return jws.getBody();
}
}

View File

@@ -75,7 +75,7 @@ public class BarcodeManager {
var scanMode = sharedPreferences.getString(MainSettingsFragment.KEY_TRIGGER_SCAN_MODE, null);
var scanModeSetting = new Pair<String, Object>(BarcodeSetting.P_TRIGGER_SCAN_MODE, scanMode);
additionalSettings.add(scanModeSetting);
BarcodeManager.changeSettings(additionalSettings);
});
@@ -85,7 +85,7 @@ public class BarcodeManager {
private static BarcodeCallbackDTO getValidCallback() {
if (mBarcodeCallbacksStacktrace.size() > 0) {
if (!mBarcodeCallbacksStacktrace.isEmpty()) {
return mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1);
} else {
return null;
@@ -106,7 +106,7 @@ public class BarcodeManager {
int newID = -1;
if (mBarcodeCallbacksStacktrace.size() > 0) {
if (!mBarcodeCallbacksStacktrace.isEmpty()) {
newID = mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1).getID() + 1;
} else {
newID = 1;

View File

@@ -0,0 +1,5 @@
package it.integry.integrywmsnative.core.base;
public interface Callable<I, O> {
O call(I input);
}

View File

@@ -0,0 +1,5 @@
package it.integry.integrywmsnative.core.base;
public interface CallableII<I, L, O> {
O call(I input, L input2);
}

View File

@@ -5,6 +5,7 @@ import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.MainAccettazioneBollaElencoFragment;
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazioneOrdiniElencoFragment;
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaFragment;
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniFragment;
import it.integry.integrywmsnative.gest.inventario.ElencoInventariFragment;
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoFragment;
@@ -14,6 +15,7 @@ import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisogn
import it.integry.integrywmsnative.gest.prod_linee_produzione.ProdLineeProduzioneFragment;
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceFragment;
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.ProdRiposizionamentoDaProdFragment;
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
import it.integry.integrywmsnative.gest.prod_versamento_materiale_su_mag_prossimita.ProdVersamentoMaterialeInBufferFragment;
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaFragment;
@@ -86,7 +88,8 @@ public class MenuConfiguration extends BaseMenuConfiguration {
.setTitleText(R.string.free_picking)
.setTitleIcon(R.drawable.ic_dashboard_picking_libero)
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_picking, GestioneEnum.VENDITA, SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false)))
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_picking, GestioneEnum.VENDITA,
SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false, false)))
.addItem(new MenuItem()
.setID(R.id.nav_resi_cliente)
@@ -114,7 +117,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
.setTitleText(R.string.prod_ordine_lavorazione_title_fragment)
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_lavorazione)
.setDrawerIcon(R.drawable.ic_black_external)
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, null)))
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, SettingsManager.iDB().isFlagProduzioneShowInfo() ? DialogInfoSituazioneArticoloView.class : null)))
.addItem(new MenuItem()
.setID(R.id.nav_free_lav_picking)
@@ -122,7 +125,8 @@ public class MenuConfiguration extends BaseMenuConfiguration {
.setTitleText(R.string.free_lav_picking)
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_lav_picking, GestioneEnum.LAVORAZIONE, SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false)))
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_lav_picking, GestioneEnum.LAVORAZIONE,
SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false, SettingsManager.iDB().isFlagAskCommessaInPickingLiberoLav())))
.addItem(new MenuItem()
.setID(R.id.nav_prod_posizionamento_da_ord)
@@ -178,7 +182,15 @@ public class MenuConfiguration extends BaseMenuConfiguration {
.setTitleText(R.string.prod_versamento_su_ordine_title_fragment)
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_su_ord)
.setDrawerIcon(R.drawable.ic_black_external)
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.prod_versamento_su_ordine_title_fragment, GestioneEnum.LAVORAZIONE, false, true)))
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.prod_versamento_su_ordine_title_fragment, GestioneEnum.LAVORAZIONE, false, true, false)))
.addItem(new MenuItem()
.setID(R.id.nav_prod_riposizionamento_da_ord)
.setCodMenu("MG069")
.setTitleText(R.string.prod_riposizionamento_da_prod_title)
.setTitleIcon(R.drawable.ic_production_line_produzione)
.setDrawerIcon(R.drawable.ic_black_load_shelf)
.setFragmentFactory(ProdRiposizionamentoDaProdFragment::newInstance))
).addGroup(
new MenuGroup()
.setGroupText(R.string.internal_handling)
@@ -209,6 +221,13 @@ public class MenuConfiguration extends BaseMenuConfiguration {
.setDrawerIcon(R.drawable.ic_black_empty_box)
.setFragmentFactory(ElencoInventariFragment::newInstance))
.addItem(new MenuItem()
.setID(R.id.nav_articoli_in_giacenza)
.setCodMenu("MG070")
.setTitleText(R.string.articoli_in_giacenza_title)
.setTitleIcon(R.drawable.ic_dashboard_articoli_in_giacenza)
.setDrawerIcon(R.drawable.ic_black_empty_box)
.setFragmentFactory(ArticoliInGiacenzaFragment::newInstance))
).addGroup(
new MenuGroup()

View File

@@ -19,6 +19,7 @@ import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityThread;
import it.integry.integrywmsnative.gest.login.rest.AuthenticationRESTConsumer;
@Singleton
public class MainContext {
@@ -27,18 +28,19 @@ public class MainContext {
private final MenuService menuService;
private final AppDatabase appDatabase;
private final SystemRESTConsumer systemRESTConsumer;
private final AuthenticationRESTConsumer authenticationRESTConsumer;
private Listener mListener;
public MainContext(Context applicationContext, MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer) {
public MainContext(Context applicationContext, MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer, AuthenticationRESTConsumer authenticationRESTConsumer) {
this.applicationContext = applicationContext;
this.menuService = menuService;
this.appDatabase = appDatabase;
this.systemRESTConsumer = systemRESTConsumer;
this.authenticationRESTConsumer = authenticationRESTConsumer;
}
public void init() {
try {
BarcodeManager.init(applicationContext);
} catch (Exception exception) {
@@ -46,6 +48,7 @@ public class MainContext {
}
//this.initAuthSession(() -> {
this.initDeviceId(() -> {
this.initDBData(() -> {
this.initMenu(() -> {
@@ -54,12 +57,33 @@ public class MainContext {
});
});
});
//});
this.initServerStatusChecker();
// EventBus.getDefault().register(this);
}
// @Subscribe(threadMode = ThreadMode.MAIN)
// public void onSessionExpired(SessionExpiredEvent event) {
// DialogSimpleMessageView.makeErrorDialog(
// new SpannedString("La sessione è scaduta. Effettua nuovamente la login"),
// null,
// () -> {
// logout(MainApplication::exit);
// })
// .show(activity.getSupportFragmentManager(), "expired-session-error");
// }
private void initAuthSession(Runnable onComplete) {
this.authenticationRESTConsumer.me(obj -> {
onComplete.run();
}, ex -> {
if (mListener != null) mListener.onError(new SpannedString(ex.getMessage()));
});
}
private void initDeviceId(Runnable onComplete) {
if (SettingsManager.i().getUserSession().getDeviceId() != null) {

View File

@@ -30,7 +30,7 @@ public class DataCache {
Object foundDataCache = null;
if(dataCacheTemp != null && dataCacheTemp.size() > 0) {
if(dataCacheTemp != null && !dataCacheTemp.isEmpty()) {
foundDataCache = dataCacheTemp.get(0).getItem();
dataCacheList.remove(dataCacheTemp.get(0));
}

View File

@@ -22,6 +22,7 @@ import javax.inject.Singleton;
import it.integry.integrywmsnative.core.CommonConst;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
import it.integry.integrywmsnative.core.utility.UtilityGson;
@Singleton
public class ColliDataRecoverService {
@@ -45,7 +46,7 @@ public class ColliDataRecoverService {
}
public boolean thereIsAnExistantSession() {
return mtbColtsSessions != null && mtbColtsSessions.size() > 0;
return mtbColtsSessions != null && !mtbColtsSessions.isEmpty();
}
public List<Integer> getAllSessionIDs() {
@@ -108,7 +109,7 @@ public class ColliDataRecoverService {
private void loadLocalFile() {
InputStream inputStream;
Gson gson = new Gson();
Gson gson = UtilityGson.createObject();
try {
inputStream = mApplicationContext.openFileInput(CommonConst.Files.RECOVER_COLLO_FILE);
@@ -130,7 +131,7 @@ public class ColliDataRecoverService {
private void updateLocalFile() {
FileOutputStream outputStream;
Gson gson = new Gson();
Gson gson = UtilityGson.createObject();
String jsonText = gson.toJson(mtbColtsSessions);
try {

View File

@@ -9,7 +9,7 @@ import java.math.BigDecimal;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
public class BindableBigDecimal implements Observable {
public class BindableBigDecimal implements Observable {
BigDecimal mValue;

View File

@@ -105,6 +105,28 @@ public class Converters {
view.setTag(R.id.bound_observable, new Pair<>(observableField, watcher));
view.addTextChangedListener(watcher);
}
String newValue = observableField != null ? observableField.get() : "";
if (!view.getText().toString().equals(newValue)) {
view.setText(newValue);
}
}
@BindingAdapter("binding")
public static void bindEditText(AppCompatTextView view, final ValidatableObservableField<String> observableField) {
Pair<ValidatableObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
if (pair == null || pair.first != observableField) {
if (pair != null) {
view.removeTextChangedListener(pair.second);
}
TextWatcherAdapter watcher = new TextWatcherAdapter() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (observableField != null) observableField.set(s.toString());
}
};
view.setTag(R.id.bound_observable, new Pair<>(observableField, watcher));
view.addTextChangedListener(watcher);
}
String newValue = observableField.get();
if (!view.getText().toString().equals(newValue)) {
view.setText(newValue);
@@ -156,6 +178,28 @@ public class Converters {
}
}
@BindingAdapter("binding")
public static void bindEditText(EditText view, final ValidatableObservableField<String> observableString) {
Pair<ValidatableObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
if (pair == null || pair.first != observableString) {
if (pair != null) {
view.removeTextChangedListener(pair.second);
}
TextWatcherAdapter watcher = new TextWatcherAdapter() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
observableString.set(s.toString());
}
};
view.setTag(R.id.bound_observable, new Pair<>(observableString, watcher));
view.addTextChangedListener(watcher);
}
String newValue = observableString.get();
if (!view.getText().toString().equals(newValue)) {
view.setText(newValue);
}
}
@BindingAdapter("binding")
public static void bindEditText(AutoCompleteTextView view, final ObservableField<String> observableString) {
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
@@ -211,16 +255,19 @@ public class Converters {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
BigDecimal value = null;
if (!UtilityString.isNullOrEmpty(s.toString()))
value = new BigDecimal(s.toString());
observableBigDecimal.set(value);
}
};
view.setTag(R.id.bound_observable, new Pair<>(observableBigDecimal, watcher));
view.addTextChangedListener(watcher);
}
BigDecimal newValue = observableBigDecimal.get();
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
view.setText(UtilityNumber.decimalToString(newValue));
@@ -238,8 +285,11 @@ public class Converters {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
BigDecimal value = null;
if (!UtilityString.isNullOrEmpty(s.toString()))
value = new BigDecimal(s.toString());
String newValueString = s.toString().trim();
if (!UtilityString.isNullOrEmpty(newValueString))
value = new BigDecimal(newValueString);
observableBigDecimal.set(value);
}
};
@@ -247,7 +297,37 @@ public class Converters {
view.addTextChangedListener(watcher);
}
BigDecimal newValue = observableBigDecimal.get();
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
view.setText(UtilityNumber.decimalToString(newValue));
}
}
@BindingAdapter("binding")
public static void bindTextInputEditTextBigDecimal(EditText view, final ValidatableObservableField<BigDecimal> observableBigDecimal) {
Pair<ValidatableObservableField<BigDecimal>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
if (pair == null || pair.first != observableBigDecimal) {
if (pair != null) {
view.removeTextChangedListener(pair.second);
}
TextWatcherAdapter watcher = new TextWatcherAdapter() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
BigDecimal value = null;
String newValueString = s.toString().trim();
if (!UtilityString.isNullOrEmpty(newValueString))
value = new BigDecimal(newValueString);
observableBigDecimal.set(value);
}
};
view.setTag(R.id.bound_observable, new Pair<>(observableBigDecimal, watcher));
view.addTextChangedListener(watcher);
}
BigDecimal newValue = observableBigDecimal.get();
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
view.setText(UtilityNumber.decimalToString(newValue));
@@ -274,7 +354,7 @@ public class Converters {
view.addTextChangedListener(watcher);
}
BigDecimal newValue = bindableBigDecimal.get();
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
view.setText(UtilityNumber.decimalToString(newValue));
@@ -301,7 +381,7 @@ public class Converters {
view.addTextChangedListener(watcher);
}
Integer newValue = bindableInteger.get();
Integer viewValue = view.getText().toString().trim().length() > 0 ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
Integer viewValue = !view.getText().toString().trim().isEmpty() ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
if (!(viewValue.compareTo(newValue) == 0)) {
view.setText(newValue.toString());
@@ -352,7 +432,7 @@ public class Converters {
view.addTextChangedListener(watcher);
}
Integer newValue = observableInteger.get();
Integer viewValue = view.getText().toString().trim().length() > 0 ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
Integer viewValue = !view.getText().toString().trim().isEmpty() ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
if (!viewValue.equals(newValue) && newValue != null) {
view.setText(newValue.toString());
@@ -379,7 +459,7 @@ public class Converters {
view.addTextChangedListener(watcher);
}
Long newValue = observableLong.get();
Long viewValue = view.getText().toString().trim().length() > 0 ? Long.valueOf(view.getText().toString()) : Long.valueOf(0);
Long viewValue = !view.getText().toString().trim().isEmpty() ? Long.valueOf(view.getText().toString()) : Long.valueOf(0);
if (!viewValue.equals(newValue) && newValue != null) {
view.setText(newValue.toString());
@@ -651,6 +731,30 @@ public class Converters {
view.setChecked(newValue);
}
@BindingAdapter("checked")
public static void bindCheckbox(AppCompatCheckBox view, final ObservableField<Boolean> bindableBoolean) {
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
view.setTag(R.id.bound_observable, bindableBoolean);
view.setOnCheckedChangeListener((compoundButton, b) -> {
bindableBoolean.set(b);
});
}
Boolean newValue = bindableBoolean.get();
view.setChecked(newValue);
}
@BindingAdapter("checked")
public static void bindCheckbox(AppCompatCheckBox view, final ValidatableObservableField<Boolean> bindableBoolean) {
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
view.setTag(R.id.bound_observable, bindableBoolean);
view.setOnCheckedChangeListener((compoundButton, b) -> {
bindableBoolean.set(b);
});
}
Boolean newValue = bindableBoolean.get();
view.setChecked(newValue);
}
@BindingAdapter("checked")
public static void bindCheckbox(CheckBox view, final BindableBoolean bindableBoolean) {
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
@@ -715,10 +819,55 @@ public class Converters {
}
@BindingAdapter("visibilityWhenNotNull")
public static void bindViewVisibilityWhenNotNull(View view, ObservableField<?> bindableObject) {
if(bindableObject == null) return;
if (view.getTag(R.id.bound_observable) != bindableObject) {
view.setTag(R.id.bound_observable, bindableObject);
}
bindableObject.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
@Override
public void onPropertyChanged(Observable sender, int propertyId) {
view.setVisibility(bindableObject.get() == null ? View.GONE : View.VISIBLE);
}
});
view.setVisibility(bindableObject.get() == null ? View.GONE : View.VISIBLE);
}
@BindingAdapter("visibilityWhenNotNull")
public static void bindViewVisibilityWhenNotNull(View view, Object genericObject) {
view.setVisibility(genericObject == null ? View.GONE : View.VISIBLE);
}
@BindingAdapter("visibilityWhenNull")
public static void bindViewVisibilityWhenNull(View view, ObservableField<?> bindableObject) {
if (view.getTag(R.id.bound_observable_visibility) != bindableObject) {
view.setTag(R.id.bound_observable_visibility, bindableObject);
}
view.setVisibility(bindableObject == null || bindableObject.get() == null ? View.VISIBLE : View.GONE);
if(bindableObject == null) return;
bindableObject.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
@Override
public void onPropertyChanged(Observable sender, int propertyId) {
view.setVisibility(bindableObject.get() == null ? View.VISIBLE : View.GONE);
}
});
}
@BindingAdapter({"reverse_visibility"})
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
view.setTag(R.id.bound_observable, bindableBoolean);
if (view.getTag(R.id.bound_reverse_visibility) != bindableBoolean) {
view.setTag(R.id.bound_reverse_visibility, bindableBoolean);
}
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
@Override

View File

@@ -0,0 +1,65 @@
package it.integry.integrywmsnative.core.di;
import androidx.annotation.Nullable;
import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;
import java.util.ArrayList;
import java.util.List;
import it.integry.integrywmsnative.BR;
import it.integry.integrywmsnative.core.di.validators.Validator;
public class ValidatableObservableField<T> extends BaseObservable {
private T mValue;
private final List<Validator<T>> validators = new ArrayList<>();
public String errorMessage;
public ValidatableObservableField() {
}
public ValidatableObservableField(T value) {
mValue = value;
}
/**
* @return the stored value.
*/
@Nullable
public T get() {
return mValue;
}
public void set(T value) {
if (value != mValue) {
mValue = value;
notifyChange();
validate();
}
}
public void addValidator(Validator<T> validator) {
validators.add(validator);
}
public boolean validate() {
for (Validator<T> validator : validators) {
if (!validator.isValid(mValue)) {
setErrorMessage(validator.getErrorMessage());
return false;
}
}
setErrorMessage(null);
return true;
}
@Bindable
public String getErrorMessage() {
return errorMessage;
}
private void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
notifyPropertyChanged(BR.errorMessage); // Notifica il cambiamento di errorMessage
}
}

View File

@@ -2,5 +2,25 @@ package it.integry.integrywmsnative.core.di.binders;
public class AutoCompleteTextViewBinders {
// @BindingAdapter("binding")
// public static void bindUntMisText(AppCompatAutoCompleteTextView view, ObservableField<MtbUntMis> untMisField) {
// Pair<ObservableField<MtbUntMis>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
// if (pair == null || pair.first != untMisField) {
// if (pair != null) {
// view.removeTextChangedListener(pair.second);
// }
// TextWatcherAdapter watcher = new TextWatcherAdapter() {
// @Override
// public void onTextChanged(CharSequence s, int start, int before, int count) {
// if (untMisField != null) untMisField.set(s.toString());
// }
// };
// view.setTag(R.id.bound_observable, new Pair<>(untMisField, watcher));
// view.addTextChangedListener(watcher);
// }
// String newValue = untMisField != null && untMisField.get() != null ? Objects.requireNonNull(untMisField.get()).getUntMis() : "";
// if (!view.getText().toString().equals(newValue)) {
// view.setText(newValue);
// }
// }
}

View File

@@ -1,6 +1,7 @@
package it.integry.integrywmsnative.core.di.binders;
import androidx.databinding.BindingAdapter;
import com.google.android.material.textfield.TextInputLayout;
public class TextInputLayoutBinders {

View File

@@ -1,14 +1,15 @@
package it.integry.integrywmsnative.core.di.binders.recyclerview;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableList;
import androidx.databinding.ViewDataBinding;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.lang.ref.WeakReference;
import java.util.Collection;

View File

@@ -0,0 +1,23 @@
package it.integry.integrywmsnative.core.di.validators;
import java.math.BigDecimal;
public class GreaterThenValidator implements Validator<BigDecimal> {
private final String errorMessage;
private final BigDecimal greaterThanValue;
public GreaterThenValidator(BigDecimal greaterThanValue, String errorMessage) {
this.greaterThanValue = greaterThanValue;
this.errorMessage = errorMessage;
}
@Override
public boolean isValid(BigDecimal value) {
return value != null && value.compareTo(greaterThanValue) > 0;
}
@Override
public String getErrorMessage() {
return errorMessage;
}
}

View File

@@ -0,0 +1,21 @@
package it.integry.integrywmsnative.core.di.validators;
public class MinLengthValidator implements Validator<String> {
private final int minLength;
private final String errorMessage;
public MinLengthValidator(int minLength, String errorMessage) {
this.minLength = minLength;
this.errorMessage = errorMessage;
}
@Override
public boolean isValid(String value) {
return value != null && value.length() >= minLength;
}
@Override
public String getErrorMessage() {
return errorMessage;
}
}

View File

@@ -0,0 +1,19 @@
package it.integry.integrywmsnative.core.di.validators;
public class NotEmptyValidator implements Validator<String> {
private final String errorMessage;
public NotEmptyValidator(String errorMessage) {
this.errorMessage = errorMessage;
}
@Override
public boolean isValid(String value) {
return value != null && !value.trim().isEmpty();
}
@Override
public String getErrorMessage() {
return errorMessage;
}
}

View File

@@ -0,0 +1,19 @@
package it.integry.integrywmsnative.core.di.validators;
public class NotNullValidator<T> implements Validator<T>{
private final String errorMessage;
public NotNullValidator(String errorMessage) {
this.errorMessage = errorMessage;
}
@Override
public boolean isValid(T value) {
return value != null;
}
@Override
public String getErrorMessage() {
return errorMessage;
}
}

View File

@@ -0,0 +1,7 @@
package it.integry.integrywmsnative.core.di.validators;
public interface Validator<T> {
boolean isValid(T value);
String getErrorMessage();
}

View File

@@ -0,0 +1,127 @@
package it.integry.integrywmsnative.core.ean128;
public enum Ean128AI {
NULL, //Valore nullo (usato solo in logica)
SSCC, //Numero sequenziale del collo n2+n18
GTIN, //Codice EAN/UCC unità logistica n2+n14
CONTENT, //Codice EAN/UCC dei prodotti contenuti all'interno di unità log n2+n14
BATCH_LOT, //Numero del lotto di fabbricazione n2+an.20
PROD_DATE, //Data di produzione (yymmdd) 0~50 (2000~2050) - 51~99 (1951~1999) n2+n6
DUE_DATE, //Data di scadenza pagamento fattura n2+n6
PACK_DATE, //Data di confezionamento n2+n6
BEST_BEFORE,//Data minima di validità n2+n6
EXPIRY, //Data massima di validità n2+n6
VARIANT, //Variante di prodotto - uso interno aziendale n2+n2
SERIAL, //Numero di serie n2+an.20
QTY_DATE_BATCH, //Dati supplementari per prodotti farmaceutici n2+an.29
ADDITIONAL_ID, //Numedi di identificazione supplementare del prodotto n3+an.30
CUST_PART_NO, //Codice prodotto interno del cliente n3+an.30
SECONDARY_SERIAL, //Numero di serie secondario n3+an.30
REF_TO_SOURCE, //Entità di origine o marca auricolare n3+an.30
VAR_COUNT, //Quantità variabile n2+n.8
//Misure commerciali e logistiche FORMATO: n4+n6
NET_WEIGHT_KG, //Peso netto in Kg
LENGTH_M, //Lunghezza o 1° dimensione, in mt, uso commerciale
WIDTH_M, //Larghezza, diametro o 2° dimensione, in mt, uso commerciale
HEIGHT_M, //Profondità, spessore, altezza o 3° dimensione, in mt, uso commerciale
AREA_M2, //Superficie, in metriquadri, uso commerciale
NET_VOLUME_L, //Volume, in litri, uso commerciale
NET_VOLUME_M3, //Volume, in metricubi, uso commerciale
NET_WEIGHT_LB, //Peso netto, in libbre, uso commerciale
LENGTH_I, //Lunghezza o 1° dimensione, in pollici, uso commerciale
LENGTH_F, //Lunghezza o 1° dimensione, in piedi, uso commerciale
LENGTH_Y, //Lunghezza o 1° dimensione, in yards, uso commerciale
WIDTH_I, //Larghezza, diametro o 2° dimensione, in pollici, uso commerciale
WIDTH_F, //Larghezza, diametro o 2° dimensione, in piedi, uso commerciale
WIDTH_Y, //Larghezza, diametro o 2° dimensione, in yards, uso commerciale
HEIGHT_I, //Profondità, spessore, altezza o 3° dimensione, in pollici, uso commerciale
HEIGHT_F, //Profondità, spessore, altezza o 3° dimensione, in piedi, uso commerciale
HEIGHT_Y, //Profondità, spessore, altezza o 3° dimensione, in yards, uso commerciale
CROSSWEIGHT_KG_LOG, //Peso lordo, in Kg, uso logistico
LENGTH_M_LOG, //Lunghezza o 1° dimensione, in metri, uso logistico
WIDTH_M_LOG, //Larghezza, diametro o 2° dimensione, in metri, uso logistico
HEIGHT_M_LOG, //Profondità, spessore, altezza o 3° dimensione, in metri, uso logistico
AREA_M2_LOG, //Superficie, in metriquadri, uso logistico
VOLUME_L_LOG, //Volume lordo, in litri, uso logistico
VOLUME_M3_LOG, //Volume lordo, in metricubi, uso logistico
CROSSWEIGHT_LB_LOG, //Peso lordo, in libbre, uso logistico
LENGTH_I_LOG, //Lunghezza o 1° dimensione, in pollici, uso logistico
LENGTH_F_LOG, //Lunghezza o 1° dimensione, in piedi, uso logistico
LENGTH_Y_LOG, //Lunghezza o 1° dimensione, in yards, uso logistico
WIDTH_I_LOG, //Larghezza, diametro o 2° dimensione, in pollici, uso logistico
WIDTH_F_LOG, //Larghezza, diametro o 2° dimensione, in piedi, uso logistico
WIDTH_Y_LOG, //Larghezza, diametro o 2° dimensione, in yards, uso logistico
HEIGHT_I_LOG, //Profondità, spessore, altezza o 3° dimensione, in pollici, uso logistico
HEIGHT_F_LOG, //Profondità, spessore, altezza o 3° dimensione, in piedi, uso logistico
HEIGHT_Y_LOG, //Profondità, spessore, altezza o 3° dimensione, in yards, uso logistico
AREA_I2, //Superficie, in pollici quadrati, uso commerciale
AREA_F2, //Superficie, in piedi quadrati, uso commerciale
AREA_Y2, //Superficie, in yards quadrati, uso commerciale
AREA_I2_LOG, //Superficie, in pollici quadrati, uso logistico
AREA_F2_LOG, //Superficie, in piedi quadrati, uso logistico
AREA_Y2_LOG, //Superficie, in yards quadrati, uso logistico
NET_WEIGHT_T, //Peso netto, in once troy, uso commerciale
NET_VOLUME_OZ, //Volume netto, in once (U.S.), uso commerciale
NET_VOLUME_LB, //Volume netto, in quarti di gallone, uso commerciale
NET_VOLUME_G, //Volume netto, in galloni (U.S.), uso commerciale
VOLUME_Q_LOG, //Volume lordo, in quarti di gallone, uso logistico
VOLUME_G_LOG, //Volume lordo, in galloni (U.S.), uso logistico
NET_VOLUME_I3, //Volume netto, in pollici cubi, uso commerciale
NET_VOLUME_F3, //Volume netto, in piedi cubi, uso commerciale
NET_VOLUME_Y3, //Volume netto, in yards cubi, uso commerciale
VOLUME_I3_LOG, //Volume lordo, in pollici cubi, uso logistico
VOLUME_F3_LOG, //Volume lordo, in piedi cubi, uso logistico
VOLUME_Y3_LOG, //Volume lordo, in yards cubi, uso logistico
COUNT, //Quantità prodotti contenuti in un'unità logistica
AMOUNT, //Importo da pagare singola area monetaria
AMOUNT_ISO, //Importo da pagare con codice valuta ISO
PRICE, //Importo da pagare singola unità monetaria (prodotti a peso variabile)
PRICE_ISO, //Importo da pagare con codice valuta ISO (prodotti a peso variabile)
ORDER_NUMBER, //Numero d'ordine d'acquisto cliente
CONSIGNMENT, //Numero di consegna
SHIPMENT_NO, //Numero di spedizione
ROUTE, //Codice di smistamento pacchi
SHIP_TO_LOC, //Codice di locazione EAN/UCC "Spedire a, Consegnare a"
BILL_TO_LOC, //Codice di locazione EAN/UCC "Fatturare a"
PURCHASE_FROM_LOC, //Codice di locazione EAN/UCC "Acquistato da"
SHIP_FOR_LOC, //Codice di locazione EAN/UCC "Sperdire per, Consegnare per, Inoltrare a"
LOC_NO, //Codice di locazione EAN/UCC: identificazione di una locazione fisica
PAY_TO_LOC, //Codice di locazione EAN/UCC di chi emette la fattura
SHIP_TO_POST, //Codice postale "Spedire a, Consegnare a" (nazionale)
SHIP_TO_POST_ISO, //Codice postale "Spedire a, Consegnare a" con codice nazione ISO
ORIGIN, //Paese di origine del prodotto
COUNTRY_INITIAL_PROCESS, //Paese di lavorazione iniziale del prodotto con codice nazionale ISO
COUNTRY_PROCESS, //Paese di lavorazione con codice nazionale ISO
COUNTRY_DISASSEMBLY, //Paese di scomposizione con codice nazionale ISO
COUNTRY_FULL_PROCESS,//Paese di lavorazione completa con codice nazionale ISO
NSN, //Numero di stock NATO
MEAT_CUT, //Carcasse animali e classificazione dei tagli UN/ECE
PROCESSORS, //Numero di approvazione del laboratorio di lavorazione intermedio con codice nazionale ISO
DIMENSIONS, //Prodotti in rotoli - larghezza, lunghezza, diametro interno, senso di svolgimento e giunte
CMT_NO, //Numero sequenziale elettronico per applicazioni di telefonia cellulare
GRAI, //Numero di identificazione per beni a rendere,
GIAI, //Numero di identificazione globale per beni individuali
PRICE_PER_UNIT, //Prezzo per unità di misura
GCTIN, //Identificazione dei componenti di un prodotto
IBAN, //Numero di contocorrente bancario internazionale
PROD_TIME, //Data e ora di produzione
GSRN, //Numedo Globale di Relazione di Servizio
REF_NO, //Numero del bollettino di pagamento
COUPON_1, //Codice esteso per i coupons, UCC
COUPON_2, //Codice esteso per i coupons, UCC
COUPON_3, //Codice esteso per i coupons, UCC
INTERNAL_PART, //Informazioni concordate tra i partners commerciali
INTERNAL_1, //Informazioni interne
INTERNAL_2, //Informazioni interne
INTERNAL_3, //Informazioni interne
INTERNAL_4, //Informazioni interne
INTERNAL_5, //Informazioni interne
INTERNAL_6, //Informazioni interne
INTERNAL_7, //Informazioni interne
INTERNAL_8, //Informazioni interne
INTERNAL_9, //Informazioni interne
}

View File

@@ -0,0 +1,40 @@
package it.integry.integrywmsnative.core.ean128;
public class Ean128AIModel implements Cloneable {
public Ean128AI AI;
public String code;
public int dataLength;
public boolean flagVariableLength;
public boolean flagOnlyNumeric;
public int decimalDigits;
public Ean128AIModel(Ean128AI AI, String code, int dataLength, boolean flagVariableLength, boolean flagOnlyNumeric, int decimalDigits) {
this.AI = AI;
this.code = code;
this.dataLength = dataLength;
this.flagVariableLength = flagVariableLength;
this.flagOnlyNumeric = flagOnlyNumeric;
this.decimalDigits = decimalDigits;
}
public Ean128AIModel(Ean128AI AI, String code, int dataLength, boolean flagVariableLength, boolean flagOnlyNumeric) {
this.AI = AI;
this.code = code;
this.dataLength = dataLength;
this.flagVariableLength = flagVariableLength;
this.flagOnlyNumeric = flagOnlyNumeric;
}
protected Object clone() throws CloneNotSupportedException {
return super.clone();
}
}

View File

@@ -0,0 +1,209 @@
package it.integry.integrywmsnative.core.ean128;
import java.util.regex.MatchResult;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Ean128AIModelBij {
private final Ean128AIModel[] _aiModelArray = new Ean128AIModel[]{
new Ean128AIModel(Ean128AI.SSCC, "^00", 18, false, true),
new Ean128AIModel(Ean128AI.GTIN, "^01", 14, false, true),
new Ean128AIModel(Ean128AI.CONTENT, "^02", 14, false, true),
new Ean128AIModel(Ean128AI.BATCH_LOT, "^10", 20, true, false),
new Ean128AIModel(Ean128AI.PROD_DATE, "^11", 6, false, true),
new Ean128AIModel(Ean128AI.DUE_DATE, "^12", 6, false, true),
new Ean128AIModel(Ean128AI.PACK_DATE, "^13", 6, false, true),
new Ean128AIModel(Ean128AI.BEST_BEFORE, "^15", 6, false, true),
new Ean128AIModel(Ean128AI.EXPIRY, "^17", 6, false, true),
new Ean128AIModel(Ean128AI.VARIANT, "^20", 2, false, true),
new Ean128AIModel(Ean128AI.SERIAL, "^21", 20, true, false),
new Ean128AIModel(Ean128AI.QTY_DATE_BATCH, "^22", 29, true, false),
new Ean128AIModel(Ean128AI.ADDITIONAL_ID, "^240", 30, true, false),
new Ean128AIModel(Ean128AI.CUST_PART_NO, "^241", 30, true, false),
new Ean128AIModel(Ean128AI.SECONDARY_SERIAL, "^250", 30, true, false),
new Ean128AIModel(Ean128AI.REF_TO_SOURCE, "^251", 30, true, false),
new Ean128AIModel(Ean128AI.VAR_COUNT, "^30", 8, true, true),
new Ean128AIModel(Ean128AI.NET_WEIGHT_KG, "^310(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.LENGTH_M, "^311(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.WIDTH_M, "^312(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.HEIGHT_M, "^313(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.AREA_M2, "^314(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.NET_VOLUME_L, "^315(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.NET_VOLUME_M3, "^316(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.NET_WEIGHT_LB, "^320(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.LENGTH_I, "^321(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.LENGTH_F, "^322(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.LENGTH_Y, "^323(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.WIDTH_I, "^324(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.WIDTH_F, "^325(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.WIDTH_Y, "^326(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.HEIGHT_I, "^327(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.HEIGHT_F, "^328(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.HEIGHT_Y, "^329(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.CROSSWEIGHT_KG_LOG, "^330(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.LENGTH_M_LOG, "^331(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.WIDTH_M_LOG, "^332(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.HEIGHT_M_LOG, "^333(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.AREA_M2_LOG, "^334(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.VOLUME_L_LOG, "^335(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.VOLUME_M3_LOG, "^336(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.CROSSWEIGHT_LB_LOG, "^340(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.LENGTH_I_LOG, "^341(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.LENGTH_F_LOG, "^342(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.LENGTH_Y_LOG, "^343(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.WIDTH_I_LOG, "^344(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.WIDTH_F_LOG, "^345(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.WIDTH_Y_LOG, "^346(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.HEIGHT_I_LOG, "^347(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.HEIGHT_F_LOG, "^348(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.HEIGHT_Y_LOG, "^349(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.AREA_I2, "^350(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.AREA_F2, "^351(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.AREA_Y2, "^352(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.AREA_I2_LOG, "^353(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.AREA_F2_LOG, "^354(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.AREA_Y2_LOG, "^355(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.NET_WEIGHT_T, "^356(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.NET_VOLUME_OZ, "^357(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.NET_VOLUME_LB, "^360(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.NET_VOLUME_G, "^361(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.VOLUME_Q_LOG, "^362(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.VOLUME_G_LOG, "^363(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.NET_VOLUME_I3, "^364(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.NET_VOLUME_F3, "^365(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.NET_VOLUME_Y3, "^366(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.VOLUME_I3_LOG, "^367(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.VOLUME_F3_LOG, "^368(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.VOLUME_Y3_LOG, "^369(\\d{1})", 6, false, true),
new Ean128AIModel(Ean128AI.COUNT, "^37", 8, true, true),
new Ean128AIModel(Ean128AI.AMOUNT, "^390(\\d{1})", 15, true, true),
new Ean128AIModel(Ean128AI.AMOUNT_ISO, "^391(\\d{1})", 18, true, true),
new Ean128AIModel(Ean128AI.PRICE, "^392(\\d{1})", 15, true, true),
new Ean128AIModel(Ean128AI.PRICE_ISO, "^393(\\d{1})", 18, true, true),
new Ean128AIModel(Ean128AI.ORDER_NUMBER, "^400", 30, true, false),
new Ean128AIModel(Ean128AI.CONSIGNMENT, "^401", 30, true, false),
new Ean128AIModel(Ean128AI.SHIPMENT_NO, "^402", 17, false, true),
new Ean128AIModel(Ean128AI.ROUTE, "^403", 30, true, false),
new Ean128AIModel(Ean128AI.SHIP_TO_LOC, "^410", 13, false, true),
new Ean128AIModel(Ean128AI.BILL_TO_LOC, "^411", 13, false, true),
new Ean128AIModel(Ean128AI.PURCHASE_FROM_LOC, "^412", 13, false, true),
new Ean128AIModel(Ean128AI.SHIP_FOR_LOC, "^413", 13, false, true),
new Ean128AIModel(Ean128AI.LOC_NO, "^414", 13, false, true),
new Ean128AIModel(Ean128AI.PAY_TO_LOC, "^415", 13, false, true),
new Ean128AIModel(Ean128AI.SHIP_TO_POST, "^420", 20, true, false),
new Ean128AIModel(Ean128AI.SHIP_TO_POST_ISO, "^421", 12, true, false),
new Ean128AIModel(Ean128AI.ORIGIN, "^422", 3, false, true),
new Ean128AIModel(Ean128AI.COUNTRY_INITIAL_PROCESS, "^423", 15, true, true),
new Ean128AIModel(Ean128AI.COUNTRY_PROCESS, "^424", 3, false, true),
new Ean128AIModel(Ean128AI.COUNTRY_DISASSEMBLY, "^425", 3, false, true),
new Ean128AIModel(Ean128AI.COUNTRY_FULL_PROCESS, "^426", 3, false, true),
new Ean128AIModel(Ean128AI.NSN, "^7001", 13, false, true),
new Ean128AIModel(Ean128AI.MEAT_CUT, "^7002", 30, true, false),
new Ean128AIModel(Ean128AI.DIMENSIONS, "^8001", 14, false, true),
new Ean128AIModel(Ean128AI.CMT_NO, "^8002", 20, true, false),
new Ean128AIModel(Ean128AI.GRAI, "^8003", 30, true, false),
new Ean128AIModel(Ean128AI.GIAI, "^8004", 30, true, false),
new Ean128AIModel(Ean128AI.PRICE_PER_UNIT, "^8005", 6, false, true),
new Ean128AIModel(Ean128AI.GCTIN, "^8006", 18, false, false),
new Ean128AIModel(Ean128AI.IBAN, "^8007", 30, true, false),
new Ean128AIModel(Ean128AI.PROD_TIME, "^8008", 12, true, true),
new Ean128AIModel(Ean128AI.GSRN, "^8018", 18, false, true),
new Ean128AIModel(Ean128AI.REF_NO, "^8020", 25, true, false),
new Ean128AIModel(Ean128AI.COUPON_1, "^8100", 6, false, true),
new Ean128AIModel(Ean128AI.COUPON_2, "^8101", 10, false, true),
new Ean128AIModel(Ean128AI.COUPON_3, "^8102", 2, false, true),
new Ean128AIModel(Ean128AI.INTERNAL_PART, "^90", 30, true, false),
new Ean128AIModel(Ean128AI.INTERNAL_1, "^91", 30, true, false),
new Ean128AIModel(Ean128AI.INTERNAL_2, "^92", 30, true, false),
new Ean128AIModel(Ean128AI.INTERNAL_3, "^93", 30, true, false),
new Ean128AIModel(Ean128AI.INTERNAL_4, "^94", 30, true, false),
new Ean128AIModel(Ean128AI.INTERNAL_5, "^95", 30, true, false),
new Ean128AIModel(Ean128AI.INTERNAL_6, "^96", 30, true, false),
new Ean128AIModel(Ean128AI.INTERNAL_7, "^97", 30, true, false),
new Ean128AIModel(Ean128AI.INTERNAL_8, "^98", 30, true, false),
new Ean128AIModel(Ean128AI.INTERNAL_9, "^99", 30, true, false)
};
public int checkAI(String aiToCheck) {
int count = -1;
if (aiToCheck.length() > 1) {
for (int i = 0; i < _aiModelArray.length; i++) {
final String groupSeparatorCharInHexForRegex = "\\x1D";
String codePattern = "";
if (aiToCheck.charAt(0) == (char) 29) {
codePattern += groupSeparatorCharInHexForRegex;
}
codePattern += _aiModelArray[i].code;
Pattern pattern = Pattern.compile(codePattern, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(aiToCheck);
if (matcher.find()) {
count = i;
MatchResult matchResult = matcher.toMatchResult();
if (matchResult.groupCount() >= 1) {
String digitsString = matchResult.group(1);
_aiModelArray[i].decimalDigits = Integer.parseInt(digitsString);
}
break;
}
}
}
return count;
}
public Ean128AIModel readAI(String aiToSearch) {
Ean128AIModel barcodeAIModel = null;
for (Ean128AIModel singleBarcodeAIModel : _aiModelArray) {
final String groupSeparatorCharInHexForRegex = "\\x1D";
String codePattern = "";
if (aiToSearch.charAt(0) == (char) 29) {
codePattern += groupSeparatorCharInHexForRegex;
}
codePattern += singleBarcodeAIModel.code;
Pattern pattern = Pattern.compile(codePattern, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(aiToSearch);
if (matcher.matches()) {
try {
barcodeAIModel = (Ean128AIModel) singleBarcodeAIModel.clone();
MatchResult matchResult = matcher.toMatchResult();
if (matchResult.groupCount() > 1) {
String digitsString = matchResult.group(1);
barcodeAIModel.decimalDigits = Integer.parseInt(digitsString);
}
break;
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
}
}
return barcodeAIModel;
}
public Ean128AIModel getAI(int index) {
return _aiModelArray[index];
}
}

View File

@@ -0,0 +1,8 @@
package it.integry.integrywmsnative.core.ean128;
public class Ean128ISOValueModel<T> {
public String ISOCode;
public T Value;
}

View File

@@ -0,0 +1,331 @@
package it.integry.integrywmsnative.core.ean128;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
import it.integry.integrywmsnative.core.base.Callable;
import it.integry.integrywmsnative.core.base.CallableII;
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
import it.integry.integrywmsnative.core.utility.UtilityDate;
public class Ean128Service {
public Ean128Model decode(BarcodeScanDTO barcodeScanDTO) throws Exception {
byte[] inputEan128ByteArr = barcodeScanDTO.getStringValue().replaceAll("" + ((char) 29), "|").getBytes();
Ean128AIModelBij ean128AIModelBij = new Ean128AIModelBij();
String aiCodeBuffer = "";
Ean128Model model = new Ean128Model();
for (int i = 0; i < inputEan128ByteArr.length; i++) {
aiCodeBuffer += (char) inputEan128ByteArr[i];
if (aiCodeBuffer.startsWith("|")) {
aiCodeBuffer = aiCodeBuffer.substring(1);
}
if (aiCodeBuffer.length() <= 5) {
int aiIndex = ean128AIModelBij.checkAI(aiCodeBuffer);
if (aiIndex != -1) {
Ean128AIModel aiModel = ean128AIModelBij.getAI(aiIndex);
StringBuilder aiValue = new StringBuilder();
if (!aiModel.flagVariableLength) {
for (int j = (i + 1); j < (i + 1) + aiModel.dataLength; j++) {
aiValue.append((char) inputEan128ByteArr[j]);
}
//aiValue = barcodeAsString.Substring(i + 1, aiModel.DataLength);
i += aiModel.dataLength;
} else {
String tempBuffer = "";
i++;
while (i < inputEan128ByteArr.length && i < (aiModel.dataLength + i)) {
byte currentChar = inputEan128ByteArr[i];
if (currentChar != 29 && currentChar != '|') { //Controllo carattere FNC1
tempBuffer += (char) currentChar;
} else {
break;
}
i++;
}
aiValue = new StringBuilder(tempBuffer.replace("\r", "").replace("\n", ""));
}
switch (aiModel.AI) {
case SSCC -> {
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
aiValue = new StringBuilder(aiValue.substring(1));
}
model.Sscc = aiValue.toString();
}
case GTIN -> {
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
aiValue = new StringBuilder(aiValue.substring(1));
}
model.Gtin = aiValue.toString();
}
case CONTENT -> {
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
aiValue = new StringBuilder(aiValue.substring(1));
}
model.Content = aiValue.toString();
}
case BATCH_LOT -> model.BatchLot = aiValue.toString();
case PROD_DATE -> model.ProdDate = convertToDateTime(aiValue.toString());
case DUE_DATE -> model.DueDate = convertToDateTime(aiValue.toString());
case PACK_DATE -> model.PackDate = convertToDateTime(aiValue.toString());
case BEST_BEFORE ->
model.BestBefore = UtilityDate.formatDate(convertToDateTime(aiValue.toString()), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
case EXPIRY -> model.Expiry = UtilityDate.formatDate(convertToDateTime(aiValue.toString()), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
case VARIANT -> model.Variant = aiValue.toString();
case SERIAL -> model.Serial = aiValue.toString();
case QTY_DATE_BATCH -> model.QtyDateBatch = aiValue.toString();
case ADDITIONAL_ID -> model.AdditionalID = aiValue.toString();
case CUST_PART_NO -> model.CustPartNumber = aiValue.toString();
case SECONDARY_SERIAL -> model.SecondarySerial = aiValue.toString();
case REF_TO_SOURCE -> model.RefToSource = aiValue.toString();
case VAR_COUNT -> model.VarCount = aiValue.toString();
case NET_WEIGHT_KG ->
model.NetWeightKg = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case LENGTH_M ->
model.LengthM = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case WIDTH_M ->
model.WidthM = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case HEIGHT_M ->
model.HeightM = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case AREA_M2 ->
model.AreaM2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case NET_VOLUME_L ->
model.NetVolumeL = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case NET_VOLUME_M3 ->
model.NetVolumeM3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case NET_WEIGHT_LB ->
model.NetWeightLb = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case LENGTH_I ->
model.LengthI = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case LENGTH_F ->
model.LengthF = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case LENGTH_Y ->
model.LengthY = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case WIDTH_I ->
model.WidthI = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case WIDTH_F ->
model.WidthF = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case WIDTH_Y ->
model.WidthY = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case HEIGHT_I ->
model.HeightI = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case HEIGHT_F ->
model.HeightF = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case HEIGHT_Y ->
model.HeightY = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case CROSSWEIGHT_KG_LOG ->
model.CrossweightKgLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case CROSSWEIGHT_LB_LOG ->
model.CrossweightLbLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case LENGTH_M_LOG ->
model.LengthMLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case WIDTH_M_LOG ->
model.WidthMLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case HEIGHT_M_LOG ->
model.HeigthMLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case AREA_M2_LOG ->
model.AreaM2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case VOLUME_L_LOG ->
model.VolumeLLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case VOLUME_M3_LOG ->
model.VolumeM3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case LENGTH_I_LOG ->
model.LengthILog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case LENGTH_F_LOG ->
model.LengthFLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case LENGTH_Y_LOG ->
model.LengthYLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case WIDTH_I_LOG ->
model.WidthILog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case WIDTH_F_LOG ->
model.WidthFLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case WIDTH_Y_LOG ->
model.WidthYLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case HEIGHT_I_LOG ->
model.HeigthILog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case HEIGHT_F_LOG ->
model.HeigthFLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case HEIGHT_Y_LOG ->
model.HeigthYLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case AREA_I2 ->
model.AreaI2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case AREA_F2 ->
model.AreaF2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case AREA_Y2 ->
model.AreaY2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case AREA_I2_LOG ->
model.AreaI2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case AREA_F2_LOG ->
model.AreaF2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case AREA_Y2_LOG ->
model.AreaY2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case NET_WEIGHT_T ->
model.NetWeightT = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case NET_VOLUME_OZ ->
model.NetVolumeOz = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case NET_VOLUME_LB ->
model.NetVolumeLb = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case NET_VOLUME_G ->
model.NetVolumeG = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case VOLUME_Q_LOG ->
model.VolumeQLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case VOLUME_G_LOG ->
model.VolumeGLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case NET_VOLUME_I3 ->
model.NetVolumeI3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case NET_VOLUME_F3 ->
model.NetVolumeF3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case NET_VOLUME_Y3 ->
model.NetVolumeY3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case VOLUME_I3_LOG ->
model.VolumeI3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case VOLUME_F3_LOG ->
model.VolumeF3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case VOLUME_Y3_LOG ->
model.VolumeY3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case COUNT -> model.Count = Integer.parseInt(aiValue.toString());
case AMOUNT ->
model.Amount = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case AMOUNT_ISO ->
model.AmountISO = convertToIsoValueModel(aiValue.toString(), aiModel.decimalDigits,
Double::parseDouble,
(input, input2) -> String.valueOf(convertToDecimalString(input, input2)));
case PRICE ->
model.Price = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
case PRICE_ISO ->
model.PriceISO = convertToIsoValueModel(aiValue.toString(), aiModel.decimalDigits,
Double::parseDouble,
(input, input2) -> String.valueOf(convertToDecimalString(input, input2)));
case ORDER_NUMBER -> model.OrderNumber = aiValue.toString();
case CONSIGNMENT -> model.Consignment = aiValue.toString();
case SHIPMENT_NO -> model.ShipmentNo = aiValue.toString();
case ROUTE -> model.Route = aiValue.toString();
case SHIP_TO_LOC -> model.ShipToLoc = aiValue.toString();
case BILL_TO_LOC -> model.BillToLoc = aiValue.toString();
case PURCHASE_FROM_LOC -> model.PurchaseFromLoc = aiValue.toString();
case SHIP_FOR_LOC -> model.ShipForLoc = aiValue.toString();
case LOC_NO -> model.LocationNumber = aiValue.toString();
case PAY_TO_LOC -> model.PayToLoc = aiValue.toString();
case SHIP_TO_POST -> model.ShipToPost = aiValue.toString();
case SHIP_TO_POST_ISO ->
model.ShipToPostISO = convertToIsoValueModel(aiValue.toString(), 0,
new Callable<>() {
@Override
public String call(String input) {
return input;
}
},
new CallableII<>() {
@Override
public String call(String input, Integer input2) {
return input;
}
});
case ORIGIN -> model.Origin = aiValue.toString();
case COUNTRY_INITIAL_PROCESS ->
model.ShipToPostISO = convertToIsoValueModel(aiValue.toString(), 0,
input -> input,
(input, input2) -> input);
case COUNTRY_PROCESS -> model.CountryProcess = aiValue.toString();
case COUNTRY_DISASSEMBLY -> model.CountryDisassembly = aiValue.toString();
case COUNTRY_FULL_PROCESS -> model.CountryFullProcess = aiValue.toString();
case NSN -> model.NSN = aiValue.toString();
case MEAT_CUT -> model.MeatCut = aiValue.toString();
case DIMENSIONS -> model.Dimensions = aiValue.toString();
case CMT_NO -> model.CmtNo = aiValue.toString();
case GRAI -> model.Grai = aiValue.toString();
case GIAI -> model.Giai = aiValue.toString();
case PRICE_PER_UNIT -> model.PricePerUnit = aiValue.toString();
case GCTIN -> model.Gctin = aiValue.toString();
case IBAN -> model.Iban = aiValue.toString();
case PROD_TIME -> model.ProdTime = convertToDateTime(aiValue.toString());
case GSRN -> model.Gsrn = aiValue.toString();
case REF_NO -> model.RefNo = aiValue.toString();
case COUPON_1 -> model.Coupon1 = aiValue.toString();
case COUPON_2 -> model.Coupon2 = aiValue.toString();
case COUPON_3 -> model.Coupon3 = aiValue.toString();
case INTERNAL_PART -> model.InternalPart = aiValue.toString();
case INTERNAL_1 -> model.Internal1 = aiValue.toString();
case INTERNAL_2 -> model.Internal2 = aiValue.toString();
case INTERNAL_3 -> model.Internal3 = aiValue.toString();
case INTERNAL_4 -> model.Internal4 = aiValue.toString();
case INTERNAL_5 -> model.Internal5 = aiValue.toString();
case INTERNAL_6 -> model.Internal6 = aiValue.toString();
case INTERNAL_7 -> model.Internal7 = aiValue.toString();
case INTERNAL_8 -> model.Internal8 = aiValue.toString();
case INTERNAL_9 -> model.Internal9 = aiValue.toString();
default -> {
}
}
aiCodeBuffer = "";
}
} else {
throw new Exception(String.format("Il barcode non è un EAN128 valido (%s)", new String(inputEan128ByteArr)));
}
}
return model;
}
private float convertToDecimalString(String sourceString, int numberOfdecimalDigits) {
int divider = (int) Math.pow(10, numberOfdecimalDigits);
return Float.parseFloat(sourceString) / divider;
}
private <T> Ean128ISOValueModel<T> convertToIsoValueModel(String sourceString, int numberOfDecimalDigits, Callable<String, T> castFunc, CallableII<String, Integer, String> splitFunc) {
String isoCode = sourceString.substring(0, 3);
T value = castFunc.call(splitFunc.call(sourceString.substring(3), numberOfDecimalDigits));
Ean128ISOValueModel<T> isoModel = new Ean128ISOValueModel<>();
isoModel.ISOCode = isoCode;
isoModel.Value = value;
return isoModel;
}
private Date convertToDateTime(String sourceString) {
int year = Integer.parseInt(sourceString.substring(0, 2));
//Se l'anno è minore di 50 indica 2000-2050 altrimenti 1951-1999
int correctedYear = year <= 50 ? (2000 + year) : (1900 + year);
int month = Integer.parseInt(sourceString.substring(2, 4));
int day = Integer.parseInt(sourceString.substring(4, 6));
Date d = null;
try {
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
d = formatter.parse(day + "/" + month + "/" + correctedYear);
} catch (ParseException e) {
e.printStackTrace();
}
return d;
}
}

View File

@@ -0,0 +1,4 @@
package it.integry.integrywmsnative.core.event;
public class SessionExpiredEvent {
}

View File

@@ -0,0 +1,10 @@
package it.integry.integrywmsnative.core.exception;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.utility.UtilityResources;
public final class InvalidCodMdepException extends Exception {
public InvalidCodMdepException() {
super(UtilityResources.getString(R.string.invalid_codmdep));
}
}

View File

@@ -0,0 +1,7 @@
package it.integry.integrywmsnative.core.exception;
public class UnauthorizedAccessException extends Exception {
public UnauthorizedAccessException() {
super("Accesso non autorizzato. Si prega di effettuare nuovamente l'accesso e riprovare");
}
}

View File

@@ -6,6 +6,8 @@ import android.view.KeyEvent;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import java.util.concurrent.ExecutorService;
import javax.inject.Inject;
import it.integry.integrywmsnative.MainApplication;
@@ -18,7 +20,8 @@ public class BaseActivity extends AppCompatActivity {
@Inject
public DialogProgressView mCurrentProgress;
private boolean progressOpened;
@Inject
public ExecutorService executorService;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -47,24 +50,19 @@ public class BaseActivity extends AppCompatActivity {
}
private void openProgress() {
BarcodeManager.disable();
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
this.progressOpened = true;
runOnUiThread(() -> {
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
});
}
// executorService.execute(() -> {
this.mCurrentProgress.show(getSupportFragmentManager());
// });
}
private void closeProgress() {
BarcodeManager.enable();
if (progressOpened) {
this.progressOpened = false;
runOnUiThread(() -> {
mCurrentProgress.dismiss();
});
}
// executorService.execute(() -> {
mCurrentProgress.dismiss();
// });
}
@Override

View File

@@ -2,15 +2,11 @@ package it.integry.integrywmsnative.core.expansion;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.KeyEvent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
public class BaseDialog extends Dialog {

View File

@@ -5,6 +5,7 @@ import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -12,6 +13,8 @@ import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import java.util.concurrent.ExecutorService;
import javax.inject.Inject;
import it.integry.integrywmsnative.MainApplication;
@@ -19,11 +22,13 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
public class BaseDialogFragment extends DialogFragment implements DialogInterface.OnShowListener {
public abstract class BaseDialogFragment extends DialogFragment implements DialogInterface.OnShowListener {
@Inject
public DialogProgressView mCurrentProgress;
private boolean progressOpened;
@Inject
public ExecutorService executorService;
private boolean mBarcodeListener = false;
@@ -69,28 +74,26 @@ public class BaseDialogFragment extends DialogFragment implements DialogInterfac
BarcodeManager.enable();
}
private void openProgress() {
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
this.progressOpened = true;
requireActivity().runOnUiThread(() -> {
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
});
}
BarcodeManager.disable();
// executorService.execute(() -> {
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
// });
}
private void closeProgress() {
if (progressOpened) {
this.progressOpened = false;
requireActivity().runOnUiThread(() -> {
mCurrentProgress.dismiss();
});
}
BarcodeManager.enable();
// executorService.execute(() -> {
mCurrentProgress.dismiss();
// });
}
public void onError(Exception ex) {
this.onLoadingEnded();
requireActivity().runOnUiThread(() -> {
this.onLoadingEnded();
UtilityExceptions.defaultException(requireActivity(), ex);
});
}
@@ -111,7 +114,14 @@ public class BaseDialogFragment extends DialogFragment implements DialogInterfac
@Override
public void onShow(DialogInterface dialogInterface) {
getDialog().getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
this.initialize();
this.onInit(dialogInterface);
}
public void onInit(DialogInterface dialogInterface) {
}
private void initialize() {

View File

@@ -33,7 +33,6 @@ public abstract class BaseFragment extends Fragment {
protected ElevatedToolbar mToolbar;
protected final List<Runnable> mOnPreDestroyList = new ArrayList<>();
private boolean progressOpened;
public void setScrollToolbar(ElevatedToolbar toolbar) {
@@ -67,22 +66,16 @@ public abstract class BaseFragment extends Fragment {
private void openProgress() {
BarcodeManager.disable();
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
this.progressOpened = true;
executorService.execute(() -> {
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
});
}
// executorService.execute(() -> {
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
// });
}
private void closeProgress() {
BarcodeManager.enable();
if (progressOpened) {
this.progressOpened = false;
executorService.execute(() -> {
mCurrentProgress.dismissAllowingStateLoss();
});
}
// executorService.execute(() -> {
mCurrentProgress.dismiss();
// });
}
public void onError(Exception ex) {

View File

@@ -0,0 +1,26 @@
package it.integry.integrywmsnative.core.helper;
import android.content.Context;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import it.integry.integrywmsnative.core.utility.UtilityContext;
public final class ContextHelper {
public static FragmentManager getFragmentManagerFromContext(Context context) {
if (context == null) {
throw new IllegalArgumentException("Context cannot be null");
}
if (context instanceof FragmentActivity) {
return ((FragmentActivity) context).getSupportFragmentManager();
} else if (UtilityContext.getMainActivity() != null) {
return UtilityContext.getMainActivity().getSupportFragmentManager();
}
return null;
}
}

View File

@@ -0,0 +1,16 @@
package it.integry.integrywmsnative.core.helper;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
public final class GestioneToTextConverter {
public static String convert(GestioneEnum gestioneEnum) {
return switch (gestioneEnum) {
case ACQUISTO -> "Acquisto";
case PRODUZIONE -> "Produzione";
case LAVORAZIONE -> "Lavorazione";
case VENDITA -> "Vendita";
};
}
}

View File

@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.mapper;
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRowRoomDTO;
import it.integry.integrywmsnative.core.model.MtbInvenr;
import it.integry.integrywmsnative.core.settings.SettingsManager;
public class InventarioRowMapper extends BaseMapper<MtbInvenr, InventarioRowRoomDTO> {
@@ -32,6 +33,7 @@ public class InventarioRowMapper extends BaseMapper<MtbInvenr, InventarioRowRoom
data.setDataOraInv(inputData.getDataOraInv());
data.setScanCodBarre(inputData.getScanCodBarre());
data.setZona(inputData.getZona());
data.setIdDisp(SettingsManager.i().getUserSession().getDeviceId());
return data;
}
}

View File

@@ -1,30 +1,38 @@
package it.integry.integrywmsnative.core.menu;
import androidx.annotation.NonNull;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.StbMenu;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class MenuRESTConsumer extends _BaseRESTConsumer {
private final RESTBuilder restBuilder;
public MenuRESTConsumer(RESTBuilder restBuilder) {
this.restBuilder = restBuilder;
}
public void retrieveMenu(String rootCodOpz, RunnableArgs<StbMenu> onComplete, RunnableArgs<Exception> onFailed) {
MenuRESTConsumerService menuRESTConsumerService = RESTBuilder.getService(MenuRESTConsumerService.class);
menuRESTConsumerService.retrieveMenuConfig(rootCodOpz).enqueue(new Callback<>() {
MenuRESTConsumerService menuRESTConsumerService = restBuilder.getService(MenuRESTConsumerService.class);
menuRESTConsumerService.retrieveMenuConfig(rootCodOpz).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<StbMenu>> call, Response<ServiceRESTResponse<StbMenu>> response) {
analyzeAnswer(response, "retrieveMenu", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<StbMenu>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<StbMenu>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@@ -1,7 +1,5 @@
package it.integry.integrywmsnative.core.model;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import it.integry.integrywmsnative.core.utility.UtilityDate;

View File

@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.model;
public class JtbComt extends EntityBase {
private String codJcom;
private String codAnag;
private String codJfas;
private String codJflav;
private String descrizione;
@@ -20,6 +21,15 @@ public class JtbComt extends EntityBase {
return this;
}
public String getCodAnag() {
return codAnag;
}
public JtbComt setCodAnag(String codAnag) {
this.codAnag = codAnag;
return this;
}
public String getCodJfas() {
return codJfas;
}

View File

@@ -7,6 +7,7 @@ import java.util.Date;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.core.utility.UtilityString;
public class MtbColr extends EntityBase {
@@ -25,7 +26,7 @@ public class MtbColr extends EntityBase {
private String gestioneRif;
private String serColloRif;
private String note;
private String dataOrd;
private LocalDate dataOrd;
private String dataColloRif;
private BigDecimal qtaCnf;
private BigDecimal qtaCol;
@@ -224,24 +225,15 @@ public class MtbColr extends EntityBase {
return this;
}
public String getDataOrdS() {
public LocalDate getDataOrd() {
return dataOrd;
}
public Date getDataOrdD() {
return UtilityDate.recognizeDateWithExceptionHandler(getDataOrdS());
}
public MtbColr setDataOrd(String dataOrd) {
public MtbColr setDataOrd(LocalDate dataOrd) {
this.dataOrd = dataOrd;
return this;
}
public MtbColr setDataOrd(Date dataOrd) {
this.dataOrd = UtilityDate.formatDate(dataOrd, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH);
return this;
}
public String getDataColloRifS() {
return dataColloRif;
}
@@ -260,6 +252,11 @@ public class MtbColr extends EntityBase {
return this;
}
public MtbColr setDataColloRif(LocalDate dataColloRif) {
this.dataColloRif = UtilityDate.formatDate(dataColloRif, UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
return this;
}
public BigDecimal getQtaCnf() {
return qtaCnf;
}
@@ -372,7 +369,7 @@ public class MtbColr extends EntityBase {
}
public String getDescrizione() {
return descrizione;
return UtilityString.isNull(descrizione, getMtbAart() != null ? UtilityString.isNull(getMtbAart().getDescrizioneEstesa(), getMtbAart().getDescrizione()) : null);
}
public MtbColr setDescrizione(String descrizione) {

View File

@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.model;
import android.text.TextUtils;
import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableField;
import com.annimon.stream.Optional;
import com.annimon.stream.Stream;
@@ -10,11 +11,13 @@ import com.annimon.stream.Stream;
import org.jetbrains.annotations.Nullable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityDB;
@@ -63,7 +66,7 @@ public class MtbColt extends EntityBase {
private BigDecimal altezzaCm;
private String codJcom;
private MtbTCol mtbTCol;
private final ObservableField<ObservableMtbTcol> mtbTCol = new ObservableField<>();
private Boolean disablePrint;
private String ragSocCliente;
@@ -160,6 +163,10 @@ public class MtbColt extends EntityBase {
return UtilityDate.recognizeDateWithExceptionHandler(getDataColloS());
}
public LocalDate getDataColloLD() {
return UtilityDate.recognizeLocalDateWithExceptionHandler(getDataColloS());
}
public MtbColt setDataCollo(String dataCollo) {
this.dataCollo = dataCollo;
return this;
@@ -170,6 +177,11 @@ public class MtbColt extends EntityBase {
return this;
}
public MtbColt setDataCollo(LocalDate dataCollo) {
this.dataCollo = UtilityDate.formatDate(dataCollo, UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
return this;
}
public String getSerCollo() {
return serCollo;
}
@@ -248,6 +260,16 @@ public class MtbColt extends EntityBase {
public MtbColt setCodTcol(String codTcol) {
this.codTcol = codTcol;
if(!UtilityString.isNullOrEmpty(codTcol)) {
var fountMtbTcolObservable = SettingsManager.iDB().getInternalImballi().stream()
.filter(x -> x.getCodTcol().equalsIgnoreCase(codTcol))
.findFirst()
.orElse(null);
this.setMtbTCol(fountMtbTcolObservable);
} else
this.setMtbTCol(null);
return this;
}
@@ -522,15 +544,19 @@ public class MtbColt extends EntityBase {
return this;
}
public MtbTCol getMtbTCol() {
return mtbTCol;
public ObservableMtbTcol getMtbTCol() {
return mtbTCol.get();
}
public MtbColt setMtbTCol(MtbTCol mtbTCol) {
this.mtbTCol = mtbTCol;
public MtbColt setMtbTCol(ObservableMtbTcol mtbTCol) {
this.mtbTCol.set(mtbTCol);
return this;
}
public ObservableField<ObservableMtbTcol> mtbTcolProperty() {
return mtbTCol;
}
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
String xmlPrefix = "{\"whereCond\": \"";

View File

@@ -103,7 +103,7 @@ public class MtbDepo extends EntityBase implements Parcelable {
return 0;
}
public static final Creator<MtbDepo> CREATOR = new Creator<MtbDepo>() {
public static final Creator<MtbDepo> CREATOR = new Creator<>() {
@Override
public MtbDepo createFromParcel(Parcel in) {
return new MtbDepo(in);

View File

@@ -1,5 +1,8 @@
package it.integry.integrywmsnative.core.model;
import java.util.ArrayList;
import java.util.List;
public class MtbGrup extends EntityBase {
private String codMgrp;
@@ -8,6 +11,7 @@ public class MtbGrup extends EntityBase {
private String logoWeb;
private String criterioVal;
private String tipoMgrp;
private List<MtbSgrp> mtbSgrp = new ArrayList<>();
public MtbGrup() {
this.type = "mtb_grup";
@@ -66,4 +70,13 @@ public class MtbGrup extends EntityBase {
this.tipoMgrp = tipoMgrp;
return this;
}
public List<MtbSgrp> getMtbSgrp() {
return mtbSgrp;
}
public MtbGrup setMtbSgrp(List<MtbSgrp> mtbSgrp) {
this.mtbSgrp = mtbSgrp;
return this;
}
}

View File

@@ -0,0 +1,49 @@
package it.integry.integrywmsnative.core.model;
public class MtbSfam extends EntityBase {
private String codMgrp;
private String codMsgr;
private String codMsfa;
private String descrizione;
public MtbSfam() {
this.type = "mtb_sfam";
}
public String getCodMgrp() {
return codMgrp;
}
public MtbSfam setCodMgrp(String codMgrp) {
this.codMgrp = codMgrp;
return this;
}
public String getCodMsgr() {
return codMsgr;
}
public MtbSfam setCodMsgr(String codMsgr) {
this.codMsgr = codMsgr;
return this;
}
public String getCodMsfa() {
return codMsfa;
}
public MtbSfam setCodMsfa(String codMsfa) {
this.codMsfa = codMsfa;
return this;
}
public String getDescrizione() {
return descrizione;
}
public MtbSfam setDescrizione(String descrizione) {
this.descrizione = descrizione;
return this;
}
}

View File

@@ -0,0 +1,112 @@
package it.integry.integrywmsnative.core.model;
import java.util.ArrayList;
import java.util.List;
public class MtbSgrp extends EntityBase {
private String codMgrp;
private String codMsgr;
private String descrizione;
private String inclInStat;
private String contoRimFin;
private Integer ordinamento;
private Boolean chkGiacenzaNeg;
private Boolean flagReso;
private String codCconWip;
private List<MtbSfam> mtbSfam = new ArrayList<>();
public MtbSgrp() {
this.type = "mtb_sgrp";
}
public String getCodMgrp() {
return codMgrp;
}
public MtbSgrp setCodMgrp(String codMgrp) {
this.codMgrp = codMgrp;
return this;
}
public String getCodMsgr() {
return codMsgr;
}
public MtbSgrp setCodMsgr(String codMsgr) {
this.codMsgr = codMsgr;
return this;
}
public String getDescrizione() {
return descrizione;
}
public MtbSgrp setDescrizione(String descrizione) {
this.descrizione = descrizione;
return this;
}
public String getInclInStat() {
return inclInStat;
}
public MtbSgrp setInclInStat(String inclInStat) {
this.inclInStat = inclInStat;
return this;
}
public String getContoRimFin() {
return contoRimFin;
}
public MtbSgrp setContoRimFin(String contoRimFin) {
this.contoRimFin = contoRimFin;
return this;
}
public Integer getOrdinamento() {
return ordinamento;
}
public MtbSgrp setOrdinamento(Integer ordinamento) {
this.ordinamento = ordinamento;
return this;
}
public Boolean getChkGiacenzaNeg() {
return chkGiacenzaNeg;
}
public MtbSgrp setChkGiacenzaNeg(Boolean chkGiacenzaNeg) {
this.chkGiacenzaNeg = chkGiacenzaNeg;
return this;
}
public Boolean getFlagReso() {
return flagReso;
}
public MtbSgrp setFlagReso(Boolean flagReso) {
this.flagReso = flagReso;
return this;
}
public String getCodCconWip() {
return codCconWip;
}
public MtbSgrp setCodCconWip(String codCconWip) {
this.codCconWip = codCconWip;
return this;
}
public List<MtbSfam> getMtbSfam() {
return mtbSfam;
}
public MtbSgrp setMtbSfam(List<MtbSfam> mtbSfam) {
this.mtbSfam = mtbSfam;
return this;
}
}

View File

@@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.model;
import com.google.gson.annotations.SerializedName;
import java.math.BigDecimal;
public class MtbTCol {
@@ -13,7 +15,7 @@ public class MtbTCol {
private BigDecimal taraKg;
private String descrizione;
private String codMart;
private String flagUIUL;
private FlagUiUlEnum flagUiUl;
private String circuito;
public String getCodTcol() {
@@ -88,13 +90,12 @@ public class MtbTCol {
return this;
}
public String getFlagUIUL() {
return flagUIUL;
public FlagUiUlEnum getFlagUiUl() {
return flagUiUl;
}
public MtbTCol setFlagUIUL(String flagUIUL) {
this.flagUIUL = flagUIUL;
return this;
public void setFlagUiUl(FlagUiUlEnum flagUiUl) {
this.flagUiUl = flagUiUl;
}
public String getCircuito() {
@@ -107,4 +108,29 @@ public class MtbTCol {
}
public enum FlagUiUlEnum {
@SerializedName("UI")
UI("UI"),
@SerializedName("UL")
UL("UL");
private final String text;
FlagUiUlEnum(String text) {
this.text = text;
}
public String getText() {
return this.text;
}
public static FlagUiUlEnum fromString(String text) {
for (FlagUiUlEnum b : FlagUiUlEnum.values()) {
if (b.text.equalsIgnoreCase(text)) return b;
}
return null;
}
}
}

View File

@@ -2,8 +2,11 @@ package it.integry.integrywmsnative.core.model;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.core.utility.UtilityNumber;
import it.integry.integrywmsnative.core.utility.UtilityString;
/**
* Created by ValerioC on 06/03/2018.
@@ -38,6 +41,8 @@ public class MvwSitArtUdcDetInventario {
private BigDecimal pesoLordoKg;
private String codJfas;
private MtbAart mtbAart;
private Integer numOrd;
private Date dataOrd;
public String getGestione() {
return gestione;
@@ -282,6 +287,21 @@ public class MvwSitArtUdcDetInventario {
return this;
}
public Integer getNumOrd() {
return numOrd;
}
public MvwSitArtUdcDetInventario setNumOrd(Integer numOrd) {
this.numOrd = numOrd;
return this;
}
public String getQtaText(){
String text = UtilityNumber.decimalToString(this.qtaCol);
text += !UtilityString.isNullOrEmpty(this.untMis) ? "\n" + this.untMis : "";
return text;
}
public MtbColr toMtbColr() {
return new MtbColr()
.setCodJcom(getCodJcom())
@@ -299,4 +319,13 @@ public class MvwSitArtUdcDetInventario {
.setPesoLordoKg(getPesoLordoKg())
.setUntMis(getUntMis());
}
public Date getDataOrd() {
return dataOrd;
}
public MvwSitArtUdcDetInventario setDataOrd(Date dataOrd) {
this.dataOrd = dataOrd;
return this;
}
}

View File

@@ -1,7 +1,5 @@
package it.integry.integrywmsnative.core.model;
import java.util.Date;
public class StbGestSetup extends EntityBase{
private String gestName;

View File

@@ -55,7 +55,7 @@ public class VtbDest extends EntityBase implements Parcelable {
return 0;
}
public static final Creator<VtbDest> CREATOR = new Creator<VtbDest>() {
public static final Creator<VtbDest> CREATOR = new Creator<>() {
@Override
public VtbDest createFromParcel(Parcel in) {
return new VtbDest(in);

View File

@@ -0,0 +1,93 @@
package it.integry.integrywmsnative.core.model;
import java.math.BigDecimal;
public class VtbVetr extends EntityBase {
public VtbVetr() {
type = "vtb_vetr";
}
private String codVvet;
private String codSpes;
private String idRiga;
private BigDecimal daQta;
private BigDecimal aQta;
private BigDecimal impUnt;
private BigDecimal impFisso;
private String codDivi;
public String getCodVvet() {
return codVvet;
}
public VtbVetr setCodVvet(String codVvet) {
this.codVvet = codVvet;
return this;
}
public String getCodSpes() {
return codSpes;
}
public VtbVetr setCodSpes(String codSpes) {
this.codSpes = codSpes;
return this;
}
public String getIdRiga() {
return idRiga;
}
public VtbVetr setIdRiga(String idRiga) {
this.idRiga = idRiga;
return this;
}
public BigDecimal getDaQta() {
return daQta;
}
public VtbVetr setDaQta(BigDecimal daQta) {
this.daQta = daQta;
return this;
}
public BigDecimal getaQta() {
return aQta;
}
public VtbVetr setaQta(BigDecimal aQta) {
this.aQta = aQta;
return this;
}
public BigDecimal getImpUnt() {
return impUnt;
}
public VtbVetr setImpUnt(BigDecimal impUnt) {
this.impUnt = impUnt;
return this;
}
public BigDecimal getImpFisso() {
return impFisso;
}
public VtbVetr setImpFisso(BigDecimal impFisso) {
this.impFisso = impFisso;
return this;
}
public String getCodDivi() {
return codDivi;
}
public VtbVetr setCodDivi(String codDivi) {
this.codDivi = codDivi;
return this;
}
}

View File

@@ -0,0 +1,273 @@
package it.integry.integrywmsnative.core.model;
import java.math.BigDecimal;
import java.util.List;
public class VtbVett extends EntityBase {
public VtbVett() {
type = "vtb_vett";
}
private String codVvet;
private String codLettVett;
private String codAnag;
private String ragSoc;
private String indirizzo;
private String cap;
private String citta;
private String prov;
private String nazione;
private String telefono;
private String fax;
private String partIva;
private String note;
private String eMail;
private String modStamp;
private BigDecimal coefVol;
private String flagAttivo;
private String numAutoriz;
private List<VtbVetr> vtbVetr;
public String getCodVvet() {
return codVvet;
}
public VtbVett setCodVvet(String codVvet) {
this.codVvet = codVvet;
return this;
}
public String getCodLettVett() {
return codLettVett;
}
public VtbVett setCodLettVett(String codLettVett) {
this.codLettVett = codLettVett;
return this;
}
public String getCodAnag() {
return codAnag;
}
public VtbVett setCodAnag(String codAnag) {
this.codAnag = codAnag;
return this;
}
public String getRagSoc() {
return ragSoc;
}
public VtbVett setRagSoc(String ragSoc) {
this.ragSoc = ragSoc;
return this;
}
public String getIndirizzo() {
return indirizzo;
}
public VtbVett setIndirizzo(String indirizzo) {
this.indirizzo = indirizzo;
return this;
}
public String getCap() {
return cap;
}
public VtbVett setCap(String cap) {
this.cap = cap;
return this;
}
public String getCitta() {
return citta;
}
public VtbVett setCitta(String citta) {
this.citta = citta;
return this;
}
public String getProv() {
return prov;
}
public VtbVett setProv(String prov) {
this.prov = prov;
return this;
}
public String getNazione() {
return nazione;
}
public VtbVett setNazione(String nazione) {
this.nazione = nazione;
return this;
}
public String getTelefono() {
return telefono;
}
public VtbVett setTelefono(String telefono) {
this.telefono = telefono;
return this;
}
public String getFax() {
return fax;
}
public VtbVett setFax(String fax) {
this.fax = fax;
return this;
}
public String getPartIva() {
return partIva;
}
public VtbVett setPartIva(String partIva) {
this.partIva = partIva;
return this;
}
public String getNote() {
return note;
}
public VtbVett setNote(String note) {
this.note = note;
return this;
}
public String geteMail() {
return eMail;
}
public VtbVett seteMail(String eMail) {
this.eMail = eMail;
return this;
}
public String getModStamp() {
return modStamp;
}
public VtbVett setModStamp(String modStamp) {
this.modStamp = modStamp;
return this;
}
public BigDecimal getCoefVol() {
return coefVol;
}
public VtbVett setCoefVol(BigDecimal coefVol) {
this.coefVol = coefVol;
return this;
}
public String getFlagAttivo() {
return flagAttivo;
}
public VtbVett setFlagAttivo(String flagAttivo) {
this.flagAttivo = flagAttivo;
return this;
}
public String getNumAutoriz() {
return numAutoriz;
}
public VtbVett setNumAutoriz(String numAutoriz) {
this.numAutoriz = numAutoriz;
return this;
}
public List<VtbVetr> getVtbVetr() {
return vtbVetr;
}
public VtbVett setVtbVetr(List<VtbVetr> vtbVetr) {
this.vtbVetr = vtbVetr;
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
VtbVett vtbVett = (VtbVett) o;
if (!getCodVvet().equals(vtbVett.getCodVvet())) return false;
if (getCodLettVett() != null ? !getCodLettVett().equals(vtbVett.getCodLettVett()) : vtbVett.getCodLettVett() != null)
return false;
if (getCodAnag() != null ? !getCodAnag().equals(vtbVett.getCodAnag()) : vtbVett.getCodAnag() != null)
return false;
if (getRagSoc() != null ? !getRagSoc().equals(vtbVett.getRagSoc()) : vtbVett.getRagSoc() != null)
return false;
if (getIndirizzo() != null ? !getIndirizzo().equals(vtbVett.getIndirizzo()) : vtbVett.getIndirizzo() != null)
return false;
if (getCap() != null ? !getCap().equals(vtbVett.getCap()) : vtbVett.getCap() != null)
return false;
if (getCitta() != null ? !getCitta().equals(vtbVett.getCitta()) : vtbVett.getCitta() != null)
return false;
if (getProv() != null ? !getProv().equals(vtbVett.getProv()) : vtbVett.getProv() != null)
return false;
if (getNazione() != null ? !getNazione().equals(vtbVett.getNazione()) : vtbVett.getNazione() != null)
return false;
if (getTelefono() != null ? !getTelefono().equals(vtbVett.getTelefono()) : vtbVett.getTelefono() != null)
return false;
if (getFax() != null ? !getFax().equals(vtbVett.getFax()) : vtbVett.getFax() != null)
return false;
if (getPartIva() != null ? !getPartIva().equals(vtbVett.getPartIva()) : vtbVett.getPartIva() != null)
return false;
if (getNote() != null ? !getNote().equals(vtbVett.getNote()) : vtbVett.getNote() != null)
return false;
if (geteMail() != null ? !geteMail().equals(vtbVett.geteMail()) : vtbVett.geteMail() != null)
return false;
if (getModStamp() != null ? !getModStamp().equals(vtbVett.getModStamp()) : vtbVett.getModStamp() != null)
return false;
if (getCoefVol() != null ? !getCoefVol().equals(vtbVett.getCoefVol()) : vtbVett.getCoefVol() != null)
return false;
if (getFlagAttivo() != null ? !getFlagAttivo().equals(vtbVett.getFlagAttivo()) : vtbVett.getFlagAttivo() != null)
return false;
if (getNumAutoriz() != null ? !getNumAutoriz().equals(vtbVett.getNumAutoriz()) : vtbVett.getNumAutoriz() != null)
return false;
return getVtbVetr() != null ? getVtbVetr().equals(vtbVett.getVtbVetr()) : vtbVett.getVtbVetr() == null;
}
@Override
public int hashCode() {
int result = getCodVvet().hashCode();
result = 31 * result + (getCodLettVett() != null ? getCodLettVett().hashCode() : 0);
result = 31 * result + (getCodAnag() != null ? getCodAnag().hashCode() : 0);
result = 31 * result + (getRagSoc() != null ? getRagSoc().hashCode() : 0);
result = 31 * result + (getIndirizzo() != null ? getIndirizzo().hashCode() : 0);
result = 31 * result + (getCap() != null ? getCap().hashCode() : 0);
result = 31 * result + (getCitta() != null ? getCitta().hashCode() : 0);
result = 31 * result + (getProv() != null ? getProv().hashCode() : 0);
result = 31 * result + (getNazione() != null ? getNazione().hashCode() : 0);
result = 31 * result + (getTelefono() != null ? getTelefono().hashCode() : 0);
result = 31 * result + (getFax() != null ? getFax().hashCode() : 0);
result = 31 * result + (getPartIva() != null ? getPartIva().hashCode() : 0);
result = 31 * result + (getNote() != null ? getNote().hashCode() : 0);
result = 31 * result + (geteMail() != null ? geteMail().hashCode() : 0);
result = 31 * result + (getModStamp() != null ? getModStamp().hashCode() : 0);
result = 31 * result + (getCoefVol() != null ? getCoefVol().hashCode() : 0);
result = 31 * result + (getFlagAttivo() != null ? getFlagAttivo().hashCode() : 0);
result = 31 * result + (getNumAutoriz() != null ? getNumAutoriz().hashCode() : 0);
result = 31 * result + (getVtbVetr() != null ? getVtbVetr().hashCode() : 0);
return result;
}
}

View File

@@ -0,0 +1,29 @@
package it.integry.integrywmsnative.core.model.mapper;
import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableList;
import java.util.List;
import java.util.stream.Collectors;
import it.integry.integrywmsnative.core.model.MtbTCol;
import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
public class MtbTcolMapper {
public static ObservableMtbTcol fromDTO(MtbTCol dto) {
ObservableMtbTcol mtbTcol = new ObservableMtbTcol();
mtbTcol.updateFromDTO(dto);
return mtbTcol;
}
public static ObservableList<ObservableMtbTcol> fromDTOList(List<MtbTCol> dto) {
ObservableList<ObservableMtbTcol> mtbTCols = new ObservableArrayList<>();
mtbTCols.addAll(dto.stream().map(MtbTcolMapper::fromDTO)
.collect(Collectors.toUnmodifiableList()));
return mtbTCols;
}
}

View File

@@ -0,0 +1,127 @@
package it.integry.integrywmsnative.core.model.observable;
import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;
import androidx.databinding.ObservableField;
import java.math.BigDecimal;
import it.integry.integrywmsnative.core.model.MtbTCol;
public class ObservableMtbTcol extends BaseObservable {
private final ObservableField<String> codTcol = new ObservableField<>();
private final ObservableField<BigDecimal> pesoKg = new ObservableField<>();
private final ObservableField<BigDecimal> lunghezzaCm = new ObservableField<>();
private final ObservableField<BigDecimal> larghezzaCm = new ObservableField<>();
private final ObservableField<BigDecimal> altezzaCm = new ObservableField<>();
private final ObservableField<BigDecimal> taraKg = new ObservableField<>();
private final ObservableField<String> descrizione = new ObservableField<>();
private final ObservableField<String> codMart = new ObservableField<>();
private final ObservableField<MtbTCol.FlagUiUlEnum> flagUIUL = new ObservableField<>();
private final ObservableField<String> circuito = new ObservableField<>();
@Bindable
public String getCodTcol() {
return codTcol.get();
}
@Bindable
public BigDecimal getPesoKg() {
return pesoKg.get();
}
@Bindable
public BigDecimal getLunghezzaCm() {
return lunghezzaCm.get();
}
@Bindable
public BigDecimal getLarghezzaCm() {
return larghezzaCm.get();
}
@Bindable
public BigDecimal getAltezzaCm() {
return altezzaCm.get();
}
@Bindable
public BigDecimal getTaraKg() {
return taraKg.get();
}
@Bindable
public String getDescrizione() {
return descrizione.get();
}
@Bindable
public String getCodMart() {
return codMart.get();
}
@Bindable
public MtbTCol.FlagUiUlEnum getFlagUIUL() {
return flagUIUL.get();
}
@Bindable
public String getCircuito() {
return circuito.get();
}
public ObservableField<String> codTcolProperty() {
return codTcol;
}
public ObservableField<BigDecimal> pesoKgProperty() {
return pesoKg;
}
public ObservableField<BigDecimal> lunghezzaCmProperty() {
return lunghezzaCm;
}
public ObservableField<BigDecimal> larghezzaCmProperty() {
return larghezzaCm;
}
public ObservableField<BigDecimal> altezzaCmProperty() {
return altezzaCm;
}
public ObservableField<BigDecimal> taraKgProperty() {
return taraKg;
}
public ObservableField<String> descrizioneProperty() {
return descrizione;
}
public ObservableField<String> codMartProperty() {
return codMart;
}
public ObservableField<MtbTCol.FlagUiUlEnum> flagUIULProperty() {
return flagUIUL;
}
public ObservableField<String> circuitoProperty() {
return circuito;
}
public void updateFromDTO(MtbTCol mtbTCol) {
codTcol.set(mtbTCol.getCodTcol());
pesoKg.set(mtbTCol.getPesoKg());
lunghezzaCm.set(mtbTCol.getLunghezzaCm());
larghezzaCm.set(mtbTCol.getLarghezzaCm());
altezzaCm.set(mtbTCol.getAltezzaCm());
taraKg.set(mtbTCol.getTaraKg());
descrizione.set(mtbTCol.getDescrizione());
codMart.set(mtbTCol.getCodMart());
flagUIUL.set(mtbTCol.getFlagUiUl());
circuito.set(mtbTCol.getCircuito());
}
}

View File

@@ -10,8 +10,6 @@ public enum ReportType {
ETICHETTA_SSCC_LAVORAZIONE(1),
@SerializedName("2")
ETICHETTA_SSCC_SPEDIZIONE(2),
@SerializedName("3")
WMS_SPEDIZIONE_ETICHETTE_SSCC_ORD(3),
@SerializedName("4")
WMS_SPEDIZIONE_PACKING_LIST_ORD(4),
@SerializedName("5")

View File

@@ -0,0 +1,78 @@
package it.integry.integrywmsnative.core.rest;
import androidx.annotation.NonNull;
import java.io.IOException;
import io.jsonwebtoken.Claims;
import it.integry.integrywmsnative.core.authentication.JwtUtils;
import it.integry.integrywmsnative.core.exception.UnauthorizedAccessException;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.gest.login.rest.RefreshRESTConsumer;
import okhttp3.Interceptor;
import okhttp3.Protocol;
import okhttp3.Response;
import okhttp3.ResponseBody;
public class AuthInterceptor implements Interceptor {
private final RefreshRESTConsumer refreshRESTConsumer;
public AuthInterceptor(RefreshRESTConsumer refreshRESTConsumer) {
this.refreshRESTConsumer = refreshRESTConsumer;
}
@NonNull
@Override
public Response intercept(@NonNull Chain chain) throws IOException {
var originalRequest = chain.request();
if (SettingsManager.i().getUserSession() != null) {
var accessToken = SettingsManager.i().getUserSession().getAccessToken();
var accessTokenExpiryDate = SettingsManager.i().getUserSession().getAccessTokenExpiryDate();
if (accessToken != null && (accessTokenExpiryDate == null || UtilityDate.getNowTime().isAfter(accessTokenExpiryDate.minusSeconds(20)))) {
// Make the token refresh request
try {
var response = refreshRESTConsumer.makeSynchronousRefreshTokenRequest();
Claims claims = JwtUtils.parseJwt(response.getAccessToken());
SettingsManager.i().getUserSession()
.setAccessToken(response.getAccessToken())
.setAccessTokenExpiryDate(UtilityDate.toLocalDateTime(claims.getExpiration()))
.setRefreshToken(response.getRefreshToken())
.setRefreshTokenExpiryDate(response.getExpiryDate());
SettingsManager.update();
} catch (UnauthorizedAccessException uae) {
// Crea una risposta 401 manualmente
return new Response.Builder()
.request(originalRequest)
.protocol(Protocol.HTTP_1_1)
.code(401)
.message("Unauthorized")
.body(ResponseBody.create(new byte[0], null))
.build();
} catch (Exception e) {
return chain.proceed(originalRequest);
}
// Add the access token to the request header
var authorizedRequest = originalRequest.newBuilder()
.header("Authorization", "Bearer " + SettingsManager.i().getUserSession().getAccessToken())
.build();
return chain.proceed(authorizedRequest);
} else
return chain.proceed(originalRequest);
} else
return chain.proceed(originalRequest);
}
}

View File

@@ -1,10 +1,9 @@
package it.integry.integrywmsnative.core.rest;
import android.util.Base64;
import java.io.IOException;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.Request;
@@ -20,25 +19,33 @@ public class HttpInterceptor implements Interceptor {
public Response intercept(Chain chain) throws IOException {
final String PROFILE_DB = SettingsManager.i().getUserSession() == null ? null : SettingsManager.i().getUserSession().getProfileDB();
final String USERNAME = SettingsManager.i().getUser().getUsername();
final String PASSWORD = SettingsManager.i().getUser().getPassword();
final String DEVICE_ID = SettingsManager.i().getUserSession().getDeviceId();
final String APP_TOKEN = "fa3a21af-606b-4129-a22b-aedc2a52c7b6";
final Request request = chain.request();
final HttpUrl url = request.url().newBuilder()
.addQueryParameter("profileDb", PROFILE_DB)
.build();
String string = "Basic " + Base64.encodeToString((USERNAME + ":" + PASSWORD).getBytes(), Base64.NO_WRAP);
final Request newRequest = chain.request().newBuilder()
.addHeader("Authorization", string)
Request.Builder builder = chain.request().newBuilder()
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "*/*")
.addHeader("username", USERNAME != null ? USERNAME : "")
.addHeader("password", PASSWORD != null ? PASSWORD : "")
.addHeader("device_id", DEVICE_ID != null ? DEVICE_ID : "")
.url(url).build();
.addHeader("x-app-token", APP_TOKEN);
String accessToken = null;
//Nel caso in cui il token è scaduto e devo richiamare la refresh non bisogna passare il vecchio token
if(SettingsManager.i().getUserSession().getAccessTokenExpiryDate() != null &&
UtilityDate.getNowTime().isBefore(SettingsManager.i().getUserSession().getAccessTokenExpiryDate())) {
accessToken = SettingsManager.i().getUserSession().getAccessToken();
}
if(accessToken != null)
builder.header("Authorization", "Bearer " + accessToken);
var newRequest = builder
.url(url)
.build();
return chain.proceed(newRequest);
}

View File

@@ -6,6 +6,7 @@ import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.TimeUnit;
import javax.inject.Singleton;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
@@ -20,29 +21,35 @@ import retrofit2.converter.gson.GsonConverterFactory;
* Created by GiuseppeS on 06/03/2018.
*/
@Singleton
public class RESTBuilder {
private static final boolean ADD_LOGGER_INTERCEPTOR = false;
private final boolean ADD_LOGGER_INTERCEPTOR = false;
private final AuthInterceptor authInterceptor;
public static <T> T getService(final Class<T> service) {
public RESTBuilder(AuthInterceptor authInterceptor) {
this.authInterceptor = authInterceptor;
}
public <T> T getService(final Class<T> service) {
return getService(service, SettingsManager.i().getServer().getProtocol(), SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true);
}
public static <T> T getService(final Class<T> service, int timeout) {
public <T> T getService(final Class<T> service, int timeout) {
return getService(service, SettingsManager.i().getServer().getProtocol(), SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true, true, timeout);
}
public static <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors) {
public <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors) {
return getService(service, protocol, host, port, addInterceptors, true, 60);
}
public static <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors, boolean addEmsApi) {
public <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors, boolean addEmsApi) {
return getService(service, protocol, host, port, addInterceptors, addEmsApi, 60);
}
public static <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout) {
public <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout) {
OkHttpClient.Builder clientBuilder = getDefaultHttpClient();
clientBuilder.connectTimeout(timeout, TimeUnit.SECONDS);
@@ -51,6 +58,7 @@ public class RESTBuilder {
clientBuilder.retryOnConnectionFailure(true);
clientBuilder.addInterceptor(authInterceptor);
if (addInterceptors) clientBuilder.addInterceptor(new HttpInterceptor());
if (ADD_LOGGER_INTERCEPTOR) clientBuilder.addInterceptor(new HttpLoggerInterceptor());
@@ -61,21 +69,16 @@ public class RESTBuilder {
Gson gson = UtilityGson.createObject();
Retrofit retrofit = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create(gson)).baseUrl(endpoint).client(client).build();
Retrofit retrofit = new Retrofit.Builder()
.addConverterFactory(GsonConverterFactory.create(gson))
.baseUrl(endpoint)
.client(client)
.build();
return retrofit.create(service);
}
public static String getDefaultHost() {
return SettingsManager.i().getServer().getHost();
}
public static int getDefaultPort() {
return SettingsManager.i().getServer().getPort();
}
public static OkHttpClient.Builder getDefaultHttpClient() {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {

View File

@@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import com.annimon.stream.Stream;
import com.google.gson.reflect.TypeToken;
@@ -17,27 +19,67 @@ import it.integry.integrywmsnative.core.model.MtbGrup;
import it.integry.integrywmsnative.core.model.MtbUntMis;
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.articolo.ArticoloDTO;
import it.integry.integrywmsnative.core.rest.model.articolo.RetrieveArticoloByCodMartRequestDTO;
import it.integry.integrywmsnative.core.rest.model.articolo.SaveArticoloRequestDTO;
import it.integry.integrywmsnative.core.rest.model.articolo.SaveArticoloResponseDTO;
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeRequestDTO;
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeResponseDTO;
import it.integry.integrywmsnative.core.rest.model.articolo.UpdateBarcodeImballoRequestDTO;
import it.integry.integrywmsnative.core.utility.UtilityQuery;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class ArticoloRESTConsumer extends _BaseRESTConsumer {
private final RESTBuilder restBuilder;
private final SystemRESTConsumer systemRESTConsumer;
public ArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
public ArticoloRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
this.restBuilder = restBuilder;
this.systemRESTConsumer = systemRESTConsumer;
}
public void retrieveAvailableUntMis(RunnableArgs<List<MtbUntMis>> onComplete, RunnableArgs<Exception> onFailed) {
ArticoloRESTConsumerService articoloRESTConsumerService = restBuilder.getService(ArticoloRESTConsumerService.class);
articoloRESTConsumerService
.retrieveAvailableUntMis()
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbUntMis>> call, Response<ServiceRESTResponse<MtbUntMis>> response) {
analyzeAnswerList(response, "retrieveAvailableUntMis", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbUntMis>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void retrieveAvailableGruppiMerceologici(RunnableArgs<List<MtbGrup>> onComplete, RunnableArgs<Exception> onFailed) {
ArticoloRESTConsumerService articoloRESTConsumerService = restBuilder.getService(ArticoloRESTConsumerService.class);
articoloRESTConsumerService
.retrieveAvailableGruppiMerceologici()
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbGrup>> call, Response<ServiceRESTResponse<MtbGrup>> response) {
analyzeAnswerList(response, "retrieveAvailableGruppiMerceologici", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbGrup>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void searchByBarcode(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
ArticoloRESTConsumerService articoloRESTConsumerService = restBuilder.getService(ArticoloRESTConsumerService.class);
var request = new SearchArticoloByBarcodeRequestDTO()
.setBarcode(barcodeProd)
@@ -45,7 +87,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
articoloRESTConsumerService
.searchByBarcode(request)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> call, Response<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> response) {
analyzeAnswer(response, "searchByBarcode", (m) -> {
@@ -54,37 +96,51 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void findIfIsKit(MtbAart mtbAart, RunnableArgs<MtbAart> onComplete, RunnableArgs<Exception> onFailed){
ArticoloRESTConsumerService articoloRESTConsumerService = restBuilder.getService(ArticoloRESTConsumerService.class);
public void getByCodMarts(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
getByCodMartsStatic(codMartToFind, onComplete, onFailed);
articoloRESTConsumerService
.findIfIsKit(mtbAart)
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<MtbAart>> call, @NonNull Response<ServiceRESTResponse<MtbAart>> response) {
analyzeAnswer(response, "findIfIsKit", (m) -> {
onComplete.run(response.body().getDto());
}, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, @NonNull Exception e) {
onFailed.run(e);
}
});
}
public static void getByCodMartsStatic(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
public void getByCodMarts(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
var codMarts = Stream.of(codMartToFind)
.withoutNulls()
.distinct().toList();
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
ArticoloRESTConsumerService articoloRESTConsumer = restBuilder.getService(ArticoloRESTConsumerService.class);
articoloRESTConsumer
.getByCodMart(new RetrieveArticoloByCodMartRequestDTO()
.setCodMarts(codMarts))
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<MtbAart>>> call, Response<ServiceRESTResponse<List<MtbAart>>> response) {
analyzeAnswer(response, "getByCodMart", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<MtbAart>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<MtbAart>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@@ -92,16 +148,16 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
public void getStatoPartita(String codMart, String partitaMag, RunnableArgs<List<StatoArticoloDTO>> onComplete, RunnableArgs<Exception> onFailed) {
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
articoloRESTConsumer.getStatoPartita(codMart, partitaMag).enqueue(new Callback<>() {
ArticoloRESTConsumerService articoloRESTConsumer = restBuilder.getService(ArticoloRESTConsumerService.class);
articoloRESTConsumer.getStatoPartita(codMart, partitaMag).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, Response<ServiceRESTResponse<List<StatoArticoloDTO>>> response) {
analyzeAnswer(response, "getStatoPartita", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@@ -183,7 +239,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
public void updateBarcodeImballo(String codMart, String newBarcodeImballo, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
ArticoloRESTConsumerService articoloRESTConsumerService = restBuilder.getService(ArticoloRESTConsumerService.class);
var request = new UpdateBarcodeImballoRequestDTO()
.setCodMart(codMart)
@@ -191,7 +247,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
articoloRESTConsumerService
.updateBarcodeImballo(request)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "updateBarcodeImballo", m -> {
@@ -200,8 +256,32 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void saveArticolo(ArticoloDTO articoloToSave, RunnableArgs<String> onComplete, RunnableArgs<Exception> onFailed) {
ArticoloRESTConsumerService articoloRESTConsumerService = restBuilder.getService(ArticoloRESTConsumerService.class);
var request = new SaveArticoloRequestDTO()
.setArtToSave(articoloToSave);
articoloRESTConsumerService
.saveArticolo(request)
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<SaveArticoloResponseDTO>> call, Response<ServiceRESTResponse<SaveArticoloResponseDTO>> response) {
analyzeAnswer(response, "saveArticolo", data -> {
onComplete.run(data.getCodMart());
}, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<SaveArticoloResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@@ -3,9 +3,13 @@ package it.integry.integrywmsnative.core.rest.consumers;
import java.util.List;
import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.model.MtbGrup;
import it.integry.integrywmsnative.core.model.MtbUntMis;
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.articolo.RetrieveArticoloByCodMartRequestDTO;
import it.integry.integrywmsnative.core.rest.model.articolo.SaveArticoloRequestDTO;
import it.integry.integrywmsnative.core.rest.model.articolo.SaveArticoloResponseDTO;
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeRequestDTO;
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeResponseDTO;
import it.integry.integrywmsnative.core.rest.model.articolo.UpdateBarcodeImballoRequestDTO;
@@ -17,9 +21,19 @@ import retrofit2.http.Query;
public interface ArticoloRESTConsumerService {
@GET("wms/articolo/availableUntMis")
Call<ServiceRESTResponse<MtbUntMis>> retrieveAvailableUntMis();
@GET("wms/articolo/availableGruppiMerceologici")
Call<ServiceRESTResponse<MtbGrup>> retrieveAvailableGruppiMerceologici();
@POST("wms/articolo/searchByBarcode")
Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> searchByBarcode(@Body() SearchArticoloByBarcodeRequestDTO searchArticoloByBarcodeRequest);
@POST("wms/articolo/findIfIsKit")
Call<ServiceRESTResponse<MtbAart>> findIfIsKit(@Body MtbAart mtbAart);
@POST("wms/articolo/retrieveByCodMart")
Call<ServiceRESTResponse<List<MtbAart>>> getByCodMart(@Body RetrieveArticoloByCodMartRequestDTO retrieveArticoloByCodMartRequest);
@@ -29,4 +43,7 @@ public interface ArticoloRESTConsumerService {
@GET("getProductLotStatus")
Call<ServiceRESTResponse<List<StatoArticoloDTO>>> getStatoPartita(@Query("codMart") String codMart, @Query("partitaMag") String partitaMag);
@POST("wms/articolo/saveArticolo")
Call<ServiceRESTResponse<SaveArticoloResponseDTO>> saveArticolo(@Body SaveArticoloRequestDTO saveArticoloRequest);
}

View File

@@ -1,29 +1,37 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.Azienda;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class AziendaRESTConsumer extends _BaseRESTConsumer {
private final RESTBuilder restBuilder;
public AziendaRESTConsumer(RESTBuilder restBuilder) {
this.restBuilder = restBuilder;
}
public void retrieveAzienda(RunnableArgs<Azienda> onComplete, RunnableArgs<Exception> onFailed) {
AziendaRESTConsumerService aziendaRESTConsumerService = RESTBuilder.getService(AziendaRESTConsumerService.class);
aziendaRESTConsumerService.retrieveDefaultAzienda().enqueue(new Callback<>() {
AziendaRESTConsumerService aziendaRESTConsumerService = restBuilder.getService(AziendaRESTConsumerService.class);
aziendaRESTConsumerService.retrieveDefaultAzienda().enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Azienda>> call, Response<ServiceRESTResponse<Azienda>> response) {
analyzeAnswer(response, "Retrieve default azienda", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Azienda>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Azienda>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@@ -3,32 +3,24 @@ package it.integry.integrywmsnative.core.rest.consumers;
import javax.inject.Singleton;
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
import it.integry.integrywmsnative.core.ean128.Ean128Service;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class BarcodeRESTConsumer extends _BaseRESTConsumer {
private final Ean128Service ean128Service;
public BarcodeRESTConsumer(Ean128Service ean128Service) {
this.ean128Service = ean128Service;
}
public void decodeEan128(BarcodeScanDTO barcodeObj, RunnableArgs<Ean128Model> onComplete, RunnableArgs<Exception> onFailed) {
String ean128 = barcodeObj.getStringValue().replaceAll("" + ((char) 29), "|");
BarcodeRESTConsumerService barcodeRESTConsumerService = RESTBuilder.getService(BarcodeRESTConsumerService.class);
barcodeRESTConsumerService.decodeEan128(ean128).enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Ean128Model>> call, Response<ServiceRESTResponse<Ean128Model>> response) {
analyzeAnswer(response, "DecodeEan128", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Ean128Model>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
try {
onComplete.run(this.ean128Service.decode(barcodeObj));
} catch (Exception e){
onFailed.run(e);
}
}
}

View File

@@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
@@ -7,6 +9,7 @@ import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCResponseDTO;
@@ -18,25 +21,30 @@ import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements ColliCaricoRESTConsumerInterface {
private final RESTBuilder restBuilder;
public ColliAccettazioneRESTConsumer(RESTBuilder restBuilder) {
this.restBuilder = restBuilder;
}
public void createUDC(CreateUDCRequestDTO createUDCRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = restBuilder.getService(ColliAccettazioneRESTConsumerService.class);
colliAccettazioneRESTConsumerService.createUDC(createUDCRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Response<ServiceRESTResponse<CreateUDCResponseDTO>> response) {
analyzeAnswer(response, "accettazione/createUDC", data -> onComplete.run(data.getMtbColt()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@@ -44,72 +52,89 @@ public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements
@Override
public void closeUDC(CloseUDCRequestDTO closeUDCRequestDTO, RunnableArgs<CloseUDCResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = restBuilder.getService(ColliAccettazioneRESTConsumerService.class);
colliAccettazioneRESTConsumerService.closeUDC(closeUDCRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Response<ServiceRESTResponse<CloseUDCResponseDTO>> response) {
analyzeAnswer(response, "accettazione/closeUDC", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@Override
public void insertUDCRow(InsertUDCRowRequestDTO insertUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = restBuilder.getService(ColliAccettazioneRESTConsumerService.class);
colliAccettazioneRESTConsumerService.insertUDCRow(insertUDCRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDCRowResponseDTO>> response) {
analyzeAnswer(response, "accettazione/insertUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@Override
public void editUDCRow(EditUDCRowRequestDTO editUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = restBuilder.getService(ColliAccettazioneRESTConsumerService.class);
colliAccettazioneRESTConsumerService.editUDCRow(editUDCRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDCRowResponseDTO>> response) {
analyzeAnswer(response, "accettazione/editUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@Override
public void deleteUDCRow(DeleteUDCRowRequestDTO deleteUDCRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = restBuilder.getService(ColliAccettazioneRESTConsumerService.class);
colliAccettazioneRESTConsumerService.deleteUDCRow(deleteUDCRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "accettazione/deleteUDCRow", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void checkBarcodeUl(String barcodeUl, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed){
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = restBuilder.getService(ColliAccettazioneRESTConsumerService.class);
colliAccettazioneRESTConsumerService.checkIfBarcodeUlAlreadyRegistered(barcodeUl)
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
analyzeAnswer(response, "accettazione/checkIfBarcodeUlAlreadyRegistered", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@@ -12,7 +12,9 @@ import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
public interface ColliAccettazioneRESTConsumerService {
@@ -31,4 +33,7 @@ public interface ColliAccettazioneRESTConsumerService {
@POST("wms/accettazione/deleteUDCRow")
Call<ServiceRESTResponse<Void>> deleteUDCRow(@Body DeleteUDCRowRequestDTO deleteUDCRowRequestDTO);
@GET("wms/accettazione/checkIfBarcodeUlAlreadyRegistered")
Call<ServiceRESTResponse<Boolean>> checkIfBarcodeUlAlreadyRegistered(@Query("barcodeUl") String barcodeUl);
}

View File

@@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import java.math.BigDecimal;
import javax.inject.Singleton;
@@ -12,6 +14,7 @@ import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCResponseDTO;
@@ -34,104 +37,105 @@ import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements ColliCaricoRESTConsumerInterface, ColliScaricoRESTConsumerInterface {
private final RESTBuilder restBuilder;
private final SettingsManager settingsManager;
public ColliLavorazioneRESTConsumer(SettingsManager settingsManager) {
public ColliLavorazioneRESTConsumer(RESTBuilder restBuilder, SettingsManager settingsManager) {
this.restBuilder = restBuilder;
this.settingsManager = settingsManager;
}
@Override
public void createUDC(CreateUDCRequestDTO createUDCRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.createUDC(createUDCRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Response<ServiceRESTResponse<CreateUDCResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/createUDC", data -> onComplete.run(data.getMtbColt()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@Override
public void closeUDC(CloseUDCRequestDTO closeUDCRequestDTO, RunnableArgs<CloseUDCResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.closeUDC(closeUDCRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Response<ServiceRESTResponse<CloseUDCResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/closeUDC", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@Override
public void insertUDCRow(InsertUDCRowRequestDTO insertUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.insertUDCRow(insertUDCRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDCRowResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/insertUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@Override
public void editUDCRow(EditUDCRowRequestDTO editUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.editUDCRow(editUDCRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDCRowResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/editUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void createUDS(CreateUDSRequestDTO createUDSRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.createUDS(createUDSRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Response<ServiceRESTResponse<CreateUDSResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/createUDS", data -> onComplete.run(data.getMtbColt()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@@ -139,89 +143,89 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
@Override
public void closeUDS(CloseUDSRequestDTO closeUDSRequestDTO, RunnableArgs<CloseUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.closeUDS(closeUDSRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Response<ServiceRESTResponse<CloseUDSResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/closeUDS", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@Override
public void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.insertUDSRow(insertUDSRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDSRowResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/insertUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void editUDSRow(EditUDSRowRequestDTO editUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.editUDSRow(editUDSRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDSRowResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/editUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@Override
public void deleteUDSRow(DeleteUDSRowRequestDTO deleteUDSRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.deleteUDSRow(deleteUDSRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "lavorazione/deleteUDSRow", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@Override
public void deleteUDCRow(DeleteUDCRowRequestDTO deleteUDCRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.deleteUDCRow(deleteUDCRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "lavorazione/deleteUDCRow", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@@ -249,18 +253,18 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
createUDSFromArtRequestDTO
.setCodJfas(posizione.getPosizione());
}
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.createUDSFromArt(createUDSFromArtRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "lavorazione/createUDSFromArt", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@@ -1,5 +1,6 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import androidx.databinding.ObservableArrayList;
import com.annimon.stream.Optional;
@@ -11,9 +12,12 @@ import org.jetbrains.annotations.NotNull;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.inject.Singleton;
@@ -28,9 +32,13 @@ import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULResponseDTO;
import it.integry.integrywmsnative.core.rest.model.SpostaULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.UpdateTipoULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
@@ -42,21 +50,22 @@ import it.integry.integrywmsnative.core.utility.UtilityQuery;
import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
private final RESTBuilder restBuilder;
private final SystemRESTConsumer mSystemRESTConsumer;
private final ArticoloRESTConsumer mArticoloRESTConsumer;
private final EntityRESTConsumer mEntityRESTConsumer;
private final SettingsManager mSettingsManager;
public ColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer,
public ColliMagazzinoRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer,
ArticoloRESTConsumer articoloRESTConsumer,
EntityRESTConsumer entityRESTConsumer,
SettingsManager settingsManager) {
this.restBuilder = restBuilder;
this.mSystemRESTConsumer = systemRESTConsumer;
this.mArticoloRESTConsumer = articoloRESTConsumer;
this.mEntityRESTConsumer = entityRESTConsumer;
@@ -78,7 +87,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
.setMtbPartitaMag(null));
}
this.mEntityRESTConsumer.processEntity(mtbColtToSaveClone, new ISimpleOperationCallback<MtbColt>() {
this.mEntityRESTConsumer.processEntity(mtbColtToSaveClone, new ISimpleOperationCallback<>() {
@Override
public void onSuccess(MtbColt value) {
if (onComplete != null) onComplete.run(value);
@@ -280,13 +289,13 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
public void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<>() {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
analyzeAnswer(response, "GetBySSCC", mtbColt -> {
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
List<MtbColt> mtbColtList = new ArrayList<>();
mtbColtList.add(mtbColt);
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
@@ -298,40 +307,69 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void fillMtbAartsOfMtbColts(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
fillMtbAartsOfMtbColtsStatic(mtbColts, onComplete, onFailed);
public void fillMtbAartsOfMtbColrs(List<MtbColr> mtbColrs, RunnableArgs<List<MtbColr>> onComplete, RunnableArgs<Exception> onFailed) {
List<String> codMarts = new ArrayList<>(mtbColrs.stream()
.map(MtbColr::getCodMart)
.filter(Objects::nonNull)
.distinct()
.collect(Collectors.toUnmodifiableList()));
mArticoloRESTConsumer.getByCodMarts(codMarts, arts -> {
if (arts != null && !arts.isEmpty()) {
for (MtbColr mtbColr : mtbColrs) {
MtbAart foundMtbAart = null;
List<MtbAart> mtbAartStream = arts.stream()
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart()))
.collect(Collectors.toList());
if (!mtbAartStream.isEmpty()) {
foundMtbAart = mtbAartStream.get(0);
}
mtbColr.setMtbAart(foundMtbAart);
}
}
onComplete.run(mtbColrs);
}, onFailed);
}
public static void fillMtbAartsOfMtbColtsStatic(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
public void fillMtbAartsOfMtbColts(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
List<String> codMarts = new ArrayList<>();
for (MtbColt mtbColt : mtbColts) {
codMarts.addAll(Stream.of(mtbColt.getMtbColr())
codMarts.addAll(mtbColt.getMtbColr().stream()
.map(MtbColr::getCodMart)
.withoutNulls()
.filter(Objects::nonNull)
.distinct()
.toList());
.collect(Collectors.toUnmodifiableList()));
}
ArticoloRESTConsumer.getByCodMartsStatic(codMarts, arts -> {
mArticoloRESTConsumer.getByCodMarts(codMarts, arts -> {
if (arts != null && arts.size() > 0) {
if (arts != null && !arts.isEmpty()) {
for (MtbColt mtbColt : mtbColts) {
for (MtbColr mtbColr : mtbColt.getMtbColr()) {
MtbAart foundMtbAart = null;
List<MtbAart> mtbAartStream = Stream.of(arts)
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart())).toList();
List<MtbAart> mtbAartStream = arts.stream()
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart()))
.collect(Collectors.toList());
if (mtbAartStream != null && mtbAartStream.size() > 0) {
if (!mtbAartStream.isEmpty()) {
foundMtbAart = mtbAartStream.get(0);
}
@@ -380,35 +418,32 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
testata.setMtbColr(new ObservableArrayList<>());
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.getColloInGiac(onlyResiduo, throwExcIfNull, testata).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
analyzeAnswer(response, "getColloInGiac", mtbColt -> {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.getColloInGiac(onlyResiduo, throwExcIfNull, testata)
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
analyzeAnswer(response, "getColloInGiac", mtbColt -> {
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
List<MtbColt> mtbColtList = new ArrayList<>();
mtbColtList.add(mtbColt);
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
} else {
onComplete.run(mtbColt);
if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
List<MtbColt> mtbColtList = new ArrayList<>();
mtbColtList.add(mtbColt);
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
} else {
onComplete.run(mtbColt);
}
}, onFailed);
}
}, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
@Override
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
String codMdep = posizione.getCodMdep();
String posizioneString = posizione.getPosizione();
public void spostaUL(MtbColt mtbColtToMove, String codMdep, String posizione, boolean createDocAutomatically, Runnable onComplete, RunnableArgs<Exception> onFailed) {
MtbColt mtbColtToMoveClone = (MtbColt) mtbColtToMove.clone();
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
@@ -417,26 +452,66 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
.setMtbPartitaMag(null);
}
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
SpostaULRequestDTO spostaUlRequestDTO = new SpostaULRequestDTO()
.setCodMdep(codMdep)
.setPosizione(posizione)
.setMtbColtsToMove(Collections.singletonList(mtbColtToMoveClone))
.setCreateDocAutomatically(createDocAutomatically);
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService
.spostaULInPosizione(codMdep,
posizioneString,
mtbColtToMoveClone)
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
.spostaUL(spostaUlRequestDTO)
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
analyzeAnswer(response, "changePosizione", mtbColts -> {
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "spostaUL", mtbColts -> {
onComplete.run();
}, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
public void spostaUL(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
String codMdep = posizione.getCodMdep();
String posizioneString = posizione.getPosizione();
spostaUL(mtbColtToMove, codMdep, posizioneString, true, onComplete, onFailed);
}
public void updateTipoUL(MtbColt mtbColt, String codTcol, Runnable onComplete, RunnableArgs<Exception> onFailed) {
MtbColt mtbColtClone = (MtbColt) mtbColt.clone();
mtbColtClone.setMtbColr(new ObservableArrayList<>());
UpdateTipoULRequestDTO updateTipoULRequest = new UpdateTipoULRequestDTO()
.setMtbColt(mtbColtClone)
.setCodTcol(codTcol);
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService
.updateTipoUL(updateTipoULRequest)
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "updateTipoUL", mtbColts -> {
onComplete.run();
}, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
public void updateDataFine(MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();
@@ -453,19 +528,19 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
public static void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
public void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<MtbColt>>> call, Response<ServiceRESTResponse<List<MtbColt>>> response) {
analyzeAnswer(response, "getColliInBasket", mtbColts -> {
fillMtbAartsOfMtbColtsStatic(mtbColts, onComplete, onFailed);
fillMtbAartsOfMtbColts(mtbColts, onComplete, onFailed);
}, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<MtbColt>>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<MtbColt>>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@@ -480,24 +555,24 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
.setNewNumCnf(newNumCnf)
.setNewQtaCol(newQtaTot);
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.creaRettificaCollo(
SettingsManager.i().getUserSession().getDepo().getCodMdep(),
rettificaULDTO
).enqueue(new Callback<>() {
).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbColr>> call, Response<ServiceRESTResponse<MtbColr>> response) {
analyzeAnswer(response, "creaRettificaCollo", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbColr>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<MtbColr>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, boolean flagForceUseRefs, RunnableArgs<List<MtbColr>> onComplete, RunnableArgs<Exception> onFailed) {
new Thread(() -> {
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
@@ -512,20 +587,23 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO()
.setSourceMtbColt(mtbColtToMoveClone)
.setDestinationMtbColt(mtbColtDestClone);
.setDestinationMtbColt(mtbColtDestClone)
.setFlagForceUseRefs(flagForceUseRefs);
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new Callback<>() {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
public void onResponse(Call<ServiceRESTResponse<SpostaArtsTraULResponseDTO>> call, Response<ServiceRESTResponse<SpostaArtsTraULResponseDTO>> response) {
analyzeAnswer(response, "spostaArtsTraUL", data -> {
onComplete.run();
fillMtbAartsOfMtbColrs(data.getGeneratedMtbColr(), onComplete, onFailed);
}, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<SpostaArtsTraULResponseDTO>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}).start();
@@ -540,8 +618,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
.setMtbPartitaMag(null);
}
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.assegnaLottoSuColloScarico(sourceMtbColtClone).enqueue(new Callback<>() {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.assegnaLottoSuColloScarico(sourceMtbColtClone).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
analyzeAnswer(response, "assegnaLottoSuColloScarico", data -> {
@@ -550,8 +628,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@@ -565,8 +643,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
.setMtbPartitaMag(null);
}
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.versamentoAutomaticoUL(sourceMtbColtClone).enqueue(new Callback<>() {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.versamentoAutomaticoUL(sourceMtbColtClone).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Response<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> response) {
analyzeAnswer(response, "versamentoAutomaticoUL", data -> {
@@ -603,8 +681,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@@ -613,8 +691,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
sourceMtbColtClone.setMtbColr(new ObservableArrayList<>());
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.confirmGiacenzaUL(sourceMtbColtClone).enqueue(new Callback<>() {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.confirmGiacenzaUL(sourceMtbColtClone).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
analyzeAnswer(response, "confirmGiacenzaUL", data -> {
@@ -624,8 +702,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@@ -661,36 +739,36 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
CanULBeDeletedRequestDTO canULBeDeletedRequestDTO = new CanULBeDeletedRequestDTO()
.setMtbColt(mtbColt);
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.canULBeDeleted(canULBeDeletedRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
analyzeAnswer(response, "generic/canULBeDeleted", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void deleteUL(DeleteULRequestDTO deleteULRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.deleteUL(deleteULRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "generic/deleteUL", Void -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@@ -702,18 +780,18 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
return;
}
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.printUL(printULRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "generic/printUL", Void -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});

View File

@@ -7,6 +7,9 @@ import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULResponseDTO;
import it.integry.integrywmsnative.core.rest.model.SpostaULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.UpdateTipoULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
@@ -31,11 +34,14 @@ public interface ColliMagazzinoRESTConsumerService {
@POST("creaRettificaCollo")
Call<ServiceRESTResponse<MtbColr>> creaRettificaCollo(@Query("codMdep") String codMdep, @Body RettificaULDTO rettificaULDTO);
@POST("wms/spostaULInPosizione")
Call<ServiceRESTResponse<Object>> spostaULInPosizione(@Query("codMdep") String codMdep, @Query("posizione") String posizione, @Body MtbColt mtbColtToMove);
@POST("wms/updateTipoUL")
Call<ServiceRESTResponse<Void>> updateTipoUL(@Body UpdateTipoULRequestDTO requestDto);
@POST("wms/spostaUL")
Call<ServiceRESTResponse<Void>> spostaUL(@Body SpostaULRequestDTO requestDto);
@POST("wms/spostaArtsTraUL")
Call<ServiceRESTResponse<Object>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
Call<ServiceRESTResponse<SpostaArtsTraULResponseDTO>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
@POST("wms/assegnaLottoSuColloScarico")
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);

View File

@@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
@@ -7,110 +9,134 @@ import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements ColliScaricoRESTConsumerInterface {
private final RESTBuilder restBuilder;
public ColliSpedizioneRESTConsumer(RESTBuilder restBuilder) {
this.restBuilder = restBuilder;
}
public void createUDS(CreateUDSRequestDTO createUDSRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = restBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.createUDS(createUDSRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Response<ServiceRESTResponse<CreateUDSResponseDTO>> response) {
analyzeAnswer(response, "spedizione/createUDS", data -> onComplete.run(data.getMtbColt()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void closeUDS(CloseUDSRequestDTO closeUDSRequestDTO, RunnableArgs<CloseUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = restBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.closeUDS(closeUDSRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Response<ServiceRESTResponse<CloseUDSResponseDTO>> response) {
analyzeAnswer(response, "spedizione/closeUDS", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = restBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.insertUDSRow(insertUDSRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDSRowResponseDTO>> response) {
analyzeAnswer(response, "spedizione/insertUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void editUDSRow(EditUDSRowRequestDTO editUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = restBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.editUDSRow(editUDSRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDSRowResponseDTO>> response) {
analyzeAnswer(response, "spedizione/editUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void deleteUDSRow(DeleteUDSRowRequestDTO deleteUDSRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = restBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.deleteUDSRow(deleteUDSRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "spedizione/deleteUDSRow", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void duplicateUDS(DuplicateUDSRequestDTO duplicateUDSRequestDTO, RunnableArgs<DuplicateUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = restBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.duplicateUDS(duplicateUDSRequestDTO)
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<DuplicateUDSResponseDTO>> call, @NonNull Response<ServiceRESTResponse<DuplicateUDSResponseDTO>> response) {
analyzeAnswer(response, "spedizione/duplicateUDS", onComplete, onFailed);
}
@Override
public void onFailure(@NonNull Call<ServiceRESTResponse<DuplicateUDSResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(new Exception());
}
});
}
}

View File

@@ -6,6 +6,8 @@ import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
@@ -35,4 +37,7 @@ public interface ColliSpedizioneRESTConsumerService {
@POST("wms/spedizione/deleteUDSRow")
Call<ServiceRESTResponse<Void>> deleteUDSRow(@Body DeleteUDSRowRequestDTO deleteUDSRowRequestDTO);
@POST("wms/spedizione/duplicateUDS")
Call<ServiceRESTResponse<DuplicateUDSResponseDTO>> duplicateUDS(@Body DuplicateUDSRequestDTO duplicateUDSRequestDTO);
}

View File

@@ -1,12 +1,12 @@
package it.integry.integrywmsnative.core.rest.consumers;
import com.annimon.stream.Stream;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
import javax.inject.Singleton;
@@ -26,15 +26,15 @@ public class CommessaRESTConsumer extends _BaseRESTConsumer {
public void getJtbComts(List<String> itemsToFind, RunnableArgs<List<JtbComt>> onComplete, RunnableArgs<Exception> onFailed) {
var whereCondMap = Stream.of(itemsToFind)
.withoutNulls()
var whereCondMap = itemsToFind.stream()
.filter(x -> !UtilityString.isNullOrEmpty(x))
.map(x -> {
HashMap<String, Object> vars = new HashMap<>();
vars.put("cod_jcom", x);
return vars;
HashMap<String, Object> codJcom = new HashMap<>() {{
put("cod_jcom", x);
}};
return codJcom;
})
.toList();
.collect(Collectors.toUnmodifiableList());
if(whereCondMap.isEmpty()) {
onComplete.run(new ArrayList<>());

View File

@@ -9,7 +9,6 @@ import java.util.List;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.CommonModelConsts;
import it.integry.integrywmsnative.core.model.MtbDepo;
@Singleton
@@ -28,27 +27,4 @@ public class DepositoRESTConsumer extends _BaseRESTConsumer {
}.getType();
this.systemRESTConsumer.processSql("SELECT * FROM mtb_depo", typeOfObjectsList, onComplete, onFailed);
}
public void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete, RunnableArgs<Exception> onFailed) {
MtbDepo mtbDepo = new MtbDepo();
mtbDepo.setCodMdep(codMdep);
mtbDepo.setOperation(CommonModelConsts.OPERATION.SELECT);
mtbDepo.setOnlyPkMaster(false);
this.entityRESTConsumer.selectEntity(mtbDepo, new ISimpleOperationCallback<>() {
@Override
public void onSuccess(List<MtbDepo> value) {
if (value != null && value.size() > 0) {
onComplete.run(value.get(0));
}
}
@Override
public void onFailed(Exception ex) {
onFailed.run(ex);
}
}, MtbDepo.class);
}
}

View File

@@ -9,62 +9,80 @@ import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.DtbDoct;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.LoadColliDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.documento.RetrieveDocumentoArtsResponseDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class DocumentRESTConsumer extends _BaseRESTConsumer {
private final RESTBuilder restBuilder;
public DocumentRESTConsumer(RESTBuilder restBuilder) {
this.restBuilder = restBuilder;
}
public void createDocsFromColli(List<LoadColliDTO> listColli, RunnableArgs<List<DtbDoct>> onComplete, RunnableArgs<Exception> onFailed) {
DocumentiRESTConsumerService documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
documentiRESTConsumerService.createDocsFromColli(listColli).enqueue(new Callback<>() {
DocumentiRESTConsumerService documentiRESTConsumerService = restBuilder.getService(DocumentiRESTConsumerService.class);
documentiRESTConsumerService.createDocsFromColli(listColli).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<DtbDoct>>> call, Response<ServiceRESTResponse<List<DtbDoct>>> response) {
analyzeAnswer(response, "createDocsFromColli", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<DtbDoct>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<DtbDoct>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void createDocFromColli(LoadColliDTO loadColliDTO, RunnableArgs<DtbDoct> onComplete, RunnableArgs<Exception> onFailed) {
DocumentiRESTConsumerService documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
documentiRESTConsumerService.createDocFromColli(loadColliDTO).enqueue(new Callback<>() {
DocumentiRESTConsumerService documentiRESTConsumerService = restBuilder.getService(DocumentiRESTConsumerService.class);
documentiRESTConsumerService.createDocFromColli(loadColliDTO).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<DtbDoct>> call, Response<ServiceRESTResponse<DtbDoct>> response) {
analyzeAnswer(response, "createDocFromColli", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<DtbDoct>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<DtbDoct>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void checkDocument(String fornitore, String numDoc, String dataDoc, String tipoDoc, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
var inventarioRESTConsumerService = restBuilder.getService(DocumentiRESTConsumerService.class);
inventarioRESTConsumerService.checkDocument(fornitore, numDoc,tipoDoc, dataDoc)
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<Boolean>> call, @NonNull Response<ServiceRESTResponse<Boolean>> response) {
analyzeAnswer(response, "checkDocument", onComplete, onFailed);
}
@Override
public void onFailure(@NonNull Call<ServiceRESTResponse<Boolean>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void loadDocumentAvailableArts(String codDtip, String codMgrp, String codAnagForn, RunnableArgs<RetrieveDocumentoArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
var inventarioRESTConsumerService = restBuilder.getService(DocumentiRESTConsumerService.class);
inventarioRESTConsumerService.retrieveArts(codDtip, codMgrp, codAnagForn)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> response) {
analyzeAnswer(response, "loadDocumentoArts", onComplete, onFailed);
}
@Override
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@@ -20,8 +20,12 @@ public interface DocumentiRESTConsumerService {
@POST("createDocFromColli")
Call<ServiceRESTResponse<DtbDoct>> createDocFromColli(@Body LoadColliDTO listColli);
@GET("wms/documento/checkDoc")
Call<ServiceRESTResponse<Boolean>> checkDocument(
@Query("fornitore") String fornitore,
@Query("numDoc") String numDoc,
@Query("tipoDoc") String tipoDoc,
@Query("dataDoc") String dataDoc);
@GET("wms/documento/arts")
Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> retrieveArts(

View File

@@ -2,6 +2,8 @@ package it.integry.integrywmsnative.core.rest.consumers;
import android.util.Log;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
@@ -13,16 +15,21 @@ import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.EntityBase;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.EsitoType;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.utility.UtilityGson;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class EntityRESTConsumer extends _BaseRESTConsumer {
private final RESTBuilder restBuilder;
public EntityRESTConsumer(RESTBuilder restBuilder) {
this.restBuilder = restBuilder;
}
public <T extends EntityBase> void processEntity(T entityToSave, final ISimpleOperationCallback<T> callback, Class<T> type) {
@@ -30,17 +37,17 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
if (callback != null) callback.onFailed(ex);
};
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
EntityRESTConsumerService service = restBuilder.getService(EntityRESTConsumerService.class);
service
.processEntity(entityToSave)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
if (response.isSuccessful()) {
if (response.body() != null) {
if (response.body().getEsito() == EsitoType.OK) {
Gson gson = new Gson();
Gson gson = UtilityGson.createObject();
T object = gson.fromJson(response.body().getEntity(), type);
callback.onSuccess(object);
@@ -59,9 +66,8 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
Log.e("EntityRESTConsumer", t.toString());
tmpFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, @NonNull final Exception e) {
tmpFailed.run(e);
}
});
@@ -74,9 +80,9 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
if (onFailed != null) onFailed.run(ex);
};
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
EntityRESTConsumerService service = restBuilder.getService(EntityRESTConsumerService.class);
Call<List<ServiceRESTResponse<JsonObject>>> request = service.processEntityList(singleTransaction, entitiesToSave);
request.enqueue(new Callback<>() {
request.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<List<ServiceRESTResponse<JsonObject>>> call, Response<List<ServiceRESTResponse<JsonObject>>> response) {
if (response.isSuccessful()) {
@@ -112,30 +118,30 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<List<ServiceRESTResponse<JsonObject>>> call, Throwable t) {
Log.e("EntityRESTConsumer", t.toString());
tmpFailed.run(new Exception(t));
public void onFailure(Call<List<ServiceRESTResponse<JsonObject>>> call, @NonNull final Exception e) {
tmpFailed.run(e);
}
});
}
@Deprecated
public <T extends EntityBase> void selectEntity(T entityToSave, final ISimpleOperationCallback<List<T>> callback, Class type) {
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
EntityRESTConsumerService service = restBuilder.getService(EntityRESTConsumerService.class);
Call<ServiceRESTResponse<JsonObject>> request = service.processEntity(entityToSave);
request.enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
request.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
if (response.isSuccessful()) {
if (response.body() != null) {
if (response.body().getEsito() == EsitoType.OK) {
Gson gson = new Gson();
Gson gson = UtilityGson.createObject();
List<JsonObject> jsons = response.body().getEntityList();
List<T> newList = new ArrayList<T>();
List<T> newList = new ArrayList<>();
if (jsons != null) {
for (int i = 0; i < jsons.size(); i++) {
@@ -162,9 +168,8 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
Log.e("EntityRESTConsumer", t.toString());
callback.onFailed(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, @NonNull final Exception e) {
callback.onFailed(e);
}
});

View File

@@ -1,6 +1,6 @@
package it.integry.integrywmsnative.core.rest.consumers;
import android.util.Log;
import androidx.annotation.NonNull;
import java.util.List;
import java.util.stream.Collectors;
@@ -10,32 +10,35 @@ import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.StbGestSetup;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.GestSetupDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.settings.StbGestSetupReader;
import it.integry.integrywmsnative.core.utility.UtilityLogger;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class GestSetupRESTConsumer extends _BaseRESTConsumer {
private final RESTBuilder restBuilder;
public GestSetupRESTConsumer(RESTBuilder restBuilder) {
this.restBuilder = restBuilder;
}
public void getValue(String gestName, String sectionName, String keySection, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
GestSetupRESTConsumerService service = restBuilder.getService(GestSetupRESTConsumerService.class);
service.getGestSetupValue(gestName, sectionName, keySection)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
Log.e("GestSetup", t.toString());
// UtilityLogger.errorMe(new Exception(t));
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@@ -51,18 +54,16 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
}
public void getValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
service.getGestSetupValue(gestName, sectionName, keySection, codMdep).enqueue(new Callback<ServiceRESTResponse<GestSetupDTO>>() {
GestSetupRESTConsumerService service = restBuilder.getService(GestSetupRESTConsumerService.class);
service.getGestSetupValue(gestName, sectionName, keySection, codMdep).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
Log.e("PrintCollo", t.toString());
UtilityLogger.error(new Exception(t));
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@@ -81,8 +82,8 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
public void getValues(String codMdep, List<StbGestSetupReader> stbGestSetupList, RunnableArgs<List<StbGestSetupReader>> onComplete, RunnableArgs<Exception> onFailed) {
var stbGestSetups = stbGestSetupList.stream().map(x -> (StbGestSetup) x).collect(Collectors.toList());
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
service.getGestSetupValues(codMdep, stbGestSetups).enqueue(new Callback<>() {
GestSetupRESTConsumerService service = restBuilder.getService(GestSetupRESTConsumerService.class);
service.getGestSetupValues(codMdep, stbGestSetups).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Response<ServiceRESTResponse<List<StbGestSetup>>> response) {
analyzeAnswer(response, "GestSetup", data -> {
@@ -100,9 +101,8 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Throwable t) {
UtilityLogger.error(new Exception(t));
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<StbGestSetup>>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}

View File

@@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import com.annimon.stream.Optional;
import com.annimon.stream.Stream;
@@ -13,31 +15,74 @@ import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationIncomingItemDto;
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationResponseDto;
import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
private final SystemRESTConsumer mSystemRESTConsumer;
private final RESTBuilder restBuilder;
private final ArticoloRESTConsumer mArticoloRESTConsumer;
public GiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
this.mSystemRESTConsumer = systemRESTConsumer;
public GiacenzaRESTConsumer(RESTBuilder restBuilder, ArticoloRESTConsumer articoloRESTConsumer) {
this.restBuilder = restBuilder;
this.mArticoloRESTConsumer = articoloRESTConsumer;
}
public void getGiacenzeInPosizione(MtbDepoPosizione posizione, RunnableArgs<List<MvwSitArtUdcDetInventario>> onComplete, RunnableArgs<Exception> onFailed) {
GiacenzaRESTConsumerService giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
giacenzaRESTConsumerService.retrieveAvailableItems(posizione.getPosizione()).enqueue(new Callback<>() {
GiacenzaRESTConsumerService giacenzaRESTConsumerService = restBuilder.getService(GiacenzaRESTConsumerService.class);
giacenzaRESTConsumerService.retrieveAvailableItems(posizione.getPosizione()).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Response<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> response) {
analyzeAnswer(response, "getGiacenzeInPosizione", inventarioList -> {
if(inventarioList != null && !inventarioList.isEmpty()){
List<String> codMarts = Stream.of(inventarioList)
.map(x -> x.getCodMart().trim())
.toList();
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
for (var row : inventarioList) {
MtbAart foundMtbAart = null;
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
.filter(x -> x.getCodMart().equalsIgnoreCase(row.getCodMart()))
.findFirst();
if (mtbAartOpt.isPresent()) {
foundMtbAart = mtbAartOpt.get();
}
row.setMtbAart(foundMtbAart);
}
onComplete.run(inventarioList);
}, onFailed);
}else{
onComplete.run(new ArrayList<>());
}
}, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void getGiacenzeInPosizione(List<String> posizioni, boolean withTestataCollo, RunnableArgs<List<ArtsInGiacenzaDTO>> onComplete, RunnableArgs<Exception> onFailed) {
GiacenzaRESTConsumerService giacenzaRESTConsumerService = restBuilder.getService(GiacenzaRESTConsumerService.class);
giacenzaRESTConsumerService.retrieveAvailableItems(posizioni, withTestataCollo).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> call, Response<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> response) {
analyzeAnswer(response, "getGiacenzeInPosizione", inventarioList -> {
List<String> codMarts = Stream.of(inventarioList)
@@ -45,18 +90,22 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
.toList();
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
for (var row : inventarioList) {
for (var articoli : inventarioList) {
List<MvwSitArtUdcDetInventario> mvwSitArtUdcDetInventario = articoli.getMvwSitArtUdcDetInventarioDTO();
if (mvwSitArtUdcDetInventario != null && !mvwSitArtUdcDetInventario.isEmpty()){
for (var row : mvwSitArtUdcDetInventario){
MtbAart foundMtbAart = null;
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
.filter(x -> x.getCodMart().equalsIgnoreCase(row.getCodMart()))
.findFirst();
MtbAart foundMtbAart = null;
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
.filter(x -> x.getCodMart().equalsIgnoreCase(row.getCodMart()))
.findFirst();
if (mtbAartOpt.isPresent()) {
foundMtbAart = mtbAartOpt.get();
}
if (mtbAartOpt.isPresent()) {
foundMtbAart = mtbAartOpt.get();
row.setMtbAart(foundMtbAart);
}
}
row.setMtbAart(foundMtbAart);
}
onComplete.run(inventarioList);
@@ -65,19 +114,19 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void getGiacenzeByArticolo(String codMart, String partitaMag, RunnableArgs<List<MvwSitArtUdcDetInventario>> onComplete, RunnableArgs<Exception> onFailed) {
GiacenzaRESTConsumerService giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
GiacenzaRESTConsumerService giacenzaRESTConsumerService = restBuilder.getService(GiacenzaRESTConsumerService.class);
var serviceRESTResponseCall =
UtilityString.isNullOrEmpty(partitaMag) ?
giacenzaRESTConsumerService.retrieveAvailableItemsByArt(codMart) :
giacenzaRESTConsumerService.retrieveAvailableItemsByArt(codMart, partitaMag);
serviceRESTResponseCall.enqueue(new Callback<>() {
serviceRESTResponseCall.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Response<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> response) {
analyzeAnswer(response, "getGiacenzeByArticolo", inventarioList -> {
@@ -108,18 +157,18 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void getInstantItemSituation(String codMdep, String codMart, String partitaMag, String codJcom, RunnableArgs<InstantItemSituationResponseDto> onComplete, RunnableArgs<Exception> onFailed) {
GiacenzaRESTConsumerService giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
GiacenzaRESTConsumerService giacenzaRESTConsumerService = restBuilder.getService(GiacenzaRESTConsumerService.class);
giacenzaRESTConsumerService.retrieveInstantItemSituation(codMdep, codMart, partitaMag, codJcom)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<InstantItemSituationResponseDto>> call, Response<ServiceRESTResponse<InstantItemSituationResponseDto>> response) {
analyzeAnswer(response, "getInstantItemSituation", data -> {
@@ -129,8 +178,8 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<InstantItemSituationResponseDto>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<InstantItemSituationResponseDto>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@@ -5,8 +5,11 @@ import java.util.List;
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationResponseDto;
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
public interface GiacenzaRESTConsumerService {
@@ -15,6 +18,9 @@ public interface GiacenzaRESTConsumerService {
Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> retrieveAvailableItems(
@Query("posizione") String posizione);
@POST("wms/giacenza/availableItemsByPosizione")
Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> retrieveAvailableItems(@Body List<String> posizioni, @Query("withTestataCollo") boolean withTestataCollo);
@GET("wms/giacenza/availableItemsByArticolo")
Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> retrieveAvailableItemsByArt(
@Query("codMart") String codMart);

View File

@@ -0,0 +1,99 @@
package it.integry.integrywmsnative.core.rest.consumers;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbTCol;
import it.integry.integrywmsnative.core.model.mapper.MtbTcolMapper;
import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.imballi.ImballoQuantityDTO;
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraCaricoImballiRequestDTO;
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraScaricoImballiRequestDTO;
import retrofit2.Response;
@Singleton
public class ImballiRESTConsumer extends _BaseRESTConsumer {
private final RESTBuilder restBuilder;
private final ExecutorService executorService;
public ImballiRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
this.restBuilder = restBuilder;
this.executorService = executorService;
}
public List<ObservableMtbTcol> retrieveImballiSyncronized(MtbTCol.FlagUiUlEnum tipoImballo) throws Exception {
ImballiRESTConsumerService service = restBuilder.getService(ImballiRESTConsumerService.class);
Response<ServiceRESTResponse<List<MtbTCol>>> response = service.retrieveImballi(tipoImballo)
.execute();
List<MtbTCol> retrieveTipiCollo = analyzeAnswer(response, "retrieveTipiCollo");
retrieveTipiCollo = retrieveTipiCollo == null ? new ArrayList<>() : retrieveTipiCollo;
return MtbTcolMapper.fromDTOList(retrieveTipiCollo);
}
public void retrieveImballi(MtbTCol.FlagUiUlEnum tipoImballo, RunnableArgs<List<ObservableMtbTcol>> onComplete, RunnableArgs<Exception> onFailed) {
executorService.execute(() -> {
try {
var response = retrieveImballiSyncronized(tipoImballo);
if (onComplete != null) onComplete.run(response);
} catch (Exception ex) {
if (onFailed != null) onFailed.run(ex);
}
});
}
public void registraCaricoSyncronized(String codAnag, List<ImballoQuantityDTO> imballi) throws Exception {
ImballiRESTConsumerService service = restBuilder.getService(ImballiRESTConsumerService.class);
Response<ServiceRESTResponse<Void>> response = service.registraCarico(
new RegistraCaricoImballiRequestDTO()
.setCodAnag(codAnag)
.setUsedImballi(imballi))
.execute();
analyzeAnswer(response, "registraCarico");
}
public void registraCarico(String codAnag, List<ImballoQuantityDTO> imballi, Runnable onComplete, RunnableArgs<Exception> onFailed) {
executorService.execute(() -> {
try {
registraCaricoSyncronized(codAnag, imballi);
if (onComplete != null) onComplete.run();
} catch (Exception ex) {
if (onFailed != null) onFailed.run(ex);
}
});
}
public void registraScaricoSyncronized(String codVettore, List<ImballoQuantityDTO> imballi) throws Exception {
ImballiRESTConsumerService service = restBuilder.getService(ImballiRESTConsumerService.class);
Response<ServiceRESTResponse<Void>> response = service.registraScarico(
new RegistraScaricoImballiRequestDTO()
.setCodVettore(codVettore)
.setUsedImballi(imballi))
.execute();
analyzeAnswer(response, "registraScarico");
}
public void registraScarico(String idVettore, List<ImballoQuantityDTO> imballi, Runnable onComplete, RunnableArgs<Exception> onFailed) {
executorService.execute(() -> {
try {
registraScaricoSyncronized(idVettore, imballi);
if (onComplete != null) onComplete.run();
} catch (Exception ex) {
if (onFailed != null) onFailed.run(ex);
}
});
}
}

View File

@@ -0,0 +1,27 @@
package it.integry.integrywmsnative.core.rest.consumers;
import java.util.List;
import it.integry.integrywmsnative.core.model.MtbTCol;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraCaricoImballiRequestDTO;
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraScaricoImballiRequestDTO;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
public interface ImballiRESTConsumerService {
@GET("wms/imballi/retrieve/{tipo}")
Call<ServiceRESTResponse<List<MtbTCol>>> retrieveImballi(@Path("tipo") MtbTCol.FlagUiUlEnum tipo);
@POST("wms/imballi/registraCarico")
Call<ServiceRESTResponse<Void>> registraCarico(@Body RegistraCaricoImballiRequestDTO registraCaricoImballiRequest);
@POST("wms/imballi/registraScarico")
Call<ServiceRESTResponse<Void>> registraScarico(@Body RegistraScaricoImballiRequestDTO registraScaricoImballiRequest);
}

View File

@@ -4,58 +4,65 @@ import androidx.annotation.NonNull;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbInvent;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.inventario.InsertInventarioRequestDTO;
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioArtsResponseDTO;
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioResponseDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class InventarioRESTConsumer extends _BaseRESTConsumer {
private final RESTBuilder restBuilder;
@Inject
public InventarioRESTConsumer(RESTBuilder restBuilder) {
this.restBuilder = restBuilder;
}
public void loadInventario(long inventoryId, RunnableArgs<RetrieveInventarioResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class);
var inventarioRESTConsumerService = restBuilder.getService(InventarioRESTConsumerService.class);
inventarioRESTConsumerService.retrieve(inventoryId)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveInventarioResponseDTO>> response) {
analyzeAnswer(response, "loadInventario", onComplete, onFailed);
}
@Override
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> call, @NonNull Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void loadInventarioArts(long inventoryId, RunnableArgs<RetrieveInventarioArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class);
var inventarioRESTConsumerService = restBuilder.getService(InventarioRESTConsumerService.class);
inventarioRESTConsumerService.retrieveArts(inventoryId)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> response) {
analyzeAnswer(response, "loadInventarioArts", onComplete, onFailed);
}
@Override
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> call, @NonNull Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public List<MtbInvent> makeSynchronousRetrieveRequest() throws Exception {
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class, 120);
var inventarioRESTConsumerService = restBuilder.getService(InventarioRESTConsumerService.class, 120);
var response = inventarioRESTConsumerService.retrieve()
.execute();
@@ -70,18 +77,18 @@ public class InventarioRESTConsumer extends _BaseRESTConsumer {
var request = new InsertInventarioRequestDTO()
.setMtbInvent(inventarioToInsert);
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class, 300);
var inventarioRESTConsumerService = restBuilder.getService(InventarioRESTConsumerService.class, 300);
inventarioRESTConsumerService
.insert(inventarioToInsert.getIdInventario(), request)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "insertInventario", ignored -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});

Some files were not shown because too many files have changed in this diff Show More