Compare commits
669 Commits
v1.24.3(27
...
v1.36.06(3
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c936bc387 | |||
| 6c30400aa9 | |||
| 03aa2b17ac | |||
| 8c24f5f025 | |||
| 7f9524e0b2 | |||
| e6b50ef7da | |||
| 2275db39b3 | |||
| 3a3680b2b2 | |||
| 2189acce5a | |||
| 4a4e290a9c | |||
| 1d92759653 | |||
| bc9f4121ef | |||
| cc54c6decb | |||
| c592ba0795 | |||
| 09d009bcc5 | |||
| 95bc3031df | |||
| 0aca5df3fe | |||
| 2ce2b8b25c | |||
| bea30a5400 | |||
| ebc0d22e9f | |||
| d520e18a30 | |||
| 19122ed637 | |||
| 138500a16f | |||
| 8d93da11b1 | |||
| 9db04fcd02 | |||
| 70b2fbd47b | |||
| 9361d786b4 | |||
| c7db59b70f | |||
| 1008e2aece | |||
| d2703fd495 | |||
| 68f576fb93 | |||
| 69758da7e2 | |||
| b832a593f4 | |||
| c115a6f9f1 | |||
| 35210db708 | |||
| 51728a8103 | |||
| 3961721241 | |||
| 5d5ca02c16 | |||
| be8739c167 | |||
| 8c6b19a064 | |||
| 8751b7c698 | |||
| 42b16975d6 | |||
| 23da1b3e94 | |||
| d003a0322e | |||
| 1e129d1ea9 | |||
| a7dbe55ad2 | |||
| 99f21b19f1 | |||
| eeb06e105e | |||
| 5988667944 | |||
| 77e3d00bef | |||
| 4b475ef1e5 | |||
| 1ec0611e2a | |||
| bd81385cac | |||
| 6dbcdb0475 | |||
| e1fddc8682 | |||
| a046f736b0 | |||
| 696ea31d7d | |||
| 3d9e33464a | |||
| ab74a9cbad | |||
| d56dcc0ed2 | |||
| 7e73aceeb7 | |||
| d63c80d6b7 | |||
| bc9016cf93 | |||
| ff128a1de2 | |||
| fa6ad5a150 | |||
| a8aaf69c57 | |||
| 9c86598f03 | |||
| 031cbc8d0a | |||
| df63fbe4af | |||
| 1372e831f7 | |||
| c31700d9cb | |||
| e6ecebd49a | |||
| dfec2f2bd3 | |||
| 3d425b6b02 | |||
| 318a8f645e | |||
| 8ec314044f | |||
| 2965b18a5f | |||
| 24f6341ff6 | |||
| 589a179a1b | |||
| afc2aef691 | |||
| 19e4a14c95 | |||
| 8237466adf | |||
| 3c1471ee8d | |||
| 099d5fa54d | |||
| 8b04f3e696 | |||
| 04ef20c69a | |||
| d08ec43d29 | |||
| 64e5200912 | |||
| 9e79653769 | |||
| 1fee2c901a | |||
| 3713bb5e49 | |||
| fdeb98b82a | |||
| 3e68dd2d36 | |||
| 1a964d7a97 | |||
| 43df6fc9f5 | |||
| 10f7ecd79b | |||
| 9a60b1ff86 | |||
| 386d51ffd7 | |||
| d3804a4601 | |||
| 04720c1d97 | |||
| 0826aa0445 | |||
| 7ceb51a54b | |||
| e8351ca75b | |||
| f8ceb1fb2d | |||
| 4ef49f3523 | |||
| 21ed15a2ea | |||
| aacec1dfde | |||
| ac7e0443a6 | |||
| 4bbb0d5cbb | |||
| 05c28d62d8 | |||
| bf2ac81ab8 | |||
| 17a78ef044 | |||
| 3c78c2787a | |||
| c7358b536e | |||
| 4f9fe14f7e | |||
| 0934765176 | |||
| b7d3cb18b9 | |||
| 227c67dc23 | |||
| da3c9eae6e | |||
| bf37a1acaf | |||
| 2a8974e9c6 | |||
| c34d7dc777 | |||
| 461a2f705e | |||
| 705dd96a0e | |||
| 10128a1bae | |||
| 54d40ca06e | |||
| e4aa2d19d9 | |||
| 6251c0f1ac | |||
| 3caed63b7f | |||
| 75bc046cf5 | |||
| 97d27b047d | |||
| 44e00f4f98 | |||
| 81b053ee06 | |||
| f1b5a7ec1b | |||
| 2d4211d329 | |||
| c5ba78eeda | |||
| 1faaef7062 | |||
| 762c5fd5b5 | |||
| 9af5970ec7 | |||
| 3a5836ba4b | |||
| 72b0e29ae6 | |||
| e0cc802b62 | |||
| 2d4d9cef4e | |||
| 4a8a21b970 | |||
| 5103a53c11 | |||
| 11c4cba70c | |||
| b1dba20973 | |||
| 920c22083b | |||
| f9230ac341 | |||
| 6344c4b77d | |||
| d4c111dedc | |||
| 65dda1d5c0 | |||
| 4a7406fda1 | |||
| ef17e7a0c7 | |||
| c45850555e | |||
| 303690eed2 | |||
| ae62b26edf | |||
| 2e39754c20 | |||
| 0ae6bbcd96 | |||
| 529455931d | |||
| 46d0510ed8 | |||
| b02e12d76e | |||
| c6bbde2b67 | |||
| cfbb27a67b | |||
| 35283fc11b | |||
| c3d62f88b4 | |||
| fc8469bf07 | |||
| 400f1440db | |||
| ad12e7e65b | |||
| a63e3817b5 | |||
| cbd772bf7e | |||
| e90bd46a42 | |||
| 96bd5d516c | |||
| d9306e13c2 | |||
| fc80baeaee | |||
| c0b49b68f7 | |||
| 73242bc208 | |||
| d4b60a51bd | |||
| 1bc687c79a | |||
| 3a6b0949d4 | |||
| bfc03a4ef9 | |||
| 4dfa796790 | |||
| f0db805c84 | |||
| 0cc742e103 | |||
| d01319c417 | |||
| c0b9496041 | |||
| d4e7832f80 | |||
| cb4f9e68f5 | |||
| ac4a5b1d34 | |||
| 39ebc9d367 | |||
| 7ef0299282 | |||
| 6a998d6605 | |||
| 9eb4b0a621 | |||
| f55080f7ca | |||
| 7fb6109e18 | |||
| f419944699 | |||
| 8de54a504b | |||
| 6f2be2b459 | |||
| fa413aba25 | |||
| ab6eeb91a6 | |||
| 16cbe01157 | |||
| 16cb685bb3 | |||
| 28501c5509 | |||
| 79c4bdad48 | |||
| 68007ebc8e | |||
| c5eec26f8d | |||
| 5c3f8d8717 | |||
| 43aa0f0324 | |||
| 4ab7bf27d7 | |||
| 28f4ac4414 | |||
| 60414c949e | |||
| ff09147968 | |||
| 17e66af99a | |||
| 762ab2719d | |||
| 95f282cd4d | |||
| 029979c463 | |||
| e748161dda | |||
| c2c2a1f984 | |||
| fd13f2f1b4 | |||
| ac6cca1eda | |||
| dc46b36624 | |||
| 42aa655021 | |||
| b89085a9c3 | |||
| 557644f024 | |||
| 258ed9d7ca | |||
| be7d3775cc | |||
| 93ffb191b5 | |||
| 8eb58a4d64 | |||
| 4bc8374ea3 | |||
| f76295c3f6 | |||
| b8486b677f | |||
| 1ad2d9ca9b | |||
| a57eadeab3 | |||
| 1c34b120db | |||
| c6c19ca04b | |||
| 987d667350 | |||
| e704bd1597 | |||
| 0f08d704ac | |||
| b340c2270d | |||
| d3c518b7df | |||
| d8a0594600 | |||
| 7af451724a | |||
| 6cbfb1d81b | |||
| a8c28d7624 | |||
| 3c7792febb | |||
| 4f2dfb82e6 | |||
| cd2c04ad0c | |||
| a1d8e98dfe | |||
| 80fb6737fe | |||
| eadd93dfaf | |||
| 12919613ab | |||
| 7da729205c | |||
| 1bfb734139 | |||
| 09ae517903 | |||
| 0735312c98 | |||
| c31e1ae79a | |||
| 3a9b6a99eb | |||
| 3da92d4630 | |||
| 1d54680db6 | |||
| 384214e084 | |||
| 03dc6e93be | |||
| 2ba4e5d11e | |||
| 78c6e98084 | |||
| 968eed44cb | |||
| ee784b27c6 | |||
| bac849324f | |||
| d823856ac5 | |||
| a49ee430e2 | |||
| d8672e1c22 | |||
| d8c6464830 | |||
| af5d19eb55 | |||
| 8fe0a1fd07 | |||
| b0a7a93f85 | |||
| 10f888b5d5 | |||
| 95807fbfbc | |||
| 4317e083a6 | |||
| 0c54a32e39 | |||
| 62dc62aa99 | |||
| 603fd6ad96 | |||
| 2182a970ac | |||
| 9b823fdca8 | |||
| 904c825472 | |||
| a15d225998 | |||
| 62f8ee61d3 | |||
| e3b8373bb9 | |||
| 0cdbbc096c | |||
| 895c21cee4 | |||
| d541761ac6 | |||
| 1df84ba046 | |||
| 72773deaf1 | |||
| 165568b7e3 | |||
| 3396e295fa | |||
| 0f3f593abd | |||
| df48ea3b32 | |||
| 5e52d83c40 | |||
| 0a71f54814 | |||
| c18828cdda | |||
| 92073fa8bb | |||
| 4131dd7e97 | |||
| 3c4fdea0ec | |||
| 71c73e8cde | |||
| 1a66d4f541 | |||
| d9c33dc5f5 | |||
| 1edcba63aa | |||
| 2566311f96 | |||
| c01cbc1bac | |||
| 9c95b107d5 | |||
| c2e1c048be | |||
| c3bfe70093 | |||
| a6cb8c9c9c | |||
| 5908e076a4 | |||
| 4445e9aff2 | |||
| 9cd0855dcf | |||
| d807ab1f31 | |||
| 69b88b1f6d | |||
| 35f1495ebc | |||
| 7fdc964687 | |||
| 8322303351 | |||
| a7f5f5f505 | |||
| 9b1a00d09c | |||
| 72ebf8f135 | |||
| be58e333b6 | |||
| 42620bd324 | |||
| d4deade046 | |||
| 846393304a | |||
| c3ceae8027 | |||
| 7b4d7db265 | |||
| 1c6cf9a02b | |||
| fd2d4fb47b | |||
| 094f9b68f6 | |||
| be418d3d26 | |||
| 25813a6362 | |||
| 51c5d3a0c7 | |||
| e964220655 | |||
| e493f1796b | |||
| 4882645311 | |||
| 468f1e5b58 | |||
| 79add4f60a | |||
| 975763f400 | |||
| 5eac3f14cc | |||
| bed5b36ade | |||
| 7678ce1a50 | |||
| b3faf38455 | |||
| 283cb59d42 | |||
| 1867ac8742 | |||
| d210e3b3e0 | |||
| 8bb2f48090 | |||
| 15b4d728e6 | |||
| 3018123110 | |||
| b02eaf02a8 | |||
| ad9795a3a3 | |||
| 170411383f | |||
| 9e87130d6c | |||
| 0f6a9cdae2 | |||
| 79ec6430f6 | |||
| 0c46fb09c1 | |||
| 8aad7337bf | |||
| c49197d002 | |||
| 16f611c147 | |||
| 7b623913d8 | |||
| 0a8997f30b | |||
| 702d0a7348 | |||
| f4ae1fbed3 | |||
| 8c0639be9b | |||
| c9ea13a1d2 | |||
| bef5423a06 | |||
| 22b072aff7 | |||
| 50acee47e9 | |||
| ba041d1133 | |||
| 21c26ab3ad | |||
| 5288ad8bb0 | |||
| 0ccff458f7 | |||
| a1c8a52dd2 | |||
| e6e8b22554 | |||
| 9371e5824f | |||
| bda1328dec | |||
| 2030893249 | |||
| fa695ca9a4 | |||
| 8b9c9437ae | |||
| 6f026145ef | |||
| 0744d3713e | |||
| 3275422af8 | |||
| a49aab1fb0 | |||
| e25cc9e825 | |||
| 92e9529cc5 | |||
| 7990f38c37 | |||
| 134dff5aba | |||
| 0c359e5110 | |||
| 7b913e607e | |||
| ee5d30ff80 | |||
| 6c41506a97 | |||
| ab14d6736c | |||
| b6c82c869e | |||
| f3f04e9473 | |||
| ef753f9bcd | |||
| e764ad1148 | |||
| 82cc4f989c | |||
| 650d1670de | |||
| 6ca7943d78 | |||
| 013646eae3 | |||
| 341359d871 | |||
| 545081444c | |||
| b35819c9c9 | |||
| ec44275e41 | |||
| f5d78edfd1 | |||
| 9390cd0320 | |||
| ca448542c3 | |||
| 9d3f6f73d9 | |||
| ee35a14518 | |||
| b7bb6ad6ac | |||
| 011deafb90 | |||
| 214d98f181 | |||
| dfa2a1106e | |||
| 08841537f5 | |||
| 21cf03a50b | |||
| 356b146e3d | |||
| a4c9b0cd3a | |||
| 882c95bd85 | |||
| 04772057c1 | |||
| c72037783f | |||
| 5e5f2b7889 | |||
| 226ce27a5c | |||
| 2e90c33854 | |||
| d4fbd7b45f | |||
| be70e75f44 | |||
| 41c5fa52b5 | |||
| f50400bcb7 | |||
| 9a8322adcc | |||
| feb79ff95d | |||
| 4634f2ce9c | |||
| 77a6856843 | |||
| 302ea697e1 | |||
| ae8db5791e | |||
| f967514f97 | |||
| 1512cb7de9 | |||
| bad3e58fbd | |||
| 75e79394f2 | |||
| b127130bc7 | |||
| 9b5beeb028 | |||
| fd95f18200 | |||
| 92d1331630 | |||
| 8216c19338 | |||
| d97d1f1597 | |||
| 52b99f084a | |||
| a3598fab56 | |||
| 7dc77bf1f9 | |||
| 66f2bda370 | |||
| 600258228b | |||
| 19cc9f5016 | |||
| 0dcb8c6af4 | |||
| 9974deaf69 | |||
| fe081897e7 | |||
| b0de2dda40 | |||
| dda288d709 | |||
| f6fdc45e1a | |||
| 5e88833039 | |||
| 2c521c5f96 | |||
| 8530309244 | |||
| 57dd0cef76 | |||
| 8df31407ac | |||
| 8134a64a43 | |||
| 0c2fd117d5 | |||
| d2b5fe917d | |||
| 3de49545b7 | |||
| 7163d91c53 | |||
| b8b3d2f2bb | |||
| 7555e3d90f | |||
| 46e438e0e9 | |||
| 439eada61b | |||
| 48548b7c92 | |||
| 79afe0155b | |||
| 730dabc2bb | |||
| 44255f08b4 | |||
| fb23009fcc | |||
| c0310e492f | |||
| bf1fc455e1 | |||
| c7c2700dbe | |||
| c89e4869ef | |||
| 5e147c9d96 | |||
| 95fc680823 | |||
| 3cd1b8eb9f | |||
| ca04b87a8e | |||
| 10ab47a1b7 | |||
| fdaa2b7f21 | |||
| e9b179ca7f | |||
| 04d811af93 | |||
| cb2421f263 | |||
| 16a565fc51 | |||
| f68691df6b | |||
| f4f7f4a6f0 | |||
| b129bb51c6 | |||
| 8c80918521 | |||
| e8dea4cef0 | |||
| b51bf1d9cb | |||
| 3c25e223ab | |||
| 16d9f2f6ff | |||
| fd3dfb9afe | |||
| 2916d2b5d0 | |||
| dac12905ef | |||
| bf56c8e4c7 | |||
| 7272e3e541 | |||
| 020c99e700 | |||
| 12a9610e7a | |||
| 0e6f4a7892 | |||
| f8c0852cb7 | |||
| ee48e7e2a4 | |||
| 821099c037 | |||
| 9a6211fc46 | |||
| ee8abe3ea8 | |||
| 654a9e0161 | |||
| 076c84c119 | |||
| 6fa80a5485 | |||
| e0ea6b17a1 | |||
| 60978167c2 | |||
| 6a848e081a | |||
| 2960d0d4b4 | |||
| 6b01861a26 | |||
| 5889942ff9 | |||
| 0359ddcc90 | |||
| 8409507dab | |||
| 208653223c | |||
| 62f6e12a86 | |||
| b662929c19 | |||
| 40895eac2f | |||
| dc7e90b2fe | |||
| 5d1f275ebc | |||
| 79192ce337 | |||
| 7f0f6c969a | |||
| e23beddf65 | |||
| 1fd51a4097 | |||
| 5ea124bcf6 | |||
| fa6ab9f58f | |||
| f7806103fb | |||
| 87acc5a4e3 | |||
| 7c49af085d | |||
| 0c3d5bd0f1 | |||
| 37d956bb5c | |||
| fef564b090 | |||
| d1c491ee80 | |||
| 0cd8a3b41f | |||
| f7e4a3d005 | |||
| a22ecb9620 | |||
| 57c22b617e | |||
| 84876bf7c1 | |||
| 2718f0ff2b | |||
| fca325855e | |||
| c6fc287a3f | |||
| 29fd0292e7 | |||
| 90cf83e3cd | |||
| f4c1f1fe34 | |||
| 9e85b9f828 | |||
| a9fd55c01f | |||
| 506a56a1a2 | |||
| c93e29606c | |||
| 4adc40aa90 | |||
| 4842a6091b | |||
| 9faf4123ef | |||
| cdf5b413a2 | |||
| 4dd2ccdb13 | |||
| 56c54d3cde | |||
| 19e2d5b869 | |||
| 0acf023556 | |||
| 71f6dc83fb | |||
| 3479ee2b87 | |||
| 609b9f1852 | |||
| 23c98d9218 | |||
| 57900a9617 | |||
| c3274a4311 | |||
| 356e2562da | |||
| 46c0078331 | |||
| bbc81f3d99 | |||
| 0dd662518e | |||
| 08d332e2c6 | |||
| b9001790be | |||
| d43bd8e659 | |||
| ef2886c963 | |||
| 7a6097fa69 | |||
| 9c45cebf51 | |||
| 344fc42d03 | |||
| 33a01b2c15 | |||
| d165174345 | |||
| 05314803bc | |||
| 9db8337f9b | |||
| abfd92ce07 | |||
| c11858aea2 | |||
| a67b28f0ad | |||
| b9f5baae5f | |||
| cb5e36ffb7 | |||
| 82ff37f4ee | |||
| 350c4bc4ed | |||
| 33f0866ea2 | |||
| df13a6e29d | |||
| ee8fa96c40 | |||
| c264cd38e3 | |||
| 64f669753f | |||
| aabc4310fd | |||
| 9dc3996aef | |||
| e0e9e657c9 | |||
| 84cbab334f | |||
| f9751e770a | |||
| 6539c9179e | |||
| f43a7acf35 | |||
| ca96bacde6 | |||
| d4c94b7ab9 | |||
| 0c9e607c33 | |||
| b5c6ce2aa5 | |||
| 66f58ea20d | |||
| d6979289e2 | |||
| 496387b5c6 | |||
| 6b0d75fc60 | |||
| 7d263699da | |||
| 63e4e4e791 | |||
| 98c260f621 | |||
| 1b57dc74cf | |||
| 4f140d0d58 | |||
| 0d021e6bad | |||
| 1a0af47613 | |||
| ead509bb32 | |||
| ddfde73f1e | |||
| 3de5a2320d | |||
| 5cb32a9a77 | |||
| ecbb4ac55c | |||
| 84e0561fff | |||
| 71bfbb2afc | |||
| 2cb563320b | |||
| f3837f35b0 | |||
| fa52b8e040 | |||
| c80b5a9160 | |||
| 65ac5590c7 | |||
| 3cee7f2a95 | |||
| 3034b49586 | |||
| 718ffb3124 | |||
| 7173c49561 | |||
| 4407f37f8c | |||
| 37a16f6292 | |||
| 83d9e0c5f7 | |||
| d2249e031a | |||
| 2522e67705 | |||
| 371514157c | |||
| de889045e6 | |||
| 6225ba8207 | |||
| 36c9319bce | |||
| d4d494218b | |||
| a3d6b11c69 | |||
| 852edf1b13 | |||
| 6806290d98 | |||
| 66f7a51462 | |||
| 0e1e69dc9a | |||
| 2ef24fe6e9 | |||
| 54c2d90334 | |||
| 577f2041a1 | |||
| 2f3e74fbfe | |||
| b0fa911322 | |||
| 473b9f22fb | |||
| cc1e1bf221 | |||
| a0c85b3fcb | |||
| 0f41bd99aa | |||
| 7a3a207462 | |||
| 7206b3c37e | |||
| 4cf8b6167f | |||
| b19b438489 | |||
| d3ee6d9ea3 | |||
| dd9789c4f3 | |||
| 67571e3d7a | |||
| a0e17f557d | |||
| 684946bb14 | |||
| 4aab6b1688 | |||
| 310a79f41d | |||
| f8164ca1eb |
7
.idea/deploymentTargetDropDown.xml
generated
7
.idea/deploymentTargetDropDown.xml
generated
@@ -1,16 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetsSelectedWithDialog>
|
||||
<runningDeviceTargetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="20119B1E55" />
|
||||
<value value="21088B8EFD" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetsSelectedWithDialog>
|
||||
</runningDeviceTargetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2023-11-20T09:49:24.751485900Z" />
|
||||
</component>
|
||||
</project>
|
||||
15
.idea/git_toolbox_prj.xml
generated
Normal file
15
.idea/git_toolbox_prj.xml
generated
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxProjectSettings">
|
||||
<option name="commitMessageIssueKeyValidationOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
<option name="commitMessageValidationEnabledOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,com.annimon.stream.Stream,of" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
6
.idea/kotlinc.xml
generated
Normal file
6
.idea/kotlinc.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.9.0" />
|
||||
</component>
|
||||
</project>
|
||||
10
.idea/migrations.xml
generated
Normal file
10
.idea/migrations.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="app_base" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
||||
<module name="WMS.app" />
|
||||
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android App">
|
||||
<module name="WMS_Native.app.main" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
@@ -8,13 +8,11 @@
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic_vgalimenti" />
|
||||
<option name="CLEAR_APP_STORAGE" value="false" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="true" />
|
||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
|
||||
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
|
||||
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
||||
<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="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||
@@ -26,6 +24,8 @@
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||
</Auto>
|
||||
<Hybrid>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
@@ -33,20 +33,27 @@
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||
</Hybrid>
|
||||
<Java />
|
||||
<Java>
|
||||
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||
</Java>
|
||||
<Native>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||
</Native>
|
||||
<Profilers>
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Callstack Sample" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Java/Kotlin Method Sample (legacy)" />
|
||||
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
||||
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
||||
</Profilers>
|
||||
61
.idea/runConfigurations/app_vglimenti.xml
generated
61
.idea/runConfigurations/app_vglimenti.xml
generated
@@ -1,61 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="app_vglimenti" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
||||
<module name="WMS.app" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
<option name="ARTIFACT_NAME" value="" />
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic__base" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="true" />
|
||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
|
||||
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
|
||||
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
||||
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
|
||||
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
|
||||
<option name="DEBUGGER_TYPE" value="Auto" />
|
||||
<Auto>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Auto>
|
||||
<Hybrid>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Hybrid>
|
||||
<Java />
|
||||
<Native>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Native>
|
||||
<Profilers>
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Callstack Sample" />
|
||||
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
||||
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
||||
</Profilers>
|
||||
<option name="DEEP_LINK" value="" />
|
||||
<option name="ACTIVITY_CLASS" value="" />
|
||||
<option name="SEARCH_ACTIVITY_IN_GLOBAL_SCOPE" value="false" />
|
||||
<option name="SKIP_ACTIVITY_VALIDATION" value="false" />
|
||||
<method v="2">
|
||||
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 271
|
||||
def appVersionName = '1.24.3'
|
||||
def appVersionCode = 399
|
||||
def appVersionName = '1.36.06'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -31,16 +31,21 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
compileSdkVersion 31
|
||||
|
||||
defaultConfig {
|
||||
applicationId "it.integry.integrywmsnative"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 31
|
||||
targetSdkVersion 33
|
||||
versionCode appVersionCode
|
||||
versionName appVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
signingConfig signingConfigs.release
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments += ["room.schemaLocation":
|
||||
"$projectDir/schemas".toString()]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@@ -55,12 +60,14 @@ android {
|
||||
}
|
||||
|
||||
android.buildFeatures.dataBinding true
|
||||
android.buildFeatures.buildConfig true
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
coreLibraryDesugaringEnabled true
|
||||
}
|
||||
|
||||
productFlavors {
|
||||
}
|
||||
|
||||
@@ -77,23 +84,21 @@ android {
|
||||
options.compilerArgs << "-Xmaxerrs" << "10000"
|
||||
}
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
dynamicFeatures = [":dynamic__base", ":dynamic_vgalimenti"]
|
||||
|
||||
|
||||
namespace 'it.integry.integrywmsnative'
|
||||
compileSdk 33
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation 'com.orhanobut:logger:2.2.0'
|
||||
implementation 'com.github.lupaulus:logger:2.3.2'
|
||||
|
||||
//Firebase
|
||||
|
||||
@@ -103,27 +108,32 @@ dependencies {
|
||||
implementation 'com.google.firebase:firebase-core'
|
||||
implementation 'com.google.firebase:firebase-crashlytics'
|
||||
implementation 'com.google.firebase:firebase-perf'
|
||||
implementation 'com.google.android.gms:play-services-basement:18.0.0'
|
||||
implementation 'com.google.android.gms:play-services-basement:18.2.0'
|
||||
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.5.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||
implementation 'com.google.android.material:material:1.9.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.1'
|
||||
|
||||
implementation('androidx.preference:preference-ktx:1.2.1') {
|
||||
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
|
||||
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
|
||||
}
|
||||
|
||||
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.annimon:stream:1.2.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.4.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
|
||||
// implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'org.apache.commons:commons-text:1.9'
|
||||
|
||||
//MVVM
|
||||
def dagger2_version = '2.40'
|
||||
def dagger2_version = '2.46.1'
|
||||
api "com.google.dagger:dagger:$dagger2_version"
|
||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||
api "com.google.dagger:dagger-android:$dagger2_version"
|
||||
@@ -142,10 +152,11 @@ dependencies {
|
||||
implementation 'com.github.pedromassango:doubleClick:3.0'
|
||||
|
||||
//SQLite ROOM
|
||||
def room_version = "2.4.1"
|
||||
def room_version = "2.5.2"
|
||||
|
||||
implementation "androidx.room:room-runtime:$room_version"
|
||||
annotationProcessor "androidx.room:room-compiler:$room_version"
|
||||
implementation "androidx.room:room-rxjava3:$room_version"
|
||||
|
||||
//AppUpdate
|
||||
implementation 'com.github.javiersantos:AppUpdater:2.7'
|
||||
@@ -164,6 +175,14 @@ dependencies {
|
||||
// testImplementation "org.junit.jupiter:junit-jupiter-api:5.8.1"
|
||||
// androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
|
||||
// androidTestImplementation 'org.testng:testng:7.4.0'
|
||||
|
||||
|
||||
//Bluetooth device manager
|
||||
implementation 'com.github.harry1453:android-bluetooth-serial:v1.1'
|
||||
|
||||
// RxJava is also required.
|
||||
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
|
||||
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="it.integry.integrywmsnative">
|
||||
<manifest xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||
|
||||
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="32" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="32"
|
||||
tools:ignore="ScopedStorage" />
|
||||
|
||||
<application
|
||||
android:name=".MainApplication"
|
||||
@@ -23,21 +33,28 @@
|
||||
android:requestLegacyExternalStorage="true">
|
||||
<activity
|
||||
android:name=".gest.spedizione.SpedizioneActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
<activity android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
<activity android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.prod_dettaglio_linea.ProdDettaglioLineaActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.picking_resi.PickingResiActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light" />
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.main.MainActivity"
|
||||
android:theme="@style/Light"
|
||||
@@ -49,24 +66,31 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".gest.accettazione_picking.AccettazionePickingActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
<activity
|
||||
android:name=".gest.login.LoginActivity"
|
||||
android:theme="@style/Light" />
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.accettazione_ordini_picking.AccettazioneOrdiniPickingActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.lista_bancali.ListaBancaliActivity"
|
||||
android:label="@string/activity_lista_bancali_title"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light" />
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.contenuto_bancale.ContenutoBancaleActivity"
|
||||
android:label="@string/activity_contenuto_bancale_title"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light" />
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.inventario.picking.PickingInventarioActivity"
|
||||
android:label="@string/activity_picking_inventario_title"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"/>
|
||||
|
||||
<meta-data
|
||||
android:name="firebase_crashlytics_collection_enabled"
|
||||
@@ -84,6 +108,11 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".gest.accettazione_bolla_picking.AccettazioneBollaPickingActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light" />
|
||||
|
||||
<provider
|
||||
android:name=".core.update.GenericFileProvider"
|
||||
android:authorities="${applicationId}.core.update.GenericFileProvider"
|
||||
|
||||
@@ -3,11 +3,13 @@ package it.integry.integrywmsnative;
|
||||
import android.app.Application;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.util.Log;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.context.AppContext;
|
||||
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
|
||||
|
||||
public class MainApplication extends Application {
|
||||
@@ -19,6 +21,8 @@ public class MainApplication extends Application {
|
||||
public static MainApplicationModule appModule;
|
||||
public static RoomModule roomModule;
|
||||
|
||||
private Thread.UncaughtExceptionHandler defaultUncaughtExceptionHandler;
|
||||
|
||||
@Inject
|
||||
AppContext appContext;
|
||||
|
||||
@@ -40,6 +44,9 @@ public class MainApplication extends Application {
|
||||
appComponent.inject(this);
|
||||
|
||||
res = getResources();
|
||||
|
||||
defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
|
||||
Thread.setDefaultUncaughtExceptionHandler(_unCaughtExceptionHandler);
|
||||
}
|
||||
|
||||
// Called by the system when the device configuration changes while your component is running.
|
||||
@@ -61,4 +68,22 @@ public class MainApplication extends Application {
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
|
||||
// handler listener
|
||||
private final Thread.UncaughtExceptionHandler _unCaughtExceptionHandler =
|
||||
new Thread.UncaughtExceptionHandler() {
|
||||
@Override
|
||||
public void uncaughtException(Thread thread, Throwable ex) {
|
||||
// re-throw critical exception further to the os (important)
|
||||
defaultUncaughtExceptionHandler.uncaughtException(thread, ex);
|
||||
|
||||
try {
|
||||
UtilityLogger.error(new Exception(ex));
|
||||
MainApplication.exit();
|
||||
} catch (Exception e) {
|
||||
Log.e("Uncaught error", "Exception Logger failed!", e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -7,12 +7,18 @@ import it.integry.integrywmsnative.core.context.AppContext;
|
||||
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivityComponent;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivityModule;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragmentComponent;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragmentModule;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragmentComponent;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragmentModule;
|
||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneModule;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingModule;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.MainAccettazioneBollaElencoComponent;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.MainAccettazioneBollaElencoModule;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.AccettazioneBollaPickingComponent;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.AccettazioneBollaPickingModule;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazioneOrdiniElencoComponent;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazioneOrdiniElencoModule;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingComponent;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoComponent;
|
||||
@@ -23,6 +29,16 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.sele
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsModule;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||
import it.integry.integrywmsnative.gest.inventario.ElencoInventariComponent;
|
||||
import it.integry.integrywmsnative.gest.inventario.ElencoInventariModule;
|
||||
import it.integry.integrywmsnative.gest.inventario.bottom_sheet__inventario_actions.BottomSheetInventarioActionsComponent;
|
||||
import it.integry.integrywmsnative.gest.inventario.bottom_sheet__inventario_actions.BottomSheetInventarioActionsModule;
|
||||
import it.integry.integrywmsnative.gest.inventario.bottom_sheet__inventario_row_actions.BottomSheetInventarioRowActionsComponent;
|
||||
import it.integry.integrywmsnative.gest.inventario.bottom_sheet__inventario_row_actions.BottomSheetInventarioRowActionsModule;
|
||||
import it.integry.integrywmsnative.gest.inventario.dialogs.ask_info_inventario.DialogAskInfoInventarioComponent;
|
||||
import it.integry.integrywmsnative.gest.inventario.dialogs.ask_info_inventario.DialogAskInfoInventarioModule;
|
||||
import it.integry.integrywmsnative.gest.inventario.picking.PickingInventarioComponent;
|
||||
import it.integry.integrywmsnative.gest.inventario.picking.PickingInventarioModule;
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliComponent;
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliModule;
|
||||
import it.integry.integrywmsnative.gest.login.LoginComponent;
|
||||
@@ -39,26 +55,41 @@ import it.integry.integrywmsnative.gest.picking_resi.PickingResiComponent;
|
||||
import it.integry.integrywmsnative.gest.picking_resi.PickingResiModule;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoModule;
|
||||
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaModule;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdModule;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaModule;
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.ProdLineeProduzioneComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.ProdLineeProduzioneModule;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeModule;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail.ProdRientroMerceOrderDetailComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeModule;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale_su_mag_prossimita.ProdVersamentoMaterialeInBufferComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale_su_mag_prossimita.ProdVersamentoMaterialeInBufferModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.DialogEditArticoloComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.DialogEditArticoloModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.edit_articolo.DialogEditArticoloComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.edit_articolo.DialogEditArticoloModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.selectArtFromList.DialogSelectArtToOrderComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.selectArtFromList.DialogSelectArtToOrderModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.dialogs.DialogScanGrigliaAcquistoComponent;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeComponent;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeModule;
|
||||
import it.integry.integrywmsnative.gest.settings.MainSettingsComponent;
|
||||
import it.integry.integrywmsnative.gest.settings.MainSettingsModule;
|
||||
import it.integry.integrywmsnative.gest.spedizione.SpedizioneComponent;
|
||||
import it.integry.integrywmsnative.gest.spedizione.SpedizioneModule;
|
||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.print_sscc_list.DialogPrintOrderSSCCListComponent;
|
||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.print_sscc_list.DialogPrintOrderSSCCListModule;
|
||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.info_situazione_articolo.DialogInfoSituazioneArticoloComponent;
|
||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.info_situazione_articolo.DialogInfoSituazioneArticoloModule;
|
||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.prod_fabbisogno_linee_prod.DialogRowInfoProdFabbisognoLineeProdComponent;
|
||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.prod_fabbisogno_linee_prod.DialogRowInfoProdFabbisognoLineeProdModule;
|
||||
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteComponent;
|
||||
@@ -67,17 +98,33 @@ import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviForn
|
||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreModule;
|
||||
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceComponent;
|
||||
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceModule;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__item_edit.BottomSheetItemEditComponent;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__item_edit.BottomSheetItemEditModule;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalComponent;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromMtbAartListComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromMtbAartListModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.DialogChooseArtsFromMtbColrListComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.DialogChooseArtsFromMtbColrListModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialogComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_peso_lu.DialogInputPesoLUComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_peso_lu.DialogInputPesoLUModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_to_return.DialogInputQuantityToReturnComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_to_return.DialogInputQuantityToReturnModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Component;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Module;
|
||||
import it.integry.integrywmsnative.view.dialogs.printSsccUl.DialogPrintUlSSCCComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.printSsccUl.DialogPrintUlSSCCModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUComponent;
|
||||
@@ -91,18 +138,20 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
MainApplicationModule.class,
|
||||
BaseActivityModule.class,
|
||||
BaseFragmentModule.class,
|
||||
BaseDialogFragmentModule.class,
|
||||
LoginModule.class,
|
||||
MainActivityModule.class,
|
||||
MainFragmentModule.class,
|
||||
MainAccettazioneModule.class,
|
||||
MainAccettazioneOrdiniElencoModule.class,
|
||||
ListaBancaliModule.class,
|
||||
ContenutoBancaleModule.class,
|
||||
PVOrdiniAcquistoGrigliaModule.class,
|
||||
PVOrdineAcquistoEditModule.class,
|
||||
PickingLiberoModule.class,
|
||||
RettificaGiacenzeModule.class,
|
||||
ElencoInventariModule.class,
|
||||
SpedizioneModule.class,
|
||||
AccettazionePickingModule.class,
|
||||
AccettazioneOrdiniPickingModule.class,
|
||||
UltimeConsegneClienteModule.class,
|
||||
UltimiArriviFornitoreModule.class,
|
||||
PickingResiModule.class,
|
||||
@@ -119,13 +168,34 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
ProdOrdineProduzioneElencoModule.class,
|
||||
ProdRecuperoMaterialeModule.class,
|
||||
ProdVersamentoMaterialeModule.class,
|
||||
DialogChooseArtsFromListaArtsModule.class,
|
||||
DialogChooseArtsFromMtbColrListModule.class,
|
||||
DocInterniModule.class,
|
||||
DialogSelectDocInfoModule.class,
|
||||
DocInterniEditFormModule.class,
|
||||
DialogSelectDocRowsModule.class,
|
||||
DialogAskClienteModule.class,
|
||||
DialogEditArticoloModule.class
|
||||
DialogEditArticoloModule.class,
|
||||
DialogPrintOrderSSCCListModule.class,
|
||||
ProdLineeProduzioneModule.class,
|
||||
ProdDettaglioLineaModule.class,
|
||||
DialogPrintUlSSCCModule.class,
|
||||
DialogAskInfoInventarioModule.class,
|
||||
DialogInputPesoLUModule.class,
|
||||
PickingInventarioModule.class,
|
||||
BottomSheetItemEditModule.class,
|
||||
BottomSheetInventarioActionsModule.class,
|
||||
BottomSheetInventarioRowActionsModule.class,
|
||||
BottomSheetMtbColrEditModalModule.class,
|
||||
DialogChooseArtsFromMtbAartListModule.class,
|
||||
MainSettingsModule.class,
|
||||
DialogInfoSituazioneArticoloModule.class,
|
||||
DialogSelectArtToOrderModule.class,
|
||||
MainAccettazioneBollaElencoModule.class,
|
||||
AccettazioneBollaPickingModule.class,
|
||||
DialogBindProductBarcodeWithPackageModule.class,
|
||||
DialogAskUnknownBarcodeNotesModule.class,
|
||||
ProdVersamentoMaterialeInBufferModule.class,
|
||||
DialogInputQuantityToReturnModule.class
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
@@ -133,6 +203,8 @@ public interface MainApplicationComponent {
|
||||
|
||||
BaseFragmentComponent.Factory baseFragmentComponent();
|
||||
|
||||
BaseDialogFragmentComponent.Factory baseDialogFragmentComponent();
|
||||
|
||||
SplashActivityComponent.Factory splashActivityComponent();
|
||||
|
||||
LoginComponent.Factory loginActivityComponent();
|
||||
@@ -141,7 +213,7 @@ public interface MainApplicationComponent {
|
||||
|
||||
MainFragmentComponent.Factory mainFragmentComponent();
|
||||
|
||||
MainAccettazioneComponent.Factory mainAccettazioneComponent();
|
||||
MainAccettazioneOrdiniElencoComponent.Factory mainAccettazioneOrdiniComponent();
|
||||
|
||||
ListaBancaliComponent.Factory listaBancaliComponent();
|
||||
|
||||
@@ -155,9 +227,11 @@ public interface MainApplicationComponent {
|
||||
|
||||
RettificaGiacenzeComponent.Factory rettificaGiacenzeComponent();
|
||||
|
||||
ElencoInventariComponent.Factory inventarioComponent();
|
||||
|
||||
SpedizioneComponent.Factory spedizioneComponent();
|
||||
|
||||
AccettazionePickingComponent.Factory accettazionePickingComponent();
|
||||
AccettazioneOrdiniPickingComponent.Factory accettazionePickingComponent();
|
||||
|
||||
UltimeConsegneClienteComponent.Factory ultimeConsegneClienteComponent();
|
||||
|
||||
@@ -183,6 +257,8 @@ public interface MainApplicationComponent {
|
||||
|
||||
DialogAskMagazzinoProssimitaComponent.Factory dialogAskMagazzinoProssimitaComponent();
|
||||
|
||||
DialogScanGrigliaAcquistoComponent.Factory dialogScanLisAComponent();
|
||||
|
||||
DialogChooseBatchLotComponent.Factory dialogChooseBatchLotComponent();
|
||||
|
||||
DialogRowInfoProdFabbisognoLineeProdComponent.Factory dialogRowInfoProdFabbisognoLineeProdComponent();
|
||||
@@ -197,13 +273,11 @@ public interface MainApplicationComponent {
|
||||
|
||||
ProdVersamentoMaterialeComponent.Factory prodVersamentoMaterialeComponent();
|
||||
|
||||
DialogChooseArtsFromListaArtsComponent.Factory dialogChooseArtsFromListaArtsComponent();
|
||||
DialogChooseArtsFromMtbColrListComponent.Factory dialogChooseArtsFromListaArtsComponent();
|
||||
|
||||
DocInterniComponent.Factory docInterniComponent();
|
||||
|
||||
DialogSelectDocInfoComponent.Factory dialogSelectMgrpDtipPairComponent();
|
||||
|
||||
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsComponent();
|
||||
DialogSelectDocInfoComponent.Factory dialogSelectDocInfoNewViewComponent();
|
||||
|
||||
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
||||
|
||||
@@ -211,6 +285,50 @@ public interface MainApplicationComponent {
|
||||
|
||||
DialogEditArticoloComponent.Factory dialogEditArticoloComponent();
|
||||
|
||||
DialogPrintOrderSSCCListComponent.Factory dialogPrintOrderSSCCListComponent();
|
||||
|
||||
ProdLineeProduzioneComponent.Factory prodLineeProduzioneComponent();
|
||||
|
||||
ProdDettaglioLineaComponent.Factory prodDettaglioLineaComponent();
|
||||
|
||||
DialogPrintUlSSCCComponent.Factory dialogPrintUlSSCCComponent();
|
||||
|
||||
DialogAskInfoInventarioComponent.Factory dialogAskInfoInventarioComponent();
|
||||
|
||||
DialogInputPesoLUComponent.Factory dialogInputPesoLUComponent();
|
||||
|
||||
PickingInventarioComponent.Factory pickingInventarioComponent();
|
||||
|
||||
BottomSheetItemEditComponent.Factory bottomSheetItemEditComponent();
|
||||
|
||||
BottomSheetInventarioActionsComponent.Factory bottomSheetInventarioActionsComponent();
|
||||
|
||||
BottomSheetInventarioRowActionsComponent.Factory bottomSheetInventarioRowActionsComponent();
|
||||
|
||||
BottomSheetMtbColrEditModalComponent.Factory bottomSheetMtbColrEditModalComponent();
|
||||
|
||||
DialogChooseArtsFromMtbAartListComponent.Factory dialogDialogDialogChooseArtsFromMtbAartListViewComponent();
|
||||
|
||||
MainSettingsComponent.Factory mainSettingsFragmentComponent();
|
||||
|
||||
DialogInfoSituazioneArticoloComponent.Factory dialogInfoSituazioneArticoloComponent();
|
||||
|
||||
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsNewComponent();
|
||||
|
||||
DialogSelectArtToOrderComponent.Factory dialogSelectArtToOrderNewComponent();
|
||||
|
||||
MainAccettazioneBollaElencoComponent.Factory mainAccettazioneBollaElencoComponent();
|
||||
|
||||
AccettazioneBollaPickingComponent.Factory accettazioneBollaPickingComponent();
|
||||
|
||||
DialogBindProductBarcodeWithPackageComponent.Factory dialogBindProductBarcodeWithPackageComponent();
|
||||
|
||||
DialogAskUnknownBarcodeNotesComponent.Factory dialogAskUnknownBarcodeNotesComponent();
|
||||
|
||||
ProdVersamentoMaterialeInBufferComponent.Factory prodVersamentoMaterialeInBufferComponent();
|
||||
|
||||
DialogInputQuantityToReturnComponent.Factory dialogInputQuantityToReturnComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package it.integry.integrywmsnative;
|
||||
|
||||
import android.app.Application;
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.core.os.HandlerCompat;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
@@ -13,20 +19,30 @@ import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||
import it.integry.integrywmsnative.core.menu.MenuRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.menu.MenuService;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.AziendaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliAccettazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliSpedizioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.CommessaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DocumentRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoBufferRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PVOrdiniAcquistoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||
@@ -48,6 +64,24 @@ public class MainApplicationModule {
|
||||
return mApplication;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
public ExecutorService providesExecutorService() {
|
||||
return Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
public Handler providesMainThreadHandler() {
|
||||
return HandlerCompat.createAsync(mApplication.getApplicationContext().getMainLooper());
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
public SettingsManager provideSettingsManager(SystemRESTConsumer systemRESTConsumer, AziendaRESTConsumer aziendaRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer, GestSetupRESTConsumer gestSetupRESTConsumer) {
|
||||
return new SettingsManager(mApplication, systemRESTConsumer, aziendaRESTConsumer, gestSetupRESTConsumer, posizioniRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
AppContext providesAppContext() {
|
||||
@@ -56,8 +90,8 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MainContext providesMainContextNew(MenuService menuService, AppDatabase appDatabase) {
|
||||
return new MainContext(mApplication.getApplicationContext(), menuService, appDatabase);
|
||||
MainContext providesMainContextNew(MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new MainContext(mApplication.getApplicationContext(), menuService, appDatabase, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -130,8 +164,8 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MagazzinoRESTConsumer provideMagazzinoRESTConsumer() {
|
||||
return new MagazzinoRESTConsumer();
|
||||
MagazzinoRESTConsumer provideMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new MagazzinoRESTConsumer(systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -148,8 +182,17 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
||||
return new ColliMagazzinoRESTConsumer(systemRESTConsumer, articoloRESTConsumer, entityRESTConsumer);
|
||||
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer,
|
||||
ArticoloRESTConsumer articoloRESTConsumer,
|
||||
EntityRESTConsumer entityRESTConsumer,
|
||||
SettingsManager settingsManager) {
|
||||
return new ColliMagazzinoRESTConsumer(systemRESTConsumer, articoloRESTConsumer, entityRESTConsumer, settingsManager);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
AziendaRESTConsumer provideAziendaRESTConsumer() {
|
||||
return new AziendaRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -170,6 +213,12 @@ public class MainApplicationModule {
|
||||
return new SystemRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
PVOrdiniAcquistoRESTConsumer providesPVOrdiniAcquistoRESTConsumer(MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||
return new PVOrdiniAcquistoRESTConsumer(magazzinoRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
PosizioniRESTConsumer providesPosizioniRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
@@ -184,8 +233,8 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DocInterniRESTConsumer provideDocInterniRESTConsumer() {
|
||||
return new DocInterniRESTConsumer();
|
||||
DocInterniRESTConsumer provideDocInterniRESTConsumer(MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||
return new DocInterniRESTConsumer(magazzinoRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -200,4 +249,46 @@ public class MainApplicationModule {
|
||||
return new InventarioService(giacenzaRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ProductionLinesRESTConsumer provideProductionLinesRESTConsumer() {
|
||||
return new ProductionLinesRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DocumentRESTConsumer provideDocumentiRESTConsumer() {
|
||||
return new DocumentRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ColliAccettazioneRESTConsumer provideColliAccettazioneRESTConsumer() {
|
||||
return new ColliAccettazioneRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ColliSpedizioneRESTConsumer provideColliSpedizioneRESTConsumer() {
|
||||
return new ColliSpedizioneRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ColliLavorazioneRESTConsumer provideColliLavorazioneRESTConsumer(SettingsManager settingsManager) {
|
||||
return new ColliLavorazioneRESTConsumer(settingsManager);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MagazzinoAutomaticoRESTConsumer provideMagazzinoAutomaticoRESTConsumer() {
|
||||
return new MagazzinoAutomaticoRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MagazzinoBufferRESTConsumer provideMagazzinoBufferRESTConsumer() {
|
||||
return new MagazzinoBufferRESTConsumer();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -83,12 +83,13 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
|
||||
|
||||
private void initPermissions(Runnable onComplete) {
|
||||
PermissionsHelper.askPermissions(this, onComplete, permanentlyDenied -> {
|
||||
if (permanentlyDenied) {
|
||||
if (permanentlyDenied)
|
||||
onError(new SpannableString(getText(R.string.permissions_permanently_denied)));
|
||||
|
||||
} else {
|
||||
initPermissions(onComplete);
|
||||
}
|
||||
|
||||
// else {
|
||||
// initPermissions(onComplete);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,9 @@ public class CommonConst {
|
||||
public static class Login {
|
||||
|
||||
public static class Azienda {
|
||||
public static String protocol = "https";
|
||||
public static String host = "www2.studioml.it";
|
||||
public static int port = 80;
|
||||
public static int port = 443;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
package it.integry.integrywmsnative.core.barcode_reader;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Pair;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.barcode_base_android_library.interfaces.BarcodeReaderInterface;
|
||||
import it.integry.barcode_base_android_library.model.BarcodeSetting;
|
||||
import it.integry.honeywellscannerlibrary.HoneyWellBarcodeReader;
|
||||
import it.integry.integrywmsnative.gest.settings.MainSettingsFragment;
|
||||
import it.integry.keyobardemulatorscannerlibrary.KeyboardEmulatorBarcodeReader;
|
||||
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
|
||||
import it.integry.zebrascannerlibrary.ZebraBarcodeReader;
|
||||
@@ -21,12 +27,7 @@ public class BarcodeManager {
|
||||
private static boolean mEnabled = true;
|
||||
|
||||
|
||||
private static final Class<? extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{
|
||||
PointMobileBarcodeReader.class,
|
||||
ZebraBarcodeReader.class,
|
||||
HoneyWellBarcodeReader.class,
|
||||
KeyboardEmulatorBarcodeReader.class
|
||||
};
|
||||
private static final Class<? extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{PointMobileBarcodeReader.class, ZebraBarcodeReader.class, HoneyWellBarcodeReader.class, KeyboardEmulatorBarcodeReader.class};
|
||||
|
||||
|
||||
public static void init(Context applicationContext) throws Exception {
|
||||
@@ -65,6 +66,18 @@ public class BarcodeManager {
|
||||
}
|
||||
});
|
||||
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(applicationContext);
|
||||
var additionalSettings = new ArrayList<Pair<String, Object>>();
|
||||
var scanDelay = sharedPreferences.getString(MainSettingsFragment.KEY_TRIGGER_SCAN_DELAY, null);
|
||||
var scanDelaySetting = new Pair<String, Object>(BarcodeSetting.P_TRIGGER_SCAN_DELAY, scanDelay);
|
||||
additionalSettings.add(scanDelaySetting);
|
||||
|
||||
var scanMode = sharedPreferences.getString(MainSettingsFragment.KEY_TRIGGER_SCAN_MODE, null);
|
||||
var scanModeSetting = new Pair<String, Object>(BarcodeSetting.P_TRIGGER_SCAN_MODE, scanMode);
|
||||
additionalSettings.add(scanModeSetting);
|
||||
|
||||
BarcodeManager.changeSettings(additionalSettings);
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -81,8 +94,7 @@ public class BarcodeManager {
|
||||
}
|
||||
|
||||
public static boolean onKeyDown(int keyCode, KeyEvent keyEvent) {
|
||||
if (mCurrentBarcodeInterface != null)
|
||||
mCurrentBarcodeInterface.onKeyEvent(keyEvent);
|
||||
if (mCurrentBarcodeInterface != null) mCurrentBarcodeInterface.onKeyEvent(keyEvent);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -123,16 +135,21 @@ public class BarcodeManager {
|
||||
|
||||
public static void disable() {
|
||||
mEnabled = false;
|
||||
// UtilityLogger.info("Barcode reader disabled");
|
||||
}
|
||||
|
||||
public static void enable() {
|
||||
mEnabled = true;
|
||||
// UtilityLogger.info("Barcode reader enabled");
|
||||
}
|
||||
|
||||
public static boolean isEnabled() {
|
||||
return mEnabled;
|
||||
}
|
||||
|
||||
public static void changeSettings(List<Pair<String, Object>> settings) {
|
||||
mCurrentBarcodeInterface.changeSettings(settings);
|
||||
}
|
||||
|
||||
public static boolean isKeyboardEmulator() {
|
||||
return mCurrentBarcodeInterface instanceof KeyboardEmulatorBarcodeReader;
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
||||
|
||||
public class BaseCustomConfiguration implements ICustomConfiguration {
|
||||
|
||||
|
||||
public static class Keys {
|
||||
public static int FLAG_SHOW_COD_FORN_IN_SPEDIZIONE = 1;
|
||||
public static int CUSTOM_DYNAMIC_VERSION_PATH = 2;
|
||||
public static int FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC = 3;
|
||||
}
|
||||
|
||||
protected HashMap<Integer, Object> configurations = new HashMap<>() {{
|
||||
put(Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE, true);
|
||||
put(Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC, false);
|
||||
}};
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public <T> T getConfig(int key) {
|
||||
return UtilityHashMap.getValue(configurations, key);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ClassRouter {
|
||||
|
||||
public enum PATH {
|
||||
FILTRO_ORDINI_VENDITA,
|
||||
ORDINI_VENDITA,
|
||||
CUSTOM_CONFIGURATION,
|
||||
BARCODE_CUSTOMIZATION
|
||||
}
|
||||
|
||||
private static Context context;
|
||||
|
||||
private static List<Pair<PATH, Object>> mRouteClasses = new ArrayList<>();
|
||||
|
||||
public static void init() {
|
||||
// ClassRouter.context = context;
|
||||
}
|
||||
|
||||
private static boolean checkIClassExists(PATH path) {
|
||||
boolean methodAlreadyDeclared = false;
|
||||
|
||||
for(int i = 0; i < mRouteClasses.size() && !methodAlreadyDeclared; i++) {
|
||||
if(mRouteClasses.get(i).first == path) methodAlreadyDeclared = true;
|
||||
}
|
||||
|
||||
return methodAlreadyDeclared;
|
||||
}
|
||||
|
||||
|
||||
private static int getClassIndex(PATH path) {
|
||||
for(int i = 0; i < mRouteClasses.size(); i++) {
|
||||
if(mRouteClasses.get(i).first == path) return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static void registerPath(PATH path, Class clazz) {
|
||||
if(checkIClassExists(path)) {
|
||||
//throw new MethodPathAlreadyDeclaredException(path);
|
||||
}
|
||||
|
||||
try {
|
||||
mRouteClasses.add(new Pair<>(path, clazz.newInstance()));
|
||||
} catch (IllegalAccessException | InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void deregisterPath(PATH path) {
|
||||
if(checkIClassExists(path)) {
|
||||
mRouteClasses.remove(getClassIndex(path));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static <T> T getInstance(PATH path) {
|
||||
try {
|
||||
|
||||
if (!checkIClassExists(path)) {
|
||||
// throw new MethodPathNotRegisteredException(path);
|
||||
}
|
||||
|
||||
Object instance = mRouteClasses.get(getClassIndex(path)).second;
|
||||
|
||||
return (T)instance;
|
||||
|
||||
} catch (Exception ex) {
|
||||
// UtilityExceptions.defaultException(null, ex, true);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -2,17 +2,22 @@ package it.integry.integrywmsnative.core.class_router.configs;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.MainAccettazioneBollaElencoFragment;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazioneOrdiniElencoFragment;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniFragment;
|
||||
import it.integry.integrywmsnative.gest.inventario.ElencoInventariFragment;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoFragment;
|
||||
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.ProdLineeProduzioneFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale_su_mag_prossimita.ProdVersamentoMaterialeInBufferFragment;
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaFragment;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment;
|
||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.info_situazione_articolo.DialogInfoSituazioneArticoloView;
|
||||
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteFragment;
|
||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreFragment;
|
||||
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceFragment;
|
||||
@@ -32,10 +37,18 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_accettazione)
|
||||
.setCodMenu("MG044")
|
||||
.setTitleText(R.string.accettazione_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_accettazione)
|
||||
.setTitleText(R.string.accettazione_ordine_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_accettazione_ordini)
|
||||
.setDrawerIcon(R.drawable.ic_black_download)
|
||||
.setFragmentFactory(MainAccettazioneFragment::newInstance))
|
||||
.setFragmentFactory(MainAccettazioneOrdiniElencoFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_accettazione_bolle)
|
||||
.setCodMenu("MG065")
|
||||
.setTitleText(R.string.accettazione_bolle_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_accettazione_bolle)
|
||||
.setDrawerIcon(R.drawable.ic_black_download)
|
||||
.setFragmentFactory(MainAccettazioneBollaElencoFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_resi_fornitore)
|
||||
@@ -45,137 +58,169 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setDrawerIcon(R.drawable.ic_black_latest_delivery)
|
||||
.setFragmentFactory(UltimiArriviFornitoreFragment::newInstance))
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
.setGroupText(R.string.checkout)
|
||||
.setGroupId(R.id.nav_group_spedizione)
|
||||
.setCodMenu("MM010")
|
||||
new MenuGroup()
|
||||
.setGroupText(R.string.checkout)
|
||||
.setGroupId(R.id.nav_group_spedizione)
|
||||
.setCodMenu("MM010")
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_spedizione)
|
||||
.setCodMenu("MG046")
|
||||
.setTitleText(R.string.vendita_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_spedizione)
|
||||
.setDrawerIcon(R.drawable.ic_upload)
|
||||
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.VENDITA, null, -1, DialogInfoSituazioneArticoloView.class)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_rettifica_spedizione)
|
||||
.setCodMenu("MG064")
|
||||
.setTitleText(R.string.rettifica_spedizione_fragment_title)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_rettifica_spedizione)
|
||||
.setDrawerIcon(R.drawable.ic_rettifica_spedizione_drawer)
|
||||
.setFragmentFactory(() -> RettificaGiacenzeFragment.newInstance(GestioneEnum.VENDITA)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_free_picking)
|
||||
.setCodMenu("MG047")
|
||||
.setTitleText(R.string.free_picking)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_picking_libero)
|
||||
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.VENDITA)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_resi_cliente)
|
||||
.setCodMenu("MG048")
|
||||
.setTitleText(R.string.fragment_ultime_consegne_cliente_title)
|
||||
.setTitleIcon(R.drawable.ic_latest_delivery_customer)
|
||||
.setDrawerIcon(R.drawable.ic_black_latest_delivery)
|
||||
.setFragmentFactory(UltimeConsegneClienteFragment::newInstance))
|
||||
).addGroup(new MenuGroup()
|
||||
.setGroupText(R.string.manufacture)
|
||||
.setGroupId(R.id.nav_group_produzione)
|
||||
.setCodMenu("MM009")
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_spedizione)
|
||||
.setCodMenu("MG046")
|
||||
.setTitleText(R.string.vendita_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_spedizione)
|
||||
.setDrawerIcon(R.drawable.ic_black_upload)
|
||||
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.VENDITA, null, -1, null)))
|
||||
.setID(R.id.nav_prod_ordine_produzione)
|
||||
.setCodMenu("MG049")
|
||||
.setTitleText(R.string.prod_ordine_produzione_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_accettazione_produzione)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdOrdineProduzioneElencoFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_free_picking)
|
||||
.setCodMenu("MG047")
|
||||
.setTitleText(R.string.free_picking)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_picking_libero)
|
||||
.setID(R.id.nav_prod_ordine_lavorazione)
|
||||
.setCodMenu("MG050")
|
||||
.setTitleText(R.string.prod_ordine_lavorazione_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_lavorazione)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, null)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_free_lav_picking)
|
||||
.setCodMenu("MG051")
|
||||
.setTitleText(R.string.free_lav_picking)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
|
||||
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.VENDITA)))
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.LAVORAZIONE)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_resi_cliente)
|
||||
.setCodMenu("MG048")
|
||||
.setTitleText(R.string.fragment_ultime_consegne_cliente_title)
|
||||
.setTitleIcon(R.drawable.ic_latest_delivery_customer)
|
||||
.setDrawerIcon(R.drawable.ic_black_latest_delivery)
|
||||
.setFragmentFactory(UltimeConsegneClienteFragment::newInstance))
|
||||
).addGroup(new MenuGroup()
|
||||
.setGroupText(R.string.manufacture)
|
||||
.setGroupId(R.id.nav_group_produzione)
|
||||
.setCodMenu("MM009")
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_ordine_produzione)
|
||||
.setCodMenu("MG049")
|
||||
.setTitleText(R.string.prod_ordine_produzione_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_accettazione_produzione)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdOrdineProduzioneElencoFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_ordine_lavorazione)
|
||||
.setCodMenu("MG050")
|
||||
.setTitleText(R.string.prod_ordine_lavorazione_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_lavorazione)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, null)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_free_lav_picking)
|
||||
.setCodMenu("MG051")
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.free_lav_picking)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_barcode_scanner)
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.LAVORAZIONE)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_posizionamento_da_ord)
|
||||
.setCodMenu("MG052")
|
||||
.setTitleText(R.string.prod_fabbisogno_linee_prod_title)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_merce)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_load_shelf)
|
||||
.setFragmentFactory(ProdFabbisognoLineeProdFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_versamento_materiale)
|
||||
.setCodMenu("MG053")
|
||||
.setTitleText(R.string.prod_versamento_materiale_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_materiale)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdVersamentoMaterialeFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_recupero_materiale)
|
||||
.setCodMenu("MG054")
|
||||
.setTitleText(R.string.prod_recupero_materiale_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_recupero_materiale)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdRecuperoMaterialeFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_prod_rientro_merce)
|
||||
.setCodMenu("MG059")
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.rientro_merce_fragment_title)
|
||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_prod_accettazione_produzione)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdRientroMerceFragment::newInstance))
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
.setGroupText(R.string.internal_handling)
|
||||
.setGroupId(R.id.nav_group_movimentazione_interna)
|
||||
.setCodMenu("MM011")
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_versamento_merce)
|
||||
.setCodMenu("MG055")
|
||||
.setTitleText(R.string.versamento_merce_fragment_title)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_versamento_merce)
|
||||
.setID(R.id.nav_prod_posizionamento_da_ord)
|
||||
.setCodMenu("MG052")
|
||||
.setTitleText(R.string.prod_fabbisogno_linee_prod_title)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_merce)
|
||||
.setDrawerIcon(R.drawable.ic_black_load_shelf)
|
||||
.setFragmentFactory(VersamentoMerceFragment::newInstance))
|
||||
.setFragmentFactory(ProdFabbisognoLineeProdFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_rettifica_giacenze)
|
||||
.setCodMenu("MG056")
|
||||
.setTitleText(R.string.rettifica_giacenze_fragment_title)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_rettifica_giacenze)
|
||||
.setDrawerIcon(R.drawable.ic_black_empty_box)
|
||||
.setFragmentFactory(RettificaGiacenzeFragment::newInstance))
|
||||
|
||||
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
.setCodMenu("MM012")
|
||||
.setGroupText(it.integry.integrywmsnative.R.string.punto_vendita)
|
||||
.setGroupId(it.integry.integrywmsnative.R.id.nav_group_puntivendita)
|
||||
.setID(R.id.nav_prod_versamento_materiale)
|
||||
.setCodMenu("MG053")
|
||||
.setTitleText(R.string.prod_versamento_materiale_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_materiale)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdVersamentoMaterialeFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setCodMenu("MG057")
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto)
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.generate_orders)
|
||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||
.setFragmentFactory(PVOrdiniAcquistoGrigliaFragment::newInstance))
|
||||
.setID(R.id.nav_prod_recupero_materiale)
|
||||
.setCodMenu("MG054")
|
||||
.setTitleText(R.string.prod_recupero_materiale_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_recupero_materiale)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdRecuperoMaterialeFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setCodMenu("MG058")
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_pv_doc_interni)
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.doc_interni)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_contab_doc_interni)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_contab_doc_interni)
|
||||
.setFragmentFactory(DocInterniFragment::newInstance))
|
||||
.setID(R.id.nav_prod_rientro_merce)
|
||||
.setCodMenu("MG059")
|
||||
.setTitleText(R.string.rientro_merce_fragment_title)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_accettazione_produzione)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdRientroMerceFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_linee)
|
||||
.setCodMenu("MG061")
|
||||
.setTitleText(R.string.nav_prod_linee_title)
|
||||
.setTitleIcon(R.drawable.ic_production_line)
|
||||
.setDrawerIcon(R.drawable.ic_production_line)
|
||||
.setFragmentFactory(ProdLineeProduzioneFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_versamento_materiale_in_buffer)
|
||||
.setCodMenu("MG066")
|
||||
.setTitleText(R.string.prod_versamento_materiale_in_buffer_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_materiale)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdVersamentoMaterialeInBufferFragment::newInstance))
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
.setGroupText(R.string.internal_handling)
|
||||
.setGroupId(R.id.nav_group_movimentazione_interna)
|
||||
.setCodMenu("MM011")
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_versamento_merce)
|
||||
.setCodMenu("MG055")
|
||||
.setTitleText(R.string.versamento_merce_fragment_title)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_versamento_merce)
|
||||
.setDrawerIcon(R.drawable.ic_black_load_shelf)
|
||||
.setFragmentFactory(VersamentoMerceFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_rettifica_giacenze)
|
||||
.setCodMenu("MG056")
|
||||
.setTitleText(R.string.rettifica_giacenze_fragment_title)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_rettifica_giacenze)
|
||||
.setDrawerIcon(R.drawable.ic_black_empty_box)
|
||||
.setFragmentFactory(RettificaGiacenzeFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_inventario)
|
||||
.setCodMenu("MG062")
|
||||
.setTitleText(R.string.inventario_fragment_title)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_rettifica_giacenze)
|
||||
.setDrawerIcon(R.drawable.ic_black_empty_box)
|
||||
.setFragmentFactory(ElencoInventariFragment::newInstance))
|
||||
|
||||
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
.setCodMenu("MM012")
|
||||
.setGroupText(it.integry.integrywmsnative.R.string.punto_vendita)
|
||||
.setGroupId(it.integry.integrywmsnative.R.id.nav_group_puntivendita)
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setCodMenu("MG057")
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto)
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.generate_orders)
|
||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||
.setFragmentFactory(PVOrdiniAcquistoGrigliaFragment::newInstance))
|
||||
.addItem(new MenuItem()
|
||||
.setCodMenu("MG058")
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_pv_doc_interni)
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.doc_interni)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_contab_doc_interni)
|
||||
.setDrawerIcon(R.drawable.ic_documents_outline)
|
||||
.setFragmentFactory(DocInterniFragment::newInstance))
|
||||
|
||||
// .addItem(new MenuItem()
|
||||
// .setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto_trasmessi)
|
||||
@@ -183,7 +228,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
// .setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_trasmitted_orders_list)
|
||||
// .setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_trasmitted_orders_list)
|
||||
// .setFragmentClass(PVOrdiniAcquistoTransmittedListFragment.newInstance()))
|
||||
);
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router.exceptions;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
|
||||
public class MethodPathNotRegisteredException extends Exception {
|
||||
|
||||
public MethodPathNotRegisteredException(ClassRouter.PATH path) {
|
||||
super(String.format("Path %s is not registered", path.toString()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router.interfaces;
|
||||
|
||||
public interface IBarcodeCustomization {
|
||||
|
||||
boolean shouldForceToEan13(String barcode);
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router.interfaces;
|
||||
|
||||
public interface ICustomConfiguration {
|
||||
|
||||
<T>T getConfig(int key);
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router.interfaces;
|
||||
|
||||
public interface IFiltroOrdiniVendita {
|
||||
|
||||
boolean shoudShowCodMdepFilter();
|
||||
|
||||
boolean shoudShowIdViaggioFilter();
|
||||
|
||||
boolean shoudShowAgenteFilter();
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router.interfaces;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
|
||||
public interface IOrdiniVendita {
|
||||
|
||||
void distribuisciCollo(MtbColt mtbColt, List<OrdineUscitaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed);
|
||||
|
||||
}
|
||||
@@ -2,10 +2,14 @@ package it.integry.integrywmsnative.core.context;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
import com.orhanobut.logger.AndroidLogAdapter;
|
||||
import com.orhanobut.logger.DiskLogAdapter;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
@@ -28,6 +32,11 @@ public class AppContext {
|
||||
@Inject
|
||||
AppDatabase mAppDatabase;
|
||||
|
||||
@Inject
|
||||
SettingsManager mSettingsManager;
|
||||
|
||||
private File logsFolder;
|
||||
|
||||
public AppContext(Context context) {
|
||||
this.mApplicationContext = context;
|
||||
|
||||
@@ -36,8 +45,6 @@ public class AppContext {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Inject
|
||||
public void init() {
|
||||
this.initUtilities();
|
||||
@@ -49,17 +56,21 @@ public class AppContext {
|
||||
this.initLogger();
|
||||
}
|
||||
|
||||
public File getLogFilePath() {
|
||||
return logsFolder;
|
||||
}
|
||||
|
||||
|
||||
private void initSettings() {
|
||||
Stash.init(mApplicationContext);
|
||||
SettingsManager.init(mApplicationContext);
|
||||
mSettingsManager.init();
|
||||
}
|
||||
|
||||
private void initCrashlytics() {
|
||||
if(!BuildConfig.DEBUG) {
|
||||
if (!BuildConfig.DEBUG) {
|
||||
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
|
||||
|
||||
if( SettingsManager.isInstanceAvailable() &&
|
||||
if (SettingsManager.isInstanceAvailable() &&
|
||||
(SettingsManager.i().getUserSession() != null && !UtilityString.isNullOrEmpty(SettingsManager.i().getUserSession().getProfileDB())) &&
|
||||
(SettingsManager.i().getUser() != null && !UtilityString.isNullOrEmpty(SettingsManager.i().getUser().getFullname()))) {
|
||||
|
||||
@@ -77,6 +88,36 @@ 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));
|
||||
|
||||
removeOldLogs(logsFolder);
|
||||
}
|
||||
|
||||
private void removeOldLogs(File logsFolder) {
|
||||
var files = logsFolder.listFiles();
|
||||
|
||||
if (files == null || files.length <= 1)
|
||||
return;
|
||||
|
||||
var logFiles = Stream.of(files)
|
||||
.sortBy(x -> -1 * x.lastModified())
|
||||
.skip(1)
|
||||
.toList();
|
||||
|
||||
for (var logFile : logFiles) {
|
||||
boolean isDeleted = logFile.delete();
|
||||
}
|
||||
|
||||
files = logsFolder.listFiles();
|
||||
|
||||
if (files == null || files.length > 1)
|
||||
return;
|
||||
|
||||
final boolean isRenamed = files[0].renameTo(new File(files[0].getParentFile().getAbsolutePath() + "/" + "logs_0.csv"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,15 +6,16 @@ import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.SpannedString;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import com.google.firebase.installations.FirebaseInstallations;
|
||||
|
||||
import java.net.ConnectException;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||
import it.integry.integrywmsnative.core.menu.MenuService;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityThread;
|
||||
@@ -25,13 +26,15 @@ public class MainContext {
|
||||
private final Context applicationContext;
|
||||
private final MenuService menuService;
|
||||
private final AppDatabase appDatabase;
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
public MainContext(Context applicationContext, MenuService menuService, AppDatabase appDatabase) {
|
||||
public MainContext(Context applicationContext, MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer) {
|
||||
this.applicationContext = applicationContext;
|
||||
this.menuService = menuService;
|
||||
this.appDatabase = appDatabase;
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
@@ -39,14 +42,16 @@ public class MainContext {
|
||||
try {
|
||||
BarcodeManager.init(applicationContext);
|
||||
} catch (Exception exception) {
|
||||
|
||||
exception.printStackTrace();
|
||||
}
|
||||
|
||||
this.initDBData(() -> {
|
||||
this.initMenu(() -> {
|
||||
|
||||
this.initReflections();
|
||||
if (mListener != null) mListener.onContextInitialized();
|
||||
this.initDeviceId(() -> {
|
||||
this.initDBData(() -> {
|
||||
this.initMenu(() -> {
|
||||
|
||||
if (mListener != null) mListener.onContextInitialized();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -55,6 +60,25 @@ public class MainContext {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void initDeviceId(Runnable onComplete) {
|
||||
if (SettingsManager.i().getUserSession().getDeviceId() != null) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
FirebaseInstallations.getInstance().getId().addOnCompleteListener(fid -> {
|
||||
SettingsManager.i().getUserSession().setDeviceId(fid.getResult());
|
||||
SettingsManager.update();
|
||||
|
||||
systemRESTConsumer.registerDevice(onComplete, ex -> {
|
||||
if (mListener != null) mListener.onError(new SpannedString(ex.getMessage()));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void logout(Runnable onLoggedOut) {
|
||||
menuService.invalidateCache();
|
||||
UtilityThread.executeParallel(() -> {
|
||||
@@ -103,30 +127,6 @@ public class MainContext {
|
||||
});
|
||||
}
|
||||
|
||||
private void initReflections() {
|
||||
ClassRouter.init();
|
||||
|
||||
try {
|
||||
String initMethod = "init";
|
||||
|
||||
Class dynamicContextClass = Class.forName("it.integry.wms.dynamic_customization.DynamicContext");
|
||||
|
||||
Method[] methods = dynamicContextClass.getMethods();
|
||||
for (Method m : methods) {
|
||||
if (initMethod.equals(m.getName())) {
|
||||
// for static methods we can use null as instance of class
|
||||
final Object newInstance = dynamicContextClass.newInstance();
|
||||
|
||||
m.invoke(newInstance, applicationContext);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
// UtilityExceptions.defaultException(mContext, e, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public MainContext setListener(Listener listener) {
|
||||
this.mListener = listener;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.UUID;
|
||||
|
||||
public class DataCache {
|
||||
|
||||
private static List<DataCacheDTO> dataCacheList = new ArrayList<>();
|
||||
private static final List<DataCacheDTO> dataCacheList = new ArrayList<>();
|
||||
|
||||
|
||||
public static String addItem(Object item) {
|
||||
|
||||
@@ -39,6 +39,9 @@ public class ColliDataRecoverService {
|
||||
if(isFilePresent(CommonConst.Files.RECOVER_COLLO_FILE)) {
|
||||
loadLocalFile();
|
||||
}
|
||||
|
||||
if(mtbColtsSessions == null)
|
||||
mtbColtsSessions = new ArrayList<>();
|
||||
}
|
||||
|
||||
public boolean thereIsAnExistantSession() {
|
||||
@@ -47,7 +50,6 @@ public class ColliDataRecoverService {
|
||||
|
||||
public List<Integer> getAllSessionIDs() {
|
||||
if(thereIsAnExistantSession()) {
|
||||
|
||||
return Stream.of(mtbColtsSessions)
|
||||
.map(ColliDataRecoverDTO::getId)
|
||||
.toList();
|
||||
@@ -56,7 +58,6 @@ public class ColliDataRecoverService {
|
||||
}
|
||||
|
||||
public ColliDataRecoverDTO getSession(Integer sessionID) {
|
||||
|
||||
if(sessionID == null) return null;
|
||||
|
||||
return getIfExists(sessionID);
|
||||
|
||||
@@ -1,31 +1,84 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.Database;
|
||||
import androidx.room.Room;
|
||||
import androidx.room.RoomDatabase;
|
||||
import androidx.room.TypeConverters;
|
||||
import androidx.room.migration.Migration;
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.converter.AppDatabaseConverters;
|
||||
import it.integry.integrywmsnative.core.data_store.db.converter.BigDecimalConverter;
|
||||
import it.integry.integrywmsnative.core.data_store.db.converter.DateConverter;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloGrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.GrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.InventarioDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.InventarioRowDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.RawDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRoomDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRowRoomDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
|
||||
@Database(entities = {ArticoloGriglia.class, Griglia.class, Ordine.class, ArticoloOrdine.class, SqlMtbColt.class, SqlMtbColr.class}, version = 8, exportSchema = false)
|
||||
@Database(entities = {
|
||||
ArticoloGriglia.class,
|
||||
Griglia.class,
|
||||
Ordine.class,
|
||||
ArticoloOrdine.class,
|
||||
SqlMtbColt.class,
|
||||
SqlMtbColr.class,
|
||||
InventarioRoomDTO.class,
|
||||
InventarioRowRoomDTO.class
|
||||
},
|
||||
version = 17)
|
||||
@TypeConverters({
|
||||
DateConverter.class,
|
||||
BigDecimalConverter.class
|
||||
BigDecimalConverter.class,
|
||||
AppDatabaseConverters.class
|
||||
})
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
|
||||
/**
|
||||
* The only instance
|
||||
*/
|
||||
private static AppDatabase sInstance;
|
||||
|
||||
/**
|
||||
* Gets the singleton instance of SampleDatabase.
|
||||
*
|
||||
* @param applicationContext The context.
|
||||
* @return The singleton instance of SampleDatabase.
|
||||
*/
|
||||
public static synchronized AppDatabase getInstance(Context applicationContext) {
|
||||
if (sInstance == null) {
|
||||
var builder = Room.databaseBuilder(applicationContext,
|
||||
AppDatabase.class, "integry_wms")
|
||||
.addMigrations(MIGRATION_10_11)
|
||||
.addMigrations(MIGRATION_11_12)
|
||||
.addMigrations(MIGRATION_12_13)
|
||||
.addMigrations(MIGRATION_13_14)
|
||||
.addMigrations(MIGRATION_14_15)
|
||||
.addMigrations(MIGRATION_15_16)
|
||||
.addMigrations(MIGRATION_16_17);
|
||||
|
||||
sInstance = builder.build();
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public abstract RawDao rawDao();
|
||||
|
||||
public abstract ArticoloGrigliaDao articoloGrigliaDao();
|
||||
|
||||
public abstract GrigliaDao grigliaDao();
|
||||
@@ -38,5 +91,95 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
|
||||
public abstract MtbColrDao mtbColrDao();
|
||||
|
||||
public abstract InventarioDao inventarioDao();
|
||||
|
||||
public abstract InventarioRowDao inventarioRowDao();
|
||||
|
||||
|
||||
|
||||
static final Migration MIGRATION_10_11 = new Migration(10, 11) {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase database) {
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS inventari (_id INTEGER PRIMARY KEY AUTOINCREMENT, id_inventario INTEGER, cod_mdep TEXT NOT NULL, zona TEXT, data_inventario INTEGER, data_reg INTEGER, data_ver INTEGER, filtro TEXT, flag_stato TEXT, flag_operazione TEXT, cod_anag TEXT, cod_dtip TEXT, inserito_da TEXT, registrato_da TEXT, verificato_da TEXT, data_ora_inizio INTEGER, data_ora_fine INTEGER, causale TEXT, remote_sync_date INTEGER)");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventari__id ON inventari (_id)");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventari_id_inventario ON inventari (id_inventario)");
|
||||
|
||||
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS inventario_rows (_id INTEGER PRIMARY KEY AUTOINCREMENT, parent_id INTEGER, cod_mart TEXT NOT NULL, descrizione TEXT, partita_mag TEXT, qta REAL NOT NULL DEFAULT 0, num_cnf REAL NOT NULL DEFAULT 0, qta_cnf REAL NOT NULL DEFAULT 0, unt_mis TEXT NOT NULL DEFAULT '0', data_ora_inv INTEGER, scan_cod_barre TEXT, zona TEXT, remote_sync_date INTEGER, FOREIGN KEY(parent_id) REFERENCES inventari(_id) ON UPDATE NO ACTION ON DELETE NO ACTION )");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__id ON inventario_rows (_id)");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__parent_id ON inventario_rows (parent_id)");
|
||||
}
|
||||
};
|
||||
|
||||
static final Migration MIGRATION_11_12 = new Migration(11, 12) {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase database) {
|
||||
database.execSQL("DROP TABLE IF EXISTS ordini_tmp;");
|
||||
database.execSQL("CREATE TABLE ordini_tmp (ordine_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, data_ins INTEGER, annotazioni TEXT, transmitted INTEGER NOT NULL, transmission_date INTEGER, gestione TEXT, data_ord INTEGER, num_ord INTEGER, cod_mdep TEXT, id_griglia INTEGER NOT NULL, cod_alis TEXT NOT NULL);");
|
||||
database.execSQL("INSERT INTO ordini_tmp(ordine_id,data_ins,annotazioni,transmitted,transmission_date,gestione,data_ord,num_ord,cod_mdep,id_griglia,cod_alis) SELECT ordini.ordine_id,ordini.data_ins,ordini.annotazioni,ordini.transmitted,ordini.transmission_date,ordini.gestione,ordini.data_ord,ordini.num_ord,ordini.cod_mdep,ordini.id_griglia,griglie.cod_alis from ordini left outer join griglie on ordini.id_griglia = griglie.griglia_id;");
|
||||
database.execSQL("DROP TABLE ordini;");
|
||||
database.execSQL("ALTER TABLE ordini_tmp RENAME TO ordini;");
|
||||
}
|
||||
};
|
||||
|
||||
static final Migration MIGRATION_12_13 = new Migration(12, 13) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS inventario_rows_tmp (_id INTEGER PRIMARY KEY AUTOINCREMENT, parent_id INTEGER, cod_mart TEXT, descrizione TEXT, partita_mag TEXT, qta REAL NOT NULL DEFAULT 0, num_cnf REAL NOT NULL DEFAULT 0, qta_cnf REAL NOT NULL DEFAULT 0, unt_mis TEXT NOT NULL DEFAULT '0', data_ora_inv INTEGER, scan_cod_barre TEXT, zona TEXT, remote_sync_date INTEGER, FOREIGN KEY(parent_id) REFERENCES inventari(_id) ON UPDATE NO ACTION ON DELETE NO ACTION )");
|
||||
database.execSQL("INSERT INTO inventario_rows_tmp SELECT * FROM inventario_rows");
|
||||
database.execSQL("DROP TABLE inventario_rows;");
|
||||
database.execSQL("ALTER TABLE inventario_rows_tmp RENAME TO inventario_rows;");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__id ON inventario_rows (_id)");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__parent_id ON inventario_rows (parent_id)");
|
||||
}
|
||||
};
|
||||
|
||||
static final Migration MIGRATION_13_14 = new Migration(13, 14) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("ALTER TABLE inventari"
|
||||
+ " ADD COLUMN new INTEGER");
|
||||
}
|
||||
};
|
||||
|
||||
static final Migration MIGRATION_14_15 = new Migration(14, 15) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
// rimuovo vincoli "not null" dai campi id_griglia e cod_alis
|
||||
database.execSQL("DROP TABLE IF EXISTS ordini_tmp;");
|
||||
database.execSQL("CREATE TABLE ordini_tmp (ordine_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, data_ins INTEGER, annotazioni TEXT, transmitted INTEGER NOT NULL, transmission_date INTEGER, gestione TEXT, data_ord INTEGER, num_ord INTEGER, cod_mdep TEXT, id_griglia INTEGER, cod_alis TEXT);");
|
||||
database.execSQL("INSERT INTO ordini_tmp(ordine_id,data_ins,annotazioni,transmitted,transmission_date,gestione,data_ord,num_ord,cod_mdep,id_griglia,cod_alis) SELECT ordini.ordine_id,ordini.data_ins,ordini.annotazioni,ordini.transmitted,ordini.transmission_date,ordini.gestione,ordini.data_ord,ordini.num_ord,ordini.cod_mdep,ordini.id_griglia,griglie.cod_alis from ordini left outer join griglie on ordini.id_griglia = griglie.griglia_id;");
|
||||
database.execSQL("DROP TABLE ordini;");
|
||||
database.execSQL("ALTER TABLE ordini_tmp RENAME TO ordini;");
|
||||
// aggiungo campo cod_alis sulle righe dell'ordine
|
||||
database.execSQL("DROP TABLE IF EXISTS art_ord_tmp;");
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS art_ord_tmp( articolo_ordine_id INTEGER PRIMARY KEY AUTOINCREMENT, cod_mart TEXT, descrizione TEXT, unt_mis TEXT, qta_cnf REAL NOT NULL, bar_code TEXT, merce_da_ric REAL NOT NULL, media_sett REAL NOT NULL, flag_qta_multipla TEXT, qta_min_ordinabile REAL NOT NULL, id_ordine INTEGER NOT NULL, qta_ord REAL NOT NULL, data_ins INTEGER, new_no_promo INTEGER NOT NULL, system_note TEXT, cod_alis TEXT , FOREIGN KEY(id_ordine) REFERENCES ordini(ordine_id) ON UPDATE NO ACTION ON DELETE CASCADE );");
|
||||
database.execSQL("INSERT INTO art_ord_tmp(articolo_ordine_id, cod_mart, descrizione, unt_mis, qta_cnf, bar_code, merce_da_ric, media_sett, flag_qta_multipla, qta_min_ordinabile, id_ordine, qta_ord, data_ins, new_no_promo, system_note, cod_alis) SELECT articolo_ordine_id, cod_mart, descrizione, unt_mis, qta_cnf, bar_code, merce_da_ric, media_sett, flag_qta_multipla, qta_min_ordinabile, id_ordine, qta_ord, data_ins, new_no_promo, system_note, null from articoli_ordine;");
|
||||
database.execSQL("DROP TABLE articoli_ordine;");
|
||||
database.execSQL("ALTER TABLE art_ord_tmp RENAME TO articoli_ordine;");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_articoli_ordine_id_ordine ON articoli_ordine (id_ordine);");
|
||||
database.execSQL("CREATE UNIQUE INDEX IF NOT EXISTS index_articoli_ordine_id_ordine_cod_mart ON articoli_ordine (id_ordine, cod_mart);");
|
||||
}
|
||||
};
|
||||
static final Migration MIGRATION_15_16 = new Migration(15, 16) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
}
|
||||
};
|
||||
static final Migration MIGRATION_16_17 = new Migration(16, 17) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("ALTER TABLE inventario_rows RENAME TO _inventario_rows_old;");
|
||||
database.execSQL("DROP INDEX index_inventario_rows__id;");
|
||||
database.execSQL("DROP INDEX index_inventario_rows_parent_id;");
|
||||
|
||||
database.execSQL("CREATE TABLE inventario_rows (_id INTEGER PRIMARY KEY AUTOINCREMENT, parent_id INTEGER, cod_mart TEXT, partita_mag TEXT, descrizione TEXT, qta REAL NOT NULL DEFAULT 0, num_cnf REAL NOT NULL DEFAULT 0, qta_cnf REAL NOT NULL DEFAULT 0, unt_mis TEXT NOT NULL DEFAULT '0', data_ora_inv INTEGER, scan_cod_barre TEXT, zona TEXT, remote_sync_date INTEGER, FOREIGN KEY(parent_id) REFERENCES inventari(_id) ON UPDATE NO ACTION ON DELETE CASCADE);");
|
||||
|
||||
database.execSQL("INSERT INTO inventario_rows SELECT * FROM _inventario_rows_old;");
|
||||
|
||||
database.execSQL("CREATE INDEX index_inventario_rows__id ON inventario_rows (_id);");
|
||||
database.execSQL("CREATE INDEX index_inventario_rows_parent_id ON inventario_rows (parent_id)");
|
||||
database.execSQL("DROP TABLE _inventario_rows_old;");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db;
|
||||
|
||||
import android.app.Application;
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.room.Room;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
@@ -11,32 +12,39 @@ import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloGrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.GrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.InventarioDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.InventarioRowDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.RawDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoloGrigliaRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.GrigliaRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.OrdineRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.ArticoliGrigliaDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.ArticoliOrdineDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.GrigliaDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.OrdineDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.SqlMtbColrDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.SqlMtbColtDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.datasource.ArticoliGrigliaDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.datasource.ArticoliOrdineDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.datasource.GrigliaDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.datasource.OrdineDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.datasource.SqlMtbColrDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.datasource.SqlMtbColtDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.InventarioRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.InventarioRowRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.data_source.InventarioLocalDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.data_source.InventarioRowLocalDataSource;
|
||||
import it.integry.integrywmsnative.core.mapper.InventarioMapper;
|
||||
import it.integry.integrywmsnative.core.mapper.InventarioRowMapper;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.InventarioRESTConsumer;
|
||||
|
||||
@Module
|
||||
public class RoomModule {
|
||||
|
||||
private AppDatabase appDatabase;
|
||||
|
||||
public RoomModule(Application application) {
|
||||
appDatabase = Room.databaseBuilder(application,
|
||||
AppDatabase.class, "integry_wms")
|
||||
.fallbackToDestructiveMigration()
|
||||
.build();
|
||||
public RoomModule(Application applicationContext) {
|
||||
appDatabase = AppDatabase.getInstance(applicationContext);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@@ -46,7 +54,11 @@ public class RoomModule {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
RawDao providesRawDao(AppDatabase appDatabase) {
|
||||
return appDatabase.rawDao();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
@@ -84,46 +96,90 @@ public class RoomModule {
|
||||
return appDatabase.mtbColrDao();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
ArticoloGrigliaRepository providesArticoloGrigliaRepository(ArticoloGrigliaDao articoloGrigliaDao) {
|
||||
return new ArticoliGrigliaDataSource(articoloGrigliaDao);
|
||||
InventarioDao providesInventarioDao(AppDatabase appDatabase) {
|
||||
return appDatabase.inventarioDao();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
ArticoliOrdineRepository providesArticoliOrdineRepository(ArticoloOrdineDao articoloOrdineDao) {
|
||||
return new ArticoliOrdineDataSource(articoloOrdineDao);
|
||||
InventarioRowDao providesInventarioRowDao(AppDatabase appDatabase) {
|
||||
return appDatabase.inventarioRowDao();
|
||||
}
|
||||
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
InventarioRowMapper providesInventarioRowMapper() {
|
||||
return new InventarioRowMapper();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
GrigliaRepository providesGrigliaRepository(GrigliaDao grigliaDao) {
|
||||
return new GrigliaDataSource(grigliaDao);
|
||||
InventarioMapper providesInventarioMapper(InventarioRowMapper inventarioRowMapper) {
|
||||
return new InventarioMapper(inventarioRowMapper);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
|
||||
@Provides
|
||||
OrdineRepository providesOrdineRepository(OrdineDao ordineDao) {
|
||||
return new OrdineDataSource(ordineDao);
|
||||
InventarioLocalDataSource providesInventarioLocalDataSource(ExecutorService executorService, InventarioDao inventarioDao) {
|
||||
return new InventarioLocalDataSource(executorService, inventarioDao);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
MtbColtRepository providesMtbColtRepository(MtbColtDao mtbColtDao) {
|
||||
return new SqlMtbColtDataSource(mtbColtDao);
|
||||
InventarioRowLocalDataSource providesInventarioRowLocalDataSource(ExecutorService executorService, InventarioRowDao inventarioRowDao) {
|
||||
return new InventarioRowLocalDataSource(executorService, inventarioRowDao);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
|
||||
@Provides
|
||||
MtbColrRepository providesMtbColrRepository(MtbColrDao mtbColrDao) {
|
||||
return new SqlMtbColrDataSource(mtbColrDao);
|
||||
ArticoloGrigliaRepository providesArticoloGrigliaRepository(ExecutorService executorService, Handler handler, ArticoloGrigliaDao articoloGrigliaDao) {
|
||||
return new ArticoliGrigliaDataSource(executorService, handler, articoloGrigliaDao);
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
ArticoliOrdineRepository providesArticoliOrdineRepository(ExecutorService executorService, Handler handler, ArticoloOrdineDao articoloOrdineDao) {
|
||||
return new ArticoliOrdineDataSource(executorService, handler, articoloOrdineDao);
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
GrigliaRepository providesGrigliaRepository(ExecutorService executorService, Handler handler, GrigliaDao grigliaDao) {
|
||||
return new GrigliaDataSource(executorService, handler, grigliaDao);
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
OrdineRepository providesOrdineRepository(ExecutorService executorService, Handler handler, OrdineDao ordineDao) {
|
||||
return new OrdineDataSource(executorService, handler, ordineDao);
|
||||
}
|
||||
|
||||
@Provides
|
||||
MtbColtRepository providesMtbColtRepository(ExecutorService executorService, Handler handler, MtbColtDao mtbColtDao) {
|
||||
return new SqlMtbColtDataSource(executorService, handler, mtbColtDao);
|
||||
}
|
||||
|
||||
@Provides
|
||||
MtbColrDataSource providesMtbColrRepository(ExecutorService executorService, Handler handler, MtbColrDao mtbColrDao) {
|
||||
return new SqlMtbColrDataSource(executorService, handler, mtbColrDao);
|
||||
}
|
||||
|
||||
@Provides
|
||||
InventarioRepository providesInventarioRepository(ExecutorService executorService, Handler handler,
|
||||
InventarioLocalDataSource inventarioLocalDataSource,
|
||||
InventarioRESTConsumer inventarioRESTConsumer,
|
||||
InventarioMapper inventarioMapper) {
|
||||
return new InventarioRepository(inventarioLocalDataSource, inventarioRESTConsumer, inventarioMapper, handler, executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
InventarioRowRepository providesInventarioRowRepository(ExecutorService executorService, Handler handler,
|
||||
InventarioRowLocalDataSource inventarioRowLocalDataSource,
|
||||
InventarioRESTConsumer inventarioRESTConsumer,
|
||||
InventarioRowMapper inventarioRowMapper) {
|
||||
return new InventarioRowRepository(inventarioRowLocalDataSource, inventarioRESTConsumer, inventarioRowMapper, handler);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.converter;
|
||||
|
||||
import androidx.room.TypeConverter;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
|
||||
public class AppDatabaseConverters {
|
||||
@TypeConverter
|
||||
public static LocalDateTime longToLocalDateTime(Long value) {
|
||||
return value == null ? null : UtilityDate.timeToLocalDateTime(value, null);
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static Long localDateTimeToTimestamp(LocalDateTime date) {
|
||||
return date == null ? null : UtilityDate.localDateTimeToTime(date, null);
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static LocalDate longToLocalDate(Long value) {
|
||||
return value == null ? null : UtilityDate.timeToLocalDate(value, null);
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static Long localDateToTimestamp(LocalDate date) {
|
||||
return date == null ? null : UtilityDate.localDateToTime(date);
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static ArrayList<String> fromString(String value) {
|
||||
Type listType = new TypeToken<ArrayList<String>>() {}.getType();
|
||||
return new Gson().fromJson(value, listType);
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static String fromArrayList(ArrayList<String> list) {
|
||||
Gson gson = new Gson();
|
||||
String json = gson.toJson(list);
|
||||
return json;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -53,6 +53,6 @@ public interface ArticoloGrigliaDao {
|
||||
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId")
|
||||
List<ArticoloGriglia> getArticoliFromGriglia(int grigliaId);
|
||||
|
||||
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId AND new_no_promo = 1")
|
||||
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId AND qta_ord >= 1")
|
||||
List<ArticoloGriglia> getNewArticoliInGriglia(int grigliaId);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import androidx.room.Update;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.ArticoloOrdineWrapper;
|
||||
|
||||
@Dao
|
||||
public interface ArticoloOrdineDao {
|
||||
@@ -33,17 +32,10 @@ public interface ArticoloOrdineDao {
|
||||
@Update
|
||||
void update(ArticoloOrdine articolo);
|
||||
|
||||
@Query("SELECT articoli_ordine.*," +
|
||||
"articoli_griglia.gg_scadenza," +
|
||||
"articoli_griglia.giacenza," +
|
||||
"articoli_griglia.qta_prevista_vendita," +
|
||||
"articoli_griglia.qta_proposta " +
|
||||
@Query("SELECT *" +
|
||||
"FROM articoli_ordine " +
|
||||
"INNER JOIN ordini on articoli_ordine.id_ordine = ordini.ordine_id " +
|
||||
"LEFT OUTER JOIN articoli_griglia " +
|
||||
"on articoli_ordine.cod_mart = articoli_griglia.cod_mart and ordini.id_griglia = articoli_griglia.id_griglia and articoli_ordine.bar_code = articoli_griglia.bar_code " +
|
||||
"where id_ordine = :ordineId")
|
||||
List<ArticoloOrdineWrapper> findArticoliByOrdine(int ordineId);
|
||||
List<ArticoloOrdine> findArticoliByOrdine(int ordineId);
|
||||
|
||||
@Query("SELECt * from articoli_ordine where cod_mart = :codMart and id_ordine = :ordineId LIMIT 1")
|
||||
ArticoloOrdine findArticoloByCodMartAndOrdine(int ordineId, String codMart);
|
||||
|
||||
@@ -9,15 +9,14 @@ import androidx.room.Update;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.GrigliaWrapper;
|
||||
|
||||
@Dao
|
||||
public interface GrigliaDao {
|
||||
@Query("SELECT * from griglie")
|
||||
List<Griglia> getAll();
|
||||
|
||||
@Query("SELECT griglie.*, COUNT(articoli_griglia.articolo_griglia_id) as countArticoli from griglie LEFT JOIN articoli_griglia ON (griglie.griglia_id = articoli_griglia.id_griglia) where cod_alis = :codAlis GROUP BY griglie.griglia_id")
|
||||
GrigliaWrapper findByCodAlis(String codAlis);
|
||||
@Query("SELECT * from griglie where cod_alis = :codAlis")
|
||||
Griglia findByCodAlis(String codAlis);
|
||||
|
||||
@Insert
|
||||
long insert(Griglia griglia);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Query;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Flowable;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.BaseSyncDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRoomDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityDaoInterface;
|
||||
|
||||
@Dao
|
||||
public interface InventarioDao extends EntityDaoInterface<InventarioRoomDTO> {
|
||||
|
||||
|
||||
@Query("SELECT * FROM " + InventarioRoomDTO.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))")
|
||||
List<InventarioRoomDTO> selectAll(boolean toBeSync);
|
||||
|
||||
|
||||
@Query("SELECT * FROM " + InventarioRoomDTO.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))" +
|
||||
" ORDER BY " + InventarioRoomDTO.Columns.DATA_INVENTARIO + " DESC")
|
||||
Flowable<List<InventarioRoomDTO>> selectAllFlowable(boolean toBeSync);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Query;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Flowable;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.BaseSyncDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRowRoomDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityDaoInterface;
|
||||
|
||||
@Dao
|
||||
public interface InventarioRowDao extends EntityDaoInterface<InventarioRowRoomDTO> {
|
||||
|
||||
@Query("SELECT * FROM " + InventarioRowRoomDTO.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))")
|
||||
List<InventarioRowRoomDTO> selectAll(boolean toBeSync);
|
||||
|
||||
|
||||
@Query("SELECT * FROM " + InventarioRowRoomDTO.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))" +
|
||||
" AND " + InventarioRowRoomDTO.Columns.PARENT_ID + " = :parentId " +
|
||||
" ORDER BY " +
|
||||
" CASE WHEN :reversed = 1 THEN " + BaseSyncDTO.Columns.ID + " END DESC," +
|
||||
" CASE WHEN :reversed = 0 THEN " + BaseSyncDTO.Columns.ID + " END ASC")
|
||||
Flowable<List<InventarioRowRoomDTO>> selectAllFlowable(long parentId, boolean reversed, boolean toBeSync);
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import androidx.room.Update;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
|
||||
@Dao
|
||||
public interface MtbColrDao {
|
||||
@@ -25,6 +24,6 @@ public interface MtbColrDao {
|
||||
@Delete
|
||||
void delete(SqlMtbColr mtbColr);
|
||||
|
||||
@Query("SELECT * from mtb_colr where id_collo = :idDocument")
|
||||
List<SqlMtbColr> getDocumentRows(int idDocument);
|
||||
@Query("SELECT * FROM mtb_colr WHERE id_collo = :idDocument ORDER BY id DESC")
|
||||
List<SqlMtbColr> getDocumentRows(long idDocument);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
@@ -9,12 +10,9 @@ import androidx.room.Update;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.view_model.OrdineWithGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.OrdineWrapper;
|
||||
|
||||
|
||||
@Dao
|
||||
public interface MtbColtDao {
|
||||
@Query("SELECT * from mtb_colt")
|
||||
@@ -36,7 +34,7 @@ public interface MtbColtDao {
|
||||
" AND ( mtb_colt.data_doc = :dataDoc OR (mtb_colt.data_doc is null and :dataDoc is null)) " +
|
||||
" AND ( mtb_colt.num_doc = :numDoc OR (mtb_colt.num_doc is null and :numDoc is null)) " +
|
||||
" and cod_dtip is null group by mtb_colt.id")
|
||||
List<DocInternoWrapper> getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc);
|
||||
LiveData<List<DocInternoWrapper>> getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc);
|
||||
|
||||
@Query("SELECT ifnull(MAX(num_collo),0) +1 as num_collo from mtb_colt")
|
||||
Integer getNextNumCollo();
|
||||
|
||||
@@ -9,7 +9,6 @@ import androidx.room.Update;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.view_model.OrdineWithGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.OrdineWrapper;
|
||||
|
||||
@Dao
|
||||
@@ -17,11 +16,11 @@ public interface OrdineDao {
|
||||
@Query("SELECT * from ordini ")
|
||||
List<Ordine> getAll();
|
||||
|
||||
@Query("SELECT ordini.*, griglie.* from ordini inner join griglie ON id_griglia = griglie.griglia_id where ordini.transmitted = 1")
|
||||
List<OrdineWithGriglia> getAllTrasnmitted();
|
||||
@Query("SELECT ordini.* from ordini where ordini.transmitted = 1")
|
||||
List<Ordine> getAllTrasnmitted();
|
||||
|
||||
@Query("SELECT ordini.*, count(articolo_ordine_id) as countArticoli from ordini left join articoli_ordine ON ordini.ordine_id = articoli_ordine.id_ordine where ordini.transmitted = 0 and ordini.id_griglia = :idGriglia group by ordini.ordine_id")
|
||||
List<OrdineWrapper> getAllOpenOrdersByGriglia(int idGriglia);
|
||||
@Query("SELECT ordini.*, count(articolo_ordine_id) as countArticoli from ordini left join articoli_ordine ON ordini.ordine_id = articoli_ordine.id_ordine where ordini.transmitted = 0 and ((:codAlis is null and ordini.cod_alis is null) OR (ordini.cod_alis = :codAlis)) group by ordini.ordine_id")
|
||||
List<OrdineWrapper> getAllOpenOrdersByGriglia(String codAlis);
|
||||
|
||||
@Insert
|
||||
Long insert(Ordine ordine);
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.RawQuery;
|
||||
import androidx.sqlite.db.SupportSQLiteQuery;
|
||||
|
||||
@Dao
|
||||
public interface RawDao {
|
||||
|
||||
@RawQuery
|
||||
int vacuumDb(SupportSQLiteQuery supportSQLiteQuery);
|
||||
|
||||
}
|
||||
@@ -6,10 +6,6 @@ import androidx.room.ForeignKey;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
|
||||
@Entity(
|
||||
tableName = "articoli_griglia",
|
||||
indices = {
|
||||
@@ -68,6 +64,9 @@ public class ArticoloGriglia {
|
||||
@ColumnInfo(name = "qta_proposta")
|
||||
private float qtaProposta;
|
||||
|
||||
@ColumnInfo(name = "qta_ord")
|
||||
private float qtaOrd;
|
||||
|
||||
@ColumnInfo(name = "id_griglia")
|
||||
private int idGriglia;
|
||||
|
||||
@@ -202,29 +201,11 @@ public class ArticoloGriglia {
|
||||
this.newNoPromo = newNoPromo;
|
||||
}
|
||||
|
||||
public ArticoloOrdine convertToArticoloOrdine(Ordine ordine) {
|
||||
ArticoloOrdine articolo = new ArticoloOrdine();
|
||||
public float getQtaOrd() {
|
||||
return qtaOrd;
|
||||
}
|
||||
|
||||
articolo.setIdOrdine(ordine.getOrdineId());
|
||||
|
||||
articolo.setBarCode(this.getBarCode());
|
||||
articolo.setCodMart(this.getCodMart());
|
||||
articolo.setMediaSett(this.getMediaSett());
|
||||
articolo.setFlagQtaMultipla(this.getFlagQtaMultipla());
|
||||
articolo.setQtaMinOrdinabile(this.getQtaMinOrdinabile());
|
||||
articolo.setMerceDaRic(this.getMerceDaRic());
|
||||
articolo.setQtaCnf(this.getQtaCnf());
|
||||
articolo.setUntMis(this.getUntMis());
|
||||
articolo.setDescrizione(this.getDescrizione());
|
||||
articolo.setDataIns(UtilityDate.getDateInstance());
|
||||
articolo.setGgScadenza(this.getGgScadenza());
|
||||
articolo.setGiacenza(BigDecimal.valueOf(this.getGiacenza()));
|
||||
articolo.setQtaPrevistaVendita(BigDecimal.valueOf(this.getQtaPrevistaVendita()));
|
||||
articolo.setQtaProposta(BigDecimal.valueOf(this.getQtaProposta()));
|
||||
articolo.setNewNoPromo(this.isNewNoPromo());
|
||||
|
||||
articolo.setQtaOrd(0);
|
||||
|
||||
return articolo;
|
||||
public void setQtaOrd(float qtaOrd) {
|
||||
this.qtaOrd = qtaOrd;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,6 +70,12 @@ public class ArticoloOrdine {
|
||||
@ColumnInfo(name = "new_no_promo")
|
||||
private boolean newNoPromo;
|
||||
|
||||
@ColumnInfo(name = "system_note")
|
||||
private String systemNote;
|
||||
|
||||
@ColumnInfo(name = "cod_alis")
|
||||
private String codAlis;
|
||||
|
||||
@Ignore
|
||||
private int ggScadenza = 0;
|
||||
|
||||
@@ -82,9 +88,15 @@ public class ArticoloOrdine {
|
||||
@Ignore
|
||||
private BigDecimal qtaProposta = BigDecimal.ZERO;
|
||||
|
||||
@Ignore
|
||||
private BigDecimal ctMaxOrd = BigDecimal.ZERO;
|
||||
|
||||
@Ignore
|
||||
private int bgTint;
|
||||
|
||||
@Ignore
|
||||
private boolean invalid = false;
|
||||
|
||||
|
||||
public Integer getArticoloOrdineId() {
|
||||
return articoloOrdineId;
|
||||
@@ -227,15 +239,15 @@ public class ArticoloOrdine {
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfPrevistaVendita() {
|
||||
return qtaPrevistaVendita.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaPrevistaVendita.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
return qtaPrevistaVendita == null || qtaPrevistaVendita.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaPrevistaVendita.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfProposta() {
|
||||
return qtaProposta.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaProposta.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
return qtaProposta == null || qtaProposta.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaProposta.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfGiacenza() {
|
||||
return giacenza.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : giacenza.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
return giacenza == null || giacenza.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : giacenza.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
}
|
||||
|
||||
public boolean isNewNoPromo() {
|
||||
@@ -247,12 +259,12 @@ public class ArticoloOrdine {
|
||||
}
|
||||
|
||||
public float getCnfDaRic() {
|
||||
return qtaCnf > 0.f ? merceDaRic * qtaCnf : 0;
|
||||
return qtaCnf > 0.f ? merceDaRic / qtaCnf : 0;
|
||||
}
|
||||
|
||||
public int checkQtaProposta() {
|
||||
int check = 0;
|
||||
if (!qtaProposta.equals(BigDecimal.ZERO)) {
|
||||
if (qtaProposta != null && !qtaProposta.equals(BigDecimal.ZERO)) {
|
||||
check = BigDecimal.valueOf(qtaOrd).compareTo(qtaProposta);
|
||||
}
|
||||
return check;
|
||||
@@ -266,4 +278,38 @@ public class ArticoloOrdine {
|
||||
this.bgTint = bgTint;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSystemNote() {
|
||||
return systemNote;
|
||||
}
|
||||
|
||||
public void setSystemNote(String systemNote) {
|
||||
this.systemNote = systemNote;
|
||||
}
|
||||
|
||||
public String getCodAlis() {
|
||||
return codAlis;
|
||||
}
|
||||
|
||||
public void setCodAlis(String codAlis) {
|
||||
this.codAlis = codAlis;
|
||||
}
|
||||
|
||||
public BigDecimal getCtMaxOrd() {
|
||||
return ctMaxOrd;
|
||||
}
|
||||
|
||||
public ArticoloOrdine setCtMaxOrd(BigDecimal ctMaxOrd) {
|
||||
this.ctMaxOrd = ctMaxOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isInvalid() {
|
||||
return invalid;
|
||||
}
|
||||
|
||||
public ArticoloOrdine setInvalid(boolean invalid) {
|
||||
this.invalid = invalid;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.entity;
|
||||
|
||||
public abstract class BaseRoomDTO {
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.entity;
|
||||
|
||||
import android.provider.BaseColumns;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public abstract class BaseSyncDTO extends BaseRoomDTO {
|
||||
|
||||
|
||||
public static class Columns {
|
||||
public static final String ID = BaseColumns._ID;
|
||||
public static final String COLUMN_REMOTE_SYNC_DATE = "remote_sync_date";
|
||||
}
|
||||
|
||||
/** The unique ID of the cheese. */
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@ColumnInfo(index = true, name = Columns.ID)
|
||||
private Long id;
|
||||
|
||||
@ColumnInfo(name = Columns.COLUMN_REMOTE_SYNC_DATE)
|
||||
private Date remoteSyncDate;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Date getRemoteSyncDate() {
|
||||
return remoteSyncDate;
|
||||
}
|
||||
|
||||
public void setRemoteSyncDate(Date remoteSyncDate) {
|
||||
this.remoteSyncDate = remoteSyncDate;
|
||||
}
|
||||
|
||||
public boolean isSyncronized() {
|
||||
return getRemoteSyncDate() != null;
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,10 @@ package it.integry.integrywmsnative.core.data_store.db.entity;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.Ignore;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
@Entity(tableName ="griglie",
|
||||
@Entity(tableName = "griglie",
|
||||
indices = {
|
||||
@Index(value = "cod_alis", unique = true)
|
||||
}
|
||||
@@ -22,8 +21,6 @@ public class Griglia {
|
||||
private String descrLisa;
|
||||
@ColumnInfo(name = "descr_depo")
|
||||
private String descrDepo;
|
||||
@Ignore
|
||||
private int countArticoli = 0;
|
||||
|
||||
|
||||
public int getGrigliaId() {
|
||||
@@ -58,11 +55,4 @@ public class Griglia {
|
||||
this.descrDepo = descrDepo;
|
||||
}
|
||||
|
||||
public int getCountArticoli() {
|
||||
return countArticoli;
|
||||
}
|
||||
|
||||
public void setCountArticoli(int countArticoli) {
|
||||
this.countArticoli = countArticoli;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.entity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.Ignore;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityModelInterface;
|
||||
|
||||
@Entity(tableName = InventarioRoomDTO.TABLE_NAME)
|
||||
public class InventarioRoomDTO extends BaseSyncDTO implements EntityModelInterface {
|
||||
|
||||
public static final String TABLE_NAME = "inventari";
|
||||
|
||||
public static class Columns {
|
||||
public static final String ID_INVENTARIO = "id_inventario";
|
||||
public static final String COD_MDEP = "cod_mdep";
|
||||
public static final String DATA_INVENTARIO = "data_inventario";
|
||||
public static final String DATA_REG = "data_reg";
|
||||
public static final String DATA_VER = "data_ver";
|
||||
public static final String FILTRO = "filtro";
|
||||
public static final String FLAG_STATO = "flag_stato";
|
||||
public static final String FLAG_OPERAZIONE = "flag_operazione";
|
||||
public static final String COD_ANAG = "cod_anag";
|
||||
public static final String COD_DTIP = "cod_dtip";
|
||||
public static final String INSERITO_DA = "inserito_da";
|
||||
public static final String REGISTRATO_DA = "registrato_da";
|
||||
public static final String VERIFICATO_DA = "verificato_da";
|
||||
public static final String DATA_ORA_INIZIO = "data_ora_inizio";
|
||||
public static final String DATA_ORA_FINE = "data_ora_fine";
|
||||
public static final String CAUSALE = "causale";
|
||||
public static final String ZONA = "zona";
|
||||
public static final String IS_NEW = "new";
|
||||
}
|
||||
|
||||
/** The unique ID of the cheese. */
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@ColumnInfo(index = true, name = BaseSyncDTO.Columns.ID)
|
||||
private Long id;
|
||||
|
||||
/** The unique ID of the cheese. */
|
||||
@ColumnInfo(index = true, name = Columns.ID_INVENTARIO)
|
||||
private Long idInventario;
|
||||
|
||||
@NonNull
|
||||
@ColumnInfo(name = Columns.COD_MDEP)
|
||||
private String codMdep;
|
||||
|
||||
@ColumnInfo(name = Columns.DATA_INVENTARIO)
|
||||
private LocalDate dataInventario;
|
||||
|
||||
@ColumnInfo(name = Columns.DATA_REG)
|
||||
private LocalDateTime dataReg;
|
||||
|
||||
@ColumnInfo(name = Columns.DATA_VER)
|
||||
private LocalDateTime dataVer;
|
||||
|
||||
@ColumnInfo(name = Columns.FILTRO)
|
||||
private String filtro;
|
||||
|
||||
@ColumnInfo(name = Columns.FLAG_STATO)
|
||||
private String flagStato;
|
||||
|
||||
@ColumnInfo(name = Columns.FLAG_OPERAZIONE)
|
||||
private String flagOperazione;
|
||||
|
||||
@ColumnInfo(name = Columns.COD_ANAG)
|
||||
private String codAnag;
|
||||
|
||||
@ColumnInfo(name = Columns.COD_DTIP)
|
||||
private String codDtip;
|
||||
|
||||
@ColumnInfo(name = Columns.INSERITO_DA)
|
||||
private String inseritoDa;
|
||||
|
||||
@ColumnInfo(name = Columns.REGISTRATO_DA)
|
||||
private String registratoDa;
|
||||
|
||||
@ColumnInfo(name = Columns.VERIFICATO_DA)
|
||||
private String verificatoDa;
|
||||
|
||||
@ColumnInfo(name = Columns.DATA_ORA_INIZIO)
|
||||
private LocalDateTime dataOraInizio;
|
||||
|
||||
@ColumnInfo(name = Columns.DATA_ORA_FINE)
|
||||
private LocalDateTime dataOraFine;
|
||||
|
||||
@ColumnInfo(name = Columns.CAUSALE)
|
||||
private String causale;
|
||||
|
||||
@ColumnInfo(name = Columns.ZONA)
|
||||
private String zona;
|
||||
|
||||
@ColumnInfo(name = Columns.IS_NEW)
|
||||
private Boolean isNew = Boolean.TRUE;
|
||||
|
||||
@Ignore
|
||||
private List<InventarioRowRoomDTO> inventarioRowList;
|
||||
|
||||
public Long getIdInventario() {
|
||||
return idInventario;
|
||||
}
|
||||
|
||||
public void setIdInventario(Long idInventario) {
|
||||
this.idInventario = idInventario;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public void setCodMdep(@NonNull String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
}
|
||||
|
||||
public LocalDate getDataInventario() {
|
||||
return dataInventario;
|
||||
}
|
||||
|
||||
public void setDataInventario(LocalDate dataInventario) {
|
||||
this.dataInventario = dataInventario;
|
||||
}
|
||||
|
||||
public LocalDateTime getDataReg() {
|
||||
return dataReg;
|
||||
}
|
||||
|
||||
public void setDataReg(LocalDateTime dataReg) {
|
||||
this.dataReg = dataReg;
|
||||
}
|
||||
|
||||
public LocalDateTime getDataVer() {
|
||||
return dataVer;
|
||||
}
|
||||
|
||||
public void setDataVer(LocalDateTime dataVer) {
|
||||
this.dataVer = dataVer;
|
||||
}
|
||||
|
||||
public String getFiltro() {
|
||||
return filtro;
|
||||
}
|
||||
|
||||
public void setFiltro(String filtro) {
|
||||
this.filtro = filtro;
|
||||
}
|
||||
|
||||
public String getFlagStato() {
|
||||
return flagStato;
|
||||
}
|
||||
|
||||
public void setFlagStato(String flagStato) {
|
||||
this.flagStato = flagStato;
|
||||
}
|
||||
|
||||
public String getFlagOperazione() {
|
||||
return flagOperazione;
|
||||
}
|
||||
|
||||
public void setFlagOperazione(String flagOperazione) {
|
||||
this.flagOperazione = flagOperazione;
|
||||
}
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public void setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
}
|
||||
|
||||
public String getCodDtip() {
|
||||
return codDtip;
|
||||
}
|
||||
|
||||
public void setCodDtip(String codDtip) {
|
||||
this.codDtip = codDtip;
|
||||
}
|
||||
|
||||
public String getInseritoDa() {
|
||||
return inseritoDa;
|
||||
}
|
||||
|
||||
public void setInseritoDa(String inseritoDa) {
|
||||
this.inseritoDa = inseritoDa;
|
||||
}
|
||||
|
||||
public String getRegistratoDa() {
|
||||
return registratoDa;
|
||||
}
|
||||
|
||||
public void setRegistratoDa(String registratoDa) {
|
||||
this.registratoDa = registratoDa;
|
||||
}
|
||||
|
||||
public String getVerificatoDa() {
|
||||
return verificatoDa;
|
||||
}
|
||||
|
||||
public void setVerificatoDa(String verificatoDa) {
|
||||
this.verificatoDa = verificatoDa;
|
||||
}
|
||||
|
||||
public LocalDateTime getDataOraInizio() {
|
||||
return dataOraInizio;
|
||||
}
|
||||
|
||||
public void setDataOraInizio(LocalDateTime dataOraInizio) {
|
||||
this.dataOraInizio = dataOraInizio;
|
||||
}
|
||||
|
||||
public LocalDateTime getDataOraFine() {
|
||||
return dataOraFine;
|
||||
}
|
||||
|
||||
public void setDataOraFine(LocalDateTime dataOraFine) {
|
||||
this.dataOraFine = dataOraFine;
|
||||
}
|
||||
|
||||
public String getCausale() {
|
||||
return causale;
|
||||
}
|
||||
|
||||
public void setCausale(String causale) {
|
||||
this.causale = causale;
|
||||
}
|
||||
|
||||
public String getZona() {
|
||||
return zona;
|
||||
}
|
||||
|
||||
public void setZona(String zona) {
|
||||
this.zona = zona;
|
||||
}
|
||||
|
||||
public Boolean isNew() {
|
||||
return isNew;
|
||||
}
|
||||
|
||||
public void setNew(Boolean aNew) {
|
||||
isNew = aNew;
|
||||
}
|
||||
|
||||
public List<InventarioRowRoomDTO> getInventarioRowList() {
|
||||
return inventarioRowList;
|
||||
}
|
||||
|
||||
public void setInventarioRowList(List<InventarioRowRoomDTO> inventarioRowList) {
|
||||
this.inventarioRowList = inventarioRowList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.entity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.ForeignKey;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityModelInterface;
|
||||
|
||||
@Entity(
|
||||
tableName = InventarioRowRoomDTO.TABLE_NAME,
|
||||
foreignKeys = {
|
||||
@ForeignKey(
|
||||
entity = InventarioRoomDTO.class,
|
||||
parentColumns = {BaseSyncDTO.Columns.ID},
|
||||
childColumns = {InventarioRowRoomDTO.Columns.PARENT_ID},
|
||||
onDelete = ForeignKey.CASCADE
|
||||
)
|
||||
}
|
||||
)
|
||||
public class InventarioRowRoomDTO extends BaseSyncDTO implements EntityModelInterface {
|
||||
|
||||
public static final String TABLE_NAME = "inventario_rows";
|
||||
|
||||
public static class Columns {
|
||||
public static final String PARENT_ID = "parent_id";
|
||||
public static final String COD_MART = "cod_mart";
|
||||
public static final String PARTITA_MAG = "partita_mag";
|
||||
public static final String DESCRIZIONE = "descrizione";
|
||||
public static final String QTA = "qta";
|
||||
public static final String NUM_CNF = "num_cnf";
|
||||
public static final String QTA_CNF = "qta_cnf";
|
||||
public static final String UNT_MIS = "unt_mis";
|
||||
public static final String DATA_ORA_INV = "data_ora_inv";
|
||||
public static final String SCAN_COD_BARRE = "scan_cod_barre";
|
||||
public static final String ZONA = "zona";
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique ID
|
||||
*/
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@ColumnInfo(index = true, name = BaseSyncDTO.Columns.ID)
|
||||
private Long id;
|
||||
|
||||
@ColumnInfo(index = true, name = Columns.PARENT_ID)
|
||||
private Long parentId;
|
||||
|
||||
@ColumnInfo(name = Columns.COD_MART)
|
||||
private String codMart;
|
||||
|
||||
@ColumnInfo(name = Columns.PARTITA_MAG)
|
||||
private String partitaMag;
|
||||
|
||||
@ColumnInfo(name = Columns.DESCRIZIONE)
|
||||
private String descrizione;
|
||||
|
||||
@NonNull
|
||||
@ColumnInfo(name = Columns.QTA, defaultValue = "0")
|
||||
private BigDecimal qta;
|
||||
|
||||
@NonNull
|
||||
@ColumnInfo(name = Columns.NUM_CNF, defaultValue = "0")
|
||||
private BigDecimal numConf;
|
||||
|
||||
@NonNull
|
||||
@ColumnInfo(name = Columns.QTA_CNF, defaultValue = "0")
|
||||
private BigDecimal qtaConf;
|
||||
|
||||
@NonNull
|
||||
@ColumnInfo(name = Columns.UNT_MIS, defaultValue = "0")
|
||||
private String untMis;
|
||||
|
||||
@ColumnInfo(name = Columns.DATA_ORA_INV)
|
||||
private LocalDateTime dataOraInv;
|
||||
|
||||
@ColumnInfo(name = Columns.SCAN_COD_BARRE)
|
||||
private String scanCodBarre;
|
||||
|
||||
@ColumnInfo(name = Columns.ZONA)
|
||||
private String zona;
|
||||
|
||||
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public void setCodMart(@NonNull String codMart) {
|
||||
this.codMart = codMart;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public void setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public void setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public BigDecimal getQta() {
|
||||
return qta;
|
||||
}
|
||||
|
||||
public void setQta(@NonNull BigDecimal qta) {
|
||||
this.qta = qta;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public BigDecimal getNumConf() {
|
||||
return numConf;
|
||||
}
|
||||
|
||||
public void setNumConf(@NonNull BigDecimal numConf) {
|
||||
this.numConf = numConf;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public BigDecimal getQtaConf() {
|
||||
return qtaConf;
|
||||
}
|
||||
|
||||
public void setQtaConf(@NonNull BigDecimal qtaConf) {
|
||||
this.qtaConf = qtaConf;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public void setUntMis(@NonNull String untMis) {
|
||||
this.untMis = untMis;
|
||||
}
|
||||
|
||||
public LocalDateTime getDataOraInv() {
|
||||
return dataOraInv;
|
||||
}
|
||||
|
||||
public void setDataOraInv(LocalDateTime dataOraInv) {
|
||||
this.dataOraInv = dataOraInv;
|
||||
}
|
||||
|
||||
public String getScanCodBarre() {
|
||||
return scanCodBarre;
|
||||
}
|
||||
|
||||
public void setScanCodBarre(String scanCodBarre) {
|
||||
this.scanCodBarre = scanCodBarre;
|
||||
}
|
||||
|
||||
public String getZona() {
|
||||
return zona;
|
||||
}
|
||||
|
||||
public void setZona(String zona) {
|
||||
this.zona = zona;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
InventarioRowRoomDTO that = (InventarioRowRoomDTO) o;
|
||||
|
||||
if (getId() != null ? !getId().equals(that.getId()) : that.getId() != null) return false;
|
||||
if (getParentId() != null ? !getParentId().equals(that.getParentId()) : that.getParentId() != null)
|
||||
return false;
|
||||
if (getCodMart() != null ? !getCodMart().equals(that.getCodMart()) : that.getCodMart() != null)
|
||||
return false;
|
||||
if (getPartitaMag() != null ? !getPartitaMag().equals(that.getPartitaMag()) : that.getPartitaMag() != null)
|
||||
return false;
|
||||
if (getDescrizione() != null ? !getDescrizione().equals(that.getDescrizione()) : that.getDescrizione() != null)
|
||||
return false;
|
||||
if (!getQta().equals(that.getQta())) return false;
|
||||
if (!getNumConf().equals(that.getNumConf())) return false;
|
||||
if (!getQtaConf().equals(that.getQtaConf())) return false;
|
||||
if (!getUntMis().equals(that.getUntMis())) return false;
|
||||
if (getDataOraInv() != null ? !getDataOraInv().equals(that.getDataOraInv()) : that.getDataOraInv() != null)
|
||||
return false;
|
||||
if (getScanCodBarre() != null ? !getScanCodBarre().equals(that.getScanCodBarre()) : that.getScanCodBarre() != null)
|
||||
return false;
|
||||
return getZona() != null ? getZona().equals(that.getZona()) : that.getZona() == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = getId() != null ? getId().hashCode() : 0;
|
||||
result = 31 * result + (getParentId() != null ? getParentId().hashCode() : 0);
|
||||
result = 31 * result + (getCodMart() != null ? getCodMart().hashCode() : 0);
|
||||
result = 31 * result + (getPartitaMag() != null ? getPartitaMag().hashCode() : 0);
|
||||
result = 31 * result + (getDescrizione() != null ? getDescrizione().hashCode() : 0);
|
||||
result = 31 * result + getQta().hashCode();
|
||||
result = 31 * result + getNumConf().hashCode();
|
||||
result = 31 * result + getQtaConf().hashCode();
|
||||
result = 31 * result + getUntMis().hashCode();
|
||||
result = 31 * result + (getDataOraInv() != null ? getDataOraInv().hashCode() : 0);
|
||||
result = 31 * result + (getScanCodBarre() != null ? getScanCodBarre().hashCode() : 0);
|
||||
result = 31 * result + (getZona() != null ? getZona().hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -48,10 +48,14 @@ public class Ordine {
|
||||
private String codMdep;
|
||||
|
||||
@Ignore
|
||||
private int countArticoli = 0;
|
||||
private boolean orderNewProducts = false;
|
||||
|
||||
@ColumnInfo(name = "id_griglia")
|
||||
private int idGriglia;
|
||||
@Nullable
|
||||
private Integer idGriglia;
|
||||
|
||||
@ColumnInfo(name = "cod_alis")
|
||||
private String codAlis;
|
||||
|
||||
public int getOrdineId() {
|
||||
return ordineId;
|
||||
@@ -77,11 +81,11 @@ public class Ordine {
|
||||
this.annotazioni = annotazioni;
|
||||
}
|
||||
|
||||
public int getIdGriglia() {
|
||||
public Integer getIdGriglia() {
|
||||
return idGriglia;
|
||||
}
|
||||
|
||||
public void setIdGriglia(int idGriglia) {
|
||||
public void setIdGriglia(Integer idGriglia) {
|
||||
this.idGriglia = idGriglia;
|
||||
}
|
||||
|
||||
@@ -102,14 +106,6 @@ public class Ordine {
|
||||
this.transmissionDate = transmissionDate;
|
||||
}
|
||||
|
||||
public int getCountArticoli() {
|
||||
return countArticoli;
|
||||
}
|
||||
|
||||
public void setCountArticoli(int countArticoli) {
|
||||
this.countArticoli = countArticoli;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
@@ -149,4 +145,20 @@ public class Ordine {
|
||||
public void setDataOrdS(String dataOrd) {
|
||||
setDataOrd(UtilityDate.recognizeDateWithExceptionHandler(dataOrd));
|
||||
}
|
||||
|
||||
public boolean isOrderNewProducts() {
|
||||
return orderNewProducts;
|
||||
}
|
||||
|
||||
public void setOrderNewProducts(boolean orderNewProducts) {
|
||||
this.orderNewProducts = orderNewProducts;
|
||||
}
|
||||
|
||||
public String getCodAlis() {
|
||||
return codAlis;
|
||||
}
|
||||
|
||||
public void setCodAlis(String codAlis) {
|
||||
this.codAlis = codAlis;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import androidx.room.ForeignKey;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity(
|
||||
@@ -138,7 +138,7 @@ public class SqlMtbColr {
|
||||
@ColumnInfo(name = "unt_mis")
|
||||
private String untMis;
|
||||
@ColumnInfo(name = "data_scad")
|
||||
private Date dataScad;
|
||||
private LocalDate dataScad;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
@@ -428,11 +428,11 @@ public class SqlMtbColr {
|
||||
this.descrizione = descrizione;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
public LocalDate getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public void setDataScad(Date dataScad) {
|
||||
public void setDataScad(LocalDate dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.interfaces;
|
||||
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.RawQuery;
|
||||
import androidx.room.Update;
|
||||
import androidx.sqlite.db.SupportSQLiteQuery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EntityDaoInterface<R> {
|
||||
|
||||
@RawQuery()
|
||||
List<R> execRaw(SupportSQLiteQuery query);
|
||||
|
||||
@Insert
|
||||
long insert(R objectToInsert);
|
||||
|
||||
@Insert
|
||||
List<Long> insertAll(List<R> objectToInsert);
|
||||
|
||||
@Delete
|
||||
void delete(R objectToInsert);
|
||||
|
||||
@Update
|
||||
void updateAll(List<R> cheese);
|
||||
|
||||
@Update
|
||||
int update(R cheese);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.interfaces;
|
||||
|
||||
public interface EntityModelInterface {
|
||||
|
||||
void setId(Long id);
|
||||
|
||||
Long getId();
|
||||
|
||||
}
|
||||
@@ -3,16 +3,15 @@ package it.integry.integrywmsnative.core.data_store.db.repository;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.GrigliaWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public interface GrigliaRepository {
|
||||
|
||||
void selectAll(RunnableArgs<List<Griglia>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void findByCodAlis(String codAlis , RunnableArgs<GrigliaWrapper> onSuccess, RunnableArgs<Exception> onError);
|
||||
void findByCodAlis(String codAlis, RunnableArgs<Griglia> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void saveGriglia(Griglia griglia, RunnableArgs<Integer> onSuccess,RunnableArgs<Exception> onFail);
|
||||
void saveGriglia(Griglia griglia, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onFail);
|
||||
|
||||
void findGrigliaById(int idGriglia, RunnableArgs<Griglia> onLoad, RunnableArgs<Exception> onFail);
|
||||
}
|
||||
|
||||
@@ -3,19 +3,18 @@ package it.integry.integrywmsnative.core.data_store.db.repository;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public interface MtbColrRepository {
|
||||
public interface MtbColrDataSource {
|
||||
|
||||
void selectAll(RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void selectAllByDocumentID(long documentID, RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void insert(SqlMtbColr mtbColr, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void update(SqlMtbColr mtbColr, RunnableArgs<SqlMtbColr> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void delete(SqlMtbColr mtbColr, Runnable onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void getDocumentRows(SqlMtbColt sqlMtbColt, RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.view_model.OrdineWithGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.OrdineWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public interface MtbColtRepository {
|
||||
@@ -21,7 +19,7 @@ public interface MtbColtRepository {
|
||||
|
||||
void delete(SqlMtbColt mtbColt, Runnable onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc, RunnableArgs<List<DocInternoWrapper>> onSuccess, RunnableArgs<Exception> onError);
|
||||
LiveData<List<DocInternoWrapper>> getDocuments(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc);
|
||||
|
||||
void getNextNumCollo(RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
|
||||
@@ -2,9 +2,7 @@ package it.integry.integrywmsnative.core.data_store.db.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.view_model.OrdineWithGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.OrdineWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
@@ -12,9 +10,9 @@ public interface OrdineRepository {
|
||||
|
||||
void selectAll(RunnableArgs<List<Ordine>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void selectAllTransmitted(RunnableArgs<List<OrdineWithGriglia>> onSuccess, RunnableArgs<Exception> onError);
|
||||
void selectAllTransmitted(RunnableArgs<List<Ordine>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void selectAllOpenOrders(Griglia griglia, RunnableArgs<List<OrdineWrapper>> onSuccess, RunnableArgs<Exception> onError);
|
||||
void selectAllOpenOrders(String codAlis, RunnableArgs<List<OrdineWrapper>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void insert(Ordine ordine, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.datasource;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
@@ -9,9 +11,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -21,24 +22,29 @@ import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoloGrigliaRepository;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
||||
|
||||
public class ArticoliGrigliaDataSource extends Repository implements ArticoloGrigliaRepository {
|
||||
public class ArticoliGrigliaDataSource extends BaseDataSource implements ArticoloGrigliaRepository {
|
||||
|
||||
private final ArticoloGrigliaDao mArticoloGrigliaDao;
|
||||
|
||||
@Inject
|
||||
public ArticoliGrigliaDataSource(ArticoloGrigliaDao articoloGrigliaDao) {
|
||||
public ArticoliGrigliaDataSource(ExecutorService executorService,
|
||||
Handler handler,
|
||||
ArticoloGrigliaDao articoloGrigliaDao) {
|
||||
super(executorService, handler);
|
||||
this.mArticoloGrigliaDao = articoloGrigliaDao;
|
||||
}
|
||||
|
||||
public void saveArticoliToGriglia(List<ArticoloGriglia> updatedArts, Griglia griglia, Runnable onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
var tmp = calcItemsToInsertAndUpdate(updatedArts);
|
||||
var toInsert = (List<ArticoloGriglia>) tmp.get("toInsert");
|
||||
var toUpdate = (List<ArticoloGriglia>) tmp.get("toUpdate");
|
||||
var codMarts = (List<String>) tmp.get("codMarts");
|
||||
public void saveArticoliToGriglia(List<ArticoloGriglia> updatedArts, Griglia griglia, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
|
||||
try {
|
||||
var tmp = calcItemsToInsertAndUpdate(updatedArts);
|
||||
var toInsert = UtilityHashMap.<List<ArticoloGriglia>>getValue(tmp, "toInsert");
|
||||
var toUpdate = UtilityHashMap.<List<ArticoloGriglia>>getValue(tmp, "toUpdate");
|
||||
var codMarts = UtilityHashMap.<List<String>>getValue(tmp, "codMarts");
|
||||
|
||||
executorService.execute(() -> {
|
||||
mArticoloGrigliaDao.insertAll(toInsert);
|
||||
mArticoloGrigliaDao.updateAll(toUpdate);
|
||||
|
||||
@@ -46,11 +52,12 @@ public class ArticoliGrigliaDataSource extends Repository implements ArticoloGri
|
||||
List<ArticoloGriglia> toDelete = Stream.of(articoliGriglia).filter(articolo -> !codMarts.contains(articolo.getCodMart())).toList();
|
||||
mArticoloGrigliaDao.deleteList(toDelete);
|
||||
|
||||
onSuccess.run();
|
||||
} catch (Exception e) {
|
||||
onFail.run(e);
|
||||
}
|
||||
});
|
||||
handler.post(onSuccess);
|
||||
});
|
||||
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HashMap<String, Object> calcItemsToInsertAndUpdate(List<ArticoloGriglia> updatedArts) throws InterruptedException, ExecutionException {
|
||||
@@ -58,12 +65,11 @@ public class ArticoliGrigliaDataSource extends Repository implements ArticoloGri
|
||||
var toUpdate = new ArrayList<ArticoloGriglia>();
|
||||
var codMarts = new ArrayList<String>();
|
||||
|
||||
int cores = Runtime.getRuntime().availableProcessors();
|
||||
ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(cores);
|
||||
List<Callable<ArticoloGriglia>> calls = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < updatedArts.size(); i++) {
|
||||
int finalI = i;
|
||||
|
||||
Callable<ArticoloGriglia> callableTask = () -> {
|
||||
var updatedArt = updatedArts.get(finalI);
|
||||
Integer id = mArticoloGrigliaDao.getIdArticoloByGrigliaAndBarcodeAndCodMart(updatedArt.getIdGriglia(), updatedArt.getBarCode(), updatedArt.getCodMart());
|
||||
@@ -78,7 +84,7 @@ public class ArticoliGrigliaDataSource extends Repository implements ArticoloGri
|
||||
calls.add(callableTask);
|
||||
}
|
||||
|
||||
List<Future<ArticoloGriglia>> futures = executor.invokeAll(calls, Long.MAX_VALUE, TimeUnit.MILLISECONDS);
|
||||
List<Future<ArticoloGriglia>> futures = executorService.invokeAll(calls, Long.MAX_VALUE, TimeUnit.MILLISECONDS);
|
||||
|
||||
for (Future<ArticoloGriglia> future : futures) {
|
||||
if (future.isDone()) {
|
||||
@@ -99,51 +105,38 @@ public class ArticoliGrigliaDataSource extends Repository implements ArticoloGri
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public void findArticoloByBarcodeAndGriglia(String barcode, int idGriglia, RunnableArgs<ArticoloGriglia> onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
onSuccess.run(mArticoloGrigliaDao.findArticoloByBarcodeAndGriglia(barcode, idGriglia));
|
||||
} catch (Exception e) {
|
||||
onFail.run(e);
|
||||
}
|
||||
});
|
||||
public void findArticoloByBarcodeAndGriglia(String barcode, int idGriglia, RunnableArgs<ArticoloGriglia> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mArticoloGrigliaDao.findArticoloByBarcodeAndGriglia(barcode, idGriglia), onSuccess, onError);
|
||||
}
|
||||
|
||||
public void findArticoloByCodMartAndGriglia(String codMart, int idGriglia, RunnableArgs<ArticoloGriglia> onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
onSuccess.run(mArticoloGrigliaDao.findArticoloByCodMartAndGriglia(codMart, idGriglia));
|
||||
} catch (Exception e) {
|
||||
onFail.run(e);
|
||||
}
|
||||
});
|
||||
public void findArticoloByCodMartAndGriglia(String codMart, int idGriglia, RunnableArgs<ArticoloGriglia> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mArticoloGrigliaDao.findArticoloByCodMartAndGriglia(codMart, idGriglia), onSuccess, onError);
|
||||
}
|
||||
|
||||
public void findArticoloByScanAndGriglia(String scan, int idGriglia, RunnableArgs<ArticoloGriglia> onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
public void findArticoloByScanAndGriglia(String scan, int idGriglia, RunnableArgs<ArticoloGriglia> onSuccess, RunnableArgs<Exception> onError) {
|
||||
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
ArticoloGriglia articolo = mArticoloGrigliaDao.findArticoloByCodMartAndGriglia(scan, idGriglia);
|
||||
|
||||
if (articolo == null) {
|
||||
articolo = mArticoloGrigliaDao.findArticoloByBarcodeAndGriglia(scan, idGriglia);
|
||||
if (articolo == null) {
|
||||
String barcode = StringUtils.leftPad(scan, 13, "0");
|
||||
articolo = mArticoloGrigliaDao.findArticoloByBarcodeAndGriglia(barcode, idGriglia);
|
||||
}
|
||||
}
|
||||
onSuccess.run(articolo);
|
||||
|
||||
if (articolo == null) {
|
||||
String barcode = StringUtils.leftPad(scan, 13, "0");
|
||||
articolo = mArticoloGrigliaDao.findArticoloByBarcodeAndGriglia(barcode, idGriglia);
|
||||
}
|
||||
|
||||
final ArticoloGriglia finalArticolo = articolo;
|
||||
handler.post(() -> onSuccess.run(finalArticolo));
|
||||
} catch (Exception e) {
|
||||
onFail.run(e);
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void findNewArticoliInGrigla(int idGriglia, RunnableArgs<List<ArticoloGriglia>> onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
onSuccess.run(mArticoloGrigliaDao.getNewArticoliInGriglia(idGriglia));
|
||||
} catch (Exception e) {
|
||||
onFail.run(e);
|
||||
}
|
||||
});
|
||||
public void findNewArticoliInGrigla(int idGriglia, RunnableArgs<List<ArticoloGriglia>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mArticoloGrigliaDao.getNewArticoliInGriglia(idGriglia), onSuccess, onError);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.datasource;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
|
||||
public class ArticoliOrdineDataSource extends BaseDataSource implements ArticoliOrdineRepository {
|
||||
|
||||
private final ArticoloOrdineDao mArticoloOrdineDao;
|
||||
|
||||
@Inject
|
||||
public ArticoliOrdineDataSource(ExecutorService executorService,
|
||||
Handler handler,
|
||||
ArticoloOrdineDao articoloOrdineDao) {
|
||||
super(executorService, handler);
|
||||
this.mArticoloOrdineDao = articoloOrdineDao;
|
||||
}
|
||||
|
||||
public void saveArticoliToOrdine(List<ArticoloOrdine> articoli, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
List<ArticoloOrdine> toUpdate = new ArrayList<>();
|
||||
List<ArticoloOrdine> toInsert = new ArrayList<>();
|
||||
for (ArticoloOrdine art : articoli) {
|
||||
if (art.getArticoloOrdineId() != null && art.getArticoloOrdineId() > 0) {
|
||||
toUpdate.add(art);
|
||||
} else {
|
||||
toInsert.add(art);
|
||||
}
|
||||
}
|
||||
for (ArticoloOrdine newArt : toInsert) {
|
||||
mArticoloOrdineDao.insert(newArt);
|
||||
}
|
||||
mArticoloOrdineDao.updateAll(toUpdate);
|
||||
handler.post(onSuccess);
|
||||
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void saveArticoloToOrdine(ArticoloOrdine articolo, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
articolo.setDataIns(UtilityDate.getDateInstance());
|
||||
if (articolo.getArticoloOrdineId() != null && articolo.getArticoloOrdineId() > 0) {
|
||||
execute(() -> mArticoloOrdineDao.update(articolo), onSuccess, onError);
|
||||
} else {
|
||||
execute(() -> mArticoloOrdineDao.insert(articolo), onSuccess, onError);
|
||||
}
|
||||
}
|
||||
|
||||
public void findArticoloByOrdineAndBarcode(Ordine ordine, String barcode, RunnableArgs<ArticoloOrdine> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mArticoloOrdineDao.findArticoloByOrdineAndBarcode(ordine.getOrdineId(), barcode), onSuccess, onError);
|
||||
}
|
||||
|
||||
public void findArticoloByScanAndOrdine(Ordine ordine, String barcode, RunnableArgs<ArticoloOrdine> onSuccess, RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
ArticoloOrdine articolo = mArticoloOrdineDao.findArticoloByCodMartAndOrdine(ordine.getOrdineId(), barcode);
|
||||
|
||||
if (articolo == null) {
|
||||
articolo = mArticoloOrdineDao.findArticoloByBarcodeAndOrdine(ordine.getOrdineId(), barcode);
|
||||
}
|
||||
|
||||
if (articolo == null) {
|
||||
String scannedCode = StringUtils.leftPad(barcode, 13, '0');
|
||||
articolo = mArticoloOrdineDao.findArticoloByBarcodeAndOrdine(ordine.getOrdineId(), scannedCode);
|
||||
}
|
||||
|
||||
final ArticoloOrdine finalArticolo = articolo;
|
||||
handler.post(() -> onSuccess.run(finalArticolo));
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void findArticoliByOrdine(Ordine ordine, RunnableArgs<List<ArticoloOrdine>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mArticoloOrdineDao.findArticoliByOrdine(ordine.getOrdineId()), onSuccess, onError);
|
||||
}
|
||||
|
||||
public void deleteArticolo(ArticoloOrdine articolo, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mArticoloOrdineDao.delete(articolo),
|
||||
onSuccess,
|
||||
onError);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.datasource;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableWithReturn;
|
||||
|
||||
public class BaseDataSource {
|
||||
|
||||
protected final ExecutorService executorService;
|
||||
protected final Handler handler;
|
||||
|
||||
protected BaseDataSource(ExecutorService executorService, Handler handler) {
|
||||
this.executorService = executorService;
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
protected <T> void execute(RunnableWithReturn<T> query, RunnableArgs<T> onSuccess, RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
var data = query.run();
|
||||
handler.post(() -> onSuccess.run(data));
|
||||
} catch (Exception ex) {
|
||||
handler.post(() -> onError.run(ex));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void execute(Runnable query, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
query.run();
|
||||
handler.post(onSuccess);
|
||||
} catch (Exception ex) {
|
||||
handler.post(() -> onError.run(ex));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.datasource;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.GrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.GrigliaRepository;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class GrigliaDataSource extends BaseDataSource implements GrigliaRepository {
|
||||
|
||||
private final GrigliaDao mGrigliaDao;
|
||||
|
||||
@Inject
|
||||
public GrigliaDataSource(ExecutorService executorService,
|
||||
Handler handler,
|
||||
GrigliaDao grigliaDao) {
|
||||
super(executorService, handler);
|
||||
this.mGrigliaDao = grigliaDao;
|
||||
}
|
||||
|
||||
public void selectAll(RunnableArgs<List<Griglia>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(mGrigliaDao::getAll, onSuccess, onError);
|
||||
}
|
||||
|
||||
public void findByCodAlis(String codAlis, RunnableArgs<Griglia> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mGrigliaDao.findByCodAlis(codAlis), onSuccess, onError);
|
||||
}
|
||||
|
||||
|
||||
public void saveGriglia(Griglia griglia, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onFail) {
|
||||
if (griglia.getGrigliaId() <= 0) {
|
||||
execute(() -> (int) mGrigliaDao.insert(griglia), grigliaId -> {
|
||||
griglia.setGrigliaId(grigliaId);
|
||||
onSuccess.run(grigliaId);
|
||||
}, onFail);
|
||||
} else {
|
||||
execute(() -> mGrigliaDao.update(griglia), () -> onSuccess.run(griglia.getGrigliaId()), onFail);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void findGrigliaById(int idGriglia, RunnableArgs<Griglia> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mGrigliaDao.findGrigliaById(idGriglia), onSuccess, onError);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.datasource;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.OrdineRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.OrdineWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class OrdineDataSource extends BaseDataSource implements OrdineRepository {
|
||||
|
||||
private final OrdineDao mOrdineDao;
|
||||
|
||||
@Inject
|
||||
public OrdineDataSource(ExecutorService executorService,
|
||||
Handler handler,
|
||||
OrdineDao ordineDao) {
|
||||
super(executorService, handler);
|
||||
this.mOrdineDao = ordineDao;
|
||||
}
|
||||
|
||||
public void selectAll(RunnableArgs<List<Ordine>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(mOrdineDao::getAll, onSuccess, onError);
|
||||
}
|
||||
|
||||
public void selectAllTransmitted(RunnableArgs<List<Ordine>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(mOrdineDao::getAllTrasnmitted, onSuccess, onError);
|
||||
}
|
||||
|
||||
public void selectAllOpenOrders(String codAlis, RunnableArgs<List<OrdineWrapper>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mOrdineDao.getAllOpenOrdersByGriglia(codAlis), onSuccess, onError);
|
||||
}
|
||||
|
||||
public void insert(Ordine ordine, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mOrdineDao.insert(ordine),
|
||||
ordineId -> onSuccess.run(ordineId.intValue()),
|
||||
onError);
|
||||
}
|
||||
|
||||
|
||||
public void updateOrder(Ordine ordine, RunnableArgs<Ordine> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mOrdineDao.update(ordine),
|
||||
() -> onSuccess.run(ordine),
|
||||
onError);
|
||||
}
|
||||
|
||||
public void delete(Ordine ordine, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mOrdineDao.delete(ordine),
|
||||
onSuccess,
|
||||
onError);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.datasource;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrDataSource;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class SqlMtbColrDataSource extends BaseDataSource implements MtbColrDataSource {
|
||||
|
||||
private final MtbColrDao mMtbColrDao;
|
||||
|
||||
@Inject
|
||||
public SqlMtbColrDataSource(ExecutorService executorService,
|
||||
Handler handler,
|
||||
MtbColrDao mtbColrDao) {
|
||||
super(executorService, handler);
|
||||
this.mMtbColrDao = mtbColrDao;
|
||||
}
|
||||
|
||||
public void selectAll(RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(mMtbColrDao::getAll, onSuccess, onError);
|
||||
}
|
||||
|
||||
public void selectAllByDocumentID(long documentId, RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mMtbColrDao.getDocumentRows(documentId), onSuccess, onError);
|
||||
}
|
||||
|
||||
public void insert(SqlMtbColr mtbColr, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mMtbColrDao.insert(mtbColr),
|
||||
mtbColrId -> onSuccess.run(mtbColrId.intValue()),
|
||||
onError);
|
||||
}
|
||||
|
||||
|
||||
public void update(SqlMtbColr mtbColr, RunnableArgs<SqlMtbColr> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mMtbColrDao.update(mtbColr),
|
||||
() -> onSuccess.run(mtbColr),
|
||||
onError);
|
||||
}
|
||||
|
||||
public void delete(SqlMtbColr mtbColr, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mMtbColrDao.delete(mtbColr),
|
||||
onSuccess,
|
||||
onError);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.datasource;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class SqlMtbColtDataSource extends BaseDataSource implements MtbColtRepository {
|
||||
|
||||
private final MtbColtDao mMtbColtDao;
|
||||
|
||||
@Inject
|
||||
public SqlMtbColtDataSource(ExecutorService executorService,
|
||||
Handler handler,
|
||||
MtbColtDao mtbColtDao) {
|
||||
super(executorService, handler);
|
||||
this.mMtbColtDao = mtbColtDao;
|
||||
}
|
||||
|
||||
public void selectAll(RunnableArgs<List<SqlMtbColt>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(mMtbColtDao::getAll, onSuccess, onError);
|
||||
}
|
||||
|
||||
public void insert(SqlMtbColt mtbColt, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mMtbColtDao.insert(mtbColt),
|
||||
mtbColtId -> onSuccess.run(mtbColtId.intValue()),
|
||||
onError);
|
||||
}
|
||||
|
||||
|
||||
public void update(SqlMtbColt mtbColt, RunnableArgs<SqlMtbColt> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mMtbColtDao.update(mtbColt),
|
||||
() -> onSuccess.run(mtbColt),
|
||||
onError);
|
||||
}
|
||||
|
||||
public void delete(SqlMtbColt mtbColt, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mMtbColtDao.delete(mtbColt),
|
||||
onSuccess,
|
||||
onError);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LiveData<List<DocInternoWrapper>> getDocuments(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc) {
|
||||
return mMtbColtDao.getLocalDocumentsByCodDtip(codDtip, codAnag, codVdes, dataDoc, numDoc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getNextNumCollo(RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(mMtbColtDao::getNextNumCollo,
|
||||
onSuccess,
|
||||
onError);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.ArticoloOrdineWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class ArticoliOrdineDataSource extends Repository implements ArticoliOrdineRepository {
|
||||
|
||||
private final ArticoloOrdineDao mArticoloOrdineDao;
|
||||
|
||||
@Inject
|
||||
public ArticoliOrdineDataSource(ArticoloOrdineDao articoloOrdineDao) {
|
||||
this.mArticoloOrdineDao = articoloOrdineDao;
|
||||
}
|
||||
|
||||
public void saveArticoliToOrdine(List<ArticoloOrdine> articoli, Runnable onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
List<ArticoloOrdine> toUpdate = new ArrayList<>();
|
||||
List<ArticoloOrdine> toInsert = new ArrayList<>();
|
||||
for (ArticoloOrdine art : articoli) {
|
||||
if (art.getArticoloOrdineId() != null && art.getArticoloOrdineId() > 0) {
|
||||
toUpdate.add(art);
|
||||
} else {
|
||||
toInsert.add(art);
|
||||
}
|
||||
}
|
||||
for (ArticoloOrdine newArt : toInsert) {
|
||||
mArticoloOrdineDao.insert(newArt);
|
||||
}
|
||||
mArticoloOrdineDao.updateAll(toUpdate);
|
||||
onSuccess.run();
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
onFail.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void saveArticoloToOrdine(ArticoloOrdine articolo, Runnable onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
if (articolo.getArticoloOrdineId() != null && articolo.getArticoloOrdineId() > 0) {
|
||||
mArticoloOrdineDao.update(articolo);
|
||||
} else {
|
||||
mArticoloOrdineDao.insert(articolo);
|
||||
}
|
||||
onSuccess.run();
|
||||
} catch (Exception e) {
|
||||
onFail.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void findArticoloByOrdineAndBarcode(Ordine ordine, String barcode, RunnableArgs<ArticoloOrdine> onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
ArticoloOrdine articolo = mArticoloOrdineDao.findArticoloByOrdineAndBarcode(ordine.getOrdineId(), barcode);
|
||||
onSuccess.run(articolo);
|
||||
} catch (Exception e) {
|
||||
onFail.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void findArticoloByScanAndOrdine(Ordine ordine, String barcode, RunnableArgs<ArticoloOrdine> onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
String scannedCode = barcode;
|
||||
ArticoloOrdine articolo = mArticoloOrdineDao.findArticoloByCodMartAndOrdine(ordine.getOrdineId(), scannedCode);
|
||||
if (articolo == null) {
|
||||
articolo = mArticoloOrdineDao.findArticoloByBarcodeAndOrdine(ordine.getOrdineId(), scannedCode);
|
||||
if (articolo == null) {
|
||||
scannedCode = StringUtils.leftPad(scannedCode, 13, '0');
|
||||
articolo = mArticoloOrdineDao.findArticoloByBarcodeAndOrdine(ordine.getOrdineId(), scannedCode);
|
||||
}
|
||||
}
|
||||
onSuccess.run(articolo);
|
||||
} catch (Exception e) {
|
||||
onFail.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void findArticoliByOrdine(Ordine ordine, RunnableArgs<List<ArticoloOrdine>> onLoad, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
List<ArticoloOrdineWrapper> list = mArticoloOrdineDao.findArticoliByOrdine(ordine.getOrdineId());
|
||||
onLoad.run(Stream.of(list).map(x -> {
|
||||
ArticoloOrdine art = x.getArticoloOrdine();
|
||||
art.setGgScadenza(x.getGgScadenza());
|
||||
art.setGiacenza(x.getGiacenza());
|
||||
art.setQtaProposta(x.getQtaProposta());
|
||||
art.setQtaPrevistaVendita(x.getQtaPrevistaVendita());
|
||||
return art;
|
||||
}).toList());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void deleteArticolo(ArticoloOrdine articolo, Runnable onSave, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mArticoloOrdineDao.delete(articolo);
|
||||
onSave.run();
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.GrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.GrigliaRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.GrigliaWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class GrigliaDataSource extends Repository implements GrigliaRepository {
|
||||
|
||||
private final GrigliaDao mGrigliaDao;
|
||||
|
||||
@Inject
|
||||
public GrigliaDataSource(GrigliaDao grigliaDao) {
|
||||
this.mGrigliaDao = grigliaDao;
|
||||
}
|
||||
|
||||
public void selectAll(RunnableArgs<List<Griglia>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mGrigliaDao.getAll());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
public void findByCodAlis(String codAlis, RunnableArgs<GrigliaWrapper> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mGrigliaDao.findByCodAlis(codAlis));
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
|
||||
public void saveGriglia(Griglia griglia, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
if (griglia.getGrigliaId() <= 0) {
|
||||
griglia.setGrigliaId((int) mGrigliaDao.insert(griglia));
|
||||
} else {
|
||||
mGrigliaDao.update(griglia);
|
||||
}
|
||||
onSuccess.run(griglia.getGrigliaId());
|
||||
} catch (Exception e) {
|
||||
onFail.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void findGrigliaById(int idGriglia, RunnableArgs<Griglia> onLoad, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
onLoad.run(mGrigliaDao.findGrigliaById(idGriglia));
|
||||
} catch (Exception e) {
|
||||
onFail.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.OrdineRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.view_model.OrdineWithGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.OrdineWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class OrdineDataSource extends Repository implements OrdineRepository {
|
||||
|
||||
private OrdineDao mOrdineDao;
|
||||
|
||||
@Inject
|
||||
public OrdineDataSource(OrdineDao ordineDao) {
|
||||
this.mOrdineDao = ordineDao;
|
||||
}
|
||||
|
||||
public void selectAll(RunnableArgs<List<Ordine>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mOrdineDao.getAll());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
public void selectAllTransmitted(RunnableArgs<List<OrdineWithGriglia>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mOrdineDao.getAllTrasnmitted());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
public void selectAllOpenOrders(Griglia griglia, RunnableArgs<List<OrdineWrapper>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mOrdineDao.getAllOpenOrdersByGriglia(griglia.getGrigliaId()));
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
public void insert(Ordine ordine, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
Long id = mOrdineDao.insert(ordine);
|
||||
onSuccess.run(id.intValue());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void updateOrder(Ordine ordine, RunnableArgs<Ordine> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mOrdineDao.update(ordine);
|
||||
onSuccess.run(ordine);
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void delete(Ordine ordine, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mOrdineDao.delete(ordine);
|
||||
onSuccess.run();
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
||||
|
||||
public class Repository {
|
||||
|
||||
|
||||
public void execute(Runnable query){
|
||||
new Thread(query).start();
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrRepository;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class SqlMtbColrDataSource extends Repository implements MtbColrRepository {
|
||||
|
||||
private MtbColrDao mMtbColrDao;
|
||||
|
||||
@Inject
|
||||
public SqlMtbColrDataSource(MtbColrDao mtbColrDao) {
|
||||
this.mMtbColrDao = mtbColrDao;
|
||||
}
|
||||
|
||||
public void selectAll(RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColrDao.getAll());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
public void insert(SqlMtbColr mtbColr, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
Long id = mMtbColrDao.insert(mtbColr);
|
||||
onSuccess.run(id.intValue());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void update(SqlMtbColr mtbColr, RunnableArgs<SqlMtbColr> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mMtbColrDao.update(mtbColr);
|
||||
onSuccess.run(mtbColr);
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void delete(SqlMtbColr mtbColr, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mMtbColrDao.delete(mtbColr);
|
||||
onSuccess.run();
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getDocumentRows(SqlMtbColt document, RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColrDao.getDocumentRows(document.getId()));
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class SqlMtbColtDataSource extends Repository implements MtbColtRepository {
|
||||
|
||||
private MtbColtDao mMtbColtDao;
|
||||
|
||||
@Inject
|
||||
public SqlMtbColtDataSource(MtbColtDao mtbColtDao) {
|
||||
this.mMtbColtDao = mtbColtDao;
|
||||
}
|
||||
|
||||
public void selectAll(RunnableArgs<List<SqlMtbColt>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColtDao.getAll());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
public void insert(SqlMtbColt mtbColt, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
Long id = mMtbColtDao.insert(mtbColt);
|
||||
onSuccess.run(id.intValue());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void update(SqlMtbColt mtbColt, RunnableArgs<SqlMtbColt> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mMtbColtDao.update(mtbColt);
|
||||
onSuccess.run(mtbColt);
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void delete(SqlMtbColt mtbColt, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mMtbColtDao.delete(mtbColt);
|
||||
onSuccess.run();
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc, RunnableArgs<List<DocInternoWrapper>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColtDao.getLocalDocumentsByCodDtip(codDtip,codAnag,codVdes,dataDoc,numDoc));
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getNextNumCollo(RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColtDao.getNextNumCollo());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.respository_new;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRoomDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.data_source.InventarioLocalDataSource;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.mapper.InventarioMapper;
|
||||
import it.integry.integrywmsnative.core.model.MtbInvent;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.InventarioRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLiveData;
|
||||
|
||||
public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioRoomDTO, InventarioMapper, InventarioLocalDataSource, InventarioRESTConsumer> {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
|
||||
private final Handler handler;
|
||||
|
||||
private final MutableLiveData<List<InventarioRoomDTO>> internalLiveData = new MutableLiveData<>();
|
||||
|
||||
@Inject
|
||||
public InventarioRepository(InventarioLocalDataSource localDataSource,
|
||||
InventarioRESTConsumer remoteDataSource,
|
||||
InventarioMapper dataMapper,
|
||||
Handler handler,
|
||||
ExecutorService executorService) {
|
||||
super(dataMapper, localDataSource, remoteDataSource);
|
||||
this.handler = handler;
|
||||
this.executorService = executorService;
|
||||
}
|
||||
|
||||
|
||||
public LiveData<List<InventarioRoomDTO>> retrieve(Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
localDataSource.makeSynchronousRetrieveAllLive(false)
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(internalLiveData::postValue);
|
||||
|
||||
UtilityLiveData.observeOnce(internalLiveData, inventories -> {
|
||||
refresh(onComplete, onError);
|
||||
});
|
||||
|
||||
|
||||
return internalLiveData;
|
||||
}
|
||||
|
||||
|
||||
public void refresh(Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
var startRetrieve = new Date();
|
||||
var remoteData = remoteDataSource.makeSynchronousRetrieveRequest();
|
||||
Log.d("Time INVENTORY RETRIEVE", ((new Date().getTime() - startRetrieve.getTime()) / 1000) + " secs");
|
||||
|
||||
if (remoteData == null) remoteData = new ArrayList<>();
|
||||
|
||||
List<MtbInvent> finalRemoteData = remoteData;
|
||||
|
||||
resolveFetch(finalRemoteData, internalLiveData.getValue(),
|
||||
(remoteItem, localItem) -> Objects.equals(remoteItem.getIdInventario(), localItem.getIdInventario()),
|
||||
(remoteItem, localItem) -> {
|
||||
remoteItem.setRemoteSyncDate(localItem.getRemoteSyncDate());
|
||||
remoteItem.setNew(false);
|
||||
}, () -> handler.post(onComplete), ex -> handler.post(() -> onError.run(ex)),
|
||||
SettingsManager.iDB().isFlagIsInventarioCacheEnabled());
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void insert(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
localDataSource.makeInsertRequest(inventarioDTO, localResult -> {
|
||||
if (onComplete != null) handler.post(onComplete);
|
||||
}, onError);
|
||||
}
|
||||
|
||||
public void export(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
remoteDataSource.makeInsertRequest(dataMapper.mapRoomToRest(inventarioDTO), () -> {
|
||||
inventarioDTO.setRemoteSyncDate(new Date());
|
||||
|
||||
localDataSource.makeUpdateRequest(inventarioDTO, (ignored) -> {
|
||||
handler.post(onComplete);
|
||||
}, onError);
|
||||
}, onError);
|
||||
}
|
||||
|
||||
public void delete(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
localDataSource.makeDeleteRequest(inventarioDTO, onComplete, onError);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.respository_new;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRowRoomDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.data_source.InventarioRowLocalDataSource;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.mapper.InventarioRowMapper;
|
||||
import it.integry.integrywmsnative.core.model.MtbInvenr;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.InventarioRESTConsumer;
|
||||
|
||||
public class InventarioRowRepository extends _BaseRepository<MtbInvenr, InventarioRowRoomDTO, InventarioRowMapper, InventarioRowLocalDataSource, InventarioRESTConsumer> {
|
||||
|
||||
private final Handler handler;
|
||||
private final MutableLiveData<List<InventarioRowRoomDTO>> internalLiveData = new MutableLiveData<>();
|
||||
|
||||
@Inject
|
||||
public InventarioRowRepository(InventarioRowLocalDataSource localDataSource,
|
||||
InventarioRESTConsumer remoteDataSource,
|
||||
InventarioRowMapper dataMapper,
|
||||
Handler handler) {
|
||||
super(dataMapper, localDataSource, remoteDataSource);
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
|
||||
public LiveData<List<InventarioRowRoomDTO>> retrieve(long parentId) {
|
||||
localDataSource.makeSynchronousRetrieveAllLive(parentId, true, false)
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(internalLiveData::postValue);
|
||||
// refresh(onComplete, onError);
|
||||
|
||||
return internalLiveData;
|
||||
}
|
||||
|
||||
|
||||
public void insert(InventarioRowRoomDTO inventarioRowDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
localDataSource.makeInsertRequest(inventarioRowDTO, localResult -> {
|
||||
if (onComplete != null) handler.post(onComplete);
|
||||
}, onError);
|
||||
}
|
||||
|
||||
|
||||
public void delete(InventarioRowRoomDTO inventarioRowDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
localDataSource.makeDeleteRequest(inventarioRowDTO, onComplete, onError);
|
||||
}
|
||||
|
||||
|
||||
public void update(InventarioRowRoomDTO inventarioRowDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
inventarioRowDTO.setRemoteSyncDate(null);
|
||||
|
||||
localDataSource.makeUpdateRequest(inventarioRowDTO, localResult -> {
|
||||
if (onComplete != null) handler.post(onComplete);
|
||||
}, onError);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.respository_new;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.BaseSyncDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.data_source._BaseRoomDataSource;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgssWithReturn;
|
||||
import it.integry.integrywmsnative.core.mapper.BaseMapper;
|
||||
import it.integry.integrywmsnative.core.model.BaseRestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
||||
|
||||
public abstract class _BaseRepository<
|
||||
A extends BaseRestDTO,
|
||||
B extends BaseSyncDTO,
|
||||
T extends BaseMapper<A, B>,
|
||||
U extends _BaseRoomDataSource<B, ?>,
|
||||
V extends _BaseRESTConsumer> {
|
||||
|
||||
protected final T dataMapper;
|
||||
protected final U localDataSource;
|
||||
protected final V remoteDataSource;
|
||||
|
||||
public _BaseRepository(T dataMapper, U localDataSource, V remoteDataSource) {
|
||||
this.dataMapper = dataMapper;
|
||||
this.localDataSource = localDataSource;
|
||||
this.remoteDataSource = remoteDataSource;
|
||||
}
|
||||
|
||||
protected void resolveFetch(List<A> remoteData,
|
||||
List<B> localData,
|
||||
RunnableArgssWithReturn<B, B, Boolean> keyComparator,
|
||||
RunnableArgss<B, B> dataCopy,
|
||||
Runnable onComplete,
|
||||
RunnableArgs<Exception> onError,
|
||||
boolean isCacheEnabled) {
|
||||
List<B> finalRemoteData = dataMapper.mapRestsToRooms(remoteData);
|
||||
|
||||
if (localData == null) localData = new ArrayList<>();
|
||||
List<B> finalLocalData = localData;
|
||||
|
||||
for (var x : finalRemoteData) {
|
||||
var matched = finalLocalData.stream().filter(y -> keyComparator.run(y, x))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (matched != null) {
|
||||
x.setId(matched.getId());
|
||||
dataCopy.run(x, matched);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var dataToUpdate = finalRemoteData.stream()
|
||||
.filter(x -> x.getId() != null && finalLocalData.stream().noneMatch(x::equals))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
var dataToDelete = finalLocalData.stream()
|
||||
.filter(x -> (!isCacheEnabled || x.isSyncronized()) && finalRemoteData.stream().noneMatch(y -> keyComparator.run(y, x)))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
var dataToInsert = finalRemoteData.stream()
|
||||
.filter(x -> x.getId() == null)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
localDataSource.makeUpdateAllRequest(dataToUpdate, localUpdateResult -> {
|
||||
|
||||
localDataSource.makeDeleteAllRequest(dataToDelete, () -> {
|
||||
|
||||
localDataSource.makeInsertAllRequest(dataToInsert, onComplete, onError);
|
||||
|
||||
}, onError);
|
||||
|
||||
}, onError);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.respository_new.data_source;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import io.reactivex.rxjava3.core.Flowable;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.InventarioDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRoomDTO;
|
||||
|
||||
@Singleton
|
||||
public class InventarioLocalDataSource extends _BaseRoomDataSource<InventarioRoomDTO, InventarioDao> {
|
||||
|
||||
@Inject
|
||||
public InventarioLocalDataSource(ExecutorService executorService, InventarioDao entityDao) {
|
||||
super(executorService, entityDao, InventarioRoomDTO.TABLE_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InventarioRoomDTO> makeSynchronousRetrieveAllRequest(boolean onlyToBeSync) {
|
||||
return entityDao
|
||||
.selectAll(onlyToBeSync);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flowable<List<InventarioRoomDTO>> makeSynchronousRetrieveAllLive(boolean onlyToBeSync) {
|
||||
return entityDao
|
||||
.selectAllFlowable(onlyToBeSync);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.respository_new.data_source;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import io.reactivex.rxjava3.core.Flowable;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.InventarioRowDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRowRoomDTO;
|
||||
|
||||
@Singleton
|
||||
public class InventarioRowLocalDataSource extends _BaseRoomDataSource<InventarioRowRoomDTO, InventarioRowDao> {
|
||||
|
||||
@Inject
|
||||
public InventarioRowLocalDataSource(ExecutorService executorService, InventarioRowDao entityDao) {
|
||||
super(executorService, entityDao, InventarioRowRoomDTO.TABLE_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InventarioRowRoomDTO> makeSynchronousRetrieveAllRequest(boolean onlyToBeSync) {
|
||||
return entityDao
|
||||
.selectAll(onlyToBeSync);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flowable<List<InventarioRowRoomDTO>> makeSynchronousRetrieveAllLive(boolean onlyToBeSync) {
|
||||
return entityDao
|
||||
.selectAllFlowable(-1, false, onlyToBeSync);
|
||||
}
|
||||
|
||||
public Flowable<List<InventarioRowRoomDTO>> makeSynchronousRetrieveAllLive(long parentId, boolean reversed, boolean onlyToBeSync) {
|
||||
return entityDao
|
||||
.selectAllFlowable(parentId, reversed, onlyToBeSync);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.respository_new.data_source;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.sqlite.db.SimpleSQLiteQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import io.reactivex.rxjava3.core.Flowable;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.BaseSyncDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityDaoInterface;
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityModelInterface;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public abstract class _BaseRoomDataSource<R extends BaseSyncDTO, T extends EntityDaoInterface<R>> {
|
||||
|
||||
protected final ExecutorService executorService;
|
||||
protected final T entityDao;
|
||||
|
||||
protected final String TABLE_NAME;
|
||||
|
||||
public _BaseRoomDataSource(ExecutorService executorService, T entityDao, String tableName) {
|
||||
this.executorService = executorService;
|
||||
this.entityDao = entityDao;
|
||||
this.TABLE_NAME = tableName;
|
||||
}
|
||||
|
||||
|
||||
public void makeRetrieveAllRequest(boolean onlyToBeSync, final RunnableArgs<List<R>> onComplete, final RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
if (onComplete != null)
|
||||
onComplete.run(makeSynchronousRetrieveAllRequest(onlyToBeSync));
|
||||
} catch (Exception ex) {
|
||||
if (onError != null) onError.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public abstract List<R> makeSynchronousRetrieveAllRequest(boolean onlyToBeSync);
|
||||
|
||||
public abstract Flowable<List<R>> makeSynchronousRetrieveAllLive(boolean onlyToBeSync);
|
||||
|
||||
|
||||
public void makeInsertAllRequest(final List<R> itemsToInsert, final Runnable onComplete, final RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
makeSynchronousInsertAllRequest(itemsToInsert);
|
||||
if (onComplete != null) onComplete.run();
|
||||
} catch (Exception ex) {
|
||||
if (onError != null) onError.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void makeSynchronousInsertAllRequest(final List<R> itemsToInsert) {
|
||||
if(itemsToInsert == null) return;
|
||||
|
||||
var ids = entityDao.insertAll(itemsToInsert);
|
||||
|
||||
for(int i = 0; i < itemsToInsert.size(); i++) {
|
||||
var inputObject = itemsToInsert.get(i);
|
||||
|
||||
if (inputObject instanceof EntityModelInterface) {
|
||||
((EntityModelInterface) inputObject).setId(ids.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void makeInsertRequest(final R itemToInsert, final RunnableArgs<R> onComplete, final RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
makeSynchronousInsertRequest(itemToInsert);
|
||||
if (onComplete != null) onComplete.run(itemToInsert);
|
||||
} catch (Exception ex) {
|
||||
if (onError != null) onError.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void makeSynchronousInsertRequest(final R itemToInsert) {
|
||||
var id = entityDao.insert(itemToInsert);
|
||||
|
||||
if (itemToInsert instanceof EntityModelInterface) {
|
||||
((EntityModelInterface) itemToInsert).setId(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void makeUpdateRequest(final R itemToUpdate, final RunnableArgs<R> onComplete, final RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
makeSynchronousUpdateRequest(itemToUpdate);
|
||||
if (onComplete != null) onComplete.run(itemToUpdate);
|
||||
} catch (Exception ex) {
|
||||
if (onError != null) onError.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void makeSynchronousUpdateRequest(final R itemToUpdate) {
|
||||
var id = entityDao.update(itemToUpdate);
|
||||
}
|
||||
|
||||
|
||||
public void makeUpdateAllRequest(final List<R> itemToUpdate, final RunnableArgs<List<R>> onComplete, final RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
makeSynchronousUpdateAllRequest(itemToUpdate);
|
||||
if (onComplete != null) onComplete.run(itemToUpdate);
|
||||
} catch (Exception ex) {
|
||||
if (onError != null) onError.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void makeSynchronousUpdateAllRequest(final List<R> itemsToUpdate) {
|
||||
if(itemsToUpdate == null) return;
|
||||
entityDao.updateAll(itemsToUpdate);
|
||||
}
|
||||
|
||||
|
||||
public void makeDeleteRequest(@NonNull final R itemToDelete, final Runnable onComplete, final RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
makeSynchronousDeleteRequest(itemToDelete);
|
||||
if (onComplete != null) onComplete.run();
|
||||
} catch (Exception ex) {
|
||||
if (onError != null) onError.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void makeSynchronousDeleteRequest(@NonNull final R itemToDelete) {
|
||||
entityDao.delete(itemToDelete);
|
||||
}
|
||||
|
||||
|
||||
public void makeDeleteAllRequest(@NonNull final List<R> itemsToDelete, final Runnable onComplete, final RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
makeSynchronousDeleteAllRequest(itemsToDelete);
|
||||
if (onComplete != null) onComplete.run();
|
||||
} catch (Exception ex) {
|
||||
if (onError != null) onError.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void makeSynchronousDeleteAllRequest(@NonNull final List<R> itemsToDelete) {
|
||||
for (R itemToDelete : itemsToDelete) {
|
||||
makeSynchronousDeleteRequest(itemToDelete);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void makeClearAllDataRequest(boolean excludeNotSync, final Runnable onComplete, final RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
makeSynchronousClearAllDataRequest(excludeNotSync);
|
||||
if (onComplete != null) onComplete.run();
|
||||
} catch (Exception ex) {
|
||||
if (onError != null) onError.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void makeSynchronousClearAllDataRequest(boolean excludeNotSync) {
|
||||
entityDao
|
||||
.execRaw(new SimpleSQLiteQuery("DELETE FROM " + TABLE_NAME + (excludeNotSync ? " WHERE " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NOT NULL" : "")));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.view_model;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||
|
||||
public class ArticoloDTO {
|
||||
|
||||
public String codMart;
|
||||
public String descrizione;
|
||||
public String untMis;
|
||||
public float qtaCnf;
|
||||
public String barcode;
|
||||
public float merceDaRic;
|
||||
public float mediaSett;
|
||||
public String flagQtaMultipla;
|
||||
public String flagTracciabilita;
|
||||
public float qtaMinOrdinabile;
|
||||
public boolean newNoPromo;
|
||||
private int ggScadenza;
|
||||
private float giacenza;
|
||||
private float qtaPrevistaVendita;
|
||||
private float qtaProposta;
|
||||
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public void setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public void setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public void setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
}
|
||||
|
||||
public float getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
public void setQtaCnf(float qtaCnf) {
|
||||
this.qtaCnf = qtaCnf;
|
||||
}
|
||||
|
||||
public String getBarCode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public void setBarCode(String barCode) {
|
||||
this.barcode = barCode;
|
||||
}
|
||||
|
||||
public float getMerceDaRic() {
|
||||
return merceDaRic;
|
||||
}
|
||||
|
||||
public void setMerceDaRic(float merceDaRic) {
|
||||
this.merceDaRic = merceDaRic;
|
||||
}
|
||||
|
||||
public float getMediaSett() {
|
||||
return mediaSett;
|
||||
}
|
||||
|
||||
public void setMediaSett(float mediaSett) {
|
||||
this.mediaSett = mediaSett;
|
||||
}
|
||||
|
||||
public String getFlagQtaMultipla() {
|
||||
return flagQtaMultipla;
|
||||
}
|
||||
|
||||
public void setFlagQtaMultipla(String flagQtaMultipla) {
|
||||
this.flagQtaMultipla = flagQtaMultipla;
|
||||
}
|
||||
|
||||
public float getQtaMinOrdinabile() {
|
||||
return qtaMinOrdinabile;
|
||||
}
|
||||
|
||||
public void setQtaMinOrdinabile(float qtaMinOrdinabile) {
|
||||
this.qtaMinOrdinabile = qtaMinOrdinabile;
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public void setBarcode(String barcode) {
|
||||
this.barcode = barcode;
|
||||
}
|
||||
|
||||
public int getGgScadenza() {
|
||||
return ggScadenza;
|
||||
}
|
||||
|
||||
public void setGgScadenza(int ggScadenza) {
|
||||
this.ggScadenza = ggScadenza;
|
||||
}
|
||||
|
||||
public float getGiacenza() {
|
||||
return giacenza;
|
||||
}
|
||||
|
||||
public void setGiacenza(float giacenza) {
|
||||
this.giacenza = giacenza;
|
||||
}
|
||||
|
||||
public float getQtaPrevistaVendita() {
|
||||
return qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public void setQtaPrevistaVendita(float qtaPrevistaVendita) {
|
||||
this.qtaPrevistaVendita = qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public float getQtaProposta() {
|
||||
return qtaProposta;
|
||||
}
|
||||
|
||||
public void setQtaProposta(float qtaProposta) {
|
||||
this.qtaProposta = qtaProposta;
|
||||
}
|
||||
|
||||
public String getFlagTracciabilita() {
|
||||
return flagTracciabilita;
|
||||
}
|
||||
|
||||
public ArticoloDTO setFlagTracciabilita(String flagTracciabilita) {
|
||||
this.flagTracciabilita = flagTracciabilita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isNewNoPromo() {
|
||||
return newNoPromo;
|
||||
}
|
||||
|
||||
public ArticoloDTO setNewNoPromo(boolean newNoPromo) {
|
||||
this.newNoPromo = newNoPromo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArticoloGriglia toArticoloGriglia() {
|
||||
ArticoloGriglia result = new ArticoloGriglia();
|
||||
result.setBarCode(this.getBarCode());
|
||||
result.setDescrizione(this.getDescrizione());
|
||||
result.setCodMart(this.getCodMart());
|
||||
result.setUntMis(this.getUntMis());
|
||||
result.setQtaCnf(this.getQtaCnf());
|
||||
result.setMerceDaRic(this.getMerceDaRic());
|
||||
result.setMediaSett(this.getMediaSett());
|
||||
result.setFlagQtaMultipla(this.getFlagQtaMultipla());
|
||||
result.setQtaMinOrdinabile(this.getQtaMinOrdinabile());
|
||||
result.setGgScadenza(this.ggScadenza);
|
||||
result.setNewNoPromo(this.newNoPromo);
|
||||
result.setGiacenza(this.giacenza);
|
||||
result.setQtaPrevistaVendita(this.qtaPrevistaVendita);
|
||||
result.setQtaProposta(this.qtaProposta);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.view_model;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class ArticoloOrdinabileDTO {
|
||||
|
||||
|
||||
private String codAlis;
|
||||
private String codMart;
|
||||
private String descrizione;
|
||||
private String untMis;
|
||||
private float qtaCnf;
|
||||
private float merceDaRic;
|
||||
private float mediaSett;
|
||||
private String flagQtaMultipla;
|
||||
private String flagTracciabilita;
|
||||
private String flagQtaCnfFissa;
|
||||
private boolean newNoPromo;
|
||||
private float qtaMinOrdinabile;
|
||||
private int ggScadenza;
|
||||
private BigDecimal giacenza;
|
||||
private BigDecimal qtaPrevistaVendita;
|
||||
private BigDecimal qtaProposta;
|
||||
private float qtaOrd;
|
||||
|
||||
private float ctMaxOrd;
|
||||
|
||||
private List<String> barcode;
|
||||
|
||||
private String selectedBarcode;
|
||||
|
||||
public String getCodAlis() {
|
||||
return codAlis;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setCodAlis(String codAlis) {
|
||||
this.codAlis = codAlis;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
return this;
|
||||
}
|
||||
|
||||
public float getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setQtaCnf(float qtaCnf) {
|
||||
this.qtaCnf = qtaCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public float getMerceDaRic() {
|
||||
return merceDaRic;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setMerceDaRic(float merceDaRic) {
|
||||
this.merceDaRic = merceDaRic;
|
||||
return this;
|
||||
}
|
||||
|
||||
public float getMediaSett() {
|
||||
return mediaSett;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setMediaSett(float mediaSett) {
|
||||
this.mediaSett = mediaSett;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagQtaMultipla() {
|
||||
return flagQtaMultipla;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setFlagQtaMultipla(String flagQtaMultipla) {
|
||||
this.flagQtaMultipla = flagQtaMultipla;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagTracciabilita() {
|
||||
return flagTracciabilita;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setFlagTracciabilita(String flagTracciabilita) {
|
||||
this.flagTracciabilita = flagTracciabilita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagQtaCnfFissa() {
|
||||
return flagQtaCnfFissa;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setFlagQtaCnfFissa(String flagQtaCnfFissa) {
|
||||
this.flagQtaCnfFissa = flagQtaCnfFissa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isNewNoPromo() {
|
||||
return newNoPromo;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setNewNoPromo(boolean newNoPromo) {
|
||||
this.newNoPromo = newNoPromo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public float getQtaMinOrdinabile() {
|
||||
return qtaMinOrdinabile;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setQtaMinOrdinabile(float qtaMinOrdinabile) {
|
||||
this.qtaMinOrdinabile = qtaMinOrdinabile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getGgScadenza() {
|
||||
return ggScadenza;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setGgScadenza(int ggScadenza) {
|
||||
this.ggScadenza = ggScadenza;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getGiacenza() {
|
||||
return giacenza;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setGiacenza(BigDecimal giacenza) {
|
||||
this.giacenza = giacenza;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaPrevistaVendita() {
|
||||
return qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setQtaPrevistaVendita(BigDecimal qtaPrevistaVendita) {
|
||||
this.qtaPrevistaVendita = qtaPrevistaVendita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaProposta() {
|
||||
return qtaProposta;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setQtaProposta(BigDecimal qtaProposta) {
|
||||
this.qtaProposta = qtaProposta;
|
||||
return this;
|
||||
}
|
||||
|
||||
public float getQtaOrd() {
|
||||
return qtaOrd;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setQtaOrd(float qtaOrd) {
|
||||
this.qtaOrd = qtaOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public float getCtMaxOrd() {
|
||||
return ctMaxOrd;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setCtMaxOrd(float ctMaxOrd) {
|
||||
this.ctMaxOrd = ctMaxOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setBarcode(List<String> barcode) {
|
||||
this.barcode = barcode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String generateSystemNote() {
|
||||
HashMap<String, String> pairs = new HashMap<>();
|
||||
pairs.put("qta_proposta", String.valueOf(qtaProposta));
|
||||
pairs.put("giacenza", String.valueOf(giacenza));
|
||||
|
||||
return new JSONObject(pairs).toString();
|
||||
}
|
||||
|
||||
public String getSelectedBarcode() {
|
||||
return selectedBarcode;
|
||||
}
|
||||
|
||||
public ArticoloOrdinabileDTO setSelectedBarcode(String selectedBarcode) {
|
||||
this.selectedBarcode = selectedBarcode;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.view_model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||
|
||||
public class GrigliaDTO {
|
||||
private String descrLisa;
|
||||
private String descrDepo;
|
||||
private List<ArticoloDTO> grigliaAcquistiChild;
|
||||
|
||||
|
||||
public String getDescrLisa() {
|
||||
return descrLisa;
|
||||
}
|
||||
|
||||
public void setDescrLisa(String descrLisa) {
|
||||
this.descrLisa = descrLisa;
|
||||
}
|
||||
|
||||
public String getDescrDepo() {
|
||||
return descrDepo;
|
||||
}
|
||||
|
||||
public void setDescrDepo(String descrDepo) {
|
||||
this.descrDepo = descrDepo;
|
||||
}
|
||||
|
||||
public List<ArticoloDTO> getGrigliaAcquistiChild() {
|
||||
return grigliaAcquistiChild;
|
||||
}
|
||||
|
||||
public void setGrigliaAcquistiChild(List<ArticoloDTO> grigliaAcquistiChild) {
|
||||
this.grigliaAcquistiChild = grigliaAcquistiChild;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.view_model;
|
||||
|
||||
import androidx.room.Embedded;
|
||||
import androidx.room.Ignore;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
|
||||
public class OrdineWithGriglia {
|
||||
|
||||
@Embedded
|
||||
private Ordine ordine;
|
||||
@Embedded
|
||||
private Griglia griglia;
|
||||
|
||||
|
||||
public Ordine getOrdine() {
|
||||
return ordine;
|
||||
}
|
||||
|
||||
public void setOrdine(Ordine ordine) {
|
||||
this.ordine = ordine;
|
||||
}
|
||||
|
||||
public Griglia getGriglia() {
|
||||
return griglia;
|
||||
}
|
||||
|
||||
public void setGriglia(Griglia griglia) {
|
||||
this.griglia = griglia;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.view_model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class OrdiniAcquistoGrigliaDTO {
|
||||
private String descrLisa;
|
||||
|
||||
private String descrDepo;
|
||||
|
||||
private List<ArticoloOrdinabileDTO> articoli;
|
||||
|
||||
public String getDescrLisa() {
|
||||
return descrLisa;
|
||||
}
|
||||
|
||||
public OrdiniAcquistoGrigliaDTO setDescrLisa(String descrLisa) {
|
||||
this.descrLisa = descrLisa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrDepo() {
|
||||
return descrDepo;
|
||||
}
|
||||
|
||||
public OrdiniAcquistoGrigliaDTO setDescrDepo(String descrDepo) {
|
||||
this.descrDepo = descrDepo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<ArticoloOrdinabileDTO> getArticoli() {
|
||||
return articoli;
|
||||
}
|
||||
|
||||
public OrdiniAcquistoGrigliaDTO setArticoli(List<ArticoloOrdinabileDTO> articoli) {
|
||||
this.articoli = articoli;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.wrappers;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Embedded;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
|
||||
public class GrigliaWrapper {
|
||||
@Embedded
|
||||
private Griglia griglia;
|
||||
|
||||
@ColumnInfo(name = "countArticoli")
|
||||
private int countArticoli = 0;
|
||||
|
||||
public Griglia getGriglia() {
|
||||
return griglia;
|
||||
}
|
||||
|
||||
public void setGriglia(Griglia griglia) {
|
||||
this.griglia = griglia;
|
||||
}
|
||||
|
||||
public int getCountArticoli() {
|
||||
return countArticoli;
|
||||
}
|
||||
|
||||
public void setCountArticoli(int countArticoli) {
|
||||
this.countArticoli = countArticoli;
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@ public class BindableBoolean implements Observable {
|
||||
this.mValue = startValue;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addOnPropertyChangedCallback(@NonNull OnPropertyChangedCallback callback) {
|
||||
synchronized (this) {
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
import androidx.databinding.BaseObservable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
|
||||
@@ -20,7 +19,7 @@ public class BindableFloat extends BaseObservable {
|
||||
|
||||
if(numberOfDigits > CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS) numberOfDigits = CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS;
|
||||
|
||||
return new BigDecimal(get());
|
||||
return BigDecimal.valueOf(get());
|
||||
}
|
||||
|
||||
public Float get(boolean defaultIfNull) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
@@ -26,15 +25,16 @@ import androidx.databinding.BindingConversion;
|
||||
import androidx.databinding.Observable;
|
||||
import androidx.databinding.ObservableField;
|
||||
|
||||
import com.google.android.material.datepicker.MaterialDatePicker;
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Locale;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
@@ -227,6 +227,33 @@ public class Converters {
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextBigDecimal(EditText view, final ObservableField<BigDecimal> observableBigDecimal) {
|
||||
Pair<ObservableField<BigDecimal>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableBigDecimal) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
BigDecimal value = null;
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = new BigDecimal(s.toString());
|
||||
observableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableBigDecimal, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
BigDecimal newValue = observableBigDecimal.get();
|
||||
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
||||
|
||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
view.setText(UtilityNumber.decimalToString(newValue));
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextBigDecimal(TextInputEditText view, final BindableBigDecimal bindableBigDecimal) {
|
||||
Pair<BindableBigDecimal, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
@@ -305,6 +332,60 @@ public class Converters {
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextInteger(TextInputEditText view, final ObservableField<Integer> observableInteger) {
|
||||
Pair<ObservableField<Integer>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableInteger) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
Integer value = null;
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = Integer.valueOf(s.toString());
|
||||
observableInteger.set(value);
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableInteger, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
Integer newValue = observableInteger.get();
|
||||
Integer viewValue = view.getText().toString().trim().length() > 0 ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
|
||||
|
||||
if (!viewValue.equals(newValue) && newValue != null) {
|
||||
view.setText(newValue.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextLong(TextInputEditText view, final ObservableField<Long> observableLong) {
|
||||
Pair<ObservableField<Long>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableLong) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
Long value = null;
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = Long.valueOf(s.toString());
|
||||
observableLong.set(value);
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableLong, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
Long newValue = observableLong.get();
|
||||
Long viewValue = view.getText().toString().trim().length() > 0 ? Long.valueOf(view.getText().toString()) : Long.valueOf(0);
|
||||
|
||||
if (!viewValue.equals(newValue) && newValue != null) {
|
||||
view.setText(newValue.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"binding", "parentView", "warningOnOldDates"}, requireAll = false)
|
||||
public static void bindTextInputEditTextDate(TextInputEditText view, final ObservableField<Date> observableDate, BaseDialogFragment parentFragment, boolean warningOnOldDates) {
|
||||
Pair<ObservableField<Date>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
@@ -328,29 +409,40 @@ public class Converters {
|
||||
c.setTime(observableDate.get());
|
||||
}
|
||||
|
||||
int mYear = c.get(Calendar.YEAR);
|
||||
int mMonth = c.get(Calendar.MONTH);
|
||||
int mDay = c.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
DatePickerDialog datePickerDialog = new DatePickerDialog(view.getContext(),
|
||||
(cView, year, month, day) -> {
|
||||
Date resultDate = new GregorianCalendar(year, month, day).getTime();
|
||||
var datePicker =
|
||||
MaterialDatePicker.Builder.datePicker()
|
||||
.setSelection(c.getTimeInMillis())
|
||||
.build();
|
||||
|
||||
if (parentFragment != null && warningOnOldDates && resultDate.before(new Date())) {
|
||||
DialogSimpleMessageView
|
||||
.makeWarningDialog(new SpannableString("Hai scelto una data precedente a quella odierna. Continuare?"), null, () -> {
|
||||
view.setText(UtilityDate.formatDate(resultDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
observableDate.set(resultDate);
|
||||
}, () -> {
|
||||
datePicker.addOnDismissListener(dialog -> {
|
||||
if(datePicker.getSelection() != null) {
|
||||
var timeInMillis = datePicker.getSelection();
|
||||
|
||||
})
|
||||
.show(parentFragment.requireActivity().getSupportFragmentManager(), "tag");
|
||||
} else {
|
||||
view.setText(UtilityDate.formatDate(resultDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
observableDate.set(resultDate);
|
||||
}
|
||||
}, mYear, mMonth, mDay);
|
||||
datePickerDialog.show();
|
||||
var calendar = UtilityDate.getCalendarInstance();
|
||||
calendar.setTimeInMillis(timeInMillis);
|
||||
|
||||
if (parentFragment != null && warningOnOldDates && calendar.before(UtilityDate.getCalendarInstance())) {
|
||||
DialogSimpleMessageView
|
||||
.makeWarningDialog(new SpannableString("Hai scelto una data precedente a quella odierna. Continuare?"), null, () -> {
|
||||
view.setText(UtilityDate.formatDate(calendar.getTime(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
observableDate.set(calendar.getTime());
|
||||
}, () -> {
|
||||
|
||||
})
|
||||
.show(parentFragment.requireActivity().getSupportFragmentManager(), "tag");
|
||||
} else {
|
||||
view.setText(UtilityDate.formatDate(calendar.getTime(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
observableDate.set(calendar.getTime());
|
||||
}
|
||||
}
|
||||
else {
|
||||
view.setText("");
|
||||
observableDate.set(null);
|
||||
}
|
||||
});
|
||||
|
||||
datePicker.show(parentFragment.requireActivity().getSupportFragmentManager(), "tag");
|
||||
};
|
||||
|
||||
//Adding click-listener
|
||||
@@ -364,6 +456,72 @@ public class Converters {
|
||||
view.setText(UtilityDate.formatDate(newValue, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"binding", "parentView", "warningOnOldDates"}, requireAll = false)
|
||||
public static void bindEditTextDate(EditText view, final ObservableField<LocalDate> observableDate, BaseDialogFragment parentFragment, boolean warningOnOldDates) {
|
||||
Pair<ObservableField<LocalDate>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableDate) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableDate, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
|
||||
RunnableArgs<View> onClick = v -> {
|
||||
// Get Current Date
|
||||
LocalDate selectedDate = observableDate.get() != null ? observableDate.get() : UtilityDate.getNow();
|
||||
|
||||
var datePicker =
|
||||
MaterialDatePicker.Builder.datePicker()
|
||||
.setSelection(UtilityDate.localDateToMillisTime(selectedDate))
|
||||
.build();
|
||||
|
||||
|
||||
|
||||
datePicker.addOnDismissListener(dialog -> {
|
||||
if(datePicker.getSelection() != null) {
|
||||
var selectedTimeInMillis = datePicker.getSelection();
|
||||
var nowTime = UtilityDate.millisTimeToLocalDate(selectedTimeInMillis, null);
|
||||
|
||||
|
||||
if (parentFragment != null && warningOnOldDates && nowTime.isBefore(UtilityDate.getNow())) {
|
||||
DialogSimpleMessageView
|
||||
.makeWarningDialog(new SpannableString("Hai scelto una data precedente a quella odierna. Continuare?"), null, () -> {
|
||||
view.setText(UtilityDate.formatDate(nowTime, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
observableDate.set(nowTime);
|
||||
}, () -> {
|
||||
|
||||
})
|
||||
.show(parentFragment.requireActivity().getSupportFragmentManager(), "tag");
|
||||
} else {
|
||||
view.setText(UtilityDate.formatDate(nowTime, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
observableDate.set(nowTime);
|
||||
}
|
||||
}
|
||||
else {
|
||||
view.setText("");
|
||||
observableDate.set(null);
|
||||
}
|
||||
});
|
||||
|
||||
datePicker.show(parentFragment.requireActivity().getSupportFragmentManager(), "tag");
|
||||
};
|
||||
|
||||
//Adding click-listener
|
||||
view.setOnClickListener(onClick::run);
|
||||
if (view.getParent() != null && view.getParent().getParent() != null && view.getParent().getParent() instanceof TextInputLayout) {
|
||||
((FrameLayout) view.getParent()).setOnClickListener(onClick::run);
|
||||
((TextInputLayout) view.getParent().getParent()).setOnClickListener(onClick::run);
|
||||
}
|
||||
}
|
||||
var newValue = observableDate.get();
|
||||
view.setText(UtilityDate.formatDate(newValue, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindAutoCompleteTextView(AutoCompleteTextView view, final BindableString bindableString) {
|
||||
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
@@ -589,6 +747,12 @@ public class Converters {
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("reverse_visibility")
|
||||
public static void bindViewReverseVisibility(View view, boolean bool) {
|
||||
view.setVisibility(!bool ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("android:layout_weight")
|
||||
public static void setLayoutWeight(View view, final Float weight) {
|
||||
|
||||
|
||||
@@ -2,11 +2,9 @@ package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.core.util.Pair;
|
||||
import androidx.databinding.BindingAdapter;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.OnMultipleClickListener;
|
||||
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
||||
|
||||
public class ViewConverters {
|
||||
@@ -25,4 +23,16 @@ public class ViewConverters {
|
||||
});
|
||||
}
|
||||
|
||||
@BindingAdapter("multipleClick")
|
||||
public static void bindViewMultipleClick(View view, final Runnable callback) {
|
||||
view.setFocusable(true);
|
||||
view.setClickable(true);
|
||||
view.setOnClickListener(new OnMultipleClickListener() {
|
||||
@Override
|
||||
public void onSingleClick(View v) {
|
||||
callback.run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.di.binders;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.databinding.BindingAdapter;
|
||||
|
||||
public class ImageViewBinders {
|
||||
@BindingAdapter("tint")
|
||||
public static void bindImageViewTint(final AppCompatImageView view, final int color) {
|
||||
view.setColorFilter(color, android.graphics.PorterDuff.Mode.MULTIPLY);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public class ArtNotFoundInGridException extends Exception {
|
||||
|
||||
public ArtNotFoundInGridException() {
|
||||
super(UtilityResources.getString(R.string.lu_already_attache_to_doc));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
public class BluetoothConnectionException extends Exception {
|
||||
|
||||
public BluetoothConnectionException(String btDeviceName, String btDeviceMac, Throwable th) {
|
||||
super("Impossibile collegarsi al dispositivo bluetooth: " + btDeviceName + " [" + btDeviceMac + "]. Riprovare.");
|
||||
initCause(th);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public final class EmptyLUException extends Exception {
|
||||
public EmptyLUException() {
|
||||
super(UtilityResources.getString(R.string.empty_lu));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public final class EmptyOrderException extends Exception {
|
||||
public EmptyOrderException() {
|
||||
super(UtilityResources.getString(R.string.empty_order));
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Environment;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.view.dialogs.exception.DialogException;
|
||||
|
||||
public class ExceptionsHandler implements Thread.UncaughtExceptionHandler {
|
||||
|
||||
private final static String TAG = ExceptionsHandler.class.getSimpleName();
|
||||
|
||||
private final Activity context;
|
||||
|
||||
public static void init(Activity context) {
|
||||
new ExceptionsHandler(context);
|
||||
}
|
||||
|
||||
private ExceptionsHandler(Activity context) {
|
||||
this.context = context;
|
||||
|
||||
//if (!BuildConfig.DEBUG) {
|
||||
Thread.setDefaultUncaughtExceptionHandler(this);
|
||||
|
||||
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uncaughtException(final Thread thread, final Throwable ex) {
|
||||
try {
|
||||
UtilityLogger.errorMe(new Exception(ex));
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Exception Logger failed!", e);
|
||||
MainApplication.exit();
|
||||
}
|
||||
|
||||
appendToFile(new Exception(ex));
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
Looper.prepare();
|
||||
DialogException.make(context, context::finish).show();
|
||||
Looper.loop();
|
||||
}
|
||||
}.start();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void appendToFile(Exception e) {
|
||||
try {
|
||||
File yourFile = new File(Environment.getExternalStorageDirectory(), "log.txt");
|
||||
|
||||
FileWriter fstream = new FileWriter(yourFile.getPath(), true);
|
||||
BufferedWriter out = new BufferedWriter(fstream);
|
||||
PrintWriter pWriter = new PrintWriter(out, true);
|
||||
e.printStackTrace(pWriter);
|
||||
}
|
||||
catch (Exception ie) {
|
||||
throw new RuntimeException("Could not write Exception to file", ie);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public final class ExpiredProductListException extends Exception {
|
||||
public ExpiredProductListException() {
|
||||
super(UtilityResources.getString(R.string.expired_list_session));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public class GridNotFoundException extends Exception {
|
||||
|
||||
public GridNotFoundException() {
|
||||
super(UtilityResources.getString(R.string.grid_not_found));
|
||||
}
|
||||
|
||||
public GridNotFoundException(String codAlis) {
|
||||
super(UtilityResources.getString(R.string.grid_not_found) + " (" + codAlis + ")");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public class GridNotSelectedException extends Exception {
|
||||
|
||||
public GridNotSelectedException() {
|
||||
super(UtilityResources.getString(R.string.grid_not_selected));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class InvalidConnectionException extends Exception {
|
||||
|
||||
|
||||
public InvalidConnectionException(String host, int port, Throwable cause) {
|
||||
super(String.format(Locale.ITALY, "Impossibile stabilire la connessione con il server (%s:%d)", host, port), cause);
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user