Compare commits

...

223 Commits

Author SHA1 Message Date
1079c38a5f Finish v1.49.01(545)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-11-24 17:20:22 +01:00
f6388eff1c -> v1.49.01 (545) 2025-11-24 17:20:18 +01:00
495a8dae92 Mini migrazione di dataCollo a LocalDate 2025-11-24 13:11:55 +01:00
ed938815bb Finish v1.49.00(544) 2025-11-24 09:38:12 +01:00
539e8b7c31 Finish v1.49.00(544)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-11-24 09:38:11 +01:00
92da8cde53 -> v1.49.00 (544) 2025-11-24 09:37:54 +01:00
3d0f7f16f9 Finish v1.48.03(543)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-11-21 13:32:21 +01:00
501ca404ff Finish v1.48.03(543) 2025-11-21 13:32:21 +01:00
5ad4fd7821 -> v1.48.03 (543) 2025-11-21 13:32:10 +01:00
1ba2fb96ba Finish v1.48.02(542) 2025-11-20 11:43:17 +01:00
ffdd1a1df5 Finish v1.48.02(542)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-11-20 11:43:16 +01:00
0205255f7d -> v1.48.02 (542) 2025-11-20 11:43:03 +01:00
c21e856a0f Finish v1.48.01(541) 2025-11-19 10:59:03 +01:00
b673940dd6 Finish v1.48.01(541)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-11-19 10:59:03 +01:00
b0ce11cbf7 -> v1.48.01 (541) 2025-11-19 10:58:54 +01:00
4ef2c209c8 Finish v1.48.00(540) 2025-11-18 10:22:03 +01:00
41d77b806f Finish v1.48.00(540)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-11-18 10:22:02 +01:00
6b65c4a570 -> v1.48.00 (540) 2025-11-18 10:21:46 +01:00
4d5c0e5509 In DtbDoct sostituite date in localDate 2025-11-11 11:50:01 +01:00
21af5fc0a9 In accettazione aggiunta proposta lotto se presente nell'ordine 2025-11-07 13:28:14 +01:00
09b984f5d0 Passato barcode di etichetta anonima in fase di creazione collo 2025-11-06 09:49:18 +01:00
dd473412cc Finish v1.47.26#2 2025-10-29 15:51:00 +01:00
4f0c5bf6dd Finish v1.47.26#2
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-10-29 15:50:59 +01:00
90e4e2e464 Fix Jenkinsfile 2025-10-29 15:50:24 +01:00
50e2605ea5 Finish v1.47.26(539)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-10-29 11:11:43 +01:00
4752e3a3a2 Finish v1.47.26(539) 2025-10-29 11:11:43 +01:00
3fe903cc12 -> v1.47.26 (539) 2025-10-29 11:11:32 +01:00
3f95a70039 Fix addEmsApi in restConsumer 2025-10-29 11:10:11 +01:00
067443698a In Rientro merce, quando si effettua un carico è stato aggiunta la richiesta di versamento automatico 2025-10-28 16:37:23 +01:00
990a4d1538 Finish v1.47.25(538)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-10-28 11:33:12 +01:00
55c16e602d Finish v1.47.25(538) 2025-10-28 11:33:12 +01:00
6097a7f736 -> v1.47.25 (538) 2025-10-28 11:32:05 +01:00
f8b92901fd Attivato di default l'http interceptor 2025-10-28 10:38:52 +01:00
6c6daa4809 Finish v1.47.24(537) 2025-10-21 18:33:28 +02:00
de8b48d938 Finish v1.47.24(537)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-10-21 18:33:27 +02:00
bfa69ca78b -> v1.47.24 (537) 2025-10-21 18:33:17 +02:00
bffb471015 Fix null in spedizione 2025-10-21 18:32:15 +02:00
087e3e261c Finish v1.47.23(536)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-10-15 11:14:03 +02:00
2eff03dee6 Finish v1.47.23(536) 2025-10-15 11:14:03 +02:00
fc34a555bd -> v1.47.23 (536) 2025-10-15 11:13:55 +02:00
0bf21c046f Migliorie UI Dark per Documenti Interni 2025-10-15 11:13:17 +02:00
473ed536fb Finish v1.47.22(535)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-10-08 19:29:27 +02:00
dc342c1fee Finish v1.47.22(535) 2025-10-08 19:29:27 +02:00
81507938b1 -> v1.47.22 (535) 2025-10-08 19:29:23 +02:00
cff52140bd Fix UI Dark.
Fix separatore virgola nel dialog input quantity.
2025-10-08 19:28:34 +02:00
24d90b58f9 Implementato popup di Device in end of life 2025-10-02 18:02:13 +02:00
b5d049aa1d Rimosso style AppTheme.NewMaterial.Text.Medium e rimpiazzato con Material 2025-10-02 11:49:59 +02:00
01028f9888 Rimossa tab bar dal main fragment 2025-10-02 11:29:48 +02:00
2774eaecbf Aggiornato Jenkinsfile
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-10-02 10:45:31 +02:00
648a572752 Finish v1.47.21(534) 2025-10-01 18:29:07 +02:00
022a56a584 Finish v1.47.21(534)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-10-01 18:29:06 +02:00
ea97e8f249 -> v1.47.21 (534) 2025-10-01 18:29:01 +02:00
571ad1590f .gitignore 2025-10-01 18:28:30 +02:00
03c02d6625 Migliorie dark mode 2025-10-01 18:22:10 +02:00
ba1118fdd8 Fix decodifica barcode in recupero materiale 2025-10-01 17:45:26 +02:00
7878748548 Miglioramenti UI dark mode 2025-10-01 16:36:34 +02:00
172a8256b6 Aggiornato style AppBar 2025-10-01 14:45:25 +02:00
c16f5c1747 Aggiornato style di alcune textbox 2025-10-01 12:50:02 +02:00
33860a0cfe Finish v1.47.20(533)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-09-30 17:44:40 +02:00
15a946dfb6 Finish v1.47.20(533) 2025-09-30 17:44:40 +02:00
62adf49157 -> v1.47.20 (533) 2025-09-30 17:44:34 +02:00
64fcb7ccc8 Fix tara pedana nulla in Bottom Sheet Fragment 2025-09-30 17:42:47 +02:00
3ebdc72642 Finish v1.47.19(532) 2025-09-23 18:03:02 +02:00
aacf5ca76e Finish v1.47.19(532)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-09-23 18:03:01 +02:00
4f134bfc8e -> v1.47.19 (532) 2025-09-23 18:02:52 +02:00
6bd1e62190 Fix errori multipli quando il menu non viene caricato 2025-09-18 17:43:44 +02:00
f9f02452d7 Finish v1.47.18(531)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-09-17 15:22:44 +02:00
b653ae39af Finish v1.47.18(531) 2025-09-17 15:22:44 +02:00
63d1d9ecf0 -> v1.47.18 (531) 2025-09-17 15:22:40 +02:00
9c72a2a628 Fix su retrieve degli ultimi versamenti di materiale 2025-09-17 15:09:01 +02:00
5f1b7ef4a4 Finish v1.47.17(530)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-09-16 17:41:52 +02:00
c36bc9d8c2 Finish v1.47.17(530) 2025-09-16 17:41:52 +02:00
ba9da26ca0 -> v1.47.17 (530) 2025-09-16 17:41:48 +02:00
b2ad4fdb62 Migliorata gestione file di log 2025-09-16 17:40:15 +02:00
60e725f554 Fix su caricamento durante il chiudi ordini spedizione 2025-09-16 12:28:52 +02:00
2f6f9b54c2 Finish v1.47.16(529)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-09-16 10:05:39 +02:00
a2ef35e353 Finish v1.47.16(529) 2025-09-16 10:05:39 +02:00
b06f058ecf -> v1.47.16 (529) 2025-09-16 10:05:35 +02:00
e67cbd3760 Merge remote-tracking branch 'origin/develop' into develop 2025-09-15 17:42:12 +02:00
ce9d304043 Aggiunto invio del file raw del log nel caso in cui vada in eccezione il parsine 2025-09-15 17:36:37 +02:00
fc30b8253d Finish v1.47.15(528) 2025-09-11 13:37:26 +02:00
e8da16cb8a Finish v1.47.15(528)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-09-11 13:37:25 +02:00
dff725ea92 -> v1.47.15 (528) 2025-09-11 13:37:14 +02:00
e4248c8c48 Fix postValue in recupero materiale 2025-09-11 13:35:57 +02:00
819cc97113 Finish v1.47.14(527) 2025-09-10 16:36:08 +02:00
05d806f9f2 Finish v1.47.14(527)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-09-10 16:36:08 +02:00
6fdadffe77 -> v1.47.14 (527) 2025-09-10 16:36:04 +02:00
5ae9371c51 Fix su loading che appare sul popup di conferma chiusura ordine 2025-09-10 16:31:50 +02:00
4861c689d7 Fix su codMdep non ricevuto nel caso di picking Extra Item in Spedizione 2025-09-10 15:50:02 +02:00
1c63908b3b Finish v1.47.13(526) 2025-09-05 11:25:31 +02:00
a622e89058 Finish v1.47.13(526)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-09-05 11:25:30 +02:00
ac4500e2a2 -> v1.47.13 (526) 2025-09-05 11:25:26 +02:00
6ebcbc2d6c Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	app/build.gradle
2025-09-05 11:24:48 +02:00
150be3cae2 Rimosso minify 2025-09-05 11:24:37 +02:00
72edf5228a Rimosso minify 2025-09-05 11:24:11 +02:00
b72a3321d9 Finish v1.47.12(525)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-09-05 11:03:49 +02:00
5bf71a1b0c Finish v1.47.12(525) 2025-09-05 11:03:49 +02:00
ee10427048 -> v1.47.12 (525) 2025-09-05 11:03:45 +02:00
7fb7cbf8ec Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	app/proguard-rules.pro
2025-09-05 11:02:17 +02:00
3a43e9238b Aggiunta esclusione classi JJWT dall'obfuscation 2025-09-05 11:01:58 +02:00
007d58a17e Aggiunta esclusione classi JJWT dall'obfuscation 2025-09-05 11:00:48 +02:00
998a59cffc Finish v1.47.11(524)#3 2025-09-05 10:37:51 +02:00
11b353a91d Finish v1.47.11(524)#3
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-09-05 10:37:50 +02:00
8772d11e02 Aggiunto upload simboli su Firebase 2025-09-05 10:37:36 +02:00
3d772e3722 Finish v1.47.11(524)#2 2025-09-05 10:36:55 +02:00
41cfbc273e Finish v1.47.11(524)#2
Some checks failed
WMS - Android (New)/pipeline/head Something is wrong with the build of this commit
2025-09-05 10:36:54 +02:00
bc67098ae0 Aggiunto upload simboli su Firebase 2025-09-05 10:36:33 +02:00
0e49c93678 Finish v1.47.11(524)#1
Some checks failed
WMS - Android (New)/pipeline/head Something is wrong with the build of this commit
2025-09-05 10:35:58 +02:00
ed93b88ee8 Finish v1.47.11(524)#1 2025-09-05 10:35:58 +02:00
2cb184f24b Aggiunto upload simboli su Firebase 2025-09-05 10:35:40 +02:00
126846aef2 Finish v1.47.11(524)
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-09-05 10:26:20 +02:00
8ac595c6c5 Finish v1.47.11(524) 2025-09-05 10:26:20 +02:00
fc2c0fbe0c -> v1.47.11 (524) 2025-09-05 10:26:15 +02:00
0aa0b09afa Fix su null della variabile Server in Login 2025-09-05 09:47:11 +02:00
9436236eaa Fix postValue in Rientro Merce 2025-09-03 16:51:48 +02:00
fc5568a046 Finish v1.47.10(523) 2025-09-03 13:25:30 +02:00
590e9ec24e Finish v1.47.10(523)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-09-03 13:25:29 +02:00
984a4a156b -> v1.47.10 (523) 2025-09-03 13:25:25 +02:00
04afb4cfca Aggiunti serialized name nei DTO del dialog di selezione cliente 2025-09-03 13:24:51 +02:00
81eda94fe0 Finish v1.47.09(522) 2025-09-03 13:01:53 +02:00
8f02dfbee4 Finish v1.47.09(522)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-09-03 13:01:52 +02:00
75e1447a54 -> v1.47.09 (522) 2025-09-03 13:01:48 +02:00
d8f9886f82 Aggiornamenti librerie 2025-09-01 18:04:45 +02:00
3279c4e2af Merge remote-tracking branch 'origin/develop' into develop 2025-09-01 17:05:15 +02:00
6f070e6998 Migliorie varie 2025-09-01 17:04:50 +02:00
df4bfcc955 Finish v1.47.08(521) 2025-08-27 12:37:31 +02:00
c1983cf73c Finish v1.47.08(521)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-08-27 12:37:30 +02:00
da9bbd0b1c -> v1.47.08 (521) 2025-08-27 12:37:16 +02:00
cd84d3e9a8 Fix gestione errori in spedizione 2025-08-27 12:34:39 +02:00
595f4a8797 Finish v1.47.07(520) 2025-08-26 15:11:00 +02:00
388f08a02f Finish v1.47.07(520)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-08-26 15:10:59 +02:00
c562735661 -> v1.47.07 (520) 2025-08-26 15:10:50 +02:00
ab137ad828 Aggiunto controllo della lunghezza di 13 per il barcode nella verifica dell'eanPeso 2025-08-26 15:09:38 +02:00
b56f209084 Modificato il toString del fornitore per il DialogSelectDocInfo 2025-08-26 15:08:42 +02:00
5107897888 Finish v1.47.06(519)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-08-06 10:42:50 +02:00
d91eaf3412 Finish v1.47.06(519) 2025-08-06 10:42:50 +02:00
caa6a7cd75 -> v1.47.06 (519) 2025-08-06 10:42:44 +02:00
567b288e4d Migliorata registrazione errore di ExportLog 2025-08-06 10:41:54 +02:00
86121bfa93 Finish v1.47.05(518)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-07-29 11:21:53 +02:00
669a38732f Finish v1.47.05(518) 2025-07-29 11:21:53 +02:00
e3e7a7d7c6 -> v1.47.05 (518) 2025-07-29 11:21:47 +02:00
75914ab9c9 Finish v1.47.04(517) 2025-07-28 17:52:40 +02:00
d1976f3e21 Finish v1.47.04(517)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-07-28 17:52:39 +02:00
5ef5c4b28a -> v1.47.04 (517) 2025-07-28 17:52:34 +02:00
2c3d4bbc22 Finish v1.47.03(516) 2025-07-14 16:14:39 +02:00
fd8bb8e7da Finish v1.47.03(516)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-07-14 16:14:38 +02:00
60a088a7f4 -> v1.47.03 (516) 2025-07-14 16:14:31 +02:00
8ca5207a58 Aggiornato AGP a 8.11.1 2025-07-14 16:13:56 +02:00
f2cc31e08a Finish v1.47.02(515)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-07-08 16:18:50 +02:00
e541031efe Finish v1.47.02(515) 2025-07-08 16:18:50 +02:00
d4b220d1e6 -> v1.47.02 (515) 2025-07-08 16:18:46 +02:00
798835cb4c Finish v1.47.01(514)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-07-08 12:00:28 +02:00
ba72284c87 Finish v1.47.01(514) 2025-07-08 12:00:28 +02:00
603c5dd8b7 -> v1.47.01 (514) 2025-07-08 12:00:24 +02:00
43fc8be493 Aggiornato AGP a 8.11.0 2025-07-08 11:59:48 +02:00
22bace2402 Finish v1.47.00(513)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-07-02 17:22:13 +02:00
3b86460f48 Finish v1.47.00(513) 2025-07-02 17:22:13 +02:00
ddac54b513 -> v1.47.00 (513) 2025-07-02 17:22:08 +02:00
a385b01584 In verifica giagenza gestito salvataggio online per ogni riga 2025-07-01 15:40:02 +02:00
7920166110 Gestita setup per mostrare o no il cambio deposito 2025-06-30 15:31:48 +02:00
e6f4cc9d6d Finish v1.46.24(512)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-06-26 11:41:01 +02:00
13d9c40119 Finish v1.46.24(512) 2025-06-26 11:41:01 +02:00
1d7125a821 -> v1.46.24 (512) 2025-06-26 11:40:57 +02:00
deb4d77203 Rimossa eliminazione del primo carattere (se 0) da SSCC durante la decodifica ean128 2025-06-26 11:40:08 +02:00
520a1cb07a Finish v1.46.23(511) 2025-06-24 16:49:12 +02:00
c620e9cb96 Finish v1.46.23(511)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-06-24 16:49:11 +02:00
6ef4961074 -> v1.46.23 (511) 2025-06-24 16:49:07 +02:00
688a8e4bad Finish v1.46.22(510) 2025-06-20 18:49:21 +02:00
12796b11e5 Finish v1.46.22(510)
Some checks failed
WMS - Android (New)/pipeline/head Something is wrong with the build of this commit
2025-06-20 18:49:21 +02:00
f7dc857587 -> v1.46.22 (510) 2025-06-20 18:49:16 +02:00
f99c0e5514 Aggiornato Jenkinsfile 2025-06-20 11:58:45 +02:00
f1c304eaeb Finish v1.46.21(509) 2025-06-09 09:48:01 +02:00
7b3fde1d71 Finish v1.46.21(509)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-06-09 09:48:00 +02:00
3c337fc138 -> v1.46.21 (509) 2025-06-09 09:47:57 +02:00
021f6974f1 Aggiornato Jenkinsfile
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-06-03 09:49:13 +02:00
92abfe1da4 Finish v1.46.20(508) 2025-06-03 09:47:38 +02:00
6338c1dfa6 Finish v1.46.20(508)
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-06-03 09:47:37 +02:00
657d85be86 -> v1.46.20 (508) 2025-06-03 09:47:33 +02:00
97c907c992 Aggiornato build.gradle
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 13:41:10 +02:00
caed709b64 Aggiornato build.gradle 2025-05-28 13:32:06 +02:00
13800eecab Aggiornato build.gradle
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 13:03:55 +02:00
c4357f662c Finish v1.46.19(507) 2025-05-28 12:51:09 +02:00
67a8ca94db Finish v1.46.19(507)
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 12:51:09 +02:00
0bfd56c011 -> v1.46.19 (507) 2025-05-28 12:51:05 +02:00
eead844ac1 Aggiunte definizioni di @SerializedName per evitare minify di Proguard 2025-05-28 12:50:21 +02:00
65cfadcb6e Finish v1.46.18(506)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 12:29:40 +02:00
00067ca1c9 Finish v1.46.18(506) 2025-05-28 12:29:40 +02:00
73ca8bb366 -> v1.46.18 (506) 2025-05-28 12:29:36 +02:00
3ffdb2c220 Fix AuthInterceptor 2025-05-28 12:28:13 +02:00
a5479595c7 Aggiornato build.gradle
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 12:24:24 +02:00
cff971bef8 Merge branch 'master' into develop
# Conflicts:
#	Jenkinsfile.groovy
2025-05-28 11:47:20 +02:00
a5d3388665 Aggiornato build.gradle
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 11:45:51 +02:00
22ad23c5b7 Aggiornato build.gradle
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 11:44:41 +02:00
b1d5e10db4 Aggiornato build.gradle 2025-05-28 11:32:35 +02:00
bde41d21be Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head Something is wrong with the build of this commit
2025-05-28 11:26:12 +02:00
9d8228419c Modificato Jenkinsfile
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 11:25:14 +02:00
ad7d9059c0 Modificato Jenkinsfile
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 11:19:57 +02:00
4831a7ce19 Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 11:19:10 +02:00
552b82feda Modificato Jenkinsfile
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 11:10:39 +02:00
6d62a7b10e Modificato Jenkinsfile
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 10:57:42 +02:00
667f4aea74 Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:53:55 +02:00
f80225b7bf Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:47:00 +02:00
7a02e1d8ad Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:46:25 +02:00
9cc70f4ee6 Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:42:51 +02:00
7c4c5da1d6 Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:41:32 +02:00
b960b6319a Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:40:47 +02:00
08ddaa7a11 Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:39:56 +02:00
bcce40094c Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:33:59 +02:00
960388adf8 Modificato Jenkinsfile 2025-05-28 10:31:48 +02:00
e76722018f Fix AuthInterceptor in caso di AccessToken nullo 2025-05-28 10:30:19 +02:00
fc30017021 Finish v1.46.17(505) 2025-05-28 10:18:03 +02:00
e1dd4f2140 Finish v1.46.17(505) 2025-05-28 10:18:03 +02:00
67a0679de7 -> v1.46.17 (505) 2025-05-28 10:17:58 +02:00
dfc87f7aec Fix AuthInterceptor in caso di AccessToken nullo 2025-05-28 10:17:09 +02:00
886ef6ba08 Finish v1.46.16(504) 2025-05-27 18:44:03 +02:00
fe77f90a7a Finish v1.46.16(504) 2025-05-27 18:44:02 +02:00
7a1f0d6cf6 -> v1.46.16 (504) 2025-05-27 18:43:56 +02:00
004bc3b926 Migliorie sulla gestione dell'access token nell'interceptor e durante il refresh.
Migliorie al loading popup durante il chiudi ordine in spedizione.
2025-05-27 18:43:01 +02:00
5a0b45c6f9 Finish v1.46.15(503) 2025-05-27 17:48:12 +02:00
be5ebb89d7 Finish v1.46.15(503) 2025-05-27 17:48:12 +02:00
f81d61c4c5 -> v1.46.15 (503) 2025-05-27 17:47:59 +02:00
634bc502ce Fix null dovuto alla getBancaliGiaRegistratiSynchronized 2025-05-27 17:45:24 +02:00
d13dbf1ad3 Finish v1.46.14(502) 2025-05-26 09:44:01 +02:00
234 changed files with 3509 additions and 2442 deletions

3
.gitignore vendored
View File

@@ -149,3 +149,6 @@ crashlytics.properties
crashlytics-build.properties
### AndroidStudio Patch ###
!/gradle/wrapper/gradle-wrapper.jar
copilot.*.xml
/.idea/dataSources.xml

View File

@@ -4,10 +4,10 @@
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2025-05-14T09:45:15.341614500Z">
<DropdownSelection timestamp="2025-10-02T11:26:10.944286600Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="PhysicalDevice" identifier="serial=23324B682F" />
<DeviceId pluginId="PhysicalDevice" identifier="serial=7da0808" />
</handle>
</Target>
</DropdownSelection>

View File

@@ -1,6 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android App">
<module name="WMS.app.main" />
<module name="WMS_Native.app" />
<option name="ANDROID_RUN_CONFIGURATION_SCHEMA_VERSION" value="1" />
<option name="DEPLOY" value="true" />
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
<option name="DEPLOY_AS_INSTANT" value="false" />
@@ -8,14 +9,17 @@
<option name="PM_INSTALL_OPTIONS" value="" />
<option name="ALL_USERS" value="false" />
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
<option name="ALLOW_ASSUME_VERIFIED" value="false" />
<option name="CLEAR_APP_STORAGE" value="false" />
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="RESTORE_ENABLED" value="false" />
<option name="RESTORE_FILE" value="" />
<option name="RESTORE_FRESH_INSTALL_ONLY" value="false" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="TARGET_SELECTION_MODE" value="DEVICE_AND_SNAPSHOT_COMBO_BOX" />
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
<option name="DEBUGGER_TYPE" value="Auto" />
@@ -59,6 +63,7 @@
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
</Profilers>
<option name="DEEP_LINK" value="" />
<option name="ACTIVITY" value="" />
<option name="ACTIVITY_CLASS" value="" />
<option name="SEARCH_ACTIVITY_IN_GLOBAL_SCOPE" value="false" />
<option name="SKIP_ACTIVITY_VALIDATION" value="false" />

72
Jenkinsfile.groovy Normal file
View File

@@ -0,0 +1,72 @@
pipeline {
agent {
label 'master'
}
options {
buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '10'))
disableConcurrentBuilds()
}
environment {
// ANDROID_HOME = "/usr/local/android/sdk" // Cambia in base al tuo sistema
JAVA_HOME = tool 'JDK 17.0.6 x64' // Nome dello strumento configurato in Jenkins
PATH = "${env.JAVA_HOME}\\bin;${env.PATH}"
}
stages {
stage('Preparing') {
when {
expression {
return env.GIT_BRANCH == "master-beta"
}
}
steps {
bat "./gradlew addBetaSuffix"
}
}
stage('Build') {
steps {
bat "./gradlew assembleRelease"
archiveArtifacts artifacts: 'app/build/outputs/apk/release/', onlyIfSuccessful: true
}
}
stage('Publish') {
steps {
azureUpload allowAnonymousAccess: true, fileShareName: 'storage-ci', filesPath: 'app/build/outputs/apk/release/*.apk,app/build/outputs/apk/release/*.txt', removePrefixPath: 'app/build/outputs/apk/release/', storageCredentialId: '83a86793-c1d6-4776-b20f-1ff652a57fee', storageType: 'filestorage', uploadArtifactsOnlyIfSuccessful: true, verbose: true, virtualPath: 'wms'
}
}
}
post {
success {
script {
bat 'curl -k "https://devservices.studioml.it/ems-api/updateWMSApp?overrideForced=false"'
bat 'curl -k "https://devservices.studioml.it/ems-api/updateWMSApp?overrideForced=false&suffix=beta"'
bat 'curl -k "https://services.studioml.it/ems-api/updateWMSApp?overrideForced=false"'
bat 'curl -k "https://services.studioml.it/ems-api/updateWMSApp?overrideForced=false&suffix=beta"'
if (env.GIT_BRANCH == "master" || env.GIT_BRANCH == "master-beta") {
office365ConnectorSend adaptiveCards: true, color: '#008000', message: 'WMS è stato compilato con successo', status: 'SUCCESS', webhookUrl: 'https://default0b9c060c159c4e5f82a77459a72572.16.environment.api.powerplatform.com:443/powerautomate/automations/direct/workflows/a73f903a4044474c84ad9a0d68a9a479/triggers/manual/paths/invoke?api-version=1&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=gXc43FQXqIq7Xpfvis2XgFoPl8lpg0Sf5HtuxZG_jeI'
}
}
}
unstable {
script {
if (env.GIT_BRANCH == "master" || env.GIT_BRANCH == "master-beta") {
office365ConnectorSend adaptiveCards: true, color: '#FFDE21', message: 'WMS è INSTABILE', status: 'UNSTABLE', webhookUrl: 'https://default0b9c060c159c4e5f82a77459a72572.16.environment.api.powerplatform.com:443/powerautomate/automations/direct/workflows/a73f903a4044474c84ad9a0d68a9a479/triggers/manual/paths/invoke?api-version=1&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=gXc43FQXqIq7Xpfvis2XgFoPl8lpg0Sf5HtuxZG_jeI'
}
}
}
failure {
script {
if (env.GIT_BRANCH == "master" || env.GIT_BRANCH == "master-beta") {
office365ConnectorSend adaptiveCards: true, color: '#FF2C2C', message: 'Errore di compilazione su WMS', status: 'FAILURE', webhookUrl: 'https://default0b9c060c159c4e5f82a77459a72572.16.environment.api.powerplatform.com:443/powerautomate/automations/direct/workflows/a73f903a4044474c84ad9a0d68a9a479/triggers/manual/paths/invoke?api-version=1&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=gXc43FQXqIq7Xpfvis2XgFoPl8lpg0Sf5HtuxZG_jeI'
}
}
}
}
}

View File

@@ -8,10 +8,11 @@ apply plugin: 'com.google.firebase.crashlytics'
//apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
android {
def appVersionCode = 502
def appVersionName = '1.46.14'
def appVersionCode = 545
def appVersionName = '1.49.01'
signingConfigs {
release {
@@ -34,7 +35,7 @@ android {
defaultConfig {
applicationId "it.integry.integrywmsnative"
minSdkVersion 21
targetSdkVersion 35
targetSdk 36
versionCode appVersionCode
versionName appVersionName
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -51,11 +52,18 @@ android {
buildTypes {
debug {
ext.enableCrashlytics = false
// minifyEnabled true // Abilita la minimizzazione del codice
// shrinkResources true // Rimuove risorse non utilizzate
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
// minifyEnabled true // Abilita la minimizzazione del codice
// shrinkResources true // Rimuove risorse non utilizzate
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
firebaseCrashlytics {
mappingFileUploadEnabled true
}
}
}
@@ -74,12 +82,7 @@ android {
}
build {
doLast {
delete "$projectDir/build/outputs/apk/release/version.txt"
file("$projectDir/build/outputs/apk/release/version.txt").text = appVersionCode + '\n' + appVersionName + '\n' + 'forced=true'
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile.class).tap {
@@ -92,7 +95,7 @@ android {
abortOnError false
}
namespace 'it.integry.integrywmsnative'
compileSdk 35
compileSdk 36
}
configurations {
@@ -107,30 +110,27 @@ dependencies {
// 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:33.13.0')
implementation platform('com.google.firebase:firebase-bom:33.16.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-perf'
implementation 'com.google.android.gms:play-services-basement:18.7.0'
implementation 'com.google.android.gms:play-services-basement:18.7.1'
//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 'io.jsonwebtoken:jjwt-api:0.13.0'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.13.0'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.13.0'
implementation 'com.google.guava:guava:33.4.0-android'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.7.1'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.4.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation('androidx.preference:preference-ktx:1.2.1') {
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
@@ -138,19 +138,18 @@ dependencies {
}
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:retrofit:3.0.0'
implementation 'com.squareup.retrofit2:converter-gson:3.0.0'
implementation 'com.annimon:stream:1.2.2'
implementation 'androidx.lifecycle:lifecycle-runtime:2.9.0'
implementation 'org.apache.commons:commons-text:1.9'
implementation 'androidx.lifecycle:lifecycle-runtime:2.9.3'
implementation 'org.apache.commons:commons-text:1.14.0'
//MVVM
def dagger2_version = '2.55'
api "com.google.dagger:dagger:$dagger2_version"
def dagger2_version = '2.57.1'
implementation "com.google.dagger:dagger:$dagger2_version"
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
api "com.google.dagger:dagger-android:$dagger2_version"
api "com.google.dagger:dagger-android-support:$dagger2_version"
implementation "com.google.dagger:dagger-android:$dagger2_version"
implementation "com.google.dagger:dagger-android-support:$dagger2_version"
// if you use the support libraries
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger2_version"
@@ -162,7 +161,7 @@ dependencies {
implementation 'com.github.pedromassango:doubleClick:3.0'
//SQLite ROOM
def room_version = "2.7.1"
def room_version = "2.7.2"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
@@ -188,14 +187,13 @@ dependencies {
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'
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
//Barcode generator
// implementation group: 'com.google.zxing', name: 'core', version: '3.5.3'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation("org.javatuples:javatuples:1.2")
}
repositories {
@@ -203,3 +201,49 @@ repositories {
google()
maven { url 'https://jitpack.io' }
}
tasks.register('addBetaSuffix') {
doLast {
def gradleFile = file("build.gradle")
def content = gradleFile.text
// Modifica appVersionName
content = content.replaceAll(/appVersionName\s*=\s*'(.*?)'/) { fullMatch, version ->
"appVersionName = '${version}-beta'"
}
// Modifica outputFileName
content = content.replaceAll(/output\.outputFileName\s*=\s*"(.*?)"/) { fullMatch, filename ->
"output.outputFileName = \"${filename.replace('.apk', '-beta.apk')}\""
}
// Modifica direttamente la riga che crea 'version.txt' in 'version-beta.txt'
content = content.replace(
"def versionFile = new File(outputDir, \"version.txt\")",
"def versionFile = new File(outputDir, \"version-beta.txt\")"
)
// Sovrascrivi il file
gradleFile.write(content)
}
}
tasks.register('createVersionFile') {
doLast {
def outputDir = file("${projectDir}/build/outputs/apk/release")
def versionFile = new File(outputDir, "version.txt")
// Cancella il file se esiste
if (versionFile.exists()) {
versionFile.delete()
}
// Crea il file con i contenuti desiderati
versionFile.write("${android.defaultConfig.versionCode}\n${android.defaultConfig.versionName}\nforced=true")
}
}
afterEvaluate {
tasks.assembleRelease.finalizedBy createVersionFile
}

View File

@@ -23,3 +23,26 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
# Prevent R8 from leaving Data object members always null
-keepclasseswithmembers class * {
<init>(...);
@com.google.gson.annotations.SerializedName <fields>;
}
# Per JJWT
-keep class io.jsonwebtoken.** { *; }
-keepnames class io.jsonwebtoken.* { *; }
-keepnames interface io.jsonwebtoken.* { *; }
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
-keep class it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse { *; }
-keep class * extends it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse { *; }

View File

@@ -142,6 +142,8 @@ import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBat
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.device_end_of_life.DialogDeviceEndOfLifeComponent;
import it.integry.integrywmsnative.view.dialogs.device_end_of_life.DialogDeviceEndOfLifeModule;
import it.integry.integrywmsnative.view.dialogs.extra_info.DialogExtraInfoComponent;
import it.integry.integrywmsnative.view.dialogs.extra_info.DialogExtraInfoModule;
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUComponent;
@@ -251,7 +253,8 @@ import it.integry.integrywmsnative.view.dialogs.update_available.DialogUpdateAva
VerificaGiacenzeModule.class,
DialogExtraInfoModule.class,
DialogAskDepositoModule.class,
DialogChooseArtFromListaArtsModule.class
DialogChooseArtFromListaArtsModule.class,
DialogDeviceEndOfLifeModule.class
})
public interface MainApplicationComponent {
@@ -422,6 +425,8 @@ public interface MainApplicationComponent {
DialogChooseArtFromListaArtsComponent.Factory dialogChooseArtFromListaArtsComponent();
DialogDeviceEndOfLifeComponent.Factory dialogDeviceEndOfLifeComponent();
void inject(MainApplication mainApplication);
void inject(AppContext mainApplication);

View File

@@ -313,8 +313,8 @@ public class MainApplicationModule {
@Provides
@Singleton
DocumentRESTConsumer provideDocumentiRESTConsumer(RESTBuilder restBuilder) {
return new DocumentRESTConsumer(restBuilder);
DocumentRESTConsumer provideDocumentiRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
return new DocumentRESTConsumer(restBuilder, executorService);
}
@Provides

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.SpannableString;
@@ -12,8 +13,10 @@ import android.view.LayoutInflater;
import androidx.databinding.DataBindingUtil;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import javax.inject.Inject;
@@ -27,6 +30,7 @@ import it.integry.integrywmsnative.databinding.ActivitySplashBinding;
import it.integry.integrywmsnative.gest.login.LoginActivity;
import it.integry.integrywmsnative.gest.main.MainActivity;
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
import it.integry.integrywmsnative.view.dialogs.device_end_of_life.DialogDeviceEndOfLifeView;
public class SplashActivity extends BaseActivity implements MainContext.Listener {
@@ -65,9 +69,24 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
UtilityContext.initMainActivity(this);
LocalDate endSupportDate = LocalDate.of(2026, 1, 31);
initAppVersion();
initPermissions(this::init);
boolean isOldAndroid = Build.VERSION.SDK_INT < Build.VERSION_CODES.O;
executorService.execute(() -> {
if (isOldAndroid)
showDeviceEndOfLifeMessage();
handler.post(() -> {
if (LocalDate.now().isBefore(endSupportDate) || !isOldAndroid) {
initAppVersion();
initPermissions(this::init);
} else {
this.finish();
}
});
});
}
private void initAppVersion() {
@@ -105,6 +124,21 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
}
}
private void showDeviceEndOfLifeMessage() {
CountDownLatch latch = new CountDownLatch(1);
DialogDeviceEndOfLifeView.newInstance(latch::countDown)
.show(this.getSupportFragmentManager(), "dialog_device_end_of_life");
try {
latch.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
@Override
public void onDBDataLoading(String item) {
handler.post(() -> mBinding.loadingInfoTextview.setText("Caricamento " + item));

View File

@@ -24,19 +24,4 @@ public class CommonConst {
public static String RECOVER_COLLO_FILE = "recover_ul.json";
}
public static class Mail {
public static String[] forErrorsDebug = {
"g.scorrano@integry.it",
"v.castellana@integry.it"
};
public static String[] forErrors = {
// "syslogs@integry.it",
"g.scorrano@integry.it",
"v.castellana@integry.it"
};
}
}

View File

@@ -11,11 +11,11 @@ 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)))
Jws<Claims> jws = Jwts.parser()
.verifyWith(Keys.hmacShaKeyFor(Decoders.BASE64.decode(SIGNING_KEY)))
.build()
.parseClaimsJws(token);
.parseSignedClaims(token);
return jws.getBody();
return jws.getPayload();
}
}

View File

@@ -89,11 +89,25 @@ public class AppContext {
private void initLogger() {
Logger.addLogAdapter(new AndroidLogAdapter());
logsFolder = new File(mApplicationContext.getExternalFilesDir(null).getAbsolutePath());
int maxBytesSize = 5 * 1024 * 1024;
Logger.addLogAdapter(new DiskLogAdapter(logsFolder, maxBytesSize));
File dataDir = mApplicationContext.getExternalFilesDir(null);
logsFolder = new File(dataDir, "logs");
if (!logsFolder.exists())
logsFolder.mkdirs();
//Temporary clean
File[] wrongFilesToBeDeleted = dataDir.listFiles((file, s) -> s.startsWith("logs_"));
if (wrongFilesToBeDeleted != null)
for (File fileToDelete : wrongFilesToBeDeleted) {
fileToDelete.delete();
}
removeOldLogs(logsFolder);
int maxBytesSize = 5 * 1024 * 1024;
Logger.addLogAdapter(new DiskLogAdapter(logsFolder, maxBytesSize));
}
private void removeOldLogs(File logsFolder) {

View File

@@ -1,5 +1,6 @@
package it.integry.integrywmsnative.core.data_recover;
import java.time.LocalDate;
import java.util.List;
import it.integry.integrywmsnative.core.model.MtbColt;
@@ -10,7 +11,7 @@ public class ColliDataRecoverDTO {
private int id;
private int numCollo;
private String serCollo;
private String dataCollo;
private LocalDate dataCollo;
private String gestioneCollo;
private String filtro;
@@ -43,11 +44,11 @@ public class ColliDataRecoverDTO {
return this;
}
public String getDataCollo() {
public LocalDate getDataCollo() {
return dataCollo;
}
public ColliDataRecoverDTO setDataCollo(String dataCollo) {
public ColliDataRecoverDTO setDataCollo(LocalDate dataCollo) {
this.dataCollo = dataCollo;
return this;
}

View File

@@ -2,7 +2,6 @@ package it.integry.integrywmsnative.core.data_recover;
import android.content.Context;
import com.annimon.stream.Optional;
import com.annimon.stream.Stream;
import com.google.android.gms.common.util.IOUtils;
import com.google.gson.Gson;
@@ -14,6 +13,7 @@ import java.io.InputStream;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.Random;
import javax.inject.Inject;
@@ -65,9 +65,9 @@ public class ColliDataRecoverService {
}
private ColliDataRecoverDTO getIfExists(int id) {
Optional<ColliDataRecoverDTO> recoverDTOOptional = Stream.of(mtbColtsSessions)
Optional<ColliDataRecoverDTO> recoverDTOOptional = mtbColtsSessions.stream()
.filter(x -> x.getId() == id)
.findSingle();
.findFirst();
return recoverDTOOptional.isPresent() ? recoverDTOOptional.get() : null;
@@ -85,7 +85,7 @@ public class ColliDataRecoverService {
ColliDataRecoverDTO recoverDTO = new ColliDataRecoverDTO()
.setId(newId)
.setDataCollo(mtbColtSession.getDataColloS())
.setDataCollo(mtbColtSession.getDataColloLD())
.setNumCollo(mtbColtSession.getNumCollo())
.setSerCollo(mtbColtSession.getSerCollo())
.setGestioneCollo(mtbColtSession.getGestione())

View File

@@ -4,9 +4,6 @@ import androidx.databinding.BaseObservable;
import java.math.BigDecimal;
import it.integry.integrywmsnative.core.CommonConst;
import it.integry.integrywmsnative.core.utility.UtilityNumber;
public class BindableFloat extends BaseObservable {
private Float value;
@@ -15,10 +12,6 @@ public class BindableFloat extends BaseObservable {
}
public BigDecimal getBigDecimal() {
int numberOfDigits = UtilityNumber.countNumberOfDecimalDigits(get());
if(numberOfDigits > CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS) numberOfDigits = CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS;
return BigDecimal.valueOf(get());
}

View File

@@ -11,6 +11,7 @@ import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import androidx.annotation.ColorRes;
import androidx.appcompat.widget.AppCompatCheckBox;
@@ -37,6 +38,8 @@ import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
@@ -45,6 +48,7 @@ import it.integry.integrywmsnative.MainApplication;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.utility.LocaleDecimalKeyListener;
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.core.utility.UtilityNumber;
@@ -261,7 +265,7 @@ public class Converters {
BigDecimal value = null;
if (!UtilityString.isNullOrEmpty(s.toString()))
value = new BigDecimal(s.toString());
value = UtilityNumber.parseBigDecimal(s.toString(), Locale.getDefault());
observableBigDecimal.set(value);
}
@@ -271,7 +275,7 @@ public class Converters {
}
BigDecimal newValue = observableBigDecimal.get();
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? UtilityNumber.parseBigDecimal(view.getText().toString(), Locale.getDefault()) : null;
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
view.setText(UtilityNumber.decimalToString(newValue));
@@ -292,7 +296,7 @@ public class Converters {
String newValueString = s.toString().trim();
if (!UtilityString.isNullOrEmpty(newValueString))
value = new BigDecimal(newValueString);
value = UtilityNumber.parseBigDecimal(newValueString, Locale.getDefault());
observableBigDecimal.set(value);
}
@@ -301,7 +305,7 @@ public class Converters {
view.addTextChangedListener(watcher);
}
BigDecimal newValue = observableBigDecimal.get();
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? UtilityNumber.parseBigDecimal(view.getText().toString(), Locale.getDefault()) : null;
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
view.setText(UtilityNumber.decimalToString(newValue));
@@ -322,7 +326,7 @@ public class Converters {
String newValueString = s.toString().trim();
if (!UtilityString.isNullOrEmpty(newValueString))
value = new BigDecimal(newValueString);
value = UtilityNumber.parseBigDecimal(newValueString, Locale.getDefault());
observableBigDecimal.set(value);
}
@@ -331,7 +335,7 @@ public class Converters {
view.addTextChangedListener(watcher);
}
BigDecimal newValue = observableBigDecimal.get();
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? UtilityNumber.parseBigDecimal(view.getText().toString(), Locale.getDefault()) : null;
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
view.setText(UtilityNumber.decimalToString(newValue));
@@ -350,7 +354,8 @@ public class Converters {
public void onTextChanged(CharSequence s, int start, int before, int count) {
BigDecimal value = null;
if (!UtilityString.isNullOrEmpty(s.toString()))
value = new BigDecimal(s.toString());
value = UtilityNumber.parseBigDecimal(s.toString(), Locale.getDefault());
bindableBigDecimal.set(value);
}
};
@@ -358,7 +363,7 @@ public class Converters {
view.addTextChangedListener(watcher);
}
BigDecimal newValue = bindableBigDecimal.get();
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? UtilityNumber.parseBigDecimal(view.getText().toString(), Locale.getDefault()) : null;
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
view.setText(UtilityNumber.decimalToString(newValue));
@@ -974,4 +979,64 @@ public class Converters {
view.setLayoutParams(layoutParams);
}
}
/**
* BindingAdapter per bindare una LocalDate diretta su una TextView con un formato specificato.
* Esempio di utilizzo in XML:
* app:localDateText="@{myLocalDate}" app:dateFormat="@{@string/my_date_format}"
*/
@BindingAdapter(value = {"localDateText", "dateFormat"}, requireAll = false)
public static void bindLocalDateText(TextView view, LocalDate date, String dateFormat) {
if (date == null) {
view.setText("");
return;
}
String pattern = dateFormat != null ? dateFormat : "dd/MM/yyyy";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
view.setText(date.format(formatter));
}
@BindingAdapter(value = {"localDateTimeText", "dateFormat"}, requireAll = false)
public static void bindLocalDateText(TextView view, LocalDateTime date, String dateFormat) {
if (date == null) {
view.setText("");
return;
}
String pattern = dateFormat != null ? dateFormat : "dd/MM/yyyy hh:mm";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
view.setText(date.format(formatter));
}
/**
* BindingAdapter per bindare una ObservableField<LocalDate> su una TextView con un formato specificato.
* Esempio di utilizzo in XML:
* app:localDateObservableText="@{myObservableLocalDate}" app:dateFormat="@{@string/my_date_format}"
*/
@BindingAdapter(value = {"localDateObservableText", "dateFormat"}, requireAll = false)
public static void bindObservableLocalDateText(TextView view, ObservableField<LocalDate> observableDate, String dateFormat) {
if (observableDate == null) {
view.setText("");
return;
}
LocalDate date = observableDate.get();
if (date == null) {
view.setText("");
return;
}
String pattern = dateFormat != null ? dateFormat : "dd/MM/yyyy";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
view.setText(date.format(formatter));
}
/**
* BindingAdapter che applica automaticamente il KeyListener localizzato
* ai campi con inputType numberDecimal, permettendo l'uso della virgola
* come separatore decimale in base al locale del dispositivo.
*/
@BindingAdapter("useLocaleDecimalInput")
public static void setLocaleDecimalInput(EditText view, boolean useLocaleInput) {
if (useLocaleInput) {
view.setKeyListener(LocaleDecimalKeyListener.getInstance());
}
}
}

View File

@@ -66,9 +66,6 @@ public class Ean128Service {
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 -> {

View File

@@ -1,7 +1,7 @@
package it.integry.integrywmsnative.core.model;
import java.math.BigDecimal;
import java.util.Date;
import java.time.LocalDate;
import java.util.List;
public class DtbDoct {
@@ -10,7 +10,7 @@ public class DtbDoct {
private String codAnag;
private String codDtip;
private Date dataDoc;
private LocalDate dataDoc;
private Integer numDoc;
private String serDoc;
private BigDecimal acconto;
@@ -41,14 +41,14 @@ public class DtbDoct {
private String compilatoDa;
private String userName;
private String controllatoDa;
private Date dataChkDoc;
private Date dataDocVal;
private Date dataInizTrasp;
private Date dataIns;
private Date dataOrd;
private Date dataReg;
private Date dataRifScad;
private Date dataUltMod;
private LocalDate dataChkDoc;
private LocalDate dataDocVal;
private LocalDate dataInizTrasp;
private LocalDate dataIns;
private LocalDate dataOrd;
private LocalDate dataReg;
private LocalDate dataRifScad;
private LocalDate dataUltMod;
private String descrizionePaga;
private String flagPrzScontati;
private String gestione;
@@ -89,7 +89,7 @@ public class DtbDoct {
private String targa;
private Integer postiPallet;
private BigDecimal tempMedia;
private Date dataCons;
private LocalDate dataCons;
private BigDecimal nolo;
private BigDecimal nolo2;
private String conducente;
@@ -102,7 +102,7 @@ public class DtbDoct {
private String setDataDecorrenza2DataRic;
private BigDecimal totSpese;
private String chkArtListino;
private Date dataCmov;
private LocalDate dataCmov;
private String reso;
private Integer numCmovAutofattura;
private Object dtbTipi;
@@ -141,11 +141,11 @@ public class DtbDoct {
return this;
}
public Date getDataDoc() {
public LocalDate getDataDoc() {
return dataDoc;
}
public DtbDoct setDataDoc(Date dataDoc) {
public DtbDoct setDataDoc(LocalDate dataDoc) {
this.dataDoc = dataDoc;
return this;
}
@@ -420,74 +420,74 @@ public class DtbDoct {
return this;
}
public Date getDataChkDoc() {
public LocalDate getDataChkDoc() {
return dataChkDoc;
}
public DtbDoct setDataChkDoc(Date dataChkDoc) {
public DtbDoct setDataChkDoc(LocalDate dataChkDoc) {
this.dataChkDoc = dataChkDoc;
return this;
}
public Date getDataDocVal() {
public LocalDate getDataDocVal() {
return dataDocVal;
}
public DtbDoct setDataDocVal(Date dataDocVal) {
public DtbDoct setDataDocVal(LocalDate dataDocVal) {
this.dataDocVal = dataDocVal;
return this;
}
public Date getDataInizTrasp() {
public LocalDate getDataInizTrasp() {
return dataInizTrasp;
}
public DtbDoct setDataInizTrasp(Date dataInizTrasp) {
public DtbDoct setDataInizTrasp(LocalDate dataInizTrasp) {
this.dataInizTrasp = dataInizTrasp;
return this;
}
public Date getDataIns() {
public LocalDate getDataIns() {
return dataIns;
}
public DtbDoct setDataIns(Date dataIns) {
public DtbDoct setDataIns(LocalDate dataIns) {
this.dataIns = dataIns;
return this;
}
public Date getDataOrd() {
public LocalDate getDataOrd() {
return dataOrd;
}
public DtbDoct setDataOrd(Date dataOrd) {
public DtbDoct setDataOrd(LocalDate dataOrd) {
this.dataOrd = dataOrd;
return this;
}
public Date getDataReg() {
public LocalDate getDataReg() {
return dataReg;
}
public DtbDoct setDataReg(Date dataReg) {
public DtbDoct setDataReg(LocalDate dataReg) {
this.dataReg = dataReg;
return this;
}
public Date getDataRifScad() {
public LocalDate getDataRifScad() {
return dataRifScad;
}
public DtbDoct setDataRifScad(Date dataRifScad) {
public DtbDoct setDataRifScad(LocalDate dataRifScad) {
this.dataRifScad = dataRifScad;
return this;
}
public Date getDataUltMod() {
public LocalDate getDataUltMod() {
return dataUltMod;
}
public DtbDoct setDataUltMod(Date dataUltMod) {
public DtbDoct setDataUltMod(LocalDate dataUltMod) {
this.dataUltMod = dataUltMod;
return this;
}
@@ -852,11 +852,11 @@ public class DtbDoct {
return this;
}
public Date getDataCons() {
public LocalDate getDataCons() {
return dataCons;
}
public DtbDoct setDataCons(Date dataCons) {
public DtbDoct setDataCons(LocalDate dataCons) {
this.dataCons = dataCons;
return this;
}
@@ -969,11 +969,11 @@ public class DtbDoct {
return this;
}
public Date getDataCmov() {
public LocalDate getDataCmov() {
return dataCmov;
}
public DtbDoct setDataCmov(Date dataCmov) {
public DtbDoct setDataCmov(LocalDate dataCmov) {
this.dataCmov = dataCmov;
return this;
}

View File

@@ -15,7 +15,7 @@ public class MtbColr extends EntityBase {
private String gestione;
private String serCollo;
private Integer numCollo;
private String dataCollo;
private LocalDate dataCollo;
private Integer riga;
private Integer rigaOrd;
private String codMart;
@@ -27,7 +27,7 @@ public class MtbColr extends EntityBase {
private String serColloRif;
private String note;
private LocalDate dataOrd;
private String dataColloRif;
private LocalDate dataColloRif;
private BigDecimal qtaCnf;
private BigDecimal qtaCol;
private Integer numOrd;
@@ -164,21 +164,18 @@ public class MtbColr extends EntityBase {
return this;
}
public String getDataColloS() {
public LocalDate getDataColloLD() {
return dataCollo;
}
public Date getDataColloD() {
return UtilityDate.recognizeDateWithExceptionHandler(getDataColloS());
}
public MtbColr setDataCollo(String dataCollo) {
this.dataCollo = dataCollo;
this.dataCollo = UtilityDate.recognizeLocalDateWithExceptionHandler(dataCollo);
return this;
}
public MtbColr setDataCollo(Date dataCollo) {
setDataCollo(UtilityDate.formatDate(dataCollo, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH));
public MtbColr setDataCollo(LocalDate dataCollo) {
this.dataCollo = dataCollo;
return this;
}
@@ -287,25 +284,24 @@ public class MtbColr extends EntityBase {
}
public String getDataColloRifS() {
return dataColloRif;
return dataColloRif != null ? UtilityDate.COMMONS_DATE_FORMATS.DATE_DMY_SLASHED_FORMATTER.format(dataColloRif) : null;
}
public Date getDataColloRifD() {
return UtilityDate.recognizeDateWithExceptionHandler(getDataColloRifS());
}
public MtbColr setDataColloRif(String dataColloRif) {
this.dataColloRif = dataColloRif;
return this;
public LocalDate getDataColloRifLD() {
return dataColloRif;
}
public MtbColr setDataColloRif(Date dataColloRif) {
this.dataColloRif = UtilityDate.formatDate(dataColloRif, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH);
public MtbColr setDataColloRif(String dataColloRif) {
this.dataColloRif = UtilityDate.recognizeLocalDateWithExceptionHandler(dataColloRif);
return this;
}
public MtbColr setDataColloRif(LocalDate dataColloRif) {
this.dataColloRif = UtilityDate.formatDate(dataColloRif, UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
this.dataColloRif = dataColloRif;
return this;
}

View File

@@ -22,7 +22,6 @@ import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityDB;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.core.utility.UtilityLogger;
import it.integry.integrywmsnative.core.utility.UtilityString;
/**
@@ -31,7 +30,7 @@ import it.integry.integrywmsnative.core.utility.UtilityString;
public class MtbColt extends EntityBase {
private String gestione;
private String dataCollo;
private LocalDate dataCollo;
private String serCollo;
private Integer numCollo;
private String rifOrd;
@@ -86,7 +85,7 @@ public class MtbColt extends EntityBase {
public MtbColt() {
type = "mtb_colt";
setDataCollo(UtilityDate.getDateInstance());
setDataCollo(LocalDate.now());
setSerCollo("/");
if (SettingsManager.i().isUserLoggedIn()) {
@@ -145,20 +144,13 @@ public class MtbColt extends EntityBase {
}
public String getDataColloHumanLong() {
Date dataColloD = null;
try {
dataColloD = getDataColloD();
} catch (Exception ex) {
UtilityLogger.error(ex);
}
if (dataColloD != null) {
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN_LONG);
if (dataCollo != null) {
return UtilityDate.COMMONS_DATE_FORMATS.DATE_DMY_HUMAN_FORMATTER.format(dataCollo);
} else return null;
}
public String getDataColloS() {
return dataCollo;
return dataCollo != null ? UtilityDate.COMMONS_DATE_FORMATS.DATE_DMY_SLASHED_FORMATTER.format(dataCollo) : null;
}
public Date getDataColloD() {
@@ -166,21 +158,16 @@ public class MtbColt extends EntityBase {
}
public LocalDate getDataColloLD() {
return UtilityDate.recognizeLocalDateWithExceptionHandler(getDataColloS());
return dataCollo;
}
public MtbColt setDataCollo(String dataCollo) {
this.dataCollo = dataCollo;
return this;
}
public MtbColt setDataCollo(Date dataCollo) {
this.dataCollo = UtilityDate.formatDate(dataCollo, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH);
this.dataCollo = UtilityDate.recognizeLocalDateWithExceptionHandler(dataCollo);
return this;
}
public MtbColt setDataCollo(LocalDate dataCollo) {
this.dataCollo = UtilityDate.formatDate(dataCollo, UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
this.dataCollo = dataCollo;
return this;
}

View File

@@ -4,7 +4,6 @@ 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;
@@ -306,7 +305,7 @@ public class MvwSitArtUdcDetInventario {
return new MtbColr()
.setCodJcom(getCodJcom())
.setCodMart(getCodMart())
.setDataCollo(UtilityDate.toDate(getDataCollo()))
.setDataCollo(getDataCollo())
.setNumCollo(getNumCollo())
.setSerCollo(getSerCollo())
.setGestione(getGestione())

View File

@@ -28,7 +28,7 @@ public class AuthInterceptor implements Interceptor {
public Response intercept(@NonNull Chain chain) throws IOException {
var originalRequest = chain.request();
if (SettingsManager.i().getUserSession() != null) {
if (SettingsManager.i().getUserSession() != null && SettingsManager.i().getUserSession().getAccessToken() != null) {
var accessToken = SettingsManager.i().getUserSession().getAccessToken();
var accessTokenExpiryDate = SettingsManager.i().getUserSession().getAccessTokenExpiryDate();
@@ -55,21 +55,22 @@ public class AuthInterceptor implements Interceptor {
.protocol(Protocol.HTTP_1_1)
.code(401)
.message("Unauthorized")
.body(ResponseBody.create(new byte[0], null))
.body(ResponseBody.create(okhttp3.MediaType.get("application/json"), new byte[0]))
.build();
} catch (Exception e) {
return chain.proceed(originalRequest);
}
//Retrieve the new access token after refresh
accessToken = SettingsManager.i().getUserSession().getAccessToken();
}
// Add the access token to the request header
var authorizedRequest = originalRequest.newBuilder()
.header("Authorization", "Bearer " + SettingsManager.i().getUserSession().getAccessToken())
.build();
// Add the access token to the request header
var authorizedRequest = originalRequest.newBuilder()
.header("Authorization", "Bearer " + accessToken)
.build();
return chain.proceed(authorizedRequest);
} else
return chain.proceed(originalRequest);
return chain.proceed(authorizedRequest);
} else
return chain.proceed(originalRequest);
}

View File

@@ -3,7 +3,7 @@ package it.integry.integrywmsnative.core.rest;
import java.io.IOException;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.core.utility.UtilityString;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.Request;
@@ -18,31 +18,23 @@ public class HttpInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
final String PROFILE_DB = SettingsManager.i().getUserSession() == null ? null : SettingsManager.i().getUserSession().getProfileDB();
final String APP_TOKEN = "fa3a21af-606b-4129-a22b-aedc2a52c7b6";
final String PROFILE_DB = SettingsManager.i().getUserSession() == null ? null : SettingsManager.i().getUserSession().getProfileDB();
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();
HttpUrl.Builder urlBuilder = chain.request().url().newBuilder();
Request.Builder builder = chain.request().newBuilder()
if (!UtilityString.isNullOrEmpty(PROFILE_DB))
urlBuilder
.addQueryParameter("profileDb", PROFILE_DB);
HttpUrl url = urlBuilder.build();
final Request.Builder requestBuilder = chain.request().newBuilder();
Request.Builder builder = requestBuilder
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "*/*")
.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().minusSeconds(20))) {
accessToken = SettingsManager.i().getUserSession().getAccessToken();
}
if(accessToken != null)
builder.header("Authorization", "Bearer " + accessToken);
var newRequest = builder
.url(url)
.build();

View File

@@ -37,19 +37,19 @@ public class RESTBuilder {
}
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);
return getService(service, SettingsManager.i().getServer().getProtocol(), SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true, timeout);
}
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 <T> T getService(final Class<T> service, String protocol, String host, int port) {
return getService(service, protocol, host, port, true, 60);
}
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 <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addEmsApi) {
return getService(service, protocol, host, port, addEmsApi, 60);
}
public <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 addEmsApi, int timeout) {
OkHttpClient.Builder clientBuilder = getDefaultHttpClient();
timeout = 0;
@@ -62,7 +62,7 @@ public class RESTBuilder {
clientBuilder.retryOnConnectionFailure(true);
clientBuilder.addInterceptor(authInterceptor);
if (addInterceptors) clientBuilder.addInterceptor(new HttpInterceptor());
clientBuilder.addInterceptor(new HttpInterceptor());
if (ADD_LOGGER_INTERCEPTOR) clientBuilder.addInterceptor(new HttpLoggerInterceptor());
OkHttpClient client = clientBuilder.build();

View File

@@ -11,6 +11,7 @@ import org.jetbrains.annotations.NotNull;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -160,11 +161,11 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
mtbColrClone
.setNumCollo(null)
.setDataCollo((String) null)
.setDataCollo((LocalDate) null)
.setRiga(null)
.setGestione(GestioneEnum.LAVORAZIONE)
.setDataColloRif(sourceMtbColt.getDataColloD())
.setDataColloRif(sourceMtbColt.getDataColloLD())
.setNumColloRif(sourceMtbColt.getNumCollo())
.setGestioneRif(sourceMtbColt.getGestione())
.setSerColloRif(sourceMtbColt.getSerCollo())
@@ -214,10 +215,10 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
MtbColr mtbColrClone = new MtbColr();
mtbColrClone
.setNumCollo(null)
.setDataCollo((String) null)
.setDataCollo((LocalDate) null)
.setRiga(null)
.setGestione(GestioneEnum.LAVORAZIONE)
.setDataColloRif(sourceMtbColt.getDataColloD())
.setDataColloRif(sourceMtbColt.getDataColloLD())
.setNumColloRif(sourceMtbColt.getNumCollo())
.setGestioneRif(sourceMtbColt.getGestione())
.setSerColloRif(sourceMtbColt.getSerCollo())
@@ -372,7 +373,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
mtbColr.setGestione(mtbColt.getGestione());
mtbColr.setSerCollo(mtbColt.getSerCollo());
mtbColr.setNumCollo(mtbColt.getNumCollo());
mtbColr.setDataCollo(mtbColt.getDataColloS());
mtbColr.setDataCollo(mtbColt.getDataColloLD());
}
}
@@ -408,7 +409,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
}
public MtbColt getByChiaveColloSynchronized(GestioneEnum gestione, int numCollo, String dataCollo, String serCollo, boolean onlyResiduo, boolean throwExcIfNull) throws Exception {
public MtbColt getByChiaveColloSynchronized(GestioneEnum gestione, int numCollo, LocalDate dataCollo, String serCollo, boolean onlyResiduo, boolean throwExcIfNull) throws Exception {
MtbColt mtbColtToRetrieve = new MtbColt()
.setGestione(gestione)
.setNumCollo(numCollo)
@@ -418,7 +419,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
return getByTestataSynchronized(mtbColtToRetrieve, onlyResiduo, throwExcIfNull);
}
public void getByChiaveCollo(GestioneEnum gestione, int numCollo, String dataCollo, String serCollo, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
public void getByChiaveCollo(GestioneEnum gestione, int numCollo, LocalDate dataCollo, String serCollo, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
MtbColt mtbColtToRetrieve = new MtbColt()
.setGestione(gestione)
.setNumCollo(numCollo)

View File

@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import java.util.List;
import java.util.concurrent.ExecutorService;
import javax.inject.Singleton;
@@ -20,9 +21,11 @@ import retrofit2.Response;
public class DocumentRESTConsumer extends _BaseRESTConsumer {
private final RESTBuilder restBuilder;
private final ExecutorService executorService;
public DocumentRESTConsumer(RESTBuilder restBuilder) {
public DocumentRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
this.restBuilder = restBuilder;
this.executorService = executorService;
}
public void createDocsFromColli(List<LoadColliDTO> listColli, RunnableArgs<List<DtbDoct>> onComplete, RunnableArgs<Exception> onFailed) {
@@ -40,19 +43,22 @@ public class DocumentRESTConsumer extends _BaseRESTConsumer {
});
}
public void createDocFromColli(LoadColliDTO loadColliDTO, RunnableArgs<DtbDoct> onComplete, RunnableArgs<Exception> onFailed) {
public DtbDoct makeSynchronousCreateDocFromColliRequest(LoadColliDTO loadColliDTO) throws Exception {
DocumentiRESTConsumerService documentiRESTConsumerService = restBuilder.getService(DocumentiRESTConsumerService.class);
documentiRESTConsumerService
var response = documentiRESTConsumerService
.createDocFromColli(loadColliDTO)
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<DtbDoct>> call, Response<ServiceRESTResponse<DtbDoct>> response) {
analyzeAnswer(response, "createDocFromColli", onComplete, onFailed);
}
.execute();
@Override
public void onFailure(Call<ServiceRESTResponse<DtbDoct>> call, @NonNull final Exception e) {
onFailed.run(e);
return analyzeAnswer(response, "createDocFromColli");
}
public void makeCreateDocFromColliRequest(LoadColliDTO loadColliDTO, RunnableArgs<DtbDoct> onComplete, RunnableArgs<Exception> onFailed) {
executorService.execute(() -> {
try {
var result = makeSynchronousCreateDocFromColliRequest(loadColliDTO);
if (onComplete != null) onComplete.run(result);
} catch (Exception ex) {
if (onFailed != null) onFailed.run(ex);
}
});
}

View File

@@ -5,8 +5,11 @@ import java.util.List;
import java.util.concurrent.ExecutorService;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.model.pv.CloseVerificaRequestDTO;
import it.integry.integrywmsnative.core.rest.model.pv.DeleteRowVerificaRequestDTO;
import it.integry.integrywmsnative.core.rest.model.pv.GiacenzaPvDTO;
import it.integry.integrywmsnative.core.rest.model.pv.SaveNewVerificaRequestDTO;
import it.integry.integrywmsnative.core.rest.model.pv.SaveNewRowVerificaRequestDTO;
import it.integry.integrywmsnative.core.rest.model.pv.UpdateRowVerificaRequestDTO;
public class GiacenzaPvRESTConsumer extends _BaseRESTConsumer {
@@ -30,12 +33,36 @@ public class GiacenzaPvRESTConsumer extends _BaseRESTConsumer {
return giacenzeList != null ? giacenzeList : new ArrayList<>();
}
public void saveNewVerificaSynchronized(SaveNewVerificaRequestDTO saveNewVerificaRequest) throws Exception {
public void saveNewRowSynchronized(SaveNewRowVerificaRequestDTO saveNewRowVerificaRequest) throws Exception {
GiacenzaPvRESTConsumerService giacenzaPvRESTConsumerService = restBuilder.getService(GiacenzaPvRESTConsumerService.class, 0);
var response = giacenzaPvRESTConsumerService.saveNewVerifica(saveNewVerificaRequest)
var response = giacenzaPvRESTConsumerService.saveNewRowVerifica(saveNewRowVerificaRequest)
.execute();
analyzeAnswer(response, "save-verifica-pv");
analyzeAnswer(response, "save-row-verifica-pv");
}
public void updateRowSynchronized(UpdateRowVerificaRequestDTO updateRowVerificaRequest) throws Exception {
GiacenzaPvRESTConsumerService giacenzaPvRESTConsumerService = restBuilder.getService(GiacenzaPvRESTConsumerService.class, 0);
var response = giacenzaPvRESTConsumerService.updateRowVerifica(updateRowVerificaRequest)
.execute();
analyzeAnswer(response, "update-row-verifica-pv");
}
public void deleteRowSynchronized(DeleteRowVerificaRequestDTO deleteRowVerificaRequest) throws Exception {
GiacenzaPvRESTConsumerService giacenzaPvRESTConsumerService = restBuilder.getService(GiacenzaPvRESTConsumerService.class, 0);
var response = giacenzaPvRESTConsumerService.deleteRowVerifica(deleteRowVerificaRequest)
.execute();
analyzeAnswer(response, "delete-row-verifica-pv");
}
public void closeVerifica(CloseVerificaRequestDTO closeVerificaRequestDTO) throws Exception {
GiacenzaPvRESTConsumerService giacenzaPvRESTConsumerService = restBuilder.getService(GiacenzaPvRESTConsumerService.class, 0);
var response = giacenzaPvRESTConsumerService.closeVerifica(closeVerificaRequestDTO)
.execute();
analyzeAnswer(response, "close-verifica-pv");
}
}

View File

@@ -3,8 +3,11 @@ package it.integry.integrywmsnative.core.rest.consumers;
import java.util.List;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.pv.CloseVerificaRequestDTO;
import it.integry.integrywmsnative.core.rest.model.pv.DeleteRowVerificaRequestDTO;
import it.integry.integrywmsnative.core.rest.model.pv.GiacenzaPvDTO;
import it.integry.integrywmsnative.core.rest.model.pv.SaveNewVerificaRequestDTO;
import it.integry.integrywmsnative.core.rest.model.pv.SaveNewRowVerificaRequestDTO;
import it.integry.integrywmsnative.core.rest.model.pv.UpdateRowVerificaRequestDTO;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
@@ -17,6 +20,15 @@ public interface GiacenzaPvRESTConsumerService {
Call<ServiceRESTResponse<List<GiacenzaPvDTO>>> retrieve(@Query("codMdep") String codMdep);
@POST("wms/pv/verifica_giacenze/save_new_verifica")
Call<ServiceRESTResponse<Void>> saveNewVerifica(@Body SaveNewVerificaRequestDTO saveNewVerificaRequest);
@POST("wms/pv/verifica_giacenze/save_new_row")
Call<ServiceRESTResponse<Void>> saveNewRowVerifica(@Body SaveNewRowVerificaRequestDTO saveNewRowVerificaRequest);
@POST("wms/pv/verifica_giacenze/update_row")
Call<ServiceRESTResponse<Void>> updateRowVerifica(@Body UpdateRowVerificaRequestDTO updateRowVerificaRequest);
@POST("wms/pv/verifica_giacenze/delete_row")
Call<ServiceRESTResponse<Void>> deleteRowVerifica(@Body DeleteRowVerificaRequestDTO deleteRowVerificaRequest);
@POST("wms/pv/verifica_giacenze/close_verifica")
Call<ServiceRESTResponse<Void>> closeVerifica(@Body CloseVerificaRequestDTO closeVerificaRequest);
}

View File

@@ -1,5 +1,6 @@
package it.integry.integrywmsnative.core.rest.consumers;
import java.util.List;
import java.util.concurrent.ExecutorService;
import javax.inject.Singleton;
@@ -9,6 +10,7 @@ import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiRequestDTO;
import it.integry.integrywmsnative.core.rest.model.materiali.VersaMaterialiRequestDTO;
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULRestDTO;
@Singleton
public class MaterialiRESTConsumer extends _BaseRESTConsumer {
@@ -21,6 +23,28 @@ public class MaterialiRESTConsumer extends _BaseRESTConsumer {
this.executorService = executorService;
}
public List<HistoryVersamentoProdULRestDTO> makeSynchronousRetrieveLastVersamentiRequest(String codJfas) throws Exception {
var materialiRESTConsumerService = restBuilder.getService(MaterialiRESTConsumerService.class);
var response = materialiRESTConsumerService.retrieveLastVersamenti(codJfas)
.execute();
var data = analyzeAnswer(response, "retrieveLastVersamenti");
return data;
}
public void makeRetrieveLastVersamentiRequest(String codJfas, final RunnableArgs<List<HistoryVersamentoProdULRestDTO>> onComplete, final RunnableArgs<Exception> onFailed) {
executorService.execute(() -> {
try {
var response = makeSynchronousRetrieveLastVersamentiRequest(codJfas);
if (onComplete != null) onComplete.run(response);
} catch (Exception ex) {
if (onFailed != null) onFailed.run(ex);
}
});
}
public MtbColt makeSynchronousRecuperaRequest(RecuperaMaterialiRequestDTO request) throws Exception {
var materialiRESTConsumerService = restBuilder.getService(MaterialiRESTConsumerService.class);

View File

@@ -1,17 +1,26 @@
package it.integry.integrywmsnative.core.rest.consumers;
import java.util.List;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiRequestDTO;
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiResponseDTO;
import it.integry.integrywmsnative.core.rest.model.materiali.VersaMaterialiRequestDTO;
import it.integry.integrywmsnative.core.rest.model.materiali.VersaMaterialiResponseDTO;
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULRestDTO;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
public interface MaterialiRESTConsumerService {
@POST("wms/materiali/versa")
Call<ServiceRESTResponse<RecuperaMaterialiResponseDTO>> versa(@Body VersaMaterialiRequestDTO request);
Call<ServiceRESTResponse<VersaMaterialiResponseDTO>> versa(@Body VersaMaterialiRequestDTO request);
@GET("wms/materiali/retrieveLastVersamenti")
Call<ServiceRESTResponse<List<HistoryVersamentoProdULRestDTO>>> retrieveLastVersamenti(@Query("codJfas") String codJfas);
@POST("wms/materiali/recupera")
Call<ServiceRESTResponse<RecuperaMaterialiResponseDTO>> recupera(@Body RecuperaMaterialiRequestDTO request);

View File

@@ -187,7 +187,7 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
var response = service.retrieveAlreadyRegisteredUDS(request)
.execute();
var data = analyzeAnswer(response, "getBancaliGiaRegistrati");
return data == null ? new ArrayList<>() : data.getUdsList();
return data == null || data.getUdsList() == null ? new ArrayList<>() : data.getUdsList();
}
public void getBancaliGiaRegistrati(List<OrdineInevasoDTO> orders, int segno, RunnableArgs<List<AlreadyRegisteredUlDTO>> onComplete, RunnableArgs<Exception> onFailed) {

View File

@@ -125,13 +125,12 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
public void printClosedOrdersSynchronized(PrintOrderCloseDTO dto, String codMdep) throws Exception {
if (BuildConfig.DEBUG) {
return;
// return;
}
PrinterRESTConsumerService printerService = restBuilder.getService(PrinterRESTConsumerService.class, 240);
Call<ServiceRESTResponse<Object>> callable = printerService.printClosedOrders(codMdep, dto);
var response = callable.execute();
var response = printerService.printClosedOrders(codMdep, dto).execute();
analyzeAnswer(response, "printCollo");
}

View File

@@ -1,8 +1,5 @@
package it.integry.integrywmsnative.core.rest.consumers;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
@@ -17,8 +14,6 @@ import java.util.concurrent.ExecutorService;
import javax.inject.Singleton;
import it.integry.integrywmsnative.BuildConfig;
import it.integry.integrywmsnative.core.CommonConst;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
@@ -27,9 +22,7 @@ import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.system.LatestAppVersionInfoDTO;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityGson;
import it.integry.integrywmsnative.core.utility.UtilityString;
import retrofit2.Call;
import retrofit2.Response;
@@ -110,36 +103,6 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
});
}
public void sendErrorLogMail(String message, Runnable onComplete, RunnableArgs<Exception> onFailed) {
String currentAzienda = UtilityString.isNullOrEmpty(SettingsManager.i().getUserSession().getProfileDB()) ? "" : " [" + SettingsManager.i().getUserSession().getProfileDB() + "]";
String dest = "";
if (BuildConfig.DEBUG) {
dest = TextUtils.join(";", CommonConst.Mail.forErrorsDebug);
} else {
dest = TextUtils.join(";", CommonConst.Mail.forErrors);
}
MailRequestDTO mailDTO = new MailRequestDTO()
.setFrom("sender@integry.it")
.setFromName((BuildConfig.DEBUG ? "[DEBUG] " : "") + "WMS Android")
.setTo(dest)
.setSubject("Bug notification" + currentAzienda)
.setMsgText(message)
.setHtml(true);
sendMail(mailDTO, () -> {
if (onComplete != null) onComplete.run();
}, ex -> {
Log.e(SystemRESTConsumer.class.getName(), "", ex);
if (onFailed != null) onFailed.run(ex);
});
}
public void sendMailSynchronized(MailRequestDTO mailDTO) throws Exception {
SystemRESTConsumerService service = restBuilder.getService(SystemRESTConsumerService.class);
var response = service.sendMail(mailDTO).execute();

View File

@@ -1,8 +1,13 @@
package it.integry.integrywmsnative.core.rest.model;
import com.google.gson.annotations.SerializedName;
public class AvailableCodMdepsDTO {
@SerializedName("codMdep")
private String codMdep;
@SerializedName("descrizione")
private String descrizione;
public String getCodMdep() {

View File

@@ -0,0 +1,27 @@
package it.integry.integrywmsnative.core.rest.model.pv;
import java.time.LocalDateTime;
public class CloseVerificaRequestDTO {
private String codMdep;
private LocalDateTime dataVerifica;
public String getCodMdep() {
return codMdep;
}
public CloseVerificaRequestDTO setCodMdep(String codMdep) {
this.codMdep = codMdep;
return this;
}
public LocalDateTime getDataVerifica() {
return dataVerifica;
}
public CloseVerificaRequestDTO setDataVerifica(LocalDateTime dataVerifica) {
this.dataVerifica = dataVerifica;
return this;
}
}

View File

@@ -0,0 +1,37 @@
package it.integry.integrywmsnative.core.rest.model.pv;
import java.time.LocalDateTime;
public class DeleteRowVerificaRequestDTO {
private String codMdep;
private LocalDateTime dataVerifica;
private VerificaGiacenzeRowDTO row;
public String getCodMdep() {
return codMdep;
}
public DeleteRowVerificaRequestDTO setCodMdep(String codMdep) {
this.codMdep = codMdep;
return this;
}
public LocalDateTime getDataVerifica() {
return dataVerifica;
}
public DeleteRowVerificaRequestDTO setDataVerifica(LocalDateTime dataVerifica) {
this.dataVerifica = dataVerifica;
return this;
}
public VerificaGiacenzeRowDTO getRow() {
return row;
}
public DeleteRowVerificaRequestDTO setRow(VerificaGiacenzeRowDTO row) {
this.row = row;
return this;
}
}

View File

@@ -0,0 +1,38 @@
package it.integry.integrywmsnative.core.rest.model.pv;
import java.time.LocalDateTime;
public class SaveNewRowVerificaRequestDTO {
private String codMdep;
private LocalDateTime dataVerifica;
private VerificaGiacenzeRowDTO row;
public String getCodMdep() {
return codMdep;
}
public SaveNewRowVerificaRequestDTO setCodMdep(String codMdep) {
this.codMdep = codMdep;
return this;
}
public LocalDateTime getDataVerifica() {
return dataVerifica;
}
public SaveNewRowVerificaRequestDTO setDataVerifica(LocalDateTime dataVerifica) {
this.dataVerifica = dataVerifica;
return this;
}
public VerificaGiacenzeRowDTO getRow() {
return row;
}
public SaveNewRowVerificaRequestDTO setRow(VerificaGiacenzeRowDTO row) {
this.row = row;
return this;
}
}

View File

@@ -1,15 +0,0 @@
package it.integry.integrywmsnative.core.rest.model.pv;
public class SaveNewVerificaRequestDTO {
private VerificaGiacenzeDTO data;
public VerificaGiacenzeDTO getData() {
return data;
}
public SaveNewVerificaRequestDTO setData(VerificaGiacenzeDTO data) {
this.data = data;
return this;
}
}

View File

@@ -0,0 +1,38 @@
package it.integry.integrywmsnative.core.rest.model.pv;
import java.time.LocalDateTime;
public class UpdateRowVerificaRequestDTO {
private String codMdep;
private LocalDateTime dataVerifica;
private VerificaGiacenzeRowDTO row;
public String getCodMdep() {
return codMdep;
}
public UpdateRowVerificaRequestDTO setCodMdep(String codMdep) {
this.codMdep = codMdep;
return this;
}
public LocalDateTime getDataVerifica() {
return dataVerifica;
}
public UpdateRowVerificaRequestDTO setDataVerifica(LocalDateTime dataVerifica) {
this.dataVerifica = dataVerifica;
return this;
}
public VerificaGiacenzeRowDTO getRow() {
return row;
}
public UpdateRowVerificaRequestDTO setRow(VerificaGiacenzeRowDTO row) {
this.row = row;
return this;
}
}

View File

@@ -16,7 +16,6 @@ import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
import it.integry.integrywmsnative.core.utility.UtilityDate;
@Singleton
public class InventarioService {
@@ -48,7 +47,7 @@ public class InventarioService {
MtbColt mtbColt = new MtbColt();
mtbColt.setGestione(inventario.getGestione());
mtbColt.setDataCollo(UtilityDate.toDate(inventario.getDataCollo()));
mtbColt.setDataCollo(inventario.getDataCollo());
mtbColt.setSerCollo(inventario.getSerCollo());
mtbColt.setNumCollo(inventario.getNumCollo());
mtbColt.setSegno(inventario.getSegno());
@@ -71,7 +70,7 @@ public class InventarioService {
MtbColr mtbColr = new MtbColr();
mtbColr.setGestione(inventario.getGestione());
mtbColr.setDataCollo(UtilityDate.toDate(inventario.getDataCollo()));
mtbColr.setDataCollo(inventario.getDataCollo());
mtbColr.setSerCollo(inventario.getSerCollo());
mtbColr.setNumCollo(inventario.getNumCollo());
mtbColr.setCodMart(inventario.getCodMart());

View File

@@ -98,7 +98,9 @@ public class DBSettingsModel {
private boolean flagAccettazioneGroupListForn = false;
private boolean flagSpedizioneEnableFastPicking = false;
private boolean flagAccettazioneBollaEditableQtaTot = true;
private boolean flagViewSwitchDepoButton = true;
private boolean flagProduzioneSkipAskVersamentoAutomatico;
private boolean flagAccettazioneViewLotto = false;
public boolean isFlagSpedizioneEnableFakeGiacenza() {
return flagSpedizioneEnableFakeGiacenza;
}
@@ -824,4 +826,30 @@ public class DBSettingsModel {
public void setFlagAccettazioneBollaEditableQtaTot(boolean flagAccettazioneBollaEditableQtaTot) {
this.flagAccettazioneBollaEditableQtaTot = flagAccettazioneBollaEditableQtaTot;
}
public boolean isFlagViewSwitchDepoButton() {
return flagViewSwitchDepoButton;
}
public void setFlagViewSwitchDepoButton(boolean flagViewSwitchDepoButton) {
this.flagViewSwitchDepoButton = flagViewSwitchDepoButton;
}
public boolean isFlagProduzioneSkipAskVersamentoAutomatico() {
return flagProduzioneSkipAskVersamentoAutomatico;
}
public DBSettingsModel setFlagProduzioneSkipAskVersamentoAutomatico(boolean flagProduzioneSkipAskVersamentoAutomatico) {
this.flagProduzioneSkipAskVersamentoAutomatico = flagProduzioneSkipAskVersamentoAutomatico;
return this;
}
public boolean isFlagAccettazioneViewLotto() {
return flagAccettazioneViewLotto;
}
public DBSettingsModel setFlagAccettazioneViewLotto(boolean flagAccettazioneViewLotto) {
this.flagAccettazioneViewLotto = flagAccettazioneViewLotto;
return this;
}
}

View File

@@ -39,8 +39,6 @@ public class SettingsManager {
private static SettingsModel settingsModelIstance;
private static DBSettingsModel dbSettingsModelIstance;
private static boolean firstStart = false;
private static Context mContext;
private static SystemRESTConsumer mSystemRESTConsumer;
private static ImballiRESTConsumer mImballiRESTConsumer;
@@ -65,15 +63,15 @@ public class SettingsManager {
public void init() {
settingsModelIstance = (SettingsModel) Stash.getObject(TAG, SettingsModel.class);
if (settingsModelIstance == null) {
if (settingsModelIstance == null)
settingsModelIstance = new SettingsModel();
if (settingsModelIstance.getServer() == null)
settingsModelIstance.setServer(new SettingsModel.Server());
firstStart = true;
}
dbSettingsModelIstance = new DBSettingsModel();
}
public SettingsModel getSettings() {
@@ -89,10 +87,6 @@ public class SettingsManager {
return dbSettingsModelIstance;
}
public static boolean isFirstStart() {
return firstStart;
}
public static boolean isInstanceAvailable() {
return i() != null;
}
@@ -260,6 +254,11 @@ public class SettingsManager {
.setSection("ACCETTAZIONE")
.setKeySection("FLAG_DELETE_ROW_ON_CLOSE")
.setSetter(dbSettingsModelIstance::setFlagAccettazioneDeleteRowOnClose));
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
.setGestName("PICKING")
.setSection("ACCETTAZIONE")
.setKeySection("FLAG_VIEW_LOTTO")
.setSetter(dbSettingsModelIstance::setFlagAccettazioneViewLotto));
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
.setGestName("PICKING")
.setSection("SPEDIZIONE")
@@ -307,6 +306,12 @@ public class SettingsManager {
.setSection("PRODUZIONE")
.setKeySection("VIEW_POSIZIONI")
.setSetter(dbSettingsModelIstance::setViewPosizioni));
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
.setGestName("PICKING")
.setSection("PRODUZIONE")
.setKeySection("FLAG_SKIP_ASK_VERSAMENTO_AUTOMATICO")
.setSetter(dbSettingsModelIstance::setFlagProduzioneSkipAskVersamentoAutomatico)
.setDefaultValue(false));
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
.setGestName("PICKING")
.setSection("SPEDIZIONE")
@@ -623,6 +628,13 @@ public class SettingsManager {
.setKeySection("ENABLE_ART_CREATION")
.setSetter(dbSettingsModelIstance::setFlagEnableArtCreation));
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
.setGestName("PICKING")
.setSection("SETUP")
.setKeySection("VIEW_SWITCH_DEPO_BUTTON")
.setSetter(dbSettingsModelIstance::setFlagViewSwitchDepoButton)
);
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
.setGestName("PICKING")
.setSection("SETUP")

View File

@@ -0,0 +1,29 @@
package it.integry.integrywmsnative.core.utility;
import android.text.method.DigitsKeyListener;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
/**
* KeyListener personalizzato che accetta numeri decimali
* usando il separatore decimale del locale corrente (virgola per italiano)
*/
public class LocaleDecimalKeyListener {
/**
* Ottiene un'istanza del KeyListener per il locale corrente
*/
public static DigitsKeyListener getInstance() {
return getInstance(Locale.getDefault());
}
/**
* Ottiene un'istanza del KeyListener per un locale specifico
*/
public static DigitsKeyListener getInstance(Locale locale) {
DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
char decimalSeparator = symbols.getDecimalSeparator();
return DigitsKeyListener.getInstance("0123456789" + decimalSeparator);
}
}

View File

@@ -78,7 +78,7 @@ public class UtilityBarcode {
public static boolean isEanPeso(BarcodeScanDTO barcodeScanDTO) {
return (isEtichetta128(barcodeScanDTO) || isEan13(barcodeScanDTO)) && barcodeScanDTO.getStringValue().startsWith("2");
return (isEtichetta128(barcodeScanDTO) || isEan13(barcodeScanDTO)) && barcodeScanDTO.getStringValue().length() == 13 && barcodeScanDTO.getStringValue().startsWith("2");
}
public static boolean isEan8(BarcodeScanDTO barcodeScanDTO) {

View File

@@ -41,6 +41,19 @@ public class UtilityDate {
public static final String DM_HUMAN = "dd MMM";
public static final String DMY_HUMAN = "dd MMM yyyy";
public static final String DMY_HUMAN_LONG = "dd MMMM yyyy";
public static final DateTimeFormatter DATE_DMY_SLASHED_FORMATTER = DateTimeFormatter.ofPattern(DMY_SLASH)
.withZone(ZoneId.systemDefault());
public static final DateTimeFormatter DATETIME_DMY_SLASHED_FORMATTER = DateTimeFormatter.ofPattern(DMY_TIME_SLASH)
.withZone(ZoneId.systemDefault());
public static final DateTimeFormatter DATE_DMY_HUMAN_FORMATTER = DateTimeFormatter.ofPattern(DMY_HUMAN_LONG)
.withZone(ZoneId.systemDefault());
}
public static Date recognizeDateWithExceptionHandler(String dateString) {

View File

@@ -1,6 +1,7 @@
package it.integry.integrywmsnative.core.utility;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
@@ -9,7 +10,8 @@ import it.integry.integrywmsnative.core.CommonConst;
public class UtilityNumber {
private static DecimalFormat decimalFormatInstance;
// Locale italiano per la formattazione
private static final Locale ITALIAN_LOCALE = new Locale("it", "IT");
public static String decimalToString(Float bigDecimal){
if(bigDecimal == null) return "0";
@@ -23,71 +25,59 @@ public class UtilityNumber {
public static String decimalToString(BigDecimal bigDecimal, int decimal){
if(bigDecimal == null) return "0";
return decimalToString(bigDecimal.floatValue(), decimal);
// Usa stripTrailingZeros per rimuovere gli zeri finali
BigDecimal stripped = bigDecimal.stripTrailingZeros();
// Limita il numero di decimali visualizzati
int scale = Math.min(stripped.scale(), decimal);
stripped = stripped.setScale(scale, RoundingMode.DOWN);
// Configura il formato italiano con virgola come separatore decimale
DecimalFormatSymbols italianSymbols = new DecimalFormatSymbols(ITALIAN_LOCALE);
italianSymbols.setDecimalSeparator(',');
// Crea il pattern dinamico basato sul numero di decimali
StringBuilder patternBuilder = new StringBuilder("0");
if (scale > 0) {
patternBuilder.append(".");
for (int i = 0; i < scale; i++) {
patternBuilder.append("0");
}
}
DecimalFormat formatter = new DecimalFormat(patternBuilder.toString(), italianSymbols);
String result = formatter.format(stripped);
// Se il risultato termina con ',', rimuovilo (per i numeri interi)
if (result.endsWith(",")) {
result = result.substring(0, result.length() - 1);
}
return result;
}
public static String decimalToString(float floatValue, int decimal) {
DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.getDefault());
otherSymbols.setDecimalSeparator('.');
otherSymbols.setGroupingSeparator(',');
final DecimalFormat decimalFormat = new DecimalFormat();
decimalFormat.setMaximumFractionDigits(decimal);
decimalFormat.setDecimalFormatSymbols(otherSymbols);
decimalFormat.setGroupingUsed(false);
decimalFormat.setMinimumFractionDigits(Math.min(2, decimal));
return decimalFormat.format(floatValue);
return decimalToString(BigDecimal.valueOf(floatValue), decimal);
}
public static DecimalFormat getNumberFormatInstance() {
if(decimalFormatInstance == null) {
DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.getDefault());
otherSymbols.setDecimalSeparator('.');
otherSymbols.setGroupingSeparator(',');
decimalFormatInstance = new DecimalFormat();
decimalFormatInstance.setMaximumFractionDigits(CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS);
decimalFormatInstance.setDecimalFormatSymbols(otherSymbols);
decimalFormatInstance.setGroupingUsed(false);
public static BigDecimal parseBigDecimal(String value, Locale locale) {
if (value == null || value.trim().isEmpty()) return null;
try {
DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
DecimalFormat format = new DecimalFormat();
format.setDecimalFormatSymbols(symbols);
format.setParseBigDecimal(true);
return (BigDecimal) format.parse(value);
} catch (Exception e) {
return null;
}
return decimalFormatInstance;
}
public static int countNumberOfDecimalDigits(Float value) {
String text = getNumberFormatInstance().format(Math.abs(value));
int integerPlaces = text.indexOf('.');
int decimalPlaces = text.length() - integerPlaces - 1;
return decimalPlaces;
}
public static String normalizeStringNumber(String numberString) {
return numberString.replaceAll(",", ".");
}
public static Float decimalToFloat(BigDecimal bigDecimalValue) {
float multiplier = (float) Math.pow(10, CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS);
Float floatValue = null;
if(bigDecimalValue != null) {
int intValue = (int) (bigDecimalValue.floatValue() * multiplier);
floatValue = Float.valueOf(intValue / multiplier);
}
return floatValue;
}
public static float truncateToDecimal(float v, int i) {
int delta = 10*i;
return ((int)v*delta)/delta;
/**
* Parsa una stringa numerica italiana (con virgola come separatore decimale)
* e restituisce un BigDecimal
*/
public static BigDecimal parseItalianBigDecimal(String value) {
return parseBigDecimal(value, ITALIAN_LOCALE);
}
}

View File

@@ -3,9 +3,15 @@ package it.integry.integrywmsnative.core.utility;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.ColorStateList;
import android.util.TypedValue;
import androidx.annotation.AttrRes;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.RawRes;
import androidx.annotation.StringRes;
import androidx.core.content.ContextCompat;
import java.io.BufferedReader;
import java.io.IOException;
@@ -69,4 +75,23 @@ public class UtilityResources {
return 0;
}
// Funzione di utilità per ottenere un colore da un attributo del tema
public static @ColorRes int getColorResourceFromAttr(Context context, @AttrRes int attrRes) {
TypedValue typedValue = new TypedValue();
context.getTheme().resolveAttribute(attrRes, typedValue, true);
return typedValue.data;
}
public static @ColorInt int getColorFromAttr(Context context, @AttrRes int attrRes) {
return ContextCompat.getColor(context, getColorResourceFromAttr(context, attrRes));
}
public static ColorStateList getColorStateListFromAttr(Context context, @AttrRes int attrRes) {
return ColorStateList.valueOf(getColorResourceFromAttr(context, attrRes));
}
}

View File

@@ -114,7 +114,7 @@ public class AccettazioneBollaPickingListAdapter extends SectionedRecyclerViewAd
} else if (position % 2 == 1) {
holder.mBinding.getRoot().setBackgroundColor(Color.WHITE);
} else {
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBGLight));
}
holder.mBinding.deactivatedOverBg.setVisibility(!pickingObjectDTO.isActive() ? View.VISIBLE : View.GONE);

View File

@@ -36,6 +36,7 @@ public class SitArtOrdDTO {
private String descrizioneEstesaArt;
private String descrizioneEstesaOrd;
private Date dataCons;
private String partitaMag;
public String getDescrizioneEstesaOrd() {
return descrizioneEstesaOrd;
@@ -301,4 +302,13 @@ public class SitArtOrdDTO {
this.dataCons = dataCons;
return this;
}
public String getPartitaMag() {
return partitaMag;
}
public SitArtOrdDTO setPartitaMag(String partitaMag) {
this.partitaMag = partitaMag;
return this;
}
}

View File

@@ -273,7 +273,7 @@ public class AccettazioneOrdiniPickingViewModel {
try {
numCollo = UtilityBarcode.getNumColloFromULAnonima(barcodeScanDTO.getStringValue());
this.createNewLU(
null,
barcodeScanDTO.getStringValue(),
numCollo,
CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE, true, onComplete);
} catch (Exception ex) {
@@ -559,6 +559,9 @@ public class AccettazioneOrdiniPickingViewModel {
dataScad = dataScad.plusDays(pickingObjectDTO.getMtbAart().getGgScadPartita());
}
if (partitaMag == null && SettingsManager.iDB().isFlagAccettazioneViewLotto())
partitaMag = pickingObjectDTO.getSitArtOrdDTO().getPartitaMag();
if (partitaMag == null && dataScad == null) {
HistoryMtbAartDTO historyMtbAartDTO = this.getHistoryItemIfExists(pickingObjectDTO.getMtbAart().getCodMart());

View File

@@ -114,7 +114,7 @@ public class AccettazioneOrdiniPickingListAdapter extends SectionedRecyclerViewA
} else if (position % 2 == 1) {
holder.mBinding.getRoot().setBackgroundColor(Color.WHITE);
} else {
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBGLight));
}
holder.mBinding.deactivatedOverBg.setVisibility(!pickingObjectDTO.isActive() ? View.VISIBLE : View.GONE);

View File

@@ -45,9 +45,7 @@ public class DialogSelectDocInfo_FornitoreAdapter extends ArrayAdapter<DialogSel
@Override
public String toString() {
return this.getOriginalModel().getCodAnag() +
(this.getOriginalModel().getCodVdes() != null ? " - " + this.getOriginalModel().getCodVdes() : "") +
" ( " + this.getOriginalModel().getDescrizione() + " )";
return this.getOriginalModel().getDescrizione();
}
}

View File

@@ -1,11 +1,17 @@
package it.integry.integrywmsnative.gest.login.dto;
import com.google.gson.annotations.SerializedName;
import java.util.HashMap;
public class AuthTokenClaimsDTO {
@SerializedName("deviceId")
private long deviceId;
@SerializedName("userDTO")
private User userDTO;
@SerializedName("profilesData")
private HashMap<String, AuthTokenProfileDetails> profilesData;
public long getDeviceId() {
@@ -36,11 +42,22 @@ public class AuthTokenClaimsDTO {
}
public class User {
@SerializedName("username")
private String username;
@SerializedName("email")
private Object email;
@SerializedName("fullname")
private String fullname;
@SerializedName("keyGroup")
private int keyGroup;
@SerializedName("attivo")
private boolean attivo;
@SerializedName("type")
private String type;
public String getUsername() {
@@ -99,6 +116,7 @@ public class AuthTokenClaimsDTO {
}
public static class AuthTokenProfileDetails {
@SerializedName("defaultDepo")
private AuthTokenDepoDetails defaultDepo;
public AuthTokenDepoDetails getDefaultDepo() {
@@ -112,8 +130,13 @@ public class AuthTokenClaimsDTO {
}
public static class AuthTokenDepoDetails {
@SerializedName("codMdep")
private String codMdep;
@SerializedName("descrizione")
private String descrizione;
@SerializedName("codJfas")
private String codJfas;
public String getCodMdep() {

View File

@@ -1,12 +1,20 @@
package it.integry.integrywmsnative.gest.login.dto;
import com.google.gson.annotations.SerializedName;
import java.time.LocalDateTime;
public class AuthenticationJwtResponseDTO {
@SerializedName("accessToken")
private String accessToken;
@SerializedName("refreshToken")
private String refreshToken;
@SerializedName("expiryDate")
private LocalDateTime expiryDate;
@SerializedName("expireIn")
private long expireIn;

View File

@@ -1,11 +1,22 @@
package it.integry.integrywmsnative.gest.login.dto;
import com.google.gson.annotations.SerializedName;
public class LoginAziendaDTO {
@SerializedName("profileDb")
private String profileDb;
@SerializedName("endpointRestApi")
private String endpointRestApi;
@SerializedName("phpApi")
private String phpApi;
@SerializedName("repoPhoto")
private String repoPhoto;
@SerializedName("endpointPvm")
private String endpointPvm;
public String getProfileDb() {

View File

@@ -1,9 +1,16 @@
package it.integry.integrywmsnative.gest.login.dto;
import com.google.gson.annotations.SerializedName;
public class LoginRequestDTO {
@SerializedName("username")
private String username;
@SerializedName("password")
private String password;
@SerializedName("deviceId")
private String deviceId;
public String getUsername() {

View File

@@ -1,12 +1,15 @@
package it.integry.integrywmsnative.gest.login.dto;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class LoginResponseDTO {
@SerializedName("fullName")
private String fullName;
private List<String> availableProfiles;
@SerializedName("availableProfiles")
private List<String> availableProfiles;
public String getFullName() {
return fullName;

View File

@@ -1,6 +1,9 @@
package it.integry.integrywmsnative.gest.login.dto;
import com.google.gson.annotations.SerializedName;
public class RefreshRequestDTO {
@SerializedName("refreshToken")
private String refreshToken;
public String getRefreshToken() {

View File

@@ -34,7 +34,7 @@ public class AuthenticationRESTConsumer extends _BaseRESTConsumer {
String host = CommonConst.Login.Azienda.host;
int port = CommonConst.Login.Azienda.port;
AuthenticationRESTConsumerService service = restBuilder.getService(AuthenticationRESTConsumerService.class, protocol, host, port, false, true);
AuthenticationRESTConsumerService service = restBuilder.getService(AuthenticationRESTConsumerService.class, protocol, host, port);
service.loginAzienda(codAzienda).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<LoginAziendaDTO>> call, Response<ServiceRESTResponse<LoginAziendaDTO>> response) {
@@ -67,7 +67,7 @@ public class AuthenticationRESTConsumer extends _BaseRESTConsumer {
public void authenticate(String protocol, String host, int port, String username, String password, String profileDb, String deviceSalt, RunnableArgs<AuthenticationJwtResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
AuthenticationRESTConsumerService service = restBuilder.getService(AuthenticationRESTConsumerService.class, protocol, host, port, false);
AuthenticationRESTConsumerService service = restBuilder.getService(AuthenticationRESTConsumerService.class, protocol, host, port);
LoginRequestDTO loginRequestDTO = new LoginRequestDTO()
.setUsername(username)
@@ -94,7 +94,7 @@ public class AuthenticationRESTConsumer extends _BaseRESTConsumer {
public void retrieveAvailableProfiles(String protocol, String host, int port, String username, String password, RunnableArgs<List<String>> onComplete, RunnableArgs<Exception> onFailed) {
AuthenticationRESTConsumerService service = restBuilder.getService(AuthenticationRESTConsumerService.class, protocol, host, port, false);
AuthenticationRESTConsumerService service = restBuilder.getService(AuthenticationRESTConsumerService.class, protocol, host, port);
service.retreiveAvailableProfiles(username, password)
.enqueue(new ManagedErrorCallback<>() {

View File

@@ -49,8 +49,12 @@ public class LoginViewModel {
FirebaseInstallations.getInstance().getId().addOnCompleteListener(fid -> {
SettingsManager.i().createUserSession();
retrieveAvailableProfiles(protocol, host, port, username, password, selectedProfile -> {
SettingsManager.i().createUserSession();
if(selectedProfile == null) {
this.sendOnLoadingEnded();
return;
}
authenticate(protocol, host, port, username, password, selectedProfile, fid.getResult(), fullName -> {
@@ -126,6 +130,8 @@ public class LoginViewModel {
}
private void authenticate(String protocol, String host, int port, String username, String password, String profileDb, String deviceSalt, RunnableArgs<String> onComplete) {
mAuthenticationRESTConsumer.authenticate(protocol, host, port, username, password, profileDb, deviceSalt, sessionData -> {
var claims = JwtUtils.parseJwt(sessionData.getAccessToken());

View File

@@ -102,7 +102,7 @@ public class MainActivity extends BaseActivity
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, mBinding.drawerLayout, mBinding.appBarMain.toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
mBinding.drawerLayout.setDrawerListener(toggle);
mBinding.drawerLayout.addDrawerListener(toggle);
toggle.syncState();
@@ -122,6 +122,16 @@ public class MainActivity extends BaseActivity
startActivity(myIntent);
}
public void toggleDrawer() {
if (mBinding.drawerLayout.isDrawerOpen(GravityCompat.START)) {
mBinding.drawerLayout.closeDrawer(GravityCompat.START);
} else {
mBinding.drawerLayout.openDrawer(GravityCompat.START);
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
@@ -294,9 +304,13 @@ public class MainActivity extends BaseActivity
for (int i = 0; i < count; i++) {
getSupportFragmentManager().popBackStack();
}
mBinding.appBarMain.elevatedToolbar.setVisibility(getSupportFragmentManager().getBackStackEntryCount() > 1 ? View.VISIBLE : View.GONE);
}
private void adaptViewToFragment(Fragment fragment) {
mBinding.appBarMain.elevatedToolbar.setVisibility(fragment instanceof MainFragment ? View.GONE : View.VISIBLE);
if (fragment instanceof ISearchableFragment) {
mBinding.appBarMain.mainSearch.setOnQueryTextListener((SearchView.OnQueryTextListener) fragment);
mBinding.appBarMain.mainSearch.setVisibility(View.VISIBLE);

View File

@@ -1,10 +1,7 @@
package it.integry.integrywmsnative.gest.main;
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
@@ -122,7 +119,6 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
mBindings = DataBindingUtil.inflate(inflater, R.layout.fragment_main, container, false);
mBindings.setView(this);
mBindings.easterEggHorrorBloodExpandableLayout.setExpanded(false, false);
return mBindings.getRoot();
}
@@ -246,6 +242,13 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
}
public void toggleDrawer() {
if (getActivity() != null && getActivity() instanceof MainActivity) {
((MainActivity) getActivity()).toggleDrawer();
}
}
private void collapseNoConnectionLayout() {
if (getActivity() != null)
getActivity().runOnUiThread(() -> mBindings.noConnectionTopLayout.collapse(true));
@@ -284,8 +287,8 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
MenuConfiguration baseMenuConfiguration = new MenuConfiguration();
List<MenuConfiguration.MenuGroup> menuGroups = baseMenuConfiguration.getGroups();
for (int i = 0; i < menuGroups.size(); i++) {
try {
try {
for (int i = 0; i < menuGroups.size(); i++) {
BaseMenuConfiguration.MenuGroup menuGroup = menuGroups.get(i);
@@ -313,16 +316,12 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
menuListAdapter.setClickListener(this::onMenuClick);
mBindings.menuContainer.addView(groupBinding.getRoot());
}
} catch (Exception exception) {
UtilityExceptions.defaultException(requireActivity(), exception);
}
}
} catch (Exception exception) {
UtilityExceptions.defaultException(requireActivity(), exception);
}
}
private void onMenuClick(MenuConfiguration.MenuItem menuItem) {
@@ -339,89 +338,6 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
this.mOnPreDestroyList.add(onPreDestroy);
}
public void toggleEasterEggMode() {
easterEggToggle = !easterEggToggle;
int rootBgStart, rootBgEnd;
int profileBgStart, profileBgEnd;
float titleFlipStart, titleFlipEnd;
int animationTimeMillis = 0;
if (easterEggToggle) {
rootBgStart = Color.argb(255, 255, 255, 255);
rootBgEnd = Color.argb(255, 0, 0, 0);
profileBgStart = Color.argb(255, 26, 115, 232);
profileBgEnd = Color.argb(255, 211, 47, 47);
animationTimeMillis = 2500;
titleFlipStart = 1f;
titleFlipEnd = -1f;
} else {
rootBgStart = Color.argb(255, 0, 0, 0);
rootBgEnd = Color.argb(255, 255, 255, 255);
profileBgStart = Color.argb(255, 211, 47, 47);
profileBgEnd = Color.argb(255, 26, 115, 232);
animationTimeMillis = 750;
titleFlipStart = -1f;
titleFlipEnd = 1f;
}
mBindings.easterEggHorrorBloodExpandableLayout.setDuration(animationTimeMillis);
mBindings.easterEggHorrorBloodExpandableLayout.setExpanded(easterEggToggle, true);
View rootActivityView = requireActivity().findViewById(R.id.drawer_layout);
ObjectAnimator colorFadeRootBg = ObjectAnimator.ofObject(rootActivityView, "backgroundColor",
new ArgbEvaluator(),
rootBgStart,
rootBgEnd);
colorFadeRootBg.setDuration(animationTimeMillis);
colorFadeRootBg.start();
View toolbarActivityView = requireActivity().findViewById(R.id.toolbar);
ObjectAnimator colorFadeToolbarBg = ObjectAnimator.ofObject(toolbarActivityView, "backgroundColor",
new ArgbEvaluator(),
rootBgStart,
rootBgEnd);
colorFadeToolbarBg.setDuration(animationTimeMillis);
colorFadeToolbarBg.start();
ObjectAnimator colorFadeProfileBg = ObjectAnimator.ofObject(mBindings.profileRootContainer, "backgroundColor",
new ArgbEvaluator(),
profileBgStart,
profileBgEnd);
colorFadeProfileBg.setDuration(animationTimeMillis);
colorFadeProfileBg.start();
View toolbarTitleActivityView = requireActivity().findViewById(R.id.toolbar_title);
ObjectAnimator flipToolbarTitleX = ObjectAnimator.ofFloat(toolbarTitleActivityView, "scaleX",
titleFlipStart,
titleFlipEnd);
flipToolbarTitleX.setDuration(animationTimeMillis);
flipToolbarTitleX.start();
ObjectAnimator flipToolbarTitleY = ObjectAnimator.ofFloat(toolbarTitleActivityView, "scaleY",
titleFlipStart,
titleFlipEnd);
flipToolbarTitleY.setDuration(animationTimeMillis);
flipToolbarTitleY.start();
ObjectAnimator colorFadeTitleTextColor = ObjectAnimator.ofObject(toolbarTitleActivityView, "textColor",
new ArgbEvaluator(),
rootBgEnd,
rootBgStart);
colorFadeTitleTextColor.setDuration(animationTimeMillis);
colorFadeTitleTextColor.start();
}
public void changeUserDepo() {
DialogSwitchUserDepoView.newInstance(SettingsManager.iDB().getAvailableCodMdep(), this::onUserDepoChanged)
.show(getParentFragmentManager(), "switch-user-depo");

View File

@@ -806,7 +806,7 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
@Override
public void onResume() {
super.onResume();
Stream.of(this.mOrdiniInevasiMutableData)
this.mOrdiniInevasiMutableData.stream()
.forEach(x -> x.getSelectedObservable().set(false));
}

View File

@@ -251,6 +251,9 @@ public class OrdiniUscitaElencoFiltroViewModel {
.distinct()
.toList();
if(codMdeps.isEmpty())
return new ArrayList<>();
return Stream.of(Objects.requireNonNull(mtbDepoFullList))
.filter(x -> codMdeps.contains(x.getCodMdep()))
.distinct()

View File

@@ -575,7 +575,7 @@ public class PickingLiberoViewModel {
MtbColt sourceMtbColt = new MtbColt()
.setNumCollo(mtbColr.getNumCollo())
.setGestione(mtbColr.getGestione())
.setDataCollo(mtbColr.getDataColloD())
.setDataCollo(mtbColr.getDataColloLD())
.setSerCollo(mtbColr.getSerCollo())
.setMtbColr(new ObservableArrayList<>());
@@ -695,7 +695,7 @@ public class PickingLiberoViewModel {
MtbColt mtbColt = mColliMagazzinoRESTConsumer.getByChiaveColloSynchronized(
mtbColr.getGestioneRifEnum(),
mtbColr.getNumColloRif(),
mtbColr.getDataColloRifS(),
mtbColr.getDataColloRifLD(),
mtbColr.getSerColloRif(),
true,
false);

View File

@@ -565,7 +565,7 @@ public class PickingResiViewModel {
.setSerColloRif(UtilityString.empty2null(mtbColrToDispatch.getSerCollo()))
.setNumColloRif(mtbColrToDispatch.getNumCollo())
.setGestioneRif(UtilityString.empty2null(mtbColrToDispatch.getGestione()))
.setDataColloRif(UtilityString.empty2null(mtbColrToDispatch.getDataColloS()));
.setDataColloRif(mtbColrToDispatch.getDataColloLD());
if (mtbColrToDispatch.getPesoNettoKg() != null) {
@@ -608,7 +608,7 @@ public class PickingResiViewModel {
this.mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
mtbColr
.setDataCollo(value.getDataColloS())
.setDataCollo(value.getDataColloLD())
.setNumCollo(value.getNumCollo())
.setGestione(value.getGestione())
.setSerCollo(value.getSerCollo())
@@ -634,7 +634,7 @@ public class PickingResiViewModel {
MtbColt mtbColt = new MtbColt()
.setNumCollo(mtbColrToUpdate.getNumCollo())
.setDataCollo(mtbColrToUpdate.getDataColloS())
.setDataCollo(mtbColrToUpdate.getDataColloLD())
.setSerCollo(mtbColrToUpdate.getSerCollo())
.setGestione(mtbColrToUpdate.getGestione())
.setMtbColr(new ObservableArrayList<>());
@@ -682,7 +682,7 @@ public class PickingResiViewModel {
MtbColt mtbColt = new MtbColt()
.setNumCollo(mtbColrToDelete.getNumCollo())
.setDataCollo(mtbColrToDelete.getDataColloS())
.setDataCollo(mtbColrToDelete.getDataColloLD())
.setSerCollo(mtbColrToDelete.getSerCollo())
.setGestione(mtbColrToDelete.getGestione())
.setMtbColr(new ObservableArrayList<>());

View File

@@ -102,7 +102,7 @@ public class PickingResiListAdapter extends SectionedRecyclerViewAdapter<Picking
} else if (position % 2 == 1) {
holder.mBinding.getRoot().setBackgroundColor(Color.WHITE);
} else {
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBGLight));
}
holder.mBinding.deactivatedOverBg.setVisibility(!pickingResiListModel.isActive() ? View.VISIBLE : View.GONE);

View File

@@ -122,7 +122,13 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
BarcodeManager.removeCallback(mBarcodeScannerInstanceID);
}
});
mViewModel.init(codJfas);
mViewModel.refreshData(); // This will eventually trigger the LiveData observer for getOrderList
mBinding.swiperefresh.setOnRefreshListener(() -> {
mViewModel.refreshData();
});
}
@@ -299,8 +305,30 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
@Override
public void onDataSaved() {
this.onLoadingEnded();
this.requireActivity().runOnUiThread(() -> {
handler.post(() -> {
DialogCommon.showDataSaved(requireActivity(), this::popMe);
});
}
@Override
public void onDataRefreshStarted() {
handler.post(() -> {
mBinding.swiperefresh.setRefreshing(true);
});
}
@Override
public void onDataRefreshEnded() {
handler.post(() -> {
mBinding.swiperefresh.setRefreshing(false);
// applyFilters(); // Non strettamente necessario qui se l'observer di getOrderList() fa il suo dovere
});
}
@Override
public void onError(Exception ex) {
super.onError(ex);
onDataRefreshEnded();
}
}

View File

@@ -1,28 +1,10 @@
package it.integry.integrywmsnative.gest.prod_recupero_materiale;
import dagger.Module;
import dagger.Provides;
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
import it.integry.integrywmsnative.gest.prod_recupero_materiale.rest.ProdRecuperoMaterialeRESTConsumer;
@Module(subcomponents = ProdRecuperoMaterialeComponent.class)
public class ProdRecuperoMaterialeModule {
@Provides
ProdRecuperoMaterialeRESTConsumer providesProdRecuperMaterialeRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
return new ProdRecuperoMaterialeRESTConsumer(systemRESTConsumer, articoloRESTConsumer);
}
@Provides
ProdRecuperoMaterialeViewModel providesProdRecuperoMaterialeViewModel(ProdRecuperoMaterialeRESTConsumer prodRecuperoMaterialeRESTConsumer,
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
PrinterRESTConsumer printerRESTConsumer,
MaterialiRESTConsumer materialiRESTConsumer) {
return new ProdRecuperoMaterialeViewModel(prodRecuperoMaterialeRESTConsumer, colliMagazzinoRESTConsumer, printerRESTConsumer, materialiRESTConsumer);
}
}

View File

@@ -3,8 +3,10 @@ package it.integry.integrywmsnative.gest.prod_recupero_materiale;
import androidx.lifecycle.MutableLiveData;
import java.math.BigDecimal;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.stream.Collectors;
import javax.inject.Inject;
@@ -16,6 +18,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgss;
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
@@ -28,62 +31,88 @@ import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
public class ProdRecuperoMaterialeViewModel {
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
private final ProdRecuperoMaterialeRESTConsumer mProdRecuperoMaterialeRESTConsumer;
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
private final PrinterRESTConsumer mPrinterRESTConsumer;
private final MaterialiRESTConsumer mMaterialiRESTConsumer;
private final ExecutorService mExecutorService;
private final MutableLiveData<List<HistoryVersamentoProdULDTO>> mUlList = new MutableLiveData<>();
private Listener mListener;
private String mCodJfas;
@Inject
public ProdRecuperoMaterialeViewModel(ProdRecuperoMaterialeRESTConsumer prodRecuperoMaterialeRESTConsumer,
public ProdRecuperoMaterialeViewModel(BarcodeRESTConsumer barcodeRESTConsumer,
ProdRecuperoMaterialeRESTConsumer prodRecuperoMaterialeRESTConsumer,
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
PrinterRESTConsumer printerRESTConsumer,
MaterialiRESTConsumer materialiRESTConsumer) {
MaterialiRESTConsumer materialiRESTConsumer,
ExecutorService executorService) {
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
this.mProdRecuperoMaterialeRESTConsumer = prodRecuperoMaterialeRESTConsumer;
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
this.mPrinterRESTConsumer = printerRESTConsumer;
this.mMaterialiRESTConsumer = materialiRESTConsumer;
this.mExecutorService = executorService;
}
public void init(String codJfas) {
this.sendOnLoadingStarted();
this.mCodJfas = codJfas;
}
mProdRecuperoMaterialeRESTConsumer.loadLastULVersate(codJfas, ulList -> {
this.mUlList.setValue(ulList);
public void refreshData() {
this.sendOnDataRefreshStarted();
this.sendOnLoadingEnded();
}, this::sendError);
this.mExecutorService.execute(() -> {
try {
List<HistoryVersamentoProdULDTO> lastUlVersate = mProdRecuperoMaterialeRESTConsumer.loadLastULVersateSynchronized(mCodJfas);
lastUlVersate.sort(Comparator.comparing(HistoryVersamentoProdULDTO::getCodJfas));
this.mUlList.postValue(lastUlVersate);
this.sendOnDataRefreshEnded();
} catch (Exception e) {
this.sendError(e);
}
});
}
public void processBarcodeDTO(BarcodeScanDTO data) {
if (UtilityBarcode.isEtichettaAnonima(data) || UtilityBarcode.isEtichetta128(data)) {
this.executeEtichettaLU(data.getStringValue());
this.executeEtichettaLU(data);
}
}
private void executeEtichettaLU(String sscc) {
private void executeEtichettaLU(BarcodeScanDTO barcodeScanDTO) {
this.sendOnLoadingStarted();
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
this.mColliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColt -> {
this.sendOnLoadingEnded();
if(ean128Model == null || ean128Model.Sscc == null) {
this.sendError(new NoLUFoundException());
this.sendOnLoadingEnded();
return;
}
this.mColliMagazzinoRESTConsumer.getBySSCC(ean128Model.Sscc, true, false, mtbColt -> {
this.sendOnLoadingEnded();
if (mtbColt != null) {
HistoryVersamentoProdULDTO historyVersamentoProdULRestDTO = this.getHistoryElementFromMtbColt(mtbColt);
if (historyVersamentoProdULRestDTO != null) {
this.dispatchItem(historyVersamentoProdULRestDTO, mtbColt);
} else {
this.sendError(new NoLUFoundException());
}
if (mtbColt != null) {
HistoryVersamentoProdULDTO historyVersamentoProdULRestDTO = this.getHistoryElementFromMtbColt(mtbColt);
if (historyVersamentoProdULRestDTO != null) {
this.dispatchItem(historyVersamentoProdULRestDTO, mtbColt);
} else {
this.sendError(new NoLUFoundException());
}
} else {
this.sendError(new NoLUFoundException());
}
}, this::sendError);
}, this::sendError);
}
@@ -164,7 +193,7 @@ public class ProdRecuperoMaterialeViewModel {
.setNumColloRif(item.getNumColloRif())
.setOrdini(ordiniRequest);
if(mtbColt != null) {
if (mtbColt != null) {
request.setMtbColtCarico(mtbColt);
} else {
request.setMtbColtCarico(sourceMtbColt);
@@ -204,6 +233,14 @@ public class ProdRecuperoMaterialeViewModel {
return this;
}
private void sendOnDataRefreshStarted() {
if (this.mListener != null) mListener.onDataRefreshStarted();
}
private void sendOnDataRefreshEnded() {
if (this.mListener != null) mListener.onDataRefreshEnded();
}
private void sendOnLoadingStarted() {
if (this.mListener != null) mListener.onLoadingStarted();
}
@@ -274,6 +311,10 @@ public class ProdRecuperoMaterialeViewModel {
void onNoLUFound(Runnable onComplete);
void onDataSaved();
void onDataRefreshStarted();
void onDataRefreshEnded();
}
}

View File

@@ -1,310 +1,432 @@
package it.integry.integrywmsnative.gest.prod_recupero_materiale.rest;
import com.annimon.stream.Stream;
import com.google.gson.reflect.TypeToken;
import androidx.annotation.NonNull;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.inject.Inject;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityDB;
import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULRestDTO;
@Singleton
public class ProdRecuperoMaterialeRESTConsumer extends _BaseRESTConsumer {
private final SystemRESTConsumer mSystemRESTConsumer;
private final ArticoloRESTConsumer mArticoloRESTConsumer;
private final MaterialiRESTConsumer mMaterialiRESTConsumer;
public ProdRecuperoMaterialeRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
this.mSystemRESTConsumer = systemRESTConsumer;
@Inject
public ProdRecuperoMaterialeRESTConsumer(ArticoloRESTConsumer articoloRESTConsumer, MaterialiRESTConsumer materialiRESTConsumer) {
this.mMaterialiRESTConsumer = materialiRESTConsumer;
this.mArticoloRESTConsumer = articoloRESTConsumer;
}
public void loadLastULVersate(RunnableArgs<List<HistoryVersamentoProdULDTO>> onComplete, RunnableArgs<Exception> onFailed) {
loadLastULVersate(null, onComplete, onFailed);
public List<HistoryVersamentoProdULDTO> loadLastULVersateSynchronized() throws Exception {
return loadLastULVersateSynchronized(null);
}
public void loadLastULVersate(String codJfas, RunnableArgs<List<HistoryVersamentoProdULDTO>> onComplete, RunnableArgs<Exception> onFailed) {
public @NonNull List<HistoryVersamentoProdULDTO> loadLastULVersateSynchronized(String codJfas) throws Exception {
var ulList = mMaterialiRESTConsumer.makeSynchronousRetrieveLastVersamentiRequest(codJfas);
String sql = "WITH ul_list AS ( " +
" SELECT jtb_fasi.cod_jfas, " +
" jtb_fasi.descrizione AS descrizione_fase, " +
" mtb_colr.gestione, " +
" mtb_colr.data_collo, " +
" mtb_colr.num_collo, " +
" mtb_colr.ser_collo, " +
" mtb_colr.cod_mart, " +
" mtb_colr.cod_col, " +
" mtb_colr.cod_tagl, " +
" SUM(mtb_colr.qta_col) AS qta_col, " +
" mtb_colr.qta_cnf AS qta_cnf, " +
" SUM(mtb_colr.num_cnf) AS num_cnf, " +
" mtb_colr.partita_mag, " +
" mtb_colr.cod_jcom, " +
" mtb_colr.num_collo_rif, " +
" mtb_colr.data_collo_rif, " +
" mtb_colr.ser_collo_rif, " +
" mtb_colr.gestione_rif, " +
" mtb_colt.segno, " +
" ISNULL(mtb_aart.descrizione_estesa, mtb_aart.descrizione) AS descrizione_art, " +
" mtb_aart.unt_mis, " +
" MAX(datetime_row) AS datetime_row, " +
" mtb_colr.num_ord, " +
" mtb_colr.data_ord, " +
" mtb_colr.gestione as gestione_ord, " +
" mtb_colr.riga_ord, " +
" dtb_ord_steps.hr_num as hr, " +
" CONVERT(INTEGER, ROUND((CAST(dtb_ord_steps.hr_num AS DECIMAL(20, 5)) / " +
" SUM(dtb_ord_steps.hr_num) OVER (PARTITION BY mtb_colr.num_collo)) * 100, " +
" SUM(CASE WHEN dtb_ord_steps.hr_num > 0 then dtb_ord_steps.hr_num else 1 end) OVER (PARTITION BY mtb_colr.num_collo)) * 100, " +
" 0) as percentage_hr " +
" FROM mtb_colr " +
" INNER JOIN mtb_colt ON mtb_colr.num_collo = mtb_colt.num_collo " +
" AND mtb_colr.data_collo = mtb_colt.data_collo " +
" AND mtb_colr.ser_collo = mtb_colt.ser_collo " +
" AND mtb_colr.gestione = mtb_colt.gestione " +
" " + (SettingsManager.iDB().isFlagVersamentoDirettoProduzione() ? "INNER" : "LEFT OUTER") + " join dtb_ord_steps ON dtb_ord_steps.data_ord = mtb_colr.data_ord " +
" AND dtb_ord_steps.gestione = mtb_colr.gestione " +
" AND dtb_ord_steps.num_ord = mtb_colr.num_ord " +
" AND dtb_ord_steps.data_iniz is not null " +
" AND dtb_ord_steps.data_fine is null " +
" INNER JOIN mtb_aart ON mtb_colr.cod_mart = mtb_aart.cod_mart " +
" LEFT OUTER JOIN jtb_fasi ON mtb_colt.cod_jfas = jtb_fasi.cod_jfas " +
" WHERE jtb_fasi.cod_jfas IS NOT NULL " +
(UtilityString.isNullOrEmpty(codJfas) ? "" : " AND jtb_fasi.cod_jfas = " + UtilityDB.valueToString(codJfas)) +
" AND segno = -1 " +
" AND mtb_colr.data_collo > DATEADD(DAY, -5, GETDATE()) " +
" GROUP BY jtb_fasi.cod_jfas, " +
" jtb_fasi.descrizione, " +
" mtb_colr.gestione, " +
" mtb_colr.data_collo, " +
" mtb_colr.num_collo, " +
" mtb_colr.ser_collo, " +
" mtb_colr.qta_cnf, " +
" mtb_colr.cod_mart, " +
" mtb_colr.cod_col, " +
" mtb_colr.cod_tagl, " +
" mtb_colr.ser_collo, " +
" mtb_colr.partita_mag, " +
" mtb_colr.cod_jcom, " +
" mtb_aart.descrizione_estesa, " +
" mtb_aart.descrizione, " +
" mtb_aart.unt_mis, " +
" mtb_colr.num_collo_rif, " +
" mtb_colr.data_collo_rif, " +
" mtb_colr.ser_collo_rif, " +
" mtb_colr.gestione_rif, " +
" mtb_colt.segno, " +
" mtb_colr.num_ord, " +
" mtb_colr.data_ord, " +
" mtb_colr.gestione, " +
" mtb_colr.riga_ord, " +
" dtb_ord_steps.hr_num " +
" HAVING SUM(mtb_colr.qta_col) > 0 " +
"), max_ul AS ( " +
" SELECT " +
" cod_jfas, " +
" descrizione_fase, " +
" gestione, " +
" cod_mart, " +
" cod_col, " +
" cod_tagl, " +
" ser_collo, " +
" partita_mag, " +
" cod_jcom, " +
" descrizione_art, " +
" unt_mis, " +
" num_collo_rif, " +
" data_collo_rif, " +
" ser_collo_rif, " +
" gestione_rif, " +
" segno, " +
" num_ord, " +
" data_ord, " +
" gestione_ord, " +
" riga_ord, " +
" hr, " +
" MAX (datetime_row) as max_datetime_row " +
" FROM ul_list " +
" GROUP BY cod_jfas, " +
" descrizione_fase, " +
" gestione, " +
" cod_mart, " +
" cod_col, " +
" cod_tagl, " +
" ser_collo, " +
" partita_mag, " +
" cod_jcom, " +
" descrizione_art, " +
" unt_mis, " +
" num_collo_rif, " +
" data_collo_rif, " +
" ser_collo_rif, " +
" gestione_rif, " +
" segno, " +
" num_ord, " +
" data_ord, " +
" gestione_ord, " +
" riga_ord, " +
" hr " +
") " +
" " +
"SELECT ul_list.* FROM max_ul " +
"LEFT OUTER JOIN ul_list ON " +
" ISNULL(max_ul.cod_jfas, '') = ISNULL(ul_list.cod_jfas, '') AND " +
" ISNULL(max_ul.descrizione_fase, '') = ISNULL(ul_list.descrizione_fase, '') AND " +
" ISNULL(max_ul.gestione, '') = ISNULL(ul_list.gestione, '') AND " +
" ISNULL(max_ul.cod_mart, '') = ISNULL(ul_list.cod_mart, '') AND " +
" ISNULL(max_ul.cod_col, '') = ISNULL(ul_list.cod_col, '') AND " +
" ISNULL(max_ul.cod_tagl, '') = ISNULL(ul_list.cod_tagl, '') AND " +
" ISNULL(max_ul.ser_collo, '') = ISNULL(ul_list.ser_collo, '') AND " +
" ISNULL(max_ul.partita_mag, '') = ISNULL(ul_list.partita_mag, '') AND " +
" ISNULL(max_ul.cod_jcom, '') = ISNULL(ul_list.cod_jcom, '') AND " +
" ISNULL(max_ul.descrizione_art, '') = ISNULL(ul_list.descrizione_art, '') AND " +
" ISNULL(max_ul.unt_mis, '') = ISNULL(ul_list.unt_mis, '') AND " +
" ISNULL(max_ul.num_collo_rif, '') = ISNULL(ul_list.num_collo_rif, '') AND " +
" ISNULL(max_ul.data_collo_rif, '') = ISNULL(ul_list.data_collo_rif, '') AND " +
" ISNULL(max_ul.ser_collo_rif, '') = ISNULL(ul_list.ser_collo_rif, '') AND " +
" ISNULL(max_ul.gestione_rif, '') = ISNULL(ul_list.gestione_rif, '') AND " +
" ISNULL(max_ul.segno, '') = ISNULL(ul_list.segno, '') AND " +
" ISNULL(max_ul.num_ord, '') = ISNULL(ul_list.num_ord, '') AND " +
" ISNULL(max_ul.data_ord, '') = ISNULL(ul_list.data_ord, '') AND " +
" ISNULL(max_ul.gestione_ord, '') = ISNULL(ul_list.gestione_ord, '') AND " +
" ISNULL(max_ul.riga_ord, '') = ISNULL(ul_list.riga_ord, '') AND " +
" ISNULL(max_ul.hr, '') = ISNULL(ul_list.hr, '') AND " +
" max_ul.max_datetime_row = ul_list.datetime_row";
if (ulList == null) {
return new ArrayList<>();
}
Type typeOfObjectsList = new TypeToken<ArrayList<HistoryVersamentoProdULRestDTO>>() {
}.getType();
this.mSystemRESTConsumer.<ArrayList<HistoryVersamentoProdULRestDTO>>processSql(sql, typeOfObjectsList, ulList -> {
List<HistoryVersamentoProdULDTO> newUlList = new ArrayList<>();
if (ulList == null) {
onComplete.run(null);
return;
Map<HashMap<String, Object>, List<HistoryVersamentoProdULRestDTO>> ulListGrouped = ulList.stream()
.collect(Collectors.groupingBy(x -> {
var keyMap = new HashMap<String, Object>();
keyMap.put("gestione", x.getGestione());
keyMap.put("data_collo", x.getDataCollo());
keyMap.put("ser_collo", x.getSerCollo());
keyMap.put("num_collo", x.getNumCollo());
keyMap.put("cod_mart", x.getCodMart());
keyMap.put("partita_mag", x.getPartitaMag());
keyMap.put("gestione_rif", x.getGestioneRif());
keyMap.put("data_collo_rif", x.getDataColloRif());
keyMap.put("ser_collo_rif", x.getSerColloRif());
keyMap.put("num_collo_rif", x.getNumColloRif());
return keyMap;
}, Collectors.toList()));
for (HashMap<String, Object> ulKey : ulListGrouped.keySet()) {
var matchingUls = ulList.stream().filter(x ->
Objects.equals(x.getGestione(), ulKey.get("gestione")) &&
Objects.equals(x.getDataCollo(), ulKey.get("data_collo")) &&
Objects.equals(x.getSerCollo(), ulKey.get("ser_collo")) &&
Objects.equals(x.getNumCollo(), ulKey.get("num_collo")) &&
Objects.equals(x.getCodMart(), ulKey.get("cod_mart")) &&
Objects.equals(x.getPartitaMag(), ulKey.get("partita_mag")) &&
Objects.equals(x.getGestioneRif(), ulKey.get("gestione_rif")) &&
Objects.equals(x.getDataColloRif(), ulKey.get("data_collo_rif")) &&
Objects.equals(x.getSerColloRif(), ulKey.get("ser_collo_rif")) &&
Objects.equals(x.getNumColloRif(), ulKey.get("num_collo_rif"))
).collect(Collectors.toUnmodifiableList());
ulKey.put("qta_col", matchingUls.stream().map(HistoryVersamentoProdULRestDTO::getQtaCol)
.reduce(BigDecimal.ZERO, BigDecimal::add));
ulKey.put("num_cnf", matchingUls.stream().map(HistoryVersamentoProdULRestDTO::getNumCnf)
.reduce(BigDecimal.ZERO, BigDecimal::add));
}
ulListGrouped.forEach((key, value) -> {
var listaOrdini = value.stream()
.filter(x -> x.getDataOrd() != null &&
x.getGestioneOrd() != null &&
x.getNumOrd() != null)
.map(x -> new HistoryVersamentoProdULDTO.OrdineDto()
.setData(x.getDataOrd())
.setNumero(x.getNumOrd())
.setGestione(x.getGestione())
.setRigaOrd(x.getRigaOrd())
.setQtaCol(x.getQtaCol())
.setNumCnf(x.getNumCnf())
.setPercentageHr(x.getPercentageHr()))
.distinct()
.collect(Collectors.toUnmodifiableList());
var restData = value.get(0);
var qtaCol = (BigDecimal) key.get("qta_col");
var numCnf = (BigDecimal) key.get("num_cnf");
newUlList.add(new HistoryVersamentoProdULDTO()
.setGestione(restData.getGestione())
.setDataCollo(restData.getDataCollo())
.setSerCollo(restData.getSerCollo())
.setNumCollo(restData.getNumCollo())
.setSegno(restData.getSegno())
.setCodMart(restData.getCodMart())
.setCodCol(restData.getCodCol())
.setCodTagl(restData.getCodTagl())
.setCodJfas(restData.getCodJfas())
.setDescrizioneArt(restData.getDescrizioneArt())
.setDescrizioneFase(restData.getDescrizioneFase())
.setQtaCol(qtaCol)
.setQtaCnf(restData.getQtaCnf())
.setNumCnf(numCnf)
.setPartitaMag(restData.getPartitaMag())
.setCodJcom(restData.getCodJcom())
.setDatetimeRow(restData.getDatetimeRow())
.setUntMis(restData.getUntMis())
.setGestioneRif(restData.getGestioneRif())
.setDataColloRif(restData.getDataColloRif())
.setSerColloRif(restData.getSerColloRif())
.setNumColloRif(restData.getNumColloRif())
.setOrdini(listaOrdini));
});
if (!newUlList.isEmpty()) {
List<String> codMarts = newUlList.stream()
.map(HistoryVersamentoProdULDTO::getCodMart)
.filter(Objects::nonNull)
.distinct()
.collect(Collectors.toUnmodifiableList());
var arts = this.mArticoloRESTConsumer.getByCodMartsSynchronized(codMarts);
if (arts != null && !arts.isEmpty()) {
for (HistoryVersamentoProdULDTO value : newUlList) {
MtbAart foundMtbAart = arts.stream()
.filter(x -> x.getCodMart().equalsIgnoreCase(value.getCodMart()))
.findFirst()
.orElse(null);
value.setMtbAart(foundMtbAart);
}
}
List<HistoryVersamentoProdULDTO> newUlList = new ArrayList<>();
return newUlList;
Stream.of(ulList)
.distinctBy(x -> {
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("gestione", x.getGestione());
hashMap.put("data_collo", x.getDataCollo());
hashMap.put("ser_collo", x.getSerCollo());
hashMap.put("num_collo", x.getNumCollo());
hashMap.put("cod_mart", x.getCodMart());
hashMap.put("gestione_rif", x.getGestioneRif());
hashMap.put("data_collo_rif", x.getDataColloRif());
hashMap.put("ser_collo_rif", x.getSerColloRif());
hashMap.put("num_collo_rif", x.getNumColloRif());
return hashMap;
})
.forEach(restDTO -> {
} else {
return newUlList;
}
}
List<HistoryVersamentoProdULDTO.OrdineDto> ordineList = ulList.stream()
.filter(x -> x.getNumCollo().equals(restDTO.getNumCollo()) &&
x.getDataCollo().equals(restDTO.getDataCollo()) &&
x.getSerCollo().equals(restDTO.getSerCollo()) &&
x.getGestione().equals(restDTO.getGestione()) &&
(x.getRigaOrd() == null || Objects.equals(x.getRigaOrd(), restDTO.getRigaOrd())))
.map(x -> new HistoryVersamentoProdULDTO.OrdineDto()
.setData(x.getDataOrd())
.setNumero(x.getNumOrd())
.setGestione(x.getGestione())
.setRigaOrd(x.getRigaOrd())
.setQtaCol(x.getQtaCol())
.setNumCnf(x.getNumCnf())
.setPercentageHr(x.getPercentageHr()))
.collect(Collectors.toList());
// BigDecimal qtaColTot = BigDecimal.ZERO;
// BigDecimal numCnfColTot = BigDecimal.ZERO;
// public void loadLastULVersate(String codJfas, RunnableArgs<List<HistoryVersamentoProdULDTO>> onComplete, RunnableArgs<Exception> onFailed) {
//
// for (HistoryVersamentoProdULDTO.OrdineDto ordine :
// ordineList) {
// qtaColTot = qtaColTot.add(ordine.getQtaCol());
// numCnfColTot = numCnfColTot.add(ordine.getNumCnf());
// String sql = "WITH ul_list AS ( " +
// " SELECT jtb_fasi.cod_jfas, " +
// " jtb_fasi.descrizione AS descrizione_fase, " +
// " mtb_colr.gestione, " +
// " mtb_colr.data_collo, " +
// " mtb_colr.num_collo, " +
// " mtb_colr.ser_collo, " +
// " mtb_colr.cod_mart, " +
// " mtb_colr.cod_col, " +
// " mtb_colr.cod_tagl, " +
// " SUM(mtb_colr.qta_col) AS qta_col, " +
// " mtb_colr.qta_cnf AS qta_cnf, " +
// " SUM(mtb_colr.num_cnf) AS num_cnf, " +
// " mtb_colr.partita_mag, " +
// " mtb_colr.cod_jcom, " +
// " mtb_colr.num_collo_rif, " +
// " mtb_colr.data_collo_rif, " +
// " mtb_colr.ser_collo_rif, " +
// " mtb_colr.gestione_rif, " +
// " mtb_colt.segno, " +
// " ISNULL(mtb_aart.descrizione_estesa, mtb_aart.descrizione) AS descrizione_art, " +
// " mtb_aart.unt_mis, " +
// " MAX(datetime_row) AS datetime_row, " +
// " mtb_colr.num_ord, " +
// " mtb_colr.data_ord, " +
// " mtb_colr.gestione as gestione_ord, " +
// " mtb_colr.riga_ord, " +
// " dtb_ord_steps.hr_num as hr, " +
// " CONVERT(INTEGER, ROUND((CAST(dtb_ord_steps.hr_num AS DECIMAL(20, 5)) / " +
// " SUM(dtb_ord_steps.hr_num) OVER (PARTITION BY mtb_colr.num_collo)), " +
// " SUM(CASE WHEN dtb_ord_steps.hr_num > 0 then dtb_ord_steps.hr_num else 1 end) OVER (PARTITION BY mtb_colr.num_collo)) * 100, " +
// " 0) as percentage_hr " +
// " FROM mtb_colr " +
// " INNER JOIN mtb_colt ON mtb_colr.num_collo = mtb_colt.num_collo " +
// " AND mtb_colr.data_collo = mtb_colt.data_collo " +
// " AND mtb_colr.ser_collo = mtb_colt.ser_collo " +
// " AND mtb_colr.gestione = mtb_colt.gestione " +
// " " + (SettingsManager.iDB().isFlagVersamentoDirettoProduzione() ? "INNER" : "LEFT OUTER") + " join dtb_ord_steps ON dtb_ord_steps.data_ord = mtb_colr.data_ord " +
// " AND dtb_ord_steps.gestione = mtb_colr.gestione " +
// " AND dtb_ord_steps.num_ord = mtb_colr.num_ord " +
// " AND dtb_ord_steps.data_iniz is not null " +
// " AND dtb_ord_steps.data_fine is null " +
// " INNER JOIN mtb_aart ON mtb_colr.cod_mart = mtb_aart.cod_mart " +
// " LEFT OUTER JOIN jtb_fasi ON mtb_colt.cod_jfas = jtb_fasi.cod_jfas " +
// " WHERE jtb_fasi.cod_jfas IS NOT NULL " +
// (UtilityString.isNullOrEmpty(codJfas) ? "" : " AND jtb_fasi.cod_jfas = " + UtilityDB.valueToString(codJfas)) +
// " AND segno = -1 " +
// " AND mtb_colr.data_collo > DATEADD(DAY, -5, GETDATE()) " +
// " GROUP BY jtb_fasi.cod_jfas, " +
// " jtb_fasi.descrizione, " +
// " mtb_colr.gestione, " +
// " mtb_colr.data_collo, " +
// " mtb_colr.num_collo, " +
// " mtb_colr.ser_collo, " +
// " mtb_colr.qta_cnf, " +
// " mtb_colr.cod_mart, " +
// " mtb_colr.cod_col, " +
// " mtb_colr.cod_tagl, " +
// " mtb_colr.ser_collo, " +
// " mtb_colr.partita_mag, " +
// " mtb_colr.cod_jcom, " +
// " mtb_aart.descrizione_estesa, " +
// " mtb_aart.descrizione, " +
// " mtb_aart.unt_mis, " +
// " mtb_colr.num_collo_rif, " +
// " mtb_colr.data_collo_rif, " +
// " mtb_colr.ser_collo_rif, " +
// " mtb_colr.gestione_rif, " +
// " mtb_colt.segno, " +
// " mtb_colr.num_ord, " +
// " mtb_colr.data_ord, " +
// " mtb_colr.gestione, " +
// " mtb_colr.riga_ord, " +
// " dtb_ord_steps.hr_num " +
// " HAVING SUM(mtb_colr.qta_col) > 0 " +
// "), max_ul AS ( " +
// " SELECT " +
// " cod_jfas, " +
// " descrizione_fase, " +
// " gestione, " +
// " cod_mart, " +
// " cod_col, " +
// " cod_tagl, " +
// " ser_collo, " +
// " partita_mag, " +
// " cod_jcom, " +
// " descrizione_art, " +
// " unt_mis, " +
// " num_collo_rif, " +
// " data_collo_rif, " +
// " ser_collo_rif, " +
// " gestione_rif, " +
// " segno, " +
// " num_ord, " +
// " data_ord, " +
// " gestione_ord, " +
// " riga_ord, " +
// " hr, " +
// " MAX (datetime_row) as max_datetime_row " +
// " FROM ul_list " +
// " GROUP BY cod_jfas, " +
// " descrizione_fase, " +
// " gestione, " +
// " cod_mart, " +
// " cod_col, " +
// " cod_tagl, " +
// " ser_collo, " +
// " partita_mag, " +
// " cod_jcom, " +
// " descrizione_art, " +
// " unt_mis, " +
// " num_collo_rif, " +
// " data_collo_rif, " +
// " ser_collo_rif, " +
// " gestione_rif, " +
// " segno, " +
// " num_ord, " +
// " data_ord, " +
// " gestione_ord, " +
// " riga_ord, " +
// " hr " +
// ") " +
// " " +
// "SELECT ul_list.* FROM max_ul " +
// "LEFT OUTER JOIN ul_list ON " +
// " ISNULL(max_ul.cod_jfas, '') = ISNULL(ul_list.cod_jfas, '') AND " +
// " ISNULL(max_ul.descrizione_fase, '') = ISNULL(ul_list.descrizione_fase, '') AND " +
// " ISNULL(max_ul.gestione, '') = ISNULL(ul_list.gestione, '') AND " +
// " ISNULL(max_ul.cod_mart, '') = ISNULL(ul_list.cod_mart, '') AND " +
// " ISNULL(max_ul.cod_col, '') = ISNULL(ul_list.cod_col, '') AND " +
// " ISNULL(max_ul.cod_tagl, '') = ISNULL(ul_list.cod_tagl, '') AND " +
// " ISNULL(max_ul.ser_collo, '') = ISNULL(ul_list.ser_collo, '') AND " +
// " ISNULL(max_ul.partita_mag, '') = ISNULL(ul_list.partita_mag, '') AND " +
// " ISNULL(max_ul.cod_jcom, '') = ISNULL(ul_list.cod_jcom, '') AND " +
// " ISNULL(max_ul.descrizione_art, '') = ISNULL(ul_list.descrizione_art, '') AND " +
// " ISNULL(max_ul.unt_mis, '') = ISNULL(ul_list.unt_mis, '') AND " +
// " ISNULL(max_ul.num_collo_rif, '') = ISNULL(ul_list.num_collo_rif, '') AND " +
// " ISNULL(max_ul.data_collo_rif, '') = ISNULL(ul_list.data_collo_rif, '') AND " +
// " ISNULL(max_ul.ser_collo_rif, '') = ISNULL(ul_list.ser_collo_rif, '') AND " +
// " ISNULL(max_ul.gestione_rif, '') = ISNULL(ul_list.gestione_rif, '') AND " +
// " ISNULL(max_ul.segno, '') = ISNULL(ul_list.segno, '') AND " +
// " ISNULL(max_ul.num_ord, '') = ISNULL(ul_list.num_ord, '') AND " +
// " ISNULL(max_ul.data_ord, '') = ISNULL(ul_list.data_ord, '') AND " +
// " ISNULL(max_ul.gestione_ord, '') = ISNULL(ul_list.gestione_ord, '') AND " +
// " ISNULL(max_ul.riga_ord, '') = ISNULL(ul_list.riga_ord, '') AND " +
// " ISNULL(max_ul.hr, '') = ISNULL(ul_list.hr, '') AND " +
// " max_ul.max_datetime_row = ul_list.datetime_row";
//
// Type typeOfObjectsList = new TypeToken<ArrayList<HistoryVersamentoProdULRestDTO>>() {
// }.getType();
// this.mSystemRESTConsumer.<ArrayList<HistoryVersamentoProdULRestDTO>>processSql(sql, typeOfObjectsList, ulList -> {
//
// if (ulList == null) {
// onComplete.run(null);
// return;
// }
//
// List<HistoryVersamentoProdULDTO> newUlList = new ArrayList<>();
//
// Stream.of(ulList)
// .distinctBy(x -> {
// HashMap<String, Object> hashMap = new HashMap<>();
// hashMap.put("gestione", x.getGestione());
// hashMap.put("data_collo", x.getDataCollo());
// hashMap.put("ser_collo", x.getSerCollo());
// hashMap.put("num_collo", x.getNumCollo());
// hashMap.put("cod_mart", x.getCodMart());
// hashMap.put("gestione_rif", x.getGestioneRif());
// hashMap.put("data_collo_rif", x.getDataColloRif());
// hashMap.put("ser_collo_rif", x.getSerColloRif());
// hashMap.put("num_collo_rif", x.getNumColloRif());
//
// return hashMap;
// })
// .forEach(restDTO -> {
//
// List<HistoryVersamentoProdULDTO.OrdineDto> ordineList = ulList.stream()
// .filter(x -> x.getNumCollo().equals(restDTO.getNumCollo()) &&
// x.getDataCollo().equals(restDTO.getDataCollo()) &&
// x.getSerCollo().equals(restDTO.getSerCollo()) &&
// x.getGestione().equals(restDTO.getGestione()) &&
// (x.getRigaOrd() == null || Objects.equals(x.getRigaOrd(), restDTO.getRigaOrd())))
// .map(x -> new HistoryVersamentoProdULDTO.OrdineDto()
// .setData(x.getDataOrd())
// .setNumero(x.getNumOrd())
// .setGestione(x.getGestione())
// .setRigaOrd(x.getRigaOrd())
// .setQtaCol(x.getQtaCol())
// .setNumCnf(x.getNumCnf())
// .setPercentageHr(x.getPercentageHr()))
// .collect(Collectors.toList());
//
//// BigDecimal qtaColTot = BigDecimal.ZERO;
//// BigDecimal numCnfColTot = BigDecimal.ZERO;
////
//// for (HistoryVersamentoProdULDTO.OrdineDto ordine :
//// ordineList) {
//// qtaColTot = qtaColTot.add(ordine.getQtaCol());
//// numCnfColTot = numCnfColTot.add(ordine.getNumCnf());
//// }
//
// newUlList.add(new HistoryVersamentoProdULDTO()
// .setGestione(restDTO.getGestione())
// .setDataCollo(restDTO.getDataCollo())
// .setSerCollo(restDTO.getSerCollo())
// .setNumCollo(restDTO.getNumCollo())
// .setSegno(restDTO.getSegno())
// .setCodMart(restDTO.getCodMart())
// .setCodCol(restDTO.getCodCol())
// .setCodTagl(restDTO.getCodTagl())
// .setCodJfas(restDTO.getCodJfas())
// .setDescrizioneArt(restDTO.getDescrizioneArt())
// .setDescrizioneFase(restDTO.getDescrizioneFase())
// .setQtaCol(restDTO.getQtaCol())
// .setQtaCnf(restDTO.getQtaCnf())
// .setNumCnf(restDTO.getNumCnf())
// .setPartitaMag(restDTO.getPartitaMag())
// .setCodJcom(restDTO.getCodJcom())
// .setDatetimeRow(restDTO.getDatetimeRow())
// .setUntMis(restDTO.getUntMis())
// .setGestioneRif(restDTO.getGestioneRif())
// .setDataColloRif(restDTO.getDataColloRif())
// .setSerColloRif(restDTO.getSerColloRif())
// .setNumColloRif(restDTO.getNumColloRif())
// .setOrdini(ordineList));
//
// });
//
//
// if (!newUlList.isEmpty()) {
// List<String> codMarts = Stream.of(newUlList)
// .map(HistoryVersamentoProdULDTO::getCodMart)
// .withoutNulls()
// .distinct()
// .toList();
//
// this.mArticoloRESTConsumer.getByCodMarts(codMarts, arts -> {
//
// if (arts != null && !arts.isEmpty()) {
// for (HistoryVersamentoProdULDTO value : newUlList) {
//
// MtbAart foundMtbAart = null;
//
// List<MtbAart> mtbAartStream = Stream.of(arts)
// .filter(x -> x.getCodMart().equalsIgnoreCase(value.getCodMart())).toList();
//
// if (mtbAartStream != null && !mtbAartStream.isEmpty()) {
// foundMtbAart = mtbAartStream.get(0);
// }
//
// value.setMtbAart(foundMtbAart);
// }
newUlList.add(new HistoryVersamentoProdULDTO()
.setGestione(restDTO.getGestione())
.setDataCollo(restDTO.getDataCollo())
.setSerCollo(restDTO.getSerCollo())
.setNumCollo(restDTO.getNumCollo())
.setSegno(restDTO.getSegno())
.setCodMart(restDTO.getCodMart())
.setCodCol(restDTO.getCodCol())
.setCodTagl(restDTO.getCodTagl())
.setCodJfas(restDTO.getCodJfas())
.setDescrizioneArt(restDTO.getDescrizioneArt())
.setDescrizioneFase(restDTO.getDescrizioneFase())
.setQtaCol(restDTO.getQtaCol())
.setQtaCnf(restDTO.getQtaCnf())
.setNumCnf(restDTO.getNumCnf())
.setPartitaMag(restDTO.getPartitaMag())
.setCodJcom(restDTO.getCodJcom())
.setDatetimeRow(restDTO.getDatetimeRow())
.setUntMis(restDTO.getUntMis())
.setGestioneRif(restDTO.getGestioneRif())
.setDataColloRif(restDTO.getDataColloRif())
.setSerColloRif(restDTO.getSerColloRif())
.setNumColloRif(restDTO.getNumColloRif())
.setOrdini(ordineList));
});
if (!newUlList.isEmpty()) {
List<String> codMarts = Stream.of(newUlList)
.map(HistoryVersamentoProdULDTO::getCodMart)
.withoutNulls()
.distinct()
.toList();
this.mArticoloRESTConsumer.getByCodMarts(codMarts, arts -> {
if (arts != null && !arts.isEmpty()) {
for (HistoryVersamentoProdULDTO value : newUlList) {
MtbAart foundMtbAart = null;
List<MtbAart> mtbAartStream = Stream.of(arts)
.filter(x -> x.getCodMart().equalsIgnoreCase(value.getCodMart())).toList();
if (mtbAartStream != null && !mtbAartStream.isEmpty()) {
foundMtbAart = mtbAartStream.get(0);
}
value.setMtbAart(foundMtbAart);
}
}
onComplete.run(newUlList);
}, onFailed);
} else {
onComplete.run(newUlList);
}
}, onFailed);
}
// }
//
// onComplete.run(newUlList);
//
// }, onFailed);
//
// } else {
// onComplete.run(newUlList);
// }
//
// }, onFailed);
// }
}

View File

@@ -40,14 +40,17 @@ import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.databinding.FragmentProdRientroMerceOrderDetailBinding;
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
import it.integry.integrywmsnative.gest.settings.MainSettingsFragment;
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
import it.integry.integrywmsnative.view.dialogs.ask_should_versamento_automatico_ul.DialogAskShouldVersamentoAutomaticoULView;
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdDTO;
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdView;
import it.integry.integrywmsnative.view.dialogs.printSsccUl.DialogPrintUlSSCCView;
import it.integry.integrywmsnative.view.dialogs.versamento_automatico_ul_done.DialogVersamentoAutomaticoULDoneView;
/**
* A simple {@link Fragment} subclass.
@@ -268,6 +271,19 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
}
@Override
public void onVersamentoAutomaticoULRequest(RunnableArgs<Boolean> onComplete) {
DialogAskShouldVersamentoAutomaticoULView.newInstance(onComplete).show(requireActivity().getSupportFragmentManager(), "tag");
}
@Override
public void onULVersata(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete) {
handler.post(() -> {
DialogVersamentoAutomaticoULDoneView.newInstance(versamentoAutomaticoULResponseDTO, onComplete).show(requireActivity().getSupportFragmentManager(), "tag");
});
}
public void addULButtonClick() {
this.onLoadingStarted();
@@ -355,7 +371,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
public void deleteMtbColr(MtbColr mtbColr) {
MtbColt mtbColt = new MtbColt()
.setGestione(mtbColr.getGestione())
.setDataCollo(mtbColr.getDataColloS())
.setDataCollo(mtbColr.getDataColloLD())
.setSerCollo(mtbColr.getSerCollo())
.setNumCollo(mtbColr.getNumCollo());

View File

@@ -25,6 +25,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsume
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ProduzioneRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
import it.integry.integrywmsnative.core.rest.model.produzione.CaricoProdFinDTO;
import it.integry.integrywmsnative.core.rest.model.produzione.CaricoProdFinProdottoDTO;
import it.integry.integrywmsnative.core.settings.SettingsManager;
@@ -173,13 +174,39 @@ public class ProdRientroMerceOrderDetailViewModel {
}, this::sendError);
} else {
synchronized (this.mtbColtsOfOrder) {
this.sendOnLoadingEnded();
this.mListener.onDataSaved(mtbColtSaved);
Runnable onVersamentoCompleted = () -> {
this.sendOnLoadingEnded();
this.mListener.onDataSaved(mtbColtSaved);
};
if (SettingsManager.iDB().isFlagProduzioneSkipAskVersamentoAutomatico()) {
versaAutomaticamenteUL(mtbColtSaved, onVersamentoCompleted);
} else {
sendVersamentoAutomaticoULRequest(response -> {
if (response) {
versaAutomaticamenteUL(mtbColtSaved, onVersamentoCompleted);
} else {
onVersamentoCompleted.run();
}
});
}
}
}
}, this::sendError);
}
private void versaAutomaticamenteUL(MtbColt mtbColt, Runnable onComplete) {
if (mtbColt == null) return;
colliMagazzinoRESTConsumer.versamentoAutomaticoUL(mtbColt, versamentoResult -> {
this.notifyVersamentoAutomaticoResult(versamentoResult, onComplete);
}, this::sendError);
}
private void notifyVersamentoAutomaticoResult(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete) {
if (this.mListener != null)
mListener.onULVersata(versamentoAutomaticoULResponseDTO, onComplete);
}
public void deleteLU(MtbColt mtbColt) {
this.sendOnLoadingStarted();
@@ -251,11 +278,17 @@ public class ProdRientroMerceOrderDetailViewModel {
this::sendError);
}
private void sendVersamentoAutomaticoULRequest(RunnableArgs<Boolean> onComplete) {
if (this.mListener != null) this.mListener.onVersamentoAutomaticoULRequest(onComplete);
}
public interface Listener extends ILoadingListener {
void onVersamentoAutomaticoULRequest(RunnableArgs<Boolean> onComplete);
void onDataSaved(MtbColt mtbColt);
void onError(Exception ex);
void onULVersata(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete);
}
}

View File

@@ -68,7 +68,7 @@ public class ProdRientroMerceOrderDetailRESTConsumer extends _BaseRESTConsumer {
mtbColrList) {
HashMap<String, Object> parm = new HashMap<>();
parm.put("data_collo", mtbcolr.getDataColloD());
parm.put("data_collo", mtbcolr.getDataColloLD());
parm.put("gestione", mtbcolr.getGestione());
parm.put("ser_collo", mtbcolr.getSerCollo());
parm.put("num_collo", mtbcolr.getNumCollo());
@@ -90,7 +90,7 @@ public class ProdRientroMerceOrderDetailRESTConsumer extends _BaseRESTConsumer {
ObservableArrayList<MtbColr> mtbColrsRoAdd = new ObservableArrayList<>();
mtbColrsRoAdd.addAll(Stream.of(mtbColrList)
.filter(x -> x.getNumCollo().equals(mtbColt.getNumCollo()) &&
x.getDataColloD().compareTo(mtbColt.getDataColloD()) == 0 &&
x.getDataColloLD().isEqual(mtbColt.getDataColloLD()) &&
x.getGestione().equals(mtbColt.getGestione()) &&
x.getSerCollo().equals(mtbColt.getSerCollo()))
.toList());

View File

@@ -21,7 +21,7 @@ public class ProdRientroMerceOrderListFilterViewModel {
public void init(List<OrdineLavorazioneDTO> initialList) {
this.initialOrderList = initialList;
this.currentFilteredOrderList.setValue(this.initialOrderList);
this.currentFilteredOrderList.postValue(this.initialOrderList);
}
public MutableLiveData<List<OrdineLavorazioneDTO>> getMutableFilteredOrderList() {

View File

@@ -252,7 +252,13 @@ public class VerificaGiacenzeFragment extends BaseFragment implements ITitledFra
@Override
public void onItemDeleteRequest(VerificaGiacenzeRowEntity data) {
mViewModel.deleteRow(data);
executorService.execute(() -> {
try {
mViewModel.deleteRow(data);
} catch (Exception ex) {
onError(ex);
}
});
}
@@ -317,12 +323,12 @@ public class VerificaGiacenzeFragment extends BaseFragment implements ITitledFra
return result.get();
}
public void saveAndClose() {
public void Close() {
this.onLoadingStarted();
executorService.execute(() -> {
try {
mViewModel.save();
mViewModel.close();
this.onLoadingEnded();
popMe();

View File

@@ -8,7 +8,7 @@ import dagger.Module;
import dagger.Provides;
import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGiacenzeRepository;
import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGiacenzeRowRepository;
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeMapper;
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeRowMapper;
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaPvRESTConsumer;
@@ -16,8 +16,8 @@ import it.integry.integrywmsnative.core.rest.consumers.GiacenzaPvRESTConsumer;
public class VerificaGiacenzeModule {
@Provides
VerificaGiacenzeViewModel providesVerificaGiacenzeViewModel(ExecutorService executorService, Handler handler, VerificaGiacenzeMapper verificaGiacenzeMapper, VerificaGiacenzeRepository verificaGiacenzeRepository, VerificaGiacenzeRowRepository verificaGiacenzeRowRepository, GiacenzaPvRESTConsumer giacenzaPvRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
return new VerificaGiacenzeViewModel(executorService, handler, verificaGiacenzeMapper, giacenzaPvRESTConsumer, verificaGiacenzeRepository, verificaGiacenzeRowRepository, articoloRESTConsumer);
VerificaGiacenzeViewModel providesVerificaGiacenzeViewModel(ExecutorService executorService, Handler handler, VerificaGiacenzeRowMapper verificaGiacenzeRowMapper, VerificaGiacenzeRepository verificaGiacenzeRepository, VerificaGiacenzeRowRepository verificaGiacenzeRowRepository, GiacenzaPvRESTConsumer giacenzaPvRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
return new VerificaGiacenzeViewModel(executorService, handler, verificaGiacenzeRowMapper, giacenzaPvRESTConsumer, verificaGiacenzeRepository, verificaGiacenzeRowRepository, articoloRESTConsumer);
}
}

View File

@@ -11,7 +11,6 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ExecutorService;
import java.util.stream.Collectors;
@@ -23,14 +22,18 @@ import it.integry.integrywmsnative.core.data_store.db.entity.VerificaGiacenzeRow
import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGiacenzeRepository;
import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGiacenzeRowRepository;
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeMapper;
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeRowMapper;
import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.model.MtbAartBarCode;
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaPvRESTConsumer;
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
import it.integry.integrywmsnative.core.rest.model.pv.CloseVerificaRequestDTO;
import it.integry.integrywmsnative.core.rest.model.pv.DeleteRowVerificaRequestDTO;
import it.integry.integrywmsnative.core.rest.model.pv.GiacenzaPvDTO;
import it.integry.integrywmsnative.core.rest.model.pv.SaveNewVerificaRequestDTO;
import it.integry.integrywmsnative.core.rest.model.pv.SaveNewRowVerificaRequestDTO;
import it.integry.integrywmsnative.core.rest.model.pv.UpdateRowVerificaRequestDTO;
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
@@ -39,7 +42,7 @@ public class VerificaGiacenzeViewModel {
private final ExecutorService executorService;
private final Handler handler;
private final VerificaGiacenzeMapper verificaGiacenzeMapper;
private final VerificaGiacenzeRowMapper verificaGiacenzeRowMapper;
private final GiacenzaPvRESTConsumer giacenzaPvRESTConsumer;
private final VerificaGiacenzeRepository verificaGiacenzeRepository;
private final VerificaGiacenzeRowRepository verificaGiacenzeRowRepository;
@@ -56,14 +59,14 @@ public class VerificaGiacenzeViewModel {
@Inject
public VerificaGiacenzeViewModel(ExecutorService executorService,
Handler handler,
VerificaGiacenzeMapper verificaGiacenzeMapper,
VerificaGiacenzeRowMapper verificaGiacenzeRowMapper,
GiacenzaPvRESTConsumer giacenzaPvRESTConsumer,
VerificaGiacenzeRepository verificaGiacenzeRepository,
VerificaGiacenzeRowRepository verificaGiacenzeRowRepository,
ArticoloRESTConsumer articoloRESTConsumer) {
this.executorService = executorService;
this.handler = handler;
this.verificaGiacenzeMapper = verificaGiacenzeMapper;
this.verificaGiacenzeRowMapper = verificaGiacenzeRowMapper;
this.giacenzaPvRESTConsumer = giacenzaPvRESTConsumer;
this.verificaGiacenzeRepository = verificaGiacenzeRepository;
this.verificaGiacenzeRowRepository = verificaGiacenzeRowRepository;
@@ -168,19 +171,17 @@ public class VerificaGiacenzeViewModel {
return entity;
}
public void save() throws Exception {
public void close() throws Exception {
if (currentVerificaRows.getValue().isEmpty()) {
delete();
return;
}
currentVerifica.getValue().setVerificaGiacenzeRowList(currentVerificaRows.getValue());
CloseVerificaRequestDTO request = new CloseVerificaRequestDTO()
.setCodMdep(Objects.requireNonNull(currentVerifica.getValue()).getCodMdep())
.setDataVerifica(Objects.requireNonNull(currentVerifica.getValue()).getData());
SaveNewVerificaRequestDTO saveRequest = new SaveNewVerificaRequestDTO()
.setData(verificaGiacenzeMapper.mapRoomToRest(currentVerifica.getValue()));
giacenzaPvRESTConsumer.saveNewVerificaSynchronized(saveRequest);
giacenzaPvRESTConsumer.closeVerifica(request);
delete();
}
@@ -300,6 +301,19 @@ public class VerificaGiacenzeViewModel {
}
public void insertRow(VerificaGiacenzeRowEntity rowEntity) {
this.sendOnLoadingStarted();
var saveRequest = new SaveNewRowVerificaRequestDTO()
.setCodMdep(Objects.requireNonNull(currentVerifica.getValue()).getCodMdep())
.setDataVerifica(Objects.requireNonNull(currentVerifica.getValue()).getData())
.setRow(verificaGiacenzeRowMapper.mapRoomToRest(rowEntity));
try {
giacenzaPvRESTConsumer.saveNewRowSynchronized(saveRequest);
} catch (Exception e) {
this.sendError(e);
}
verificaGiacenzeRowRepository.insert(rowEntity, insertedData -> {
handler.post(() -> {
currentVerificaRows.getValue().add(insertedData);
@@ -309,6 +323,19 @@ public class VerificaGiacenzeViewModel {
}
public void updateRow(VerificaGiacenzeRowEntity rowEntity) {
this.sendOnLoadingStarted();
var updateRequest = new UpdateRowVerificaRequestDTO()
.setCodMdep(Objects.requireNonNull(currentVerifica.getValue()).getCodMdep())
.setDataVerifica(Objects.requireNonNull(currentVerifica.getValue()).getData())
.setRow(verificaGiacenzeRowMapper.mapRoomToRest(rowEntity));
try {
giacenzaPvRESTConsumer.updateRowSynchronized(updateRequest);
} catch (Exception e) {
this.sendError(e);
}
var indexInList = -1;
List<VerificaGiacenzeRowEntity> value = currentVerificaRows.getValue();
@@ -331,6 +358,19 @@ public class VerificaGiacenzeViewModel {
}
public void deleteRow(VerificaGiacenzeRowEntity rowEntity) {
this.sendOnLoadingStarted();
var deleteRequest = new DeleteRowVerificaRequestDTO()
.setCodMdep(Objects.requireNonNull(currentVerifica.getValue()).getCodMdep())
.setDataVerifica(Objects.requireNonNull(currentVerifica.getValue()).getData())
.setRow(verificaGiacenzeRowMapper.mapRoomToRest(rowEntity));
try {
giacenzaPvRESTConsumer.deleteRowSynchronized(deleteRequest);
} catch (Exception e) {
this.sendError(e);
}
verificaGiacenzeRowRepository.delete(rowEntity, () -> {
handler.post(() -> {
@@ -343,6 +383,7 @@ public class VerificaGiacenzeViewModel {
private void notifyRowChanged() {
currentVerificaRows.postValue(currentVerificaRows.getValue());
this.sendOnLoadingEnded();
}
private PickedQuantityDTO sendOnItemDispatched(MtbAart mtbAart,
@@ -373,7 +414,15 @@ public class VerificaGiacenzeViewModel {
this.listener.onError(ex);
}
public interface Listener {
private void sendOnLoadingStarted() {
if (this.listener != null) listener.onLoadingStarted();
}
private void sendOnLoadingEnded() {
if (this.listener != null) listener.onLoadingEnded();
}
public interface Listener extends ILoadingListener {
PickedQuantityDTO onItemDispatched(MtbAart mtbAart,
BigDecimal initialNumCnf,
BigDecimal initialQtaCnf,

View File

@@ -366,7 +366,7 @@ public class RettificaGiacenzeViewModel {
mtbColr
.setQtaCol(BigDecimal.ZERO)
.setNumCnf(BigDecimal.ZERO)
.setDataCollo(mCurrentMtbColt.getDataColloS())
.setDataCollo(mCurrentMtbColt.getDataColloLD())
.setNumCollo(mCurrentMtbColt.getNumCollo())
.setGestione(mCurrentMtbColt.getGestione())
.setSerCollo(mCurrentMtbColt.getSerCollo());

View File

@@ -19,6 +19,8 @@ import androidx.sqlite.db.SimpleSQLiteQuery;
import com.annimon.stream.Stream;
import com.google.android.material.snackbar.Snackbar;
import com.google.firebase.crashlytics.CustomKeysAndValues;
import com.google.firebase.crashlytics.FirebaseCrashlytics;
import com.harrysoft.androidbluetoothserial.BluetoothManager;
import java.io.BufferedReader;
@@ -31,7 +33,9 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
import javax.inject.Inject;
@@ -256,78 +260,110 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
private void exportLog() {
var handler = new Handler(Looper.getMainLooper());
DialogYesNoView.newInstance("Esportazione log", "Vuoi inviare il log degli eventi al supporto?", result -> {
if (result == DialogConsts.Results.NO || result == DialogConsts.Results.ABORT)
return;
executorService.execute(() -> {
this.openProgress();
if(!askConfirmToExportLog()) {
return;
}
executorService.execute(() -> {
this.openProgress();
File logFilePath = appContext.getLogFilePath();
var files = logFilePath.listFiles();
File logFilePath = appContext.getLogFilePath();
var files = logFilePath.listFiles(File::isFile);
var fileToShare = Arrays.stream(files)
.sorted(Comparator.reverseOrder())
.findFirst()
.orElse(null);
try {
List<MailAttachmentDTO> attachmentDTOList = new ArrayList<>();
var fileToShare = Arrays.stream(files)
.sorted(Comparator.reverseOrder())
.findFirst()
.orElse(null);
try {
List<MailAttachmentDTO> attachmentDTOList = new ArrayList<>();
if (fileToShare != null) {
var htmlContent = createAppLogAttachment(fileToShare);
if (fileToShare != null) {
try {
var htmlContent = createAppLogAttachment(fileToShare);
byte[] buffer = htmlContent.getBytes();//specify the size to allow.
String base64 = Base64.encodeToString(buffer, Base64.NO_WRAP);
byte[] buffer = htmlContent.getBytes();//specify the size to allow.
String base64 = Base64.encodeToString(buffer, Base64.NO_WRAP);
var logAttachment = new MailAttachmentDTO()
.setFileName("wms_log.html")
.setFileb64Content(base64);
attachmentDTOList.add(logAttachment);
}
var logAttachment = new MailAttachmentDTO()
.setFileName("wms_log.html")
.setFileb64Content(base64);
attachmentDTOList.add(logAttachment);
} catch (Exception ex) {
String rawLogFile = getRawLogAttachment(fileToShare);
byte[] buffer = rawLogFile.getBytes();//specify the size to allow.
String base64 = Base64.encodeToString(buffer, Base64.NO_WRAP);
var logAttachment = new MailAttachmentDTO()
.setFileName("raw_log.txt")
.setFileb64Content(base64);
attachmentDTOList.add(logAttachment);
}
}
rawDao.vacuumDb(new SimpleSQLiteQuery("pragma wal_checkpoint(full)"));
File[] dbFiles = new File[3];
dbFiles[0] = requireContext().getDatabasePath("integry_wms");
dbFiles[1] = requireContext().getDatabasePath("integry_wms-shm");
dbFiles[2] = requireContext().getDatabasePath("integry_wms-wal");
rawDao.vacuumDb(new SimpleSQLiteQuery("pragma wal_checkpoint(full)"));
rawDao.vacuumDb(new SimpleSQLiteQuery("VACUUM;"));
File[] dbFiles = new File[3];
dbFiles[0] = requireContext().getDatabasePath("integry_wms");
dbFiles[1] = requireContext().getDatabasePath("integry_wms-shm");
dbFiles[2] = requireContext().getDatabasePath("integry_wms-wal");
for (int i = 0; i < dbFiles.length; i++) {
byte[] dbFileBytes = new byte[(int) dbFiles[i].length()];
FileInputStream inputStream = new FileInputStream(dbFiles[i]);
final int read = inputStream.read(dbFileBytes);
inputStream.close();
for (int i = 0; i < dbFiles.length; i++) {
byte[] dbFileBytes = new byte[(int) dbFiles[i].length()];
FileInputStream inputStream = new FileInputStream(dbFiles[i]);
final int read = inputStream.read(dbFileBytes);
inputStream.close();
var dbAttachment = new MailAttachmentDTO()
.setFileName(dbFiles[i].getName())
.setFileb64Content(Base64.encodeToString(dbFileBytes, Base64.NO_WRAP));
attachmentDTOList.add(dbAttachment);
}
var dbAttachment = new MailAttachmentDTO()
.setFileName(dbFiles[i].getName())
.setFileb64Content(Base64.encodeToString(dbFileBytes, Base64.NO_WRAP));
attachmentDTOList.add(dbAttachment);
}
var mailRequest = new MailRequestDTO()
.setTo("developer@integry.it")
.setMsgText("Questa è una mail contenente il log del WMS")
.setSubject("Internal WMS log")
.setAttachments(attachmentDTOList);
var mailRequest = new MailRequestDTO()
.setTo("developer@integry.it")
.setMsgText("Questa è una mail contenente il log del WMS")
.setSubject("Internal WMS log")
.setAttachments(attachmentDTOList);
systemRESTConsumer.sendMailSynchronized(mailRequest);
systemRESTConsumer.sendMailSynchronized(mailRequest);
this.closeProgress();
} catch (Exception ex) {
handler.post(() -> {
this.closeProgress();
UtilityExceptions.defaultException(requireContext(), ex);
});
}
});
})
.show(getParentFragmentManager(), "tag");
this.closeProgress();
} catch (Exception ex) {
handler.post(() -> {
FirebaseCrashlytics.getInstance().recordException(ex, new CustomKeysAndValues.Builder() {{
putString("ExportLog", "Error while exporting log");
}}.build());
this.closeProgress();
UtilityExceptions.defaultException(requireContext(), ex);
});
}
});
}
private boolean askConfirmToExportLog() {
CountDownLatch countDownLatch = new CountDownLatch(1);
AtomicBoolean userConfirmed = new AtomicBoolean(false);
DialogYesNoView.newInstance("Esportazione log", "Vuoi inviare il log degli eventi al supporto?", result -> {
userConfirmed.set(result != DialogConsts.Results.NO && result != DialogConsts.Results.ABORT);
countDownLatch.countDown();
}).show(getParentFragmentManager(), "tag");
try {
countDownLatch.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
return userConfirmed.get();
}
private void openProgress() {
// executorService.execute(() -> {
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
@@ -437,4 +473,24 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
return htmlContent.toString();
}
private String getRawLogAttachment(File logFile) {
//Read text from file
StringBuilder text = new StringBuilder();
try {
BufferedReader br = new BufferedReader(new FileReader(logFile));
String line;
while ((line = br.readLine()) != null) {
text.append(line);
text.append('\n');
}
br.close();
} catch (IOException e) {
//You'll need to add proper error handling here
}
return text.toString();
}
}

View File

@@ -739,12 +739,12 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
public void addExtraItem() {
handler.post(() -> {
DialogScanArtView
.newInstance(!mEnableFakeGiacenza, (status, mtbAart, ean128Model, mtbColr) -> {
.newInstance(!mEnableFakeGiacenza, (status, mtbAart, ean128Model, mtbColt) -> {
if (status == DialogConsts.Results.YES) {
executorService.execute(() -> {
try {
this.mViewmodel.dispatchExtraItem(mtbAart, ean128Model, mtbColr);
this.mViewmodel.dispatchExtraItem(mtbAart, ean128Model, mtbColt);
} catch (Exception e) {
onError(e);
}
@@ -854,12 +854,10 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
public void closeOrder() {
this.fabPopupMenu.dismiss();
this.onLoadingStarted();
executorService.execute(() -> {
try {
this.mViewmodel.closeOrder();
this.onLoadingEnded();
} catch (Exception e) {
onError(e);
}

View File

@@ -341,14 +341,6 @@ public class SpedizioneViewModel {
return mIsOrdTrasf;
}
private void onOrderClosedPrintingDone() {
if (this.mIsOrdTrasf && !UtilityString.isNullOrEmpty(SettingsManager.iDB().getCodDtipOrdTrasfV())) {
this.sendCreateDocsRequest();
} else {
this.sendOnOrderClosed();
}
}
private void sendOnLoadingStarted() {
if (this.mListener != null) mListener.onLoadingStarted();
@@ -868,7 +860,7 @@ public class SpedizioneViewModel {
if (pickingObjectDTO.getMtbColts().stream()
.anyMatch(x ->
Objects.equals(x.getNumCollo(), scannedUL.getNumCollo()) &&
x.getDataColloS().equals(scannedUL.getDataColloS()) &&
x.getDataColloLD().isEqual(scannedUL.getDataColloLD()) &&
x.getSerCollo().equalsIgnoreCase(scannedUL.getSerCollo()) &&
(scannedUL.getGestioneEnum() == GestioneEnum.ACQUISTO || scannedUL.getGestioneEnum() == GestioneEnum.LAVORAZIONE))) {
@@ -882,7 +874,10 @@ public class SpedizioneViewModel {
for (PickingObjectDTO pickingObject : pickingList) {
//Da verificare se il controllo per partita deve essere sempre effettuato
if (UtilityString.equalsIgnoreCase(x.getCodMart(), pickingObject.getSitArtOrdDTO().getCodMart()) && UtilityString.equalsIgnoreCase(x.getCodTagl(), pickingObject.getSitArtOrdDTO().getCodTagl()) && UtilityString.equalsIgnoreCase(x.getCodCol(), pickingObject.getSitArtOrdDTO().getCodCol()) && (!mEnableCheckPartitaMag || UtilityString.equalsIgnoreCase(x.getPartitaMag(), pickingObject.getSitArtOrdDTO().getPartitaMag()) || UtilityString.isNullOrEmpty(pickingObject.getSitArtOrdDTO().getPartitaMag()))) {
if (UtilityString.equalsIgnoreCase(x.getCodMart(), pickingObject.getSitArtOrdDTO().getCodMart()) &&
UtilityString.equalsIgnoreCase(x.getCodTagl(), pickingObject.getSitArtOrdDTO().getCodTagl()) &&
UtilityString.equalsIgnoreCase(x.getCodCol(), pickingObject.getSitArtOrdDTO().getCodCol()) &&
(!mEnableCheckPartitaMag || UtilityString.equalsIgnoreCase(x.getPartitaMag(), pickingObject.getSitArtOrdDTO().getPartitaMag()) || UtilityString.isNullOrEmpty(pickingObject.getSitArtOrdDTO().getPartitaMag()))) {
if (!matchPickingObject.contains(pickingObject)) {
matchPickingObject.add(pickingObject);
@@ -1023,7 +1018,7 @@ public class SpedizioneViewModel {
if (availableBatchLots.stream().anyMatch(x -> x.getDataScad() == null)) {
tmp.addAll(availableBatchLots.stream()
.filter(x -> x.getDataScad() == null)
.sorted(Comparator.comparing(x -> UtilityString.isNull(x.getPartitaMag(), "")))
.sorted(Comparator.comparing(x -> x.getPartitaMag() == null ? "" : x.getPartitaMag()))
.collect(Collectors.toList()));
}
@@ -1232,7 +1227,7 @@ public class SpedizioneViewModel {
return !stati.isEmpty() ? stati.get(0) : null;
}
public void dispatchExtraItem(MtbAart mtbAart, Ean128Model ean128Model, MtbColr mtbColrToUse) throws Exception {
public void dispatchExtraItem(MtbAart mtbAart, Ean128Model ean128Model, MtbColt refMtbColt) throws Exception {
PickingObjectDTO pickingObjectDTO = new PickingObjectDTO().setMtbAart(mtbAart).setTempPickData(PickDataDTO.fromEan128(ean128Model));
@@ -1251,12 +1246,23 @@ public class SpedizioneViewModel {
String partitaMag = null;
LocalDate dataScad = null;
MtbColt refMtbColt = null;
// MtbColt refMtbColt = null;
if (mtbColrToUse != null) {
refMtbColt = new MtbColt().setDataCollo(mtbColrToUse.getDataColloD()).setSerCollo(mtbColrToUse.getSerCollo()).setNumCollo(mtbColrToUse.getNumCollo()).setGestione(mtbColrToUse.getGestione()).setMtbColr(new ObservableArrayList<>());
if (refMtbColt != null && refMtbColt.getMtbColr() != null && !refMtbColt.getMtbColr().isEmpty()) {
MtbColr mtbColrToUse = refMtbColt.getMtbColr().get(0);
refMtbColt.getMtbColr().add(mtbColrToUse);
//Se il collo di riferimento non ha righe, lo creo al volo
// refMtbColt = new MtbColt()
// .setDataCollo(mtbColrToUse.getDataColloD())
// .setSerCollo(mtbColrToUse.getSerCollo())
// .setNumCollo(mtbColrToUse.getNumCollo())
// .setGestione(mtbColrToUse.getGestione())
//// .setCodMdep(mtbColrToUse.getCodMdepIn())
//// .setPosizione(mtbColrToUse.getPosizioneIn())
//// .setBarcodeUl(mtbColrToUse.getBarcodeUlIn())
// .setMtbColr(new ObservableArrayList<>());
//
// refMtbColt.getMtbColr().add(mtbColrToUse);
pickingObjectDTO.setMtbAart(mtbColrToUse.getMtbAart()).setTempPickData(new PickDataDTO().setSourceMtbColt(refMtbColt));
@@ -1464,7 +1470,7 @@ public class SpedizioneViewModel {
private MtbColt loadRifULFromMtbColr(MtbColr mtbColr) throws Exception {
//Se ho dei riferimenti ad una UL devo leggere la QTA ancora disponibile sulla Ul
if (mtbColr != null && !UtilityString.isNullOrEmpty(mtbColr.getGestioneRif()) && !UtilityString.isNullOrEmpty(mtbColr.getSerColloRif()) && !UtilityString.isNullOrEmpty(mtbColr.getDataColloRifS()) && mtbColr.getNumColloRif() != null) {
return mColliMagazzinoRESTConsumer.getByChiaveColloSynchronized(mtbColr.getGestioneRifEnum(), mtbColr.getNumColloRif(), mtbColr.getDataColloRifS(), mtbColr.getSerColloRif(), true, false);
return mColliMagazzinoRESTConsumer.getByChiaveColloSynchronized(mtbColr.getGestioneRifEnum(), mtbColr.getNumColloRif(), mtbColr.getDataColloRifLD(), mtbColr.getSerColloRif(), true, false);
}
return null;
}
@@ -1529,9 +1535,6 @@ public class SpedizioneViewModel {
.setMtbAart(null);
}
var clonedTargetMtbColt = (MtbColt) mCurrentMtbColt.clone();
clonedTargetMtbColt.setMtbColr(null);
var insertUDSRowRequestDto = new InsertUDSRowRequestDTO()
.setSourceMtbColr(clonedSourceMtbColr)
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
@@ -1539,7 +1542,7 @@ public class SpedizioneViewModel {
.setQtaCnf(qtaCnf)
.setNumCnf(numCnf)
.setPartitaMag(partitaMag)
.setTargetMtbColt(clonedTargetMtbColt);
.setTargetMtbColt(mCurrentMtbColt.clone(false));
if (dataScad != null)
insertUDSRowRequestDto
@@ -1554,6 +1557,7 @@ public class SpedizioneViewModel {
createdMtbColr = this.mColliScaricoRESTConsumer.insertUDSRowSynchronized(insertUDSRowRequestDto);
} catch (Exception ex) {
this.sendError(ex);
return;
}
pickingObjectDTO.getWithdrawMtbColrs().add(createdMtbColr);
@@ -1580,7 +1584,7 @@ public class SpedizioneViewModel {
}
refMtbColr.setNumCollo(refMtbColt.getNumCollo())
.setDataCollo(refMtbColt.getDataColloS())
.setDataCollo(refMtbColt.getDataColloLD())
.setSerCollo(refMtbColt.getSerCollo())
.setGestione(refMtbColt.getGestione());
}
@@ -2020,7 +2024,7 @@ public class SpedizioneViewModel {
cloneMtbColr.setRiga(null)
.setNumCollo(null)
.setGestione((String) null)
.setDataCollo((String) null)
.setDataCollo((LocalDate) null)
.setSerCollo(null)
.setCausale(MtbColr.Causale.VERSAMENTO);
@@ -2079,7 +2083,7 @@ public class SpedizioneViewModel {
Optional<MtbColr> optionalMtbColrReference = pickingObjectDTO.getMtbColts().stream()
.filter(y -> withdrawMtbColr.getRefMtbColr() != null &&
withdrawMtbColr.getRefMtbColr().getNumCollo().equals(y.getNumCollo()) &&
withdrawMtbColr.getRefMtbColr().getDataColloD().equals(y.getDataColloD()) &&
withdrawMtbColr.getRefMtbColr().getDataColloLD().isEqual(y.getDataColloLD()) &&
withdrawMtbColr.getRefMtbColr().getSerCollo().equals(y.getSerCollo()) &&
withdrawMtbColr.getRefMtbColr().getGestioneEnum().equals(y.getGestioneEnum()) &&
UtilityString.equalsIgnoreCase(withdrawMtbColr.getRefMtbColr().getCodMart(), y.getMtbColr() != null && !y.getMtbColr().isEmpty() ? y.getMtbColr().get(0).getCodMart() : null) &&
@@ -2123,15 +2127,21 @@ public class SpedizioneViewModel {
}
public void closeOrder() {
if (SettingsManager.iDB().isFlagPrintEtichetteOnOrderClose() || SettingsManager.iDB().isFlagPrintPackingListOnOrderClose()) {
var printRequestResult = this.sendOnCloseOrderPrintRequest();
this.onCloseOrderPrintRequest(printRequestResult);
this.sendOnLoadingStarted();
this.onCloseOrderPrintRequested(printRequestResult);
this.sendOnLoadingEnded();
}
this.onOrderClosedPrintingDone();
if (this.mIsOrdTrasf && !UtilityString.isNullOrEmpty(SettingsManager.iDB().getCodDtipOrdTrasfV())) {
this.sendCreateDocsRequest();
}
}
private void onCloseOrderPrintRequest(PrintOrderCloseDTO dto) {
private void onCloseOrderPrintRequested(PrintOrderCloseDTO dto) {
if (!dto.isFlagPrintPackingList() && !dto.isFlagPrintSSCC()) {
return;
}
@@ -2147,13 +2157,22 @@ public class SpedizioneViewModel {
dto.setPrintList(closedOrders);
CountDownLatch latch = new CountDownLatch(1);
try {
printClosedOrders(dto);
latch.countDown();
} catch (Exception e) {
this.sendLUPrintError(e, () -> {
latch.countDown();
});
}
try {
latch.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
private void printClosedOrders(PrintOrderCloseDTO dto) throws Exception {
@@ -2196,6 +2215,7 @@ public class SpedizioneViewModel {
void createDocs() {
executorService.execute(() -> {
this.sendOnLoadingStarted();
List<MtbColt> registeredUds = null;
try {
@@ -2232,7 +2252,12 @@ public class SpedizioneViewModel {
loadCollidto.setSaveDoc(true);
loadCollidto.setGestione("L");
this.mDocumentRESTConsumer.createDocFromColli(loadCollidto, doc -> this.sendOnOrderClosed(), this::sendError);
try {
this.mDocumentRESTConsumer.makeSynchronousCreateDocFromColliRequest(loadCollidto);
} catch (Exception e) {
sendError(e);
}
this.sendOnLoadingEnded();
});
}

View File

@@ -30,6 +30,7 @@ import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
import it.integry.integrywmsnative.core.utility.UtilityNumber;
import it.integry.integrywmsnative.core.utility.UtilityResources;
import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.databinding.SpedizioneMainListGroupHeaderBinding;
import it.integry.integrywmsnative.databinding.SpedizioneMainListGroupItemBinding;
@@ -123,9 +124,9 @@ public class SpedizioneListAdapter extends SectionedRecyclerViewAdapter<Spedizio
} else if (pickingObjectDTO.getQtaEvasa().floatValue() > 0) {
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.orange_600_with_alpha));
} else if (position % 2 == 1) {
holder.mBinding.getRoot().setBackgroundColor(Color.WHITE);
holder.mBinding.getRoot().setBackgroundColor(0);
} else {
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
holder.mBinding.getRoot().setBackgroundColor(UtilityResources.getColorResourceFromAttr(mContext, R.attr.colorLetturaFacilitataSurface));
}
holder.mBinding.deactivatedOverBg.setVisibility(!pickingObjectDTO.isActive() ? View.VISIBLE : View.GONE);
@@ -135,8 +136,10 @@ public class SpedizioneListAdapter extends SectionedRecyclerViewAdapter<Spedizio
holder.mBinding.qtaEvasa.setTextColor(ResourcesCompat.getColor(mContext.getResources(), !pickingObjectDTO.isActive() ? R.color.gray_600 : R.color.green_700, null));
holder.mBinding.descrizione.setText(pickingObjectDTO.getDescrizione());
holder.mBinding.descrizione.setTextColor(pickingObjectDTO.isDescrizionePresente() ? Color.BLACK : Color.GRAY);
if(pickingObjectDTO.isDescrizionePresente())
holder.mBinding.descrizione.setTextColor(UtilityResources.getColorResourceFromAttr(mContext, android.R.attr.colorForeground));
else
holder.mBinding.descrizione.setTextColor(Color.GRAY);
holder.mBinding.badge1.setText(pickingObjectDTO.getBadge1());
holder.mBinding.badge2.setText(pickingObjectDTO.getBadge2());

View File

@@ -91,7 +91,7 @@ public class BottomSheetFragmentLUContentListAdapter extends RecyclerView.Adapte
holder.mViewDataBinding.executePendingBindings();
if (position % 2 == 1)
holder.mViewDataBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
holder.mViewDataBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBGLight));
holder.mViewDataBinding.getRoot().setOnClickListener(new OnSingleClickListener() {
@Override

View File

@@ -44,7 +44,7 @@ public class BottomSheetFragmentLUContentViewModel {
if (collo == null) return;
ObservableMtbTcol tipoPedana = collo.getMtbTCol();
BigDecimal taraPedana = tipoPedana != null ? tipoPedana.getTaraKg() : BigDecimal.ZERO;
BigDecimal taraPedana = tipoPedana != null && tipoPedana.getTaraKg() != null ? tipoPedana.getTaraKg() : BigDecimal.ZERO;
BigDecimal pesoNetto = BigDecimal.ZERO;
for (MtbColr mtbColr : collo.getMtbColr()) {

View File

@@ -1,11 +1,17 @@
package it.integry.integrywmsnative.view.dialogs.ask_cliente.dto;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
public class DialogAskClienteClienteDTO {
@SerializedName("codAnag")
private String codAnag;
@SerializedName("ragSoc")
private String ragSoc;
@SerializedName("codJcoms")
private ArrayList<String> codJcoms = new ArrayList<>();
public String getCodAnag() {

View File

@@ -1,23 +1,34 @@
package it.integry.integrywmsnative.view.dialogs.ask_cliente.dto;
import com.google.gson.annotations.SerializedName;
import it.integry.integrywmsnative.core.model.VtbDest;
public class DialogAskClienteDestinatarioDTO {
@SerializedName("codAnag")
private String codAnag;
@SerializedName("codVdes")
private String codVdes;
@SerializedName("destinatario")
private String destinatario;
@SerializedName("indirizzo")
private String indirizzo;
@SerializedName("cap")
private String cap;
@SerializedName("citta")
private String citta;
@SerializedName("prov")
private String prov;
@SerializedName("nazione")
private String nazione;
public String getCodAnag() {

View File

@@ -148,7 +148,7 @@ public class DialogSimpleMessageView extends BaseDialogFragment {
}
case WARNING -> {
colorBackgroundTitle = ContextCompat.getColor(requireContext(), R.color.yellow_600);
yield ResourcesCompat.getDrawable(requireContext().getResources(), R.drawable.ic_warning_white_24dp, null);
yield ResourcesCompat.getDrawable(requireContext().getResources(), R.drawable.ic_baseline_warning_24, null);
}
case ERROR -> {
colorBackgroundTitle = ContextCompat.getColor(requireContext(), R.color.red_300);

View File

@@ -0,0 +1,14 @@
package it.integry.integrywmsnative.view.dialogs.device_end_of_life;
import dagger.Subcomponent;
@Subcomponent
public interface DialogDeviceEndOfLifeComponent {
@Subcomponent.Factory
interface Factory {
DialogDeviceEndOfLifeComponent create();
}
void inject(DialogDeviceEndOfLifeView dialogDeviceEndOfLifeView);
}

View File

@@ -0,0 +1,14 @@
package it.integry.integrywmsnative.view.dialogs.device_end_of_life;
import dagger.Module;
import dagger.Provides;
@Module(subcomponents = DialogDeviceEndOfLifeComponent.class)
public class DialogDeviceEndOfLifeModule {
@Provides
DialogDeviceEndOfLifeViewModel providesDialogDeviceEndOfLifeViewModel() {
return new DialogDeviceEndOfLifeViewModel();
}
}

View File

@@ -0,0 +1,77 @@
package it.integry.integrywmsnative.view.dialogs.device_end_of_life;
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 com.google.android.material.dialog.MaterialAlertDialogBuilder;
import javax.inject.Inject;
import it.integry.integrywmsnative.MainApplication;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
import it.integry.integrywmsnative.databinding.DialogDeviceEndOfLifeBinding;
public class DialogDeviceEndOfLifeView extends BaseDialogFragment {
@Inject
DialogDeviceEndOfLifeViewModel mViewModel;
private DialogDeviceEndOfLifeBinding mBindings;
private Context mContext;
private final Runnable onComplete;
//Pass here all external parameters
public static DialogDeviceEndOfLifeView newInstance(Runnable onComplete) {
return new DialogDeviceEndOfLifeView(onComplete);
}
private DialogDeviceEndOfLifeView(Runnable onComplete) {
super();
this.onComplete = onComplete;
MainApplication.appComponent
.dialogDeviceEndOfLifeComponent()
.create()
.inject(this);
}
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
this.mContext = requireContext();
mBindings = DialogDeviceEndOfLifeBinding.inflate(LayoutInflater.from(this.mContext), null, false);
mBindings.setLifecycleOwner(this);
setCancelable(false);
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
.setView(mBindings.getRoot())
.setCancelable(isCancelable())
.setPositiveButton(R.string.i_understand_action, (dialog, which) -> {
if (onComplete != null) onComplete.run();
dismiss();
})
.create();
alertDialog.setCanceledOnTouchOutside(isCancelable());
alertDialog.setOnShowListener(this);
return alertDialog;
}
@Override
public void dismiss() {
if (getDialog() != null) getDialog().dismiss();
}
}

View File

@@ -0,0 +1,5 @@
package it.integry.integrywmsnative.view.dialogs.device_end_of_life;
public class DialogDeviceEndOfLifeViewModel {
}

View File

@@ -214,6 +214,8 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
}
});
}
return mBindings.getRoot();
}

View File

@@ -4,15 +4,19 @@ import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.ObservableArrayList;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.javatuples.Quartet;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import java.util.stream.Collectors;
import javax.inject.Inject;
@@ -27,6 +31,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.expansion.RunnableArgssss;
import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
import it.integry.integrywmsnative.databinding.DialogScanArtBinding;
@@ -38,6 +43,9 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
@Inject
DialogScanArtViewModel mViewModel;
@Inject
Handler handler;
private Context mContext;
private final boolean mForceOnlyUL;
@@ -46,15 +54,15 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
private int mBarcodeScannerInstanceID;
private RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColr> onPickingCompleted = null;
private RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> onPickingCompleted = null;
private RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest = null;
public static DialogScanArtView newInstance(boolean forceOnlyUL, @NotNull RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColr> onPickingCompleted, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) {
public static DialogScanArtView newInstance(boolean forceOnlyUL, @NotNull RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> onPickingCompleted, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) {
return new DialogScanArtView(forceOnlyUL, onPickingCompleted, onMagazzinoAutomaticoPickingRequest);
}
private DialogScanArtView(boolean forceOnlyUL, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColr> onItemChoosed, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) {
private DialogScanArtView(boolean forceOnlyUL, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> onItemChoosed, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) {
super();
mForceOnlyUL = forceOnlyUL;
@@ -122,37 +130,60 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
this.onLoadingStarted();
this.mViewModel.processBarcodeDTO(data, (status, mtbAart, ean128Model, mtbColrList) -> {
executorService.execute(() -> {
var filteredMtbColrList = mtbColrList;
try {
if (mtbAart != null && filteredMtbColrList != null) {
filteredMtbColrList = filteredMtbColrList.stream()
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbAart.getCodMart()))
.collect(Collectors.toList());
Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> result = this.mViewModel.processBarcodeDTO(data, pickMagazzinoAutomaticoPosizione -> {
handler.post(() -> {
this.onMagazzinoAutomaticoPickingRequest.run(pickMagazzinoAutomaticoPosizione);
this.onLoadingEnded();
dismiss();
});
});
var status = result.getValue0();
var mtbAart = result.getValue1();
var ean128Model = result.getValue2();
var mtbColt = result.getValue3();
List<MtbColr> filteredMtbColrList = mtbColt.getMtbColr();
if (mtbAart != null && filteredMtbColrList != null) {
filteredMtbColrList = filteredMtbColrList.stream()
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbAart.getCodMart()))
.collect(Collectors.toList());
}
List<MtbColr> finalFilteredMtbColrList = filteredMtbColrList;
handler.post(() -> {
if (finalFilteredMtbColrList != null && finalFilteredMtbColrList.size() > 1) {
DialogChooseArtFromListaMtbColrView.make(getActivity(), finalFilteredMtbColrList, mtbColrChose -> {
mtbColt.setMtbColr(new ObservableArrayList<>());
mtbColt.getMtbColr().add(mtbColrChose);
onPickingCompleted.run(status, mtbAart, ean128Model, mtbColt);
}).show();
} else if (finalFilteredMtbColrList != null && finalFilteredMtbColrList.size() == 1) {
mtbColt.setMtbColr(new ObservableArrayList<>());
mtbColt.getMtbColr().add(finalFilteredMtbColrList.get(0));
onPickingCompleted.run(status, mtbAart, ean128Model, mtbColt);
} else {
onPickingCompleted.run(status, mtbAart, ean128Model, null);
}
this.onLoadingEnded();
dismiss();
});
} catch (Exception ex) {
onError(ex);
}
if (filteredMtbColrList != null && filteredMtbColrList.size() > 1) {
DialogChooseArtFromListaMtbColrView.make(getActivity(), filteredMtbColrList, mtbColrChose -> {
onPickingCompleted.run(status, mtbAart, ean128Model, mtbColrChose);
}).show();
} else if (filteredMtbColrList != null && filteredMtbColrList.size() == 1) {
onPickingCompleted.run(status, mtbAart, ean128Model, filteredMtbColrList.get(0));
} else {
onPickingCompleted.run(status, mtbAart, ean128Model, null);
}
this.onLoadingEnded();
dismiss();
}, pickMagazzinoAutomaticoPosizione -> {
this.onMagazzinoAutomaticoPickingRequest.run(pickMagazzinoAutomaticoPosizione);
this.onLoadingEnded();
dismiss();
});
};
}

View File

@@ -1,22 +1,17 @@
package it.integry.integrywmsnative.view.dialogs.scan_art;
import com.annimon.stream.Stream;
import org.javatuples.Quartet;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
import it.integry.integrywmsnative.core.exception.EmptyLUException;
import it.integry.integrywmsnative.core.exception.InvalidLUException;
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
import it.integry.integrywmsnative.core.exception.ScannedPositionNotExistException;
import it.integry.integrywmsnative.core.exception.TooManyLUFoundInMonoLUPositionException;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.expansion.RunnableArgssss;
import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
@@ -62,23 +57,23 @@ public class DialogScanArtViewModel {
return this;
}
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onPickingCompleted, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) {
public Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) throws Exception {
if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
//Cerco gli articoli presenti nell'ul dell'etichetta anonima
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), onPickingCompleted);
return this.executeEtichettaLU(barcodeScanDTO.getStringValue());
} else if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO)) {
//Cerco l'UL presente all'interno della posizione
this.executeEtichettaPosizione(barcodeScanDTO.getStringValue(), onPickingCompleted, onMagazzinoAutomaticoPickingRequest);
return this.executeEtichettaPosizione(barcodeScanDTO.getStringValue(), onMagazzinoAutomaticoPickingRequest);
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
this.executeEtichettaEan128(barcodeScanDTO, onPickingCompleted);
return this.executeEtichettaEan128(barcodeScanDTO);
} else if (UtilityBarcode.isEanPeso(barcodeScanDTO) && !mForceOnlyUL) {
this.executeEtichettaEanPeso(barcodeScanDTO, onPickingCompleted);
return this.executeEtichettaEanPeso(barcodeScanDTO);
} else {
this.loadArticolo(barcodeScanDTO.getStringValue(), null, onPickingCompleted);
return this.loadArticolo(barcodeScanDTO.getStringValue(), null);
}
// else {
@@ -87,123 +82,108 @@ public class DialogScanArtViewModel {
}
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
String barcodeProd = null;
if (ean128Model.Sscc != null) barcodeProd = ean128Model.Sscc;
if (ean128Model.Gtin != null) barcodeProd = ean128Model.Gtin;
if (ean128Model.Content != null) barcodeProd = ean128Model.Content;
private Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO) throws Exception {
var ean128Model = this.mBarcodeRESTConsumer.decodeEan128Synchronized(barcodeScanDTO);
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
this.executeEtichettaLU(ean128Model.Sscc, onComplete);
} else if (!mForceOnlyUL) {
String barcodeProd = null;
if (ean128Model.Sscc != null) barcodeProd = ean128Model.Sscc;
if (ean128Model.Gtin != null) barcodeProd = ean128Model.Gtin;
if (ean128Model.Content != null) barcodeProd = ean128Model.Content;
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
return this.executeEtichettaLU(ean128Model.Sscc);
} else if (!mForceOnlyUL) {
return this.loadArticolo(barcodeProd, ean128Model);
this.loadArticolo(barcodeProd, ean128Model, onComplete);
} else {
this.sendError(new Exception("Barcode non valido"));
}
} else {
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
this.sendError(new NoResultFromBarcodeException(barcodeProd));
throw new Exception("Barcode non valido");
}
}, this::sendError);
}
private void executeEtichettaEanPeso(BarcodeScanDTO barcodeScanDTO, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
try {
Ean13PesoModel ean13PesoModel = Ean13PesoModel.fromBarcode(barcodeScanDTO.getStringValue());
this.loadArticolo(ean13PesoModel.getPrecode(), ean13PesoModel.toEan128(), onComplete);
} catch (Exception ex) {
this.sendError(ex);
} else {
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
throw new NoResultFromBarcodeException(barcodeProd);
}
}
private Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> executeEtichettaEanPeso(BarcodeScanDTO barcodeScanDTO) throws Exception {
Ean13PesoModel ean13PesoModel = Ean13PesoModel.fromBarcode(barcodeScanDTO.getStringValue());
private void executeEtichettaLU(String SSCC, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
if (mtbColt.getSegno() != -1) {
onComplete.run(DialogConsts.Results.YES, null, null, mtbColt.getMtbColr());
} else this.sendError(new InvalidLUException());
} else {
this.sendError(new EmptyLUException());
}
}, this::sendError);
return this.loadArticolo(ean13PesoModel.getPrecode(), ean13PesoModel.toEan128());
}
private Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> executeEtichettaLU(String SSCC) throws Exception {
var mtbColt = mColliMagazzinoRESTConsumer.getBySsccSynchronized(SSCC, true, false);
private void executeEtichettaPosizione(String stringValue, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) {
MtbDepoPosizione foundPosizione = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
if (mtbColt == null || mtbColt.getMtbColr() == null || mtbColt.getMtbColr().isEmpty())
throw new NoLUFoundException();
if (mtbColt.getSegno() == -1) throw new InvalidLUException();
return new Quartet<>(DialogConsts.Results.YES, null, null, mtbColt);
}
private Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> executeEtichettaPosizione(String stringValue, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) throws Exception {
MtbDepoPosizione foundPosizione = SettingsManager.iDB().getAvailablePosizioni().stream()
.filter(x -> x.getPosizione().equalsIgnoreCase(stringValue))
.single();
.findFirst()
.orElse(null);
if (foundPosizione == null) {
if (foundPosizione == null)
//Nessuna posizione trovata con questo barcode
this.sendError(new ScannedPositionNotExistException());
return;
}
throw new ScannedPositionNotExistException();
if (foundPosizione.isMagazzinoAutomatico()) {
//Eseguo picking da magazzino automatico
onMagazzinoAutomaticoPickingRequest.run(foundPosizione);
} else {
this.executePosizione(foundPosizione, null, onComplete);
return this.executePosizione(foundPosizione, null);
}
return null;
}
private void executePosizione(MtbDepoPosizione posizione, MtbAart articolo, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
private Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> executePosizione(MtbDepoPosizione posizione, MtbAart articolo) throws Exception {
var mtbColtList = this.mPosizioniRESTConsumer.getBancaliInPosizioneSynchronized(posizione);
if (mtbColtList == null || mtbColtList.isEmpty()) {
this.sendError(new NoLUFoundException());
} else if (mtbColtList.size() == 1) {
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
onComplete.run(DialogConsts.Results.YES, articolo, null, mtbColt.getMtbColr());
}, this::sendError);
} else {
this.sendError(new TooManyLUFoundInMonoLUPositionException());
}
if (mtbColtList == null || mtbColtList.isEmpty())
throw new NoLUFoundException();
}, this::sendError);
if (mtbColtList.size() != 1) {
throw new TooManyLUFoundInMonoLUPositionException();
}
var mtbColt = this.mColliMagazzinoRESTConsumer.getByTestataSynchronized(mtbColtList.get(0), true, false);
return new Quartet<>(DialogConsts.Results.YES, articolo, null, mtbColt);
}
private void loadArticolo(@NotNull String barcodeProd, Ean128Model ean128Model, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
this.mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
if (mtbAartList != null && !mtbAartList.isEmpty()) {
private Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> loadArticolo(@NotNull String barcodeProd, Ean128Model ean128Model) throws Exception {
var mtbAartList = this.mArticoloRESTConsumer.searchByBarcodeSynchronized(barcodeProd);
MtbAart firstArt = mtbAartList.get(0);
MtbDepoPosizione firstArtPosition = UtilityPosizione.getFromCache(firstArt.getPosizione());
if (mtbAartList == null || mtbAartList.isEmpty())
throw new NoResultFromBarcodeException(barcodeProd);
if (firstArtPosition != null && firstArtPosition.isFlagMonoCollo() && mForceOnlyUL) {
this.executePosizione(firstArtPosition, firstArt, onComplete);
} else if (!mForceOnlyUL) {
onComplete.run(DialogConsts.Results.YES, mtbAartList.get(0), ean128Model, null);
} else {
this.sendError(new NoResultFromBarcodeException(barcodeProd));
}
MtbAart firstArt = mtbAartList.get(0);
MtbDepoPosizione firstArtPosition = UtilityPosizione.getFromCache(firstArt.getPosizione());
} else {
this.sendError(new NoResultFromBarcodeException(barcodeProd));
}
}, this::sendError);
if (firstArtPosition != null && firstArtPosition.isFlagMonoCollo() && mForceOnlyUL)
return this.executePosizione(firstArtPosition, firstArt);
if (!mForceOnlyUL)
return new Quartet<>(DialogConsts.Results.YES, mtbAartList.get(0), ean128Model, null);
throw new NoResultFromBarcodeException(barcodeProd);
}
private void sendError(Exception ex) {
if (this.mListener != null) mListener.onError(ex);
}
public void setListener(Listener listener) {
this.mListener = listener;
}

View File

@@ -2,14 +2,23 @@ package it.integry.integrywmsnative.view.dialogs.tracciamento_imballi;
import androidx.databinding.ObservableBoolean;
import androidx.databinding.ObservableField;
import com.google.gson.annotations.SerializedName;
public class TracciamentoImballoDTO {
@SerializedName("codTcol")
private final ObservableField<String> codTcol = new ObservableField<>();
@SerializedName("descrizione")
private final ObservableField<String> descrizione = new ObservableField<>();
@SerializedName("codMart")
private final ObservableField<String> codMart = new ObservableField<>();
@SerializedName("qta")
private final ObservableField<Integer> qta = new ObservableField<>();
@SerializedName("editable")
private final ObservableBoolean editable = new ObservableBoolean(true);
public ObservableField<String> getCodTcol() {

View File

@@ -7,7 +7,7 @@
<padding
android:left="6dp"
android:right="6dp"
android:right="8dp"
android:top="1dp" />
<corners android:radius="12dp" />

View File

@@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="488.3dp"
android:height="168.7dp"
android:viewportWidth="488.3"
android:viewportHeight="168.7">
<path
android:pathData="M484.96,0c0.1,1.5 0.2,3.6 -0.3,6c-0.7,3.4 -2.1,5.8 -3.6,8.5c-0.9,1.7 -2,3.3 -3.5,5.2c-3.5,4.7 -7.2,17.7 -9.9,39.7s-1.3,59.4 1.5,72s-0.1,22.1 -4.6,26.3s0.9,2.1 -6.7,5.1c-7.6,3 -18.9,-5.4 -21.2,-17.7l0,0c-2.3,-12.3 -3.1,-9.1 -0.1,-21.5c3,-12.4 7.6,-24.9 7.7,-36.7c0.1,-11.8 -5.1,-34.2 -12.3,-38s-7,-2.7 -13.8,-3.1s-9.9,-0.1 -13.8,4.3c-3.9,4.4 -6.5,10.3 -7.9,19.7c-1.4,9.4 0,26.7 2.4,33.1c2.4,6.4 3.7,6.8 1,14.9c-2.7,8.1 -15.7,9.9 -20.5,2.9c-4.8,-7.1 -4.3,-17.9 -1.5,-34.7c2.8,-16.8 2.3,-14.6 2.2,-27.2c0,-12.6 1,-11.4 -1.3,-15.8c-2.3,-4.4 -9.7,-9.7 -16.9,-5.7c-7.2,4 -11.7,21.3 -12.6,28.1s-0.9,24.5 0.4,31c1.2,6.5 1.3,12.8 -0.6,17.5s-4,7.4 -7.2,8.6s-6.4,1.4 -10.1,-0.9c-3.7,-2.3 -8.2,-4.8 -8.7,-16.8c-0.5,-12 3.7,-39.8 2.1,-53.6c-1.2,-10.7 -3.7,-14.3 -9.2,-10.6c-3.9,2.6 -7.2,9.4 -4.9,16s2.8,8.4 2.7,13s-1.1,8 -4.4,11.6c-3.3,3.5 -8.3,5 -12.8,1.9c-4.5,-3.1 -6.7,-9.9 -4.3,-18.3c2.5,-8.4 10.1,-11.6 1.7,-19.2c-8.3,-7.6 -14.9,1.7 -15.1,15.6c-0.2,14 0.8,23 3.6,32.5c2.8,9.6 4.1,14.7 4.1,22.7s-5.1,16.1 -12.8,15.3s-12.7,-15.8 -14.7,-26.2c-2,-10.4 -1.8,-8.8 -2.5,-11.3s-1.3,-5 -1.6,-9.6c-1.8,-13 4.7,-26 4.8,-37.1c0,-6.6 0.8,-8.5 -2.8,-12.3s-19.3,6.1 -23.4,17.1s-3.9,10.9 -3.6,25.9s1.8,25.1 5.1,34.5c3.3,9.4 3.9,16.5 3.2,19.7c-0.6,3.3 -0.6,3.1 -1.3,8.3c-0.7,5.2 -3.9,10.8 -6.8,12.3c-3.9,2 -8.2,0.3 -10.5,-1.8c-2.4,-2.4 -5.4,-8.4 -6.7,-13.9s-1.3,-8.5 -1.3,-16s0.3,-14.8 0.7,-19.7c0.4,-4.9 0.8,-11.8 1.1,-25.1c0.3,-13.3 -0.4,-19.2 -3.6,-29.8s-3.5,-9.7 -7.1,-13.5s-5.6,-4.9 -8.6,-4.9c-2.9,0 -8.5,3 -11.3,5.9c-2.7,2.9 -5.6,8.2 -8,15.5s-2.7,9.4 0.3,22.8s3.5,16.2 1.4,27.5c-2,11.3 -7.2,16.8 -14.8,16.8s-12.2,-3.3 -14.5,-7.8s-3.7,-12.1 -3.4,-17.3s2,-15.6 2.8,-18.3c0.9,-2.6 2.8,-14.6 3.3,-20.7c0.5,-6.1 -0.4,-11 -3.4,-16.2s-4.6,-7.1 -6.5,-8.3c-4.8,-2.5 -9.5,2.4 -11.6,4.6c-3.8,3.9 -7.6,10.3 -9,14.7s-1,4.3 -0.3,12s0.8,8.5 -0.2,17s-1.6,11.8 -4.2,15.3s-4,4.7 -9.7,4.7s-12.5,-6.7 -13.7,-12.5s1.4,-15.6 3.1,-23.4s1,-20.1 -0.3,-24c-4,-13.1 -11.8,-9.2 -16.1,-1.2c-5.2,7.4 -5.5,31.2 -3.5,39.9s0.6,19.8 -0.4,24.8s-4.2,12.3 -7,15.4s-10.6,4.7 -14.7,2.4s-8.1,-6.9 -9.7,-11.6c-1.6,-4.7 -1.4,-13.4 0.3,-17.2c1.7,-3.8 7.6,-11.5 8.4,-23.2c0.9,-11.7 -4.8,-17 -5.4,-18.6c-0.6,-1.6 -2.5,-1.1 -4.5,1c-7.6,9.1 -5.7,19.2 -5.8,24.7c-0.4,14.7 3.9,39.6 4.1,49.4c0.2,9.8 -1.7,12.8 -3.5,17.6c-1.8,4.8 -3.4,7.4 -7.6,10s-10.2,5.3 -14.5,3.4c-4.3,-2 -5.1,0.1 -9.1,-11.3c-4,-11.4 1.5,-34 4.2,-42.1c2.7,-8.1 4.2,-11 5.3,-18.4s2.4,-20.6 2.4,-38c0,-17.3 0.6,-16.8 -1.5,-21.5c-3.1,-6.7 -5.1,-14.5 -1.9,-20.4c0.2,-0.4 0.6,-1.1 1.2,-1.8C171.66,0 328.26,0 484.96,0z"
android:fillColor="#D32F2F"/>
</vector>

View File

@@ -1,4 +1,4 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="?attr/colorControlNormal" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M9,16.17L5.53,12.7c-0.39,-0.39 -1.02,-0.39 -1.41,0 -0.39,0.39 -0.39,1.02 0,1.41l4.18,4.18c0.39,0.39 1.02,0.39 1.41,0L20.29,7.71c0.39,-0.39 0.39,-1.02 0,-1.41 -0.39,-0.39 -1.02,-0.39 -1.41,0L9,16.17z"/>

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