Compare commits
1145 Commits
v1.36.07(4
...
master-bet
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ef69b8dd9 | |||
| 6b40bd1d60 | |||
| ab230425c3 | |||
| 2f54b375b9 | |||
| 9aa9b9121f | |||
| 268ce9fce9 | |||
| eddecc165d | |||
| 45c64ad0ac | |||
| 398f0a9523 | |||
| 4861d53031 | |||
| e27a4e840a | |||
| cc67ac5f47 | |||
| 8e2d110792 | |||
| 5cdf33950d | |||
| 2727c1b01c | |||
| 9924165362 | |||
| 0904388ffe | |||
| f86296d2a1 | |||
| cfe2b85886 | |||
| d57a7a53f0 | |||
| 1c9d9bfc8f | |||
| 3614192ea9 | |||
| 4d01a52590 | |||
| 638e8650ee | |||
| 36061faeeb | |||
| 83a183c5a6 | |||
| fb6a68e6d4 | |||
| fd15235e6e | |||
| a88ddab405 | |||
| 9fb18215e3 | |||
| 2e3af6d1b3 | |||
| ac38aaeea7 | |||
| ade18170ee | |||
| cc89441f0a | |||
| f612e1c402 | |||
| 663d172edf | |||
| 5ffff22013 | |||
| 56829d7ffd | |||
| 092fbd69b6 | |||
| 878584a619 | |||
| 5d52e2df46 | |||
| f25240abe4 | |||
| 809d4ef5af | |||
| faa45cd096 | |||
| 1ab9b10a13 | |||
| 3bbc8c4f21 | |||
| a952f41e61 | |||
| cce4d2dbb2 | |||
| db246e6a94 | |||
| 37ce428bf0 | |||
| 49d099c339 | |||
| 64875c10c3 | |||
| 8b442ea4d0 | |||
| bb1867b1c8 | |||
| 42cb721e1c | |||
| c104313d89 | |||
| c8cc56bfd6 | |||
| 727c56a171 | |||
| ee71349c52 | |||
| 2c297db483 | |||
| eb779c34ab | |||
| 05c306e29f | |||
| 80b5b8db34 | |||
| e0b86db09d | |||
| 9d871f3ae4 | |||
| e025b234a7 | |||
| e57bd79fba | |||
| 97fe0d53b8 | |||
| acafcf720d | |||
| 809ef43445 | |||
| 1079c38a5f | |||
| f6388eff1c | |||
| 38f3eced41 | |||
| b5010d480f | |||
| 495a8dae92 | |||
| e61ef63225 | |||
| 9e9bdcd16d | |||
| ed938815bb | |||
| 539e8b7c31 | |||
| 92da8cde53 | |||
| fee8a13960 | |||
| 95c71d73ae | |||
| 96d29c784d | |||
| be8ce4de24 | |||
| 3d0f7f16f9 | |||
| 501ca404ff | |||
| 5ad4fd7821 | |||
| c99c3a3b11 | |||
| 7ccda80bfc | |||
| 2d67d87f94 | |||
| 1ba2fb96ba | |||
| ffdd1a1df5 | |||
| 0205255f7d | |||
| f4e56c8b53 | |||
| e46cbca2a9 | |||
| 83fdb89a9e | |||
| d99fd542c2 | |||
| c21e856a0f | |||
| b673940dd6 | |||
| b0ce11cbf7 | |||
| f245bb5d1e | |||
| 4bf974e7b6 | |||
| 95adc4bdc9 | |||
| 4ef2c209c8 | |||
| 41d77b806f | |||
| 6b65c4a570 | |||
| 1247ff590b | |||
| adc76fe82c | |||
| 1c029242ac | |||
| b2aea70516 | |||
| cf2134de57 | |||
| 4d5c0e5509 | |||
| 21af5fc0a9 | |||
| caeabdb765 | |||
| 09b984f5d0 | |||
| ebea9d3a8f | |||
| ee5e80ccf4 | |||
| 9df5ac353c | |||
| 610d42328a | |||
| dd473412cc | |||
| 4f0c5bf6dd | |||
| 90e4e2e464 | |||
| 50e2605ea5 | |||
| 4752e3a3a2 | |||
| 3fe903cc12 | |||
| 3f95a70039 | |||
| b01657de87 | |||
| 067443698a | |||
| fbef5b5cac | |||
| f2ef8ed241 | |||
| 0363f9c835 | |||
| 990a4d1538 | |||
| 55c16e602d | |||
| 6097a7f736 | |||
| f8b92901fd | |||
| 6c6daa4809 | |||
| de8b48d938 | |||
| bfa69ca78b | |||
| bffb471015 | |||
| 1c9604ffde | |||
| bf39eccf72 | |||
| 087e3e261c | |||
| 2eff03dee6 | |||
| fc34a555bd | |||
| 0bf21c046f | |||
| cc14e8a55d | |||
| 892047ffd4 | |||
| 2bae112d80 | |||
| 473ed536fb | |||
| dc342c1fee | |||
| 81507938b1 | |||
| cff52140bd | |||
| f2bab2f510 | |||
| 971e026488 | |||
| 24d90b58f9 | |||
| cb9ef169f8 | |||
| 5e27b8eaf0 | |||
| b5d049aa1d | |||
| 01028f9888 | |||
| 200424fd34 | |||
| eea738b595 | |||
| 2774eaecbf | |||
| ea765b591c | |||
| 07bf4982a1 | |||
| 648a572752 | |||
| 022a56a584 | |||
| ea97e8f249 | |||
| 571ad1590f | |||
| c4124226bd | |||
| 878ac418ed | |||
| 03c02d6625 | |||
| ba1118fdd8 | |||
| a44d6610ef | |||
| 7878748548 | |||
| 172a8256b6 | |||
| 7d0448aa01 | |||
| c7cc197c4c | |||
| c16f5c1747 | |||
| 0736278dc0 | |||
| e190e3de3b | |||
| 33860a0cfe | |||
| 15a946dfb6 | |||
| 62adf49157 | |||
| 64fcb7ccc8 | |||
| dc7ac45c29 | |||
| cebd3b8a8f | |||
| 3ebdc72642 | |||
| aacf5ca76e | |||
| 4f134bfc8e | |||
| a2b53f94c6 | |||
| 6bd1e62190 | |||
| 64407787d8 | |||
| ace4996c20 | |||
| f9f02452d7 | |||
| b653ae39af | |||
| 63d1d9ecf0 | |||
| 40e46e6aac | |||
| 5dc94cbd8f | |||
| 9c72a2a628 | |||
| c06c000e05 | |||
| 48818ec05f | |||
| 5f1b7ef4a4 | |||
| c36bc9d8c2 | |||
| ba9da26ca0 | |||
| 21bd503027 | |||
| b2ad4fdb62 | |||
| fe581580b7 | |||
| 60e725f554 | |||
| 1856ad1f4a | |||
| 27ed85eb6c | |||
| 2f6f9b54c2 | |||
| a2ef35e353 | |||
| b06f058ecf | |||
| e67cbd3760 | |||
| ce9d304043 | |||
| c7d9231d27 | |||
| fc30b8253d | |||
| e8da16cb8a | |||
| dff725ea92 | |||
| e4248c8c48 | |||
| a808144896 | |||
| 601f823944 | |||
| 819cc97113 | |||
| 05d806f9f2 | |||
| 6fdadffe77 | |||
| a245497fcf | |||
| 5ae9371c51 | |||
| 4aeb37e4bc | |||
| 4861c689d7 | |||
| dfe22a76cd | |||
| 24bc83b748 | |||
| 1c63908b3b | |||
| a622e89058 | |||
| ac4500e2a2 | |||
| 6ebcbc2d6c | |||
| 150be3cae2 | |||
| 72edf5228a | |||
| b72a3321d9 | |||
| 5bf71a1b0c | |||
| ee10427048 | |||
| 7fb7cbf8ec | |||
| 3a43e9238b | |||
| 007d58a17e | |||
| 998a59cffc | |||
| 11b353a91d | |||
| 8772d11e02 | |||
| 3d772e3722 | |||
| 41cfbc273e | |||
| bc67098ae0 | |||
| 0e49c93678 | |||
| ed93b88ee8 | |||
| 2cb184f24b | |||
| 126846aef2 | |||
| 8ac595c6c5 | |||
| fc2c0fbe0c | |||
| 0aa0b09afa | |||
| 23c199d0b8 | |||
| 9436236eaa | |||
| 633f41e17d | |||
| d6f26b3971 | |||
| fc5568a046 | |||
| 590e9ec24e | |||
| 984a4a156b | |||
| 04afb4cfca | |||
| cfa527e19a | |||
| 572f75fe9e | |||
| 81eda94fe0 | |||
| 8f02dfbee4 | |||
| 75e1447a54 | |||
| aa6877c235 | |||
| 23332e1424 | |||
| fc2ffc6a62 | |||
| e5f79bf7e7 | |||
| d8f9886f82 | |||
| 51c5c831ee | |||
| 3279c4e2af | |||
| 6f070e6998 | |||
| df4bfcc955 | |||
| c1983cf73c | |||
| da9bbd0b1c | |||
| cd84d3e9a8 | |||
| e79d80c2d3 | |||
| 595f4a8797 | |||
| 388f08a02f | |||
| c562735661 | |||
| ab137ad828 | |||
| b56f209084 | |||
| ae5c2c1b5a | |||
| bddb6e2bac | |||
| 5107897888 | |||
| d91eaf3412 | |||
| caa6a7cd75 | |||
| 567b288e4d | |||
| 7cfb0879af | |||
| ed4485a536 | |||
| 1db13de61d | |||
| 12388a6175 | |||
| 86121bfa93 | |||
| 669a38732f | |||
| e3e7a7d7c6 | |||
| a5a1febc0e | |||
| 0c77af962f | |||
| 4374dc243c | |||
| 26ee5c5fea | |||
| f4d2e12073 | |||
| 75914ab9c9 | |||
| d1976f3e21 | |||
| 5ef5c4b28a | |||
| 8acb8a04db | |||
| 05a5b3d6a3 | |||
| e889f1e264 | |||
| 40d9370e3a | |||
| 2c3d4bbc22 | |||
| fd8bb8e7da | |||
| 60a088a7f4 | |||
| 8ca5207a58 | |||
| 9c3e4f0481 | |||
| b93f5e5fa5 | |||
| 87b45c6c27 | |||
| 20f425354f | |||
| 805e939c43 | |||
| b9bfdb3b44 | |||
| acfe51e83a | |||
| f2cc31e08a | |||
| e541031efe | |||
| d4b220d1e6 | |||
| e2a4a1ad67 | |||
| 136aa3bd9a | |||
| 6780f899d3 | |||
| 0e46e5fae3 | |||
| 798835cb4c | |||
| ba72284c87 | |||
| 603c5dd8b7 | |||
| 43fc8be493 | |||
| e35284f724 | |||
| b9de3e8b27 | |||
| 825eaaf840 | |||
| 22bace2402 | |||
| 3b86460f48 | |||
| ddac54b513 | |||
| f1790c2595 | |||
| dafec91aff | |||
| d818994e3a | |||
| a385b01584 | |||
| dec9f25c15 | |||
| 0f3cb16ef9 | |||
| 7920166110 | |||
| fdf719982f | |||
| 5d09453c39 | |||
| f71d4e56e6 | |||
| e6f4cc9d6d | |||
| 13d9c40119 | |||
| 1d7125a821 | |||
| deb4d77203 | |||
| cf2f9e5ffd | |||
| 1f5a628eb1 | |||
| 520a1cb07a | |||
| c620e9cb96 | |||
| 6ef4961074 | |||
| 01b91adc61 | |||
| db3641668a | |||
| 4d81b24fd4 | |||
| 8f420111fc | |||
| a20470c0f9 | |||
| 31cee18b37 | |||
| ca9c62bc80 | |||
| dd2c19f12a | |||
| 36b6ba7ddd | |||
| 3b3ab8e7c5 | |||
| 688a8e4bad | |||
| 12796b11e5 | |||
| f7dc857587 | |||
| 404716d269 | |||
| aa1c3b877d | |||
| 65e7d26655 | |||
| 3ade0879f5 | |||
| 4d267acad4 | |||
| 7c90a9b2fd | |||
| f99c0e5514 | |||
| babc0d1736 | |||
| 704caa3ab2 | |||
| 63552f6314 | |||
| 60c3dd4eca | |||
| 6776a1e521 | |||
| 7d130ae1eb | |||
| 25e3a5ddc4 | |||
| d44b726a66 | |||
| 3d3113d2bf | |||
| e917b2a413 | |||
| 96f827b692 | |||
| a41c09e980 | |||
| 7961508de3 | |||
| 3dcfe4773c | |||
| cc8b7de428 | |||
| 4bf1b2a1e9 | |||
| 5e7af4ced4 | |||
| b8bb20ce0d | |||
| b0567e4eaa | |||
| b7e74d9bdc | |||
| fd88e5cd64 | |||
| 370c0b47bd | |||
| 04071f3bad | |||
| 4901097f99 | |||
| 6e02aec5e0 | |||
| f1c304eaeb | |||
| 7b3fde1d71 | |||
| 3c337fc138 | |||
| 548cdd562a | |||
| 70a819ec83 | |||
| afd7ae25f3 | |||
| 74b3613555 | |||
| 1f1011e628 | |||
| 3a8debdbc4 | |||
| 143b8a5bda | |||
| d32c96818e | |||
| 20bc5c6da2 | |||
| cfc19b00f0 | |||
| c2d82d0806 | |||
| ae86a5cde8 | |||
| 0a55c644d7 | |||
| 417172b31c | |||
| bae4d1acac | |||
| d5a86327d8 | |||
| fef03ebfbc | |||
| 021f6974f1 | |||
| 448f361cd3 | |||
| 7aa5960f87 | |||
| 92abfe1da4 | |||
| 6338c1dfa6 | |||
| 657d85be86 | |||
| 205ba184d3 | |||
| f759b20f96 | |||
| c845689ec8 | |||
| 4479779e4a | |||
| a35b3b7fc4 | |||
| 5b31e2c6a9 | |||
| 6365cbfd5b | |||
| 9dbfa812c1 | |||
| 97c907c992 | |||
| caed709b64 | |||
| 2eb637e4bd | |||
| de91c7a8ec | |||
| 13800eecab | |||
| c9bfd52586 | |||
| c4357f662c | |||
| 67a8ca94db | |||
| 0bfd56c011 | |||
| eead844ac1 | |||
| 65cfadcb6e | |||
| 00067ca1c9 | |||
| 73ca8bb366 | |||
| 3ffdb2c220 | |||
| f3113a423c | |||
| a5479595c7 | |||
| 27e368f780 | |||
| e530c0dda9 | |||
| a3fbbb6dcc | |||
| d3931a116a | |||
| 189c11c27f | |||
| cff971bef8 | |||
| a5d3388665 | |||
| 22ad23c5b7 | |||
| b1d5e10db4 | |||
| 75662bd8ae | |||
| 763c96c7dc | |||
| 178b458030 | |||
| bde41d21be | |||
| 9d8228419c | |||
| ad7d9059c0 | |||
| 4831a7ce19 | |||
| 552b82feda | |||
| 6d62a7b10e | |||
| 667f4aea74 | |||
| f80225b7bf | |||
| 7a02e1d8ad | |||
| 9cc70f4ee6 | |||
| 7c4c5da1d6 | |||
| b960b6319a | |||
| 08ddaa7a11 | |||
| bcce40094c | |||
| 960388adf8 | |||
| e76722018f | |||
| 917a810a59 | |||
| b69a053323 | |||
| fc30017021 | |||
| e1dd4f2140 | |||
| 67a0679de7 | |||
| dfc87f7aec | |||
| 4da012b33c | |||
| c5ae374854 | |||
| 886ef6ba08 | |||
| fe77f90a7a | |||
| 7a1f0d6cf6 | |||
| 004bc3b926 | |||
| d1b9e22673 | |||
| 6edeba3246 | |||
| 5a0b45c6f9 | |||
| be5ebb89d7 | |||
| f81d61c4c5 | |||
| 634bc502ce | |||
| 7f9ebb3bc9 | |||
| 20783026b8 | |||
| 99fb9f1d6a | |||
| 86632940eb | |||
| d13dbf1ad3 | |||
| 2f9ee642da | |||
| afecc11364 | |||
| 53168632e7 | |||
| 06f59bfaaa | |||
| c83f75c5e4 | |||
| 185246597b | |||
| b33d566abd | |||
| 141147aee1 | |||
| 525570d918 | |||
| 49b4039bbe | |||
| 7a99df44c9 | |||
| 81ce09e605 | |||
| 67936a3787 | |||
| 69d880b587 | |||
| aeadea42e1 | |||
| f5c3dcfdc9 | |||
| 9bf0dacda6 | |||
| d30af1e2a6 | |||
| 71a18e9ffa | |||
| f4c64e5f04 | |||
| d54939d058 | |||
| a8674cb31e | |||
| 40e1fb4f83 | |||
| f3f0fd8fd8 | |||
| ed53b9e3b4 | |||
| 37ac05b8ab | |||
| d9070ee5fb | |||
| b3afc404f0 | |||
| 168c4e4fb7 | |||
| 1991be79d6 | |||
| c2a2983606 | |||
| 9866d5c4fd | |||
| 823d0d7a33 | |||
| 5b07ff5efa | |||
| c5639a643a | |||
| 012f75198b | |||
| ee3728436c | |||
| ed5c6c6b2f | |||
| d7e0e858d2 | |||
| 339a5e5b68 | |||
| 02a13911d8 | |||
| b6f51971f1 | |||
| 57079c0062 | |||
| 63c353a83c | |||
| c069d21cbf | |||
| afeb9ecc23 | |||
| 2ff8d80da3 | |||
| 891e2641fa | |||
| ca79107809 | |||
| 5c37b986ce | |||
| c426250cd5 | |||
| f090c11146 | |||
| 5c90f22a49 | |||
| f1ddaa1fca | |||
| 8490553a32 | |||
| 66824fccb1 | |||
| 9c6c17ffa3 | |||
| 39dce4d23f | |||
| c1dbbde905 | |||
| 8d2d0ad195 | |||
| 927b14c9fc | |||
| f342cd0e5f | |||
| c287852ce6 | |||
| c823692a72 | |||
| 1fe4437163 | |||
| 4500696bcd | |||
| 17b0454f8b | |||
| b9bbbabc5c | |||
| 4633a54152 | |||
| 5dbb03531d | |||
| edc9470e9b | |||
| 7adeee589e | |||
| 52a393c260 | |||
| 60a405536c | |||
| 5f5117c0f6 | |||
| 0740faa964 | |||
| 2f40302791 | |||
| 13b3d5e63b | |||
| 5e00329292 | |||
| 58521997c1 | |||
| 6b24111b39 | |||
| c2fe657bcf | |||
| af64ca04f9 | |||
| ad026cbd6b | |||
| 5481e25483 | |||
| c7c151045d | |||
| 1e9d048264 | |||
| 6f202c0c7a | |||
| 94a9690045 | |||
| 2b4aa11021 | |||
| f2d5bb76c5 | |||
| 61dc5fc9a4 | |||
| 3440ecd4f1 | |||
| f6c7d98efa | |||
| e8821b0caf | |||
| 627a0b402b | |||
| ab9353dee6 | |||
| e956895e8c | |||
| 724a63acc1 | |||
| 3a5312d661 | |||
| 06dbae0ac5 | |||
| 603fd59b05 | |||
| ebbd515a34 | |||
| fd89c6394f | |||
| d72f685e01 | |||
| ea1f39a9db | |||
| 518e6f0853 | |||
| ce902cd2be | |||
| fde266922b | |||
| 7bdb9b47f4 | |||
| 68bf6767b9 | |||
| 184d1f759c | |||
| 2a26236d94 | |||
| 71a00ac140 | |||
| f10aaaba6b | |||
| 296675f0b0 | |||
| 7f365be53d | |||
| 0180500e9a | |||
| 9e85204d04 | |||
| d5d80e71e7 | |||
| 73b360f427 | |||
| 722094bc3e | |||
| 645b2cfe5d | |||
| afcaa82069 | |||
| 393bffe14c | |||
| d44b6f00c6 | |||
| de68c3b49f | |||
| 0591b60fad | |||
| a6cebccad9 | |||
| 4186d90a32 | |||
| bb21441c3d | |||
| 12b1b89713 | |||
| 26512f5dc1 | |||
| 4d29e2ab41 | |||
| 40d35bb4df | |||
| 1802ab5a2e | |||
| 6c6fd38482 | |||
| 2e37e874c3 | |||
| c99e32998b | |||
| 22ce078c74 | |||
| a93d80b2e2 | |||
| 1b4df1ecd1 | |||
| ce5ab1cfc2 | |||
| 3ac021d7ef | |||
| fa7d561189 | |||
| 2c59e9beec | |||
| 01af72bd2f | |||
| 2f42958394 | |||
| 4613f13eae | |||
| fba3801994 | |||
| 7ec722fc26 | |||
| 64295d565a | |||
| 2db0027fff | |||
| 71f077a617 | |||
| a80cf53f08 | |||
| 80dac639da | |||
| ff73a124f0 | |||
| a4fcc87088 | |||
| be1b993239 | |||
| 63f9912347 | |||
| b887172032 | |||
| 18937a3315 | |||
| fb6a74aef8 | |||
| cd89ce917e | |||
| 6229a1a4b1 | |||
| eb5ae8443d | |||
| a9028e65d9 | |||
| ba413e4d05 | |||
| 6f759d969d | |||
| 044bcbd852 | |||
| 53ba5a962b | |||
| 6f06eaf0a0 | |||
| 993191c083 | |||
| db178ce991 | |||
| 329d53f8d0 | |||
| 7c35e19ed4 | |||
| 326a3a00b2 | |||
| 086597985b | |||
| c3c3d32dfe | |||
| 1756124b89 | |||
| 5bc3619d6b | |||
| 7ec04ac8da | |||
| 8d93f3bb61 | |||
| b31ea475c6 | |||
| a7e8ec4d99 | |||
| 677ee127ff | |||
| d238cb1d88 | |||
| a02035e9b8 | |||
| b61948dac3 | |||
| deee26d55b | |||
| 00443b46c8 | |||
| 5694d8bd1c | |||
| e5a4cf59c4 | |||
| 9228eaf01b | |||
| 51f9e1f58c | |||
| 6747ee077b | |||
| e11e270101 | |||
| 12fe5059a6 | |||
| e75121b0bd | |||
| 0312f972bc | |||
| 9d48fec426 | |||
| 645045b492 | |||
| 1988fae4f9 | |||
| 6c621d5ca8 | |||
| b8c8a9d8ea | |||
| bc27355ed6 | |||
| 078d9af116 | |||
| 9b14e1186e | |||
| 779c606c2a | |||
| 002e855d82 | |||
| 1c6de11e04 | |||
| 581e56a245 | |||
| 7f468e19bd | |||
| e8a511d49e | |||
| 1988ad993f | |||
| 6105c44dab | |||
| d3b7cd8cd6 | |||
| ce3dfca6e0 | |||
| 706878b1e4 | |||
| 6c59e22101 | |||
| 36c48f28d1 | |||
| 93b18531ab | |||
| 27edd84442 | |||
| e24e6858fb | |||
| 2d48f6687c | |||
| fa10973626 | |||
| 521e2fe62b | |||
| 7e7938ea1a | |||
| 4fe48bd02a | |||
| f26bc28ba1 | |||
| aaf8b96070 | |||
| c5720059f3 | |||
| 361faf235d | |||
| f85f5d63a6 | |||
| 526bc11626 | |||
| 95d73b5bc5 | |||
| 73e0f03886 | |||
| 91bc82ed16 | |||
| c6a30588e6 | |||
| 26c09c02ab | |||
| c34e6723d8 | |||
| bf2a039700 | |||
| cebe5afd0a | |||
| 2e8e4c0ccc | |||
| 1c5c8c61cf | |||
| 726d9fd29c | |||
| d7eeeeeac2 | |||
| ee72f8364e | |||
| a95ff0b0e5 | |||
| 57ced048a0 | |||
| ca545e2d44 | |||
| 0b777137d5 | |||
| d19f4de424 | |||
| 56d509b07b | |||
| fe3a9d84d5 | |||
| dc38311125 | |||
| bce8f2a8b7 | |||
| 13ec0c745e | |||
| b5f7e12f5a | |||
| 90e8ff128c | |||
| 998b1057e0 | |||
| d4a7dee121 | |||
| e85e05a526 | |||
| 7f953e78cf | |||
| 8b536eb0b0 | |||
| f390548d66 | |||
| c6a2b8c6ea | |||
| a046e31412 | |||
| 716f6d4daa | |||
| 9b451ff1bc | |||
| 6d48182d90 | |||
| e3d8defa5b | |||
| dc24b43311 | |||
| 75f55ebd44 | |||
| 09cebb1c7e | |||
| 9dc0935cc1 | |||
| 5bfd695f2d | |||
| 8e0b05b6af | |||
| ddc441e76e | |||
| 20602cadb5 | |||
| 416ac0a2a5 | |||
| 49933c8493 | |||
| b1bc72a1a5 | |||
| c498a373f5 | |||
| bd04d6263e | |||
| fbe9244000 | |||
| 6e52a3c0c7 | |||
| 9f92274720 | |||
| 6d431bb251 | |||
| 5265b949af | |||
| db875491d0 | |||
| 778fdff69a | |||
| 4b54aa3c02 | |||
| 019688a5cc | |||
| 00fc3a59eb | |||
| e5244e75a3 | |||
| cb77c21656 | |||
| 7b0f7f16ba | |||
| e23446654d | |||
| b3641534c9 | |||
| a3a5f65e53 | |||
| d5c0f388db | |||
| 8ae3820aa2 | |||
| ac6f64d494 | |||
| 9d001f8896 | |||
| 24e9cffeea | |||
| b0f2763a85 | |||
| cc343c296f | |||
| bc9b60b0ac | |||
| 856592e1fe | |||
| cd28d01354 | |||
| 653cd3fd75 | |||
| 73b1a77a12 | |||
| 777d6a3c5b | |||
| 98f520427e | |||
| 403f2ec57c | |||
| e69d99fdf1 | |||
| b48b2fbac9 | |||
| 00515aaf9b | |||
| e70d5697c3 | |||
| fb6d206203 | |||
| d3a9c87d14 | |||
| 39841f6b0d | |||
| 7ed3b421a1 | |||
| 3b5eb32190 | |||
| be31b87eac | |||
| 3d341ac99d | |||
| 9df1c37ee9 | |||
| 385a28c29b | |||
| e26568cdf1 | |||
| 191953a003 | |||
| 47143fe97d | |||
| 387ce6a555 | |||
| 47ff01805c | |||
| 0e24f7188c | |||
| 8b3d1f2a2e | |||
| dcdc823b5f | |||
| 7201e5c8f8 | |||
| 929c52b94c | |||
| 2adfda5f30 | |||
| 421accaf15 | |||
| 574ad6176b | |||
| 290d737ff7 | |||
| 4b0fbd0b6b | |||
| 6327089a55 | |||
| 807c3a8cde | |||
| 665c261b9a | |||
| bdd6f21522 | |||
| 482243ceff | |||
| 9890fbfec0 | |||
| 2a0465dc0f | |||
| 3ebe311728 | |||
| 95a51ecc7a | |||
| 342753aeac | |||
| 2b467f56d7 | |||
| a27db0ab68 | |||
| 845a4c8faa | |||
| 7b9959e68d | |||
| 0328ebad85 | |||
| 77c5252bf6 | |||
| c42a597bb4 | |||
| b40781db84 | |||
| f5a0bf67c8 | |||
| 044d60fb66 | |||
| 7999e98bd9 | |||
| 7c14688ef3 | |||
| 8039d1942d | |||
| 6c8fd2518e | |||
| 03e2f4390b | |||
| 08656ae276 | |||
| 9f2ba56c59 | |||
| 34e1ba8f95 | |||
| 4e95f4f9c9 | |||
| 7ee59ea814 | |||
| 1463510b08 | |||
| a771335ff1 | |||
| 7b1f58412a | |||
| d897c83165 | |||
| 44b9bc3fc1 | |||
| fa95ed1391 | |||
| 26ca580ba4 | |||
| f65e69b745 | |||
| 5a147fb0de | |||
| 64e38ce05a | |||
| 6c79a1781d | |||
| 6177d84131 | |||
| c6975badce | |||
| c548c6484f | |||
| 9aae16521f | |||
| 559ff4e94c | |||
| 7b11f503d8 | |||
| bc788c3a34 | |||
| f936c71188 | |||
| 25a7982a87 | |||
| 74a3749e44 | |||
| 074fb10b44 | |||
| 4f490eb737 | |||
| 2b981b6c40 | |||
| bec80d980f | |||
| 8a5c8f5c94 | |||
| da301ec6b2 | |||
| a5a9cb1c50 | |||
| cef74ab71f | |||
| 3f647952c0 | |||
| 9bf55aae85 | |||
| f9a31faa78 | |||
| 9a643837d4 | |||
| f458a52b18 | |||
| 132437d134 | |||
| 022841c195 | |||
| bdbecfb037 | |||
| 1a501af172 | |||
| fe558a8be8 | |||
| 05d930d8f7 | |||
| 267aa85e01 | |||
| 89a98cac8b | |||
| efc052d622 | |||
| 6f61f3af9b | |||
| e7d06c9752 | |||
| 81e3c70960 | |||
| 76a0fe9b6f | |||
| a9bab6db56 | |||
| 85197c1f9b | |||
| ece434806f | |||
| 0962192144 | |||
| 38139a1ec9 | |||
| 56e5603256 | |||
| b5c2efa9e2 | |||
| 26f9f0e16c | |||
| 9abba0ce82 | |||
| c616a9d31a | |||
| e45a980ce3 | |||
| 91bca90e5d | |||
| c5d09b0d8b | |||
| 46c9fa184d | |||
| 3a31fba1b4 | |||
| 6cded1d2d1 | |||
| 027d0e891b | |||
| 0da31ef866 | |||
| 56f14c064e | |||
| 09c929803f | |||
| 93abea0823 | |||
| 5c5216e207 | |||
| 7a20ff6ddc | |||
| 048b7d7f56 | |||
| f009726cf0 | |||
| fb213cbdbb | |||
| 971dcaed87 | |||
| 7b132def2a | |||
| 998dc54292 | |||
| 157eaf8760 | |||
| 10ffcf7806 | |||
| 392dd18338 | |||
| d4c7cdf400 | |||
| cde96ae694 | |||
| e49d35fdbc | |||
| 55db6d362d | |||
| 925cb6ae07 | |||
| c4f1d53199 | |||
| e18ac7a390 | |||
| cc454aea1a | |||
| 5cf275e43c | |||
| 53fe1db488 | |||
| 64082fc5ee | |||
| f9c642ad13 | |||
| bd7edf2357 | |||
| b7605bd28c | |||
| ad01283511 | |||
| adeab93b17 | |||
| 51480c2b06 | |||
| d04b3797ce | |||
| 518a00becf | |||
| c808cf7ce3 | |||
| 8cb488d81f | |||
| ed3f84d0ea | |||
| d9b02c4402 | |||
| 23522c9370 | |||
| f79b40c574 | |||
| 835915b46a | |||
| e643f25aa3 | |||
| 230a32139d | |||
| b0272cd9e0 | |||
| fa9947f22b | |||
| 5d3bb333e1 | |||
| 9f7085dfed | |||
| 95f765756c | |||
| a846ec00d7 | |||
| 6edc1917e1 | |||
| 1b864253b5 | |||
| f212987547 | |||
| 76f9c7030b | |||
| 05bc6e3fbe | |||
| 38dc5e134c | |||
| 76cf6c7d66 | |||
| 21100d517c | |||
| 37f83cd642 | |||
| f29f832387 | |||
| dd523ed6d8 | |||
| 879cfc5f7e | |||
| 83a6dd29f2 | |||
| cc85d83267 | |||
| 5d427a258e | |||
| 75e0a13f10 | |||
| 0862727176 | |||
| 6c02fcc9d5 | |||
| cd38c1b301 | |||
| c822f14a10 | |||
| 76683cb80c | |||
| 3041498ff1 | |||
| 66e0ce15cb | |||
| e12da84fa3 | |||
| bd4f28eb6d | |||
| c25b2e6cb5 | |||
| b86a1eb1bd | |||
| a9b5483005 | |||
| 29c181cff1 | |||
| 614da5ec5a | |||
| 5342f96076 | |||
| 479950df14 | |||
| 51fa32d48d | |||
| e491c56f3f | |||
| 5c505e2fe1 | |||
| 67e88d01e7 | |||
| 9454614af6 | |||
| 535a095b0a | |||
| c6457ccf1c | |||
| 3f470df462 | |||
| af5c5338b7 | |||
| e832db3214 | |||
| 8b432d1b19 | |||
| d33eb81968 | |||
| be60cdb971 | |||
| 062f877777 | |||
| 5187564250 | |||
| fc22c119f6 | |||
| dd8b696862 | |||
| 99a5e162de | |||
| 84dcf30aac | |||
| 388c0641cf | |||
| 40f2c86eec | |||
| 34bd0109c0 | |||
| b4199f38aa | |||
| 299e066436 | |||
| 0098fdaf5a | |||
| 76d26765ef | |||
| c5b6e80aaf | |||
| a1b3517b07 | |||
| bd3fdd9ab1 | |||
| 377950c978 | |||
| d17e528158 | |||
| a0c9c40ab5 | |||
| 175f9e226b | |||
| 5f2a2d96e9 | |||
| 3a167befae | |||
| 364c627f2d | |||
| c0a9477000 | |||
| f1f56b97d6 | |||
| 4a79b6c1bf | |||
| 3fddb6bcf7 | |||
| 435b6d753a | |||
| f0e1cf7f0b | |||
| 7049552f16 | |||
| 4e53189d56 | |||
| 9aa38b6fca | |||
| 5745d249f0 | |||
| 089ca061a7 | |||
| 725372befe | |||
| 6a84828506 | |||
| 1c0dc8c6f2 | |||
| 59350f768e | |||
| 0ebcf934ff | |||
| 20c934a28e | |||
| b6abeee972 | |||
| 7ecf9e4807 | |||
| 8030a90e8e | |||
| 61810c44c7 | |||
| d64bc584f0 | |||
| 4f4dea9097 | |||
| 707c852377 | |||
| 0ae1ac87d5 | |||
| f03fe78ed3 | |||
| 77cf6ac4db | |||
| 48d1a34c52 | |||
| 258f150dbb | |||
| 14783dfef5 | |||
| e62e5d11f0 | |||
| 648d908e95 | |||
| db3eb1b062 | |||
| fb2bed2dbf | |||
| f45010650a | |||
| 6022cfea1f | |||
| 1ceb8c9cf9 | |||
| 3c86db62c0 | |||
| 49687efc16 | |||
| 62835878a6 | |||
| 02cd92f2dd | |||
| 1014043c53 | |||
| bd087fbf73 | |||
| 12a1ce1654 | |||
| fbb7d414f1 | |||
| a09ed92945 | |||
| 0194a5a49d | |||
| 112110e10f | |||
| 8045d8b4e9 | |||
| d839d94d34 | |||
| 5728481a94 | |||
| 4b1632c265 | |||
| b95863d66d | |||
| 2e360e8104 | |||
| 7c52a692e3 | |||
| 17e3b8856c | |||
| 550cf3506e | |||
| 243d0d1d30 | |||
| 98649e3a42 | |||
| 9dabbee1c7 | |||
| 1c9f4de437 | |||
| b6bd8d5e01 | |||
| 502ff6f684 | |||
| 50e58446b4 | |||
| f8df1ffa96 | |||
| adf80ae3f5 | |||
| d81f623ee6 | |||
| 84c6b7099b | |||
| 965a60b6e8 | |||
| 4ba1b847e7 | |||
| f5ad8e8b64 | |||
| 4863b31bb6 | |||
| 8411b0fc17 | |||
| 6541f17555 | |||
| 143a6c9e9c | |||
| 8ef216318e | |||
| 946d3e6593 | |||
| 0bdc3a0638 | |||
| 49782755bc | |||
| 2c5fb3ba48 | |||
| bf732a1182 | |||
| a73ecc1e81 | |||
| 818351f1d0 | |||
| 27577d10cf | |||
| 09dd2ef31e |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -149,3 +149,6 @@ crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
### AndroidStudio Patch ###
|
||||
!/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
copilot.*.xml
|
||||
/.idea/dataSources.xml
|
||||
6
.idea/AndroidProjectSystem.xml
generated
Normal file
6
.idea/AndroidProjectSystem.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||
</component>
|
||||
</project>
|
||||
41
.idea/appInsightsSettings.xml
generated
Normal file
41
.idea/appInsightsSettings.xml
generated
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AppInsightsSettings">
|
||||
<option name="selectedTabId" value="Firebase Crashlytics" />
|
||||
<option name="tabSettings">
|
||||
<map>
|
||||
<entry key="Android Vitals">
|
||||
<value>
|
||||
<InsightsFilterSettings>
|
||||
<option name="connection">
|
||||
<ConnectionSetting>
|
||||
<option name="appId" value="it.integry.ordify.dulciar" />
|
||||
</ConnectionSetting>
|
||||
</option>
|
||||
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
||||
<option name="timeIntervalDays" value="SEVEN_DAYS" />
|
||||
<option name="visibilityType" value="ALL" />
|
||||
</InsightsFilterSettings>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="Firebase Crashlytics">
|
||||
<value>
|
||||
<InsightsFilterSettings>
|
||||
<option name="connection">
|
||||
<ConnectionSetting>
|
||||
<option name="appId" value="it.integry.integrywmsnative" />
|
||||
<option name="mobileSdkAppId" value="1:963231271247:android:6d73ab369f33c450" />
|
||||
<option name="projectId" value="wmsfirebaseproject-64854" />
|
||||
<option name="projectNumber" value="963231271247" />
|
||||
</ConnectionSetting>
|
||||
</option>
|
||||
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
||||
<option name="timeIntervalDays" value="THIRTY_DAYS" />
|
||||
<option name="visibilityType" value="ALL" />
|
||||
</InsightsFilterSettings>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
35
.idea/codeStyles/Project.xml
generated
35
.idea/codeStyles/Project.xml
generated
@@ -1,5 +1,40 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<JavaCodeStyleSettings>
|
||||
<option name="IMPORT_LAYOUT_TABLE">
|
||||
<value>
|
||||
<package name="" withSubpackages="true" static="false" module="true" />
|
||||
<package name="android" withSubpackages="true" static="true" />
|
||||
<package name="androidx" withSubpackages="true" static="true" />
|
||||
<package name="com" withSubpackages="true" static="true" />
|
||||
<package name="junit" withSubpackages="true" static="true" />
|
||||
<package name="net" withSubpackages="true" static="true" />
|
||||
<package name="org" withSubpackages="true" static="true" />
|
||||
<package name="java" withSubpackages="true" static="true" />
|
||||
<package name="javax" withSubpackages="true" static="true" />
|
||||
<package name="" withSubpackages="true" static="true" />
|
||||
<emptyLine />
|
||||
<package name="android" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="androidx" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="com" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="junit" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="net" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="org" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="java" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="javax" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
</value>
|
||||
</option>
|
||||
</JavaCodeStyleSettings>
|
||||
<JetCodeStyleSettings>
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
</JetCodeStyleSettings>
|
||||
|
||||
13
.idea/deploymentTargetDropDown.xml
generated
Normal file
13
.idea/deploymentTargetDropDown.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<value>
|
||||
<entry key="Prod_Android.WMS.app">
|
||||
<State />
|
||||
</entry>
|
||||
<entry key="app">
|
||||
<State />
|
||||
</entry>
|
||||
</value>
|
||||
</component>
|
||||
</project>
|
||||
18
.idea/deploymentTargetSelector.xml
generated
Normal file
18
.idea/deploymentTargetSelector.xml
generated
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2025-06-10T08:33:51.753564600Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=21088B8EFD" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
13
.idea/deviceManager.xml
generated
Normal file
13
.idea/deviceManager.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DeviceTable">
|
||||
<option name="columnSorters">
|
||||
<list>
|
||||
<ColumnSorterState>
|
||||
<option name="column" value="Name" />
|
||||
<option name="order" value="ASCENDING" />
|
||||
</ColumnSorterState>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
97
.idea/fileTemplates/Android Activity.java
generated
Normal file
97
.idea/fileTemplates/Android Activity.java
generated
Normal file
@@ -0,0 +1,97 @@
|
||||
#set( $regex = "([a-z])([A-Z]+)")
|
||||
#set( $replacement = "$1_$2")
|
||||
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
|
||||
#set( $variableName = $NAME.replace($NAME.substring(0, 1), $NAME.substring(0, 1).toLowerCase()))
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
|
||||
public class ${NAME}Activity extends BaseActivity {
|
||||
|
||||
/*
|
||||
- Create the following layout resource file [activity_${dashName}.xml]
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
|
||||
<data>
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
|
||||
|
||||
|
||||
|
||||
- Create an entry in AndroidManifest.xml
|
||||
Fix the android:name tag with current path
|
||||
|
||||
<activity
|
||||
android:name="${NAME}Activity"
|
||||
android:label="@string/activity_${dashName}_title"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light" />
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@Inject
|
||||
${NAME}ViewModel mViewModel;
|
||||
|
||||
//private Activity${NAME}Binding mBindings;
|
||||
|
||||
//Pass here all external parameters
|
||||
public static void startActivity(Context context) {
|
||||
Intent myIntent = new Intent(context, ${NAME}Activity.class);
|
||||
|
||||
//String keyExtraItem = DataCache.addItem(var);
|
||||
//myIntent.putExtra("keyExtraItem", keyExtraItem);
|
||||
|
||||
context.startActivity(myIntent);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
//mBindings = DataBindingUtil.setContentView(this, R.layout.activity_${dashName});
|
||||
//mBindings.setLifecycleOwner(this);
|
||||
|
||||
|
||||
/*
|
||||
- Add following lines into MainApplicationComponent
|
||||
|
||||
[a] into @Component
|
||||
${NAME}Module.class
|
||||
|
||||
[b] into interface body
|
||||
${NAME}Component.Factory ${variableName}Component();
|
||||
*/
|
||||
MainApplication.appComponent
|
||||
.${variableName}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Activity.java.child.0.java
generated
Normal file
12
.idea/fileTemplates/Android Activity.java.child.0.java
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = ${NAME}Component.class)
|
||||
public class ${NAME}Module {
|
||||
|
||||
@Provides
|
||||
${NAME}ViewModel provides${NAME}ViewModel() {
|
||||
return new ${NAME}ViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Activity.java.child.1.java
generated
Normal file
12
.idea/fileTemplates/Android Activity.java.child.1.java
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface ${NAME}Component {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
${NAME}Component create();
|
||||
}
|
||||
|
||||
void inject(${NAME}Activity ${NAME}Activity);
|
||||
}
|
||||
3
.idea/fileTemplates/Android Activity.java.child.2.java
generated
Normal file
3
.idea/fileTemplates/Android Activity.java.child.2.java
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
public class ${NAME}ViewModel {
|
||||
|
||||
}
|
||||
190
.idea/fileTemplates/Android Dialog.java
generated
Normal file
190
.idea/fileTemplates/Android Dialog.java
generated
Normal file
@@ -0,0 +1,190 @@
|
||||
#set( $regex = "([a-z])([A-Z]+)")
|
||||
#set( $replacement = "$1_$2")
|
||||
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseMaterialAlertDialogBuilder;
|
||||
|
||||
public class Dialog${NAME}View extends BaseMaterialAlertDialogBuilder implements DialogInterface.OnShowListener, DialogInterface.OnDismissListener {
|
||||
|
||||
/*
|
||||
Create the following layout resource file [dialog_${dashName}.xml]
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="16dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Icon.CenterStacked"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:src="@drawable/ic_error_white_24dp"
|
||||
app:tint="?colorPrimary" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="Title here" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/description_text"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="Description here" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</layout>
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@Inject
|
||||
Dialog${NAME}ViewModel mViewModel;
|
||||
|
||||
//private Dialog${NAME}Binding mBindings;
|
||||
private Context mContext;
|
||||
|
||||
//Pass here all external parameters
|
||||
public static Dialog${NAME}View newInstance(@NonNull Context context) {
|
||||
return new Dialog${NAME}View(context);
|
||||
}
|
||||
|
||||
/*
|
||||
- Add following lines into MainApplicationComponent
|
||||
|
||||
[a] into @Component
|
||||
Dialog${NAME}Module.class
|
||||
|
||||
[b] into interface body
|
||||
Dialog${NAME}Component.Factory dialog${NAME}Component();
|
||||
*/
|
||||
|
||||
private Dialog${NAME}View(@NonNull Context context) {
|
||||
super(context);
|
||||
this.mContext = context;
|
||||
|
||||
MainApplication.appComponent
|
||||
.dialog${NAME}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
//mBindings = Dialog${NAME}Binding.inflate(LayoutInflater.from(this.mContext), null, false);
|
||||
|
||||
if (context instanceof LifecycleOwner) {
|
||||
//mBindings.setLifecycleOwner((LifecycleOwner) context);
|
||||
}
|
||||
|
||||
setCancelable(true);
|
||||
|
||||
setView(mBindings.getRoot());
|
||||
|
||||
/*
|
||||
setPositiveButton(R.string.ok, (dialog, which) -> {
|
||||
onOk();
|
||||
});
|
||||
|
||||
setNegativeButton(R.string.abort, (dialog, which) -> {
|
||||
onKo();
|
||||
});
|
||||
*/
|
||||
|
||||
//this.setupBarcode();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public AlertDialog create() {
|
||||
AlertDialog alertDialog = super.create();
|
||||
alertDialog.setCanceledOnTouchOutside(false);
|
||||
alertDialog.setOnShowListener(this);
|
||||
alertDialog.setOnDismissListener(this);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onShow(DialogInterface dialogInterface) {
|
||||
//Init here all data or lists
|
||||
//this.initList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
//BarcodeManager.removeCallback(mBarcodeScannerInstanceID);
|
||||
}
|
||||
|
||||
/*
|
||||
private void setupBarcode() {
|
||||
BarcodeManager.enable(mBarcodeScannerInstanceID);
|
||||
|
||||
mBarcodeScannerInstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessful(onScanSuccessfull)
|
||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(getContext(), ex, false)));
|
||||
|
||||
super.initBarcodeManager(mBarcodeScannerInstanceID);
|
||||
}
|
||||
*/
|
||||
|
||||
public static class Result {
|
||||
private final Object returnData;
|
||||
private final boolean isAborted;
|
||||
|
||||
private Result(Object returnData, boolean isAborted) {
|
||||
this.returnData = returnData;
|
||||
this.isAborted = isAborted;
|
||||
}
|
||||
|
||||
public static Result completed(Object returnData) {
|
||||
return new Result(returnData, false);
|
||||
}
|
||||
|
||||
public static Result aborted() {
|
||||
return new Result(null, true);
|
||||
}
|
||||
|
||||
public boolean isAborted() {
|
||||
return isAborted;
|
||||
}
|
||||
|
||||
public Object getReturnData() {
|
||||
return returnData;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Dialog.java.child.0.java
generated
Normal file
12
.idea/fileTemplates/Android Dialog.java.child.0.java
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = Dialog${NAME}Component.class)
|
||||
public class Dialog${NAME}Module {
|
||||
|
||||
@Provides
|
||||
Dialog${NAME}ViewModel providesDialog${NAME}ViewModel() {
|
||||
return new Dialog${NAME}ViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Dialog.java.child.1.java
generated
Normal file
12
.idea/fileTemplates/Android Dialog.java.child.1.java
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface Dialog${NAME}Component {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
Dialog${NAME}Component create();
|
||||
}
|
||||
|
||||
void inject(Dialog${NAME}View dialog${NAME}View);
|
||||
}
|
||||
3
.idea/fileTemplates/Android Dialog.java.child.2.java
generated
Normal file
3
.idea/fileTemplates/Android Dialog.java.child.2.java
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
public class Dialog${NAME}ViewModel {
|
||||
|
||||
}
|
||||
82
.idea/fileTemplates/Android Fragment.java
generated
Normal file
82
.idea/fileTemplates/Android Fragment.java
generated
Normal file
@@ -0,0 +1,82 @@
|
||||
#set( $regex = "([a-z])([A-Z]+)")
|
||||
#set( $replacement = "$1_$2")
|
||||
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
|
||||
#set( $variableName = $NAME.replace($NAME.substring(0, 1), $NAME.substring(0, 1).toLowerCase()))
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
|
||||
public class ${NAME}Fragment extends BaseFragment {
|
||||
|
||||
/*
|
||||
- Create the following layout resource file [fragment_${dashName}.xml]
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
|
||||
<data>
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@Inject
|
||||
${NAME}ViewModel mViewModel;
|
||||
|
||||
//private Fragment${NAME}Binding mBindings;
|
||||
|
||||
|
||||
public ${NAME}Fragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static ${NAME}Fragment newInstance() {
|
||||
return new ${NAME}Fragment();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
setRetainInstance(true);
|
||||
|
||||
//mBindings = Fragment${NAME}Binding.inflate(inflater, container, false);
|
||||
//mBindings.setLifecycleOwner(this);
|
||||
|
||||
|
||||
/*
|
||||
- Add following lines into MainApplicationComponent
|
||||
|
||||
[a] into @Component
|
||||
${NAME}Module.class
|
||||
|
||||
[b] into interface body
|
||||
${NAME}Component.Factory ${variableName}Component();
|
||||
*/
|
||||
MainApplication.appComponent
|
||||
.${variableName}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
}
|
||||
3
.idea/fileTemplates/Android Fragment.java.child.0.java
generated
Normal file
3
.idea/fileTemplates/Android Fragment.java.child.0.java
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
public class ${NAME}ViewModel {
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Fragment.java.child.1.java
generated
Normal file
12
.idea/fileTemplates/Android Fragment.java.child.1.java
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface ${NAME}Component {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
${NAME}Component create();
|
||||
}
|
||||
|
||||
void inject(${NAME}Fragment ${NAME}Fragment);
|
||||
}
|
||||
12
.idea/fileTemplates/Android Fragment.java.child.2.java
generated
Normal file
12
.idea/fileTemplates/Android Fragment.java.child.2.java
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = ${NAME}Component.class)
|
||||
public class ${NAME}Module {
|
||||
|
||||
@Provides
|
||||
${NAME}ViewModel provides${NAME}ViewModel() {
|
||||
return new ${NAME}ViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
2
.idea/kotlinc.xml
generated
2
.idea/kotlinc.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.9.0" />
|
||||
<option name="version" value="1.9.25" />
|
||||
</component>
|
||||
</project>
|
||||
17
.idea/runConfigurations.xml
generated
Normal file
17
.idea/runConfigurations.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
12
.idea/runConfigurations/app.xml
generated
12
.idea/runConfigurations/app.xml
generated
@@ -1,6 +1,7 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android App">
|
||||
<module name="WMS_Native.app.main" />
|
||||
<module name="WMS.app" />
|
||||
<option name="ANDROID_RUN_CONFIGURATION_SCHEMA_VERSION" value="1" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
@@ -8,13 +9,17 @@
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="ALLOW_ASSUME_VERIFIED" value="false" />
|
||||
<option name="CLEAR_APP_STORAGE" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="RESTORE_ENABLED" value="false" />
|
||||
<option name="RESTORE_FILE" value="" />
|
||||
<option name="RESTORE_FRESH_INSTALL_ONLY" value="false" />
|
||||
<option name="CLEAR_LOGCAT" value="false" />
|
||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
|
||||
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
|
||||
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
|
||||
<option name="TARGET_SELECTION_MODE" value="DEVICE_AND_SNAPSHOT_COMBO_BOX" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
|
||||
<option name="DEBUGGER_TYPE" value="Auto" />
|
||||
@@ -58,6 +63,7 @@
|
||||
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
||||
</Profilers>
|
||||
<option name="DEEP_LINK" value="" />
|
||||
<option name="ACTIVITY" value="" />
|
||||
<option name="ACTIVITY_CLASS" value="" />
|
||||
<option name="SEARCH_ACTIVITY_IN_GLOBAL_SCOPE" value="false" />
|
||||
<option name="SKIP_ACTIVITY_VALIDATION" value="false" />
|
||||
|
||||
72
Jenkinsfile.groovy
Normal file
72
Jenkinsfile.groovy
Normal file
@@ -0,0 +1,72 @@
|
||||
pipeline {
|
||||
agent {
|
||||
label 'master'
|
||||
}
|
||||
|
||||
options {
|
||||
buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '10'))
|
||||
disableConcurrentBuilds()
|
||||
}
|
||||
|
||||
environment {
|
||||
// ANDROID_HOME = "/usr/local/android/sdk" // Cambia in base al tuo sistema
|
||||
JAVA_HOME = tool 'JDK 17.0.6 x64' // Nome dello strumento configurato in Jenkins
|
||||
PATH = "${env.JAVA_HOME}\\bin;${env.PATH}"
|
||||
}
|
||||
|
||||
stages {
|
||||
|
||||
stage('Preparing') {
|
||||
when {
|
||||
expression {
|
||||
return env.GIT_BRANCH == "master-beta"
|
||||
}
|
||||
}
|
||||
steps {
|
||||
bat "./gradlew addBetaSuffix"
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
bat "./gradlew assembleRelease"
|
||||
archiveArtifacts artifacts: 'app/build/outputs/apk/release/', onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish') {
|
||||
steps {
|
||||
azureUpload allowAnonymousAccess: true, fileShareName: 'storage-ci', filesPath: 'app/build/outputs/apk/release/*.apk,app/build/outputs/apk/release/*.txt', removePrefixPath: 'app/build/outputs/apk/release/', storageCredentialId: '83a86793-c1d6-4776-b20f-1ff652a57fee', storageType: 'filestorage', uploadArtifactsOnlyIfSuccessful: true, verbose: true, virtualPath: 'wms'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
script {
|
||||
bat 'curl -k "https://devservices.studioml.it/ems-api/updateWMSApp?overrideForced=false"'
|
||||
bat 'curl -k "https://devservices.studioml.it/ems-api/updateWMSApp?overrideForced=false&suffix=beta"'
|
||||
bat 'curl -k "https://services.studioml.it/ems-api/updateWMSApp?overrideForced=false"'
|
||||
bat 'curl -k "https://services.studioml.it/ems-api/updateWMSApp?overrideForced=false&suffix=beta"'
|
||||
if (env.GIT_BRANCH == "master" || env.GIT_BRANCH == "master-beta") {
|
||||
office365ConnectorSend adaptiveCards: true, color: '#008000', message: 'WMS è stato compilato con successo', status: 'SUCCESS', webhookUrl: 'https://default0b9c060c159c4e5f82a77459a72572.16.environment.api.powerplatform.com:443/powerautomate/automations/direct/workflows/a73f903a4044474c84ad9a0d68a9a479/triggers/manual/paths/invoke?api-version=1&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=gXc43FQXqIq7Xpfvis2XgFoPl8lpg0Sf5HtuxZG_jeI'
|
||||
}
|
||||
}
|
||||
}
|
||||
unstable {
|
||||
script {
|
||||
if (env.GIT_BRANCH == "master" || env.GIT_BRANCH == "master-beta") {
|
||||
office365ConnectorSend adaptiveCards: true, color: '#FFDE21', message: 'WMS è INSTABILE', status: 'UNSTABLE', webhookUrl: 'https://default0b9c060c159c4e5f82a77459a72572.16.environment.api.powerplatform.com:443/powerautomate/automations/direct/workflows/a73f903a4044474c84ad9a0d68a9a479/triggers/manual/paths/invoke?api-version=1&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=gXc43FQXqIq7Xpfvis2XgFoPl8lpg0Sf5HtuxZG_jeI'
|
||||
}
|
||||
}
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
if (env.GIT_BRANCH == "master" || env.GIT_BRANCH == "master-beta") {
|
||||
office365ConnectorSend adaptiveCards: true, color: '#FF2C2C', message: 'Errore di compilazione su WMS', status: 'FAILURE', webhookUrl: 'https://default0b9c060c159c4e5f82a77459a72572.16.environment.api.powerplatform.com:443/powerautomate/automations/direct/workflows/a73f903a4044474c84ad9a0d68a9a479/triggers/manual/paths/invoke?api-version=1&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=gXc43FQXqIq7Xpfvis2XgFoPl8lpg0Sf5HtuxZG_jeI'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
159
app/build.gradle
159
app/build.gradle
@@ -5,13 +5,14 @@ if (!project.hasProperty("disable-performance-plugin")) {
|
||||
}
|
||||
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
apply plugin: 'kotlin-android'
|
||||
//apply plugin: 'kotlin-android'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 400
|
||||
def appVersionName = '1.36.07'
|
||||
def appVersionCode = 553
|
||||
def appVersionName = '1.50.04'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -25,8 +26,8 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.all { output ->
|
||||
applicationVariants.configureEach { variant ->
|
||||
variant.outputs.configureEach { output ->
|
||||
output.outputFileName = "android-release.apk"
|
||||
}
|
||||
}
|
||||
@@ -34,10 +35,10 @@ android {
|
||||
defaultConfig {
|
||||
applicationId "it.integry.integrywmsnative"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 33
|
||||
targetSdk 36
|
||||
versionCode appVersionCode
|
||||
versionName appVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
signingConfig signingConfigs.release
|
||||
|
||||
javaCompileOptions {
|
||||
@@ -51,17 +52,26 @@ android {
|
||||
buildTypes {
|
||||
debug {
|
||||
ext.enableCrashlytics = false
|
||||
minifyEnabled true // Abilita la minimizzazione del codice
|
||||
// shrinkResources true // Rimuove risorse non utilizzate
|
||||
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
release {
|
||||
minifyEnabled false
|
||||
// minifyEnabled true // Abilita la minimizzazione del codice
|
||||
// shrinkResources true // Rimuove risorse non utilizzate
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.release
|
||||
firebaseCrashlytics {
|
||||
mappingFileUploadEnabled true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
android.buildFeatures.dataBinding true
|
||||
android.buildFeatures.buildConfig true
|
||||
|
||||
android.dataBinding.enabledForTests true
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
@@ -72,51 +82,55 @@ android {
|
||||
}
|
||||
|
||||
|
||||
build {
|
||||
doLast {
|
||||
delete "$projectDir/build/outputs/apk/release/version.txt"
|
||||
file("$projectDir/build/outputs/apk/release/version.txt").text = appVersionCode + '\n' + appVersionName
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gradle.projectsEvaluated {
|
||||
tasks.withType(JavaCompile.class) {
|
||||
tasks.withType(JavaCompile.class).tap {
|
||||
configureEach {
|
||||
options.compilerArgs << "-Xmaxerrs" << "10000"
|
||||
}
|
||||
}
|
||||
}
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
namespace 'it.integry.integrywmsnative'
|
||||
compileSdk 33
|
||||
compileSdk 36
|
||||
}
|
||||
|
||||
configurations {
|
||||
all*.exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
|
||||
all*.exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
// androidTestImplementation('androidx.test.espresso:espresso-core:3.6.1', {
|
||||
// exclude group: 'com.android.support', module: 'support-annotations'
|
||||
// })
|
||||
// implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
|
||||
implementation 'com.github.lupaulus:logger:2.3.2'
|
||||
|
||||
//Firebase
|
||||
|
||||
// Import the Firebase BoM
|
||||
implementation platform('com.google.firebase:firebase-bom:29.1.0')
|
||||
implementation platform('com.google.firebase:firebase-bom:33.16.0')
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
implementation 'com.google.firebase:firebase-core'
|
||||
implementation 'com.google.firebase:firebase-crashlytics'
|
||||
implementation 'com.google.firebase:firebase-perf'
|
||||
implementation 'com.google.android.gms:play-services-basement:18.2.0'
|
||||
implementation 'com.google.android.gms:play-services-basement:18.7.1'
|
||||
|
||||
//JJWT
|
||||
implementation 'io.jsonwebtoken:jjwt-api:0.12.6'
|
||||
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.6'
|
||||
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.6'
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.9.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||
implementation 'com.google.android.material:material:1.12.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.1'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.4.0'
|
||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||
|
||||
implementation('androidx.preference:preference-ktx:1.2.1') {
|
||||
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
|
||||
@@ -124,43 +138,35 @@ dependencies {
|
||||
}
|
||||
|
||||
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:retrofit:3.0.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:3.0.0'
|
||||
implementation 'com.annimon:stream:1.2.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
|
||||
// implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'org.apache.commons:commons-text:1.9'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime:2.9.1'
|
||||
implementation 'org.apache.commons:commons-text:1.13.1'
|
||||
|
||||
//MVVM
|
||||
def dagger2_version = '2.46.1'
|
||||
api "com.google.dagger:dagger:$dagger2_version"
|
||||
def dagger2_version = '2.56.2'
|
||||
implementation "com.google.dagger:dagger:$dagger2_version"
|
||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||
api "com.google.dagger:dagger-android:$dagger2_version"
|
||||
api "com.google.dagger:dagger-android-support:$dagger2_version"
|
||||
implementation "com.google.dagger:dagger-android:$dagger2_version"
|
||||
implementation "com.google.dagger:dagger-android-support:$dagger2_version"
|
||||
// if you use the support libraries
|
||||
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger2_version"
|
||||
|
||||
//FAB
|
||||
implementation 'com.github.clans:fab:1.6.4'
|
||||
//CUSTOM VIEWS
|
||||
implementation 'com.github.NaimishTrivedi:FBToast:1.0'
|
||||
implementation 'com.github.cachapa:ExpandableLayout:2.9.2'
|
||||
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
||||
implementation 'com.github.fede87:StatusBarAlert:1.0.1'
|
||||
implementation 'com.github.zhukic:sectioned-recyclerview:1.2.3'
|
||||
implementation 'com.github.pedromassango:doubleClick:3.0'
|
||||
|
||||
//SQLite ROOM
|
||||
def room_version = "2.5.2"
|
||||
def room_version = "2.7.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'
|
||||
|
||||
//Barcode
|
||||
implementation project(':pointmobilescannerlibrary')
|
||||
implementation project(':zebrascannerlibrary')
|
||||
@@ -178,11 +184,16 @@ dependencies {
|
||||
|
||||
|
||||
//Bluetooth device manager
|
||||
implementation 'com.github.harry1453:android-bluetooth-serial:v1.1'
|
||||
implementation 'com.github.harry1453:android-bluetooth-serial:v1.1.2'
|
||||
|
||||
// RxJava is also required.
|
||||
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
|
||||
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
|
||||
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
||||
|
||||
//Barcode generator
|
||||
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||
|
||||
implementation("org.javatuples:javatuples:1.2")
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -190,3 +201,49 @@ repositories {
|
||||
google()
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
|
||||
tasks.register('addBetaSuffix') {
|
||||
doLast {
|
||||
def gradleFile = file("build.gradle")
|
||||
def content = gradleFile.text
|
||||
|
||||
// Modifica appVersionName
|
||||
content = content.replaceAll(/appVersionName\s*=\s*'(.*?)'/) { fullMatch, version ->
|
||||
"appVersionName = '${version}-beta'"
|
||||
}
|
||||
|
||||
// Modifica outputFileName
|
||||
content = content.replaceAll(/output\.outputFileName\s*=\s*"(.*?)"/) { fullMatch, filename ->
|
||||
"output.outputFileName = \"${filename.replace('.apk', '-beta.apk')}\""
|
||||
}
|
||||
|
||||
// Modifica direttamente la riga che crea 'version.txt' in 'version-beta.txt'
|
||||
content = content.replace(
|
||||
"def versionFile = new File(outputDir, \"version.txt\")",
|
||||
"def versionFile = new File(outputDir, \"version-beta.txt\")"
|
||||
)
|
||||
|
||||
// Sovrascrivi il file
|
||||
gradleFile.write(content)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('createVersionFile') {
|
||||
doLast {
|
||||
def outputDir = file("${projectDir}/build/outputs/apk/release")
|
||||
def versionFile = new File(outputDir, "version.txt")
|
||||
|
||||
// Cancella il file se esiste
|
||||
if (versionFile.exists()) {
|
||||
versionFile.delete()
|
||||
}
|
||||
|
||||
// Crea il file con i contenuti desiderati
|
||||
versionFile.write("${android.defaultConfig.versionCode}\n${android.defaultConfig.versionName}\nforced=true")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
afterEvaluate {
|
||||
tasks.assembleRelease.finalizedBy createVersionFile
|
||||
}
|
||||
|
||||
49
app/proguard-rules.pro
vendored
49
app/proguard-rules.pro
vendored
@@ -18,8 +18,55 @@
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
|
||||
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
|
||||
|
||||
-dontwarn android.os.ServiceManager
|
||||
|
||||
|
||||
-keep class io.jsonwebtoken.** { *; }
|
||||
-dontwarn io.jsonwebtoken.**
|
||||
|
||||
-keep class * extends com.google.gson.TypeAdapter
|
||||
-keep class * implements com.google.gson.TypeAdapterFactory
|
||||
-keep class * implements com.google.gson.JsonSerializer
|
||||
-keep class * implements com.google.gson.JsonDeserializer
|
||||
# Prevent R8 from leaving Data object members always null
|
||||
-keepclasseswithmembers class * {
|
||||
<init>(...);
|
||||
@com.google.gson.annotations.SerializedName <fields>;
|
||||
}
|
||||
|
||||
# Per JJWT
|
||||
-keep class io.jsonwebtoken.** { *; }
|
||||
-keepnames class io.jsonwebtoken.* { *; }
|
||||
-keepnames interface io.jsonwebtoken.* { *; }
|
||||
|
||||
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
|
||||
-keep,allowshrinking class com.google.gson.reflect.TypeToken
|
||||
-keep,allowshrinking class * extends com.google.gson.reflect.TypeToken
|
||||
-keep,allowshrinking class com.google.common.reflect.TypeToken
|
||||
-keep,allowshrinking class * extends com.google.common.reflect.TypeToken
|
||||
|
||||
-keep class it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse { *; }
|
||||
-keep class * extends it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse { *; }
|
||||
-keep class * extends it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.BaseDialogRowInfoView { *; }
|
||||
-keep class * implements it.integry.barcode_base_android_library.interfaces.BarcodeReaderInterface { *; }
|
||||
|
||||
# Regole ProGuard per Gson e classi modello
|
||||
-keepattributes Signature
|
||||
-keepattributes InnerClasses
|
||||
|
||||
# Se usi ObservableArrayList o altre classi specifiche di AndroidX Data Binding con Gson,
|
||||
# potresti aver bisogno di mantenerle esplicitamente se non sono coperte sopra.
|
||||
-keep class androidx.databinding.ObservableArrayList { *; }
|
||||
-keepclassmembers class androidx.databinding.ObservableArrayList { *; }
|
||||
|
||||
|
||||
|
||||
-keep class * implements it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.IDialogAskClienteViewModel { *; }
|
||||
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
@@ -2,6 +2,9 @@
|
||||
<manifest xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-feature android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
@@ -24,8 +27,8 @@
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
@@ -33,63 +36,57 @@
|
||||
android:requestLegacyExternalStorage="true">
|
||||
<activity
|
||||
android:name=".gest.spedizione.SpedizioneActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.prod_dettaglio_linea.ProdDettaglioLineaActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.picking_resi.PickingResiActivity"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.main.MainActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.CLIENTBARCODEACTIVITY" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".gest.login.LoginActivity"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.accettazione_ordini_picking.AccettazioneOrdiniPickingActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.lista_bancali.ListaBancaliActivity"
|
||||
android:label="@string/activity_lista_bancali_title"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.contenuto_bancale.ContenutoBancaleActivity"
|
||||
android:label="@string/activity_contenuto_bancale_title"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.inventario.picking.PickingInventarioActivity"
|
||||
android:label="@string/activity_picking_inventario_title"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"/>
|
||||
|
||||
<activity
|
||||
android:name=".gest.trasferimento_pedane.edit.TrasferimentoPedaneEditActivity"
|
||||
android:label="@string/activity_trasferimento_pedane_edit_title"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
|
||||
<meta-data
|
||||
@@ -110,8 +107,7 @@
|
||||
|
||||
<activity
|
||||
android:name=".gest.accettazione_bolla_picking.AccettazioneBollaPickingActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light" />
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<provider
|
||||
android:name=".core.update.GenericFileProvider"
|
||||
|
||||
BIN
app/src/main/ic_launcher-playstore.png
Normal file
BIN
app/src/main/ic_launcher-playstore.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
@@ -11,6 +11,7 @@ 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.core.expansion.BaseMaterialAlertDialogBuilderComponent;
|
||||
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;
|
||||
@@ -19,6 +20,8 @@ import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazi
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazioneOrdiniElencoModule;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingComponent;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingModule;
|
||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaComponent;
|
||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoComponent;
|
||||
@@ -27,6 +30,8 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniE
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectLotti.DialogSelectLottiComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectLotti.DialogSelectLottiModule;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||
import it.integry.integrywmsnative.gest.inventario.ElencoInventariComponent;
|
||||
@@ -67,6 +72,11 @@ import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMate
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeModule;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail.ProdRientroMerceOrderDetailComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_list.ProdRientroMerceOrderListComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.ProdRiposizionamentoDaProdComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.ProdRiposizionamentoDaProdModule;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza.DialogInfoGiacenzaComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza.DialogInfoGiacenzaModule;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeModule;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale_su_mag_prossimita.ProdVersamentoMaterialeInBufferComponent;
|
||||
@@ -80,6 +90,8 @@ import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.selectArt
|
||||
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.pv_verifica_giacenze.VerificaGiacenzeComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_verifica_giacenze.VerificaGiacenzeModule;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeComponent;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeModule;
|
||||
import it.integry.integrywmsnative.gest.settings.MainSettingsComponent;
|
||||
@@ -92,10 +104,20 @@ import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.info_situazi
|
||||
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.trasferimento_pedane.TrasferimentoPedaneComponent;
|
||||
import it.integry.integrywmsnative.gest.trasferimento_pedane.TrasferimentoPedaneModule;
|
||||
import it.integry.integrywmsnative.gest.trasferimento_pedane.dialog.confirm_export.DialogTrasferimentoPedaneConfirmExportComponent;
|
||||
import it.integry.integrywmsnative.gest.trasferimento_pedane.dialog.confirm_export.DialogTrasferimentoPedaneConfirmExportModule;
|
||||
import it.integry.integrywmsnative.gest.trasferimento_pedane.edit.TrasferimentoPedaneEditComponent;
|
||||
import it.integry.integrywmsnative.gest.trasferimento_pedane.edit.TrasferimentoPedaneEditModule;
|
||||
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteComponent;
|
||||
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteModule;
|
||||
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.dialog.DialogUltimeConsegneFiltroAvanzatoComponent;
|
||||
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.dialog.DialogUltimeConsegneFiltroAvanzatoModule;
|
||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreComponent;
|
||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreModule;
|
||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.dialog.DialogUltimiArriviFornitoreFiltroAvanzatoComponent;
|
||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.dialog.DialogUltimiArriviFornitoreFiltroAvanzatoModule;
|
||||
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;
|
||||
@@ -104,17 +126,41 @@ import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetM
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_commessa.DialogAskCommessaComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_deposito.DialogAskDepositoComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_deposito.DialogAskDepositoModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_info_trasferimento.DialogAskInfoTrasferimentoComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_info_trasferimento.DialogAskInfoTrasferimentoModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaProdComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaProdModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_livello_posizione.DialogAskLivelloPosizioneComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_livello_posizione.DialogAskLivelloPosizioneModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_position_of_lu.DialogAskPositionOfLUComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_position_of_lu.DialogAskPositionOfLUModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_vettore.DialogAskVettoreComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_vettore.DialogAskVettoreModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.DialogBasketLUComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.DialogBasketLUModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts.DialogChooseArtFromListaArtsComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts.DialogChooseArtFromListaArtsModule;
|
||||
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.create_new_art.DialogCreateNewArtComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.create_new_art.DialogCreateNewArtModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.device_end_of_life.DialogDeviceEndOfLifeComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.device_end_of_life.DialogDeviceEndOfLifeModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.extra_info.DialogExtraInfoComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.extra_info.DialogExtraInfoModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUModule;
|
||||
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;
|
||||
@@ -129,6 +175,14 @@ import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.select_position_of_lu.DialogSelectPositionOfLuComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.select_position_of_lu.DialogSelectPositionOfLuModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.switch_user_depo.DialogSwitchUserDepoComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.switch_user_depo.DialogSwitchUserDepoModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracciamentoImballiComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracciamentoImballiModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.update_available.DialogUpdateAvailableComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.update_available.DialogUpdateAvailableModule;
|
||||
|
||||
// Definition of the Application graph
|
||||
@Singleton
|
||||
@@ -160,6 +214,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
DialogInputLUProdModule.class,
|
||||
DialogScanArtModule.class,
|
||||
DialogScanOrCreateLUModule.class,
|
||||
DialogBasketLUModule.class,
|
||||
ProdFabbisognoLineeProdModule.class,
|
||||
VersamentoMerceModule.class,
|
||||
DialogAskMagazzinoProssimitaModule.class,
|
||||
@@ -173,6 +228,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
DialogSelectDocInfoModule.class,
|
||||
DocInterniEditFormModule.class,
|
||||
DialogSelectDocRowsModule.class,
|
||||
DialogSelectLottiModule.class,
|
||||
DialogAskClienteModule.class,
|
||||
DialogEditArticoloModule.class,
|
||||
DialogPrintOrderSSCCListModule.class,
|
||||
@@ -195,7 +251,33 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
DialogBindProductBarcodeWithPackageModule.class,
|
||||
DialogAskUnknownBarcodeNotesModule.class,
|
||||
ProdVersamentoMaterialeInBufferModule.class,
|
||||
DialogInputQuantityToReturnModule.class
|
||||
DialogInputQuantityToReturnModule.class,
|
||||
DialogInfoAggiuntiveLUModule.class,
|
||||
DialogAskLineaProdModule.class,
|
||||
ProdRiposizionamentoDaProdModule.class,
|
||||
DialogInfoGiacenzaModule.class,
|
||||
ArticoliInGiacenzaModule.class,
|
||||
DialogTracciamentoImballiModule.class,
|
||||
DialogAskVettoreModule.class,
|
||||
DialogAskVettoreModule.class,
|
||||
DialogCreateNewArtModule.class,
|
||||
DialogSwitchUserDepoModule.class,
|
||||
DialogUpdateAvailableModule.class,
|
||||
DialogAskPositionOfLUModule.class,
|
||||
DialogAskLivelloPosizioneModule.class,
|
||||
VerificaGiacenzeModule.class,
|
||||
DialogExtraInfoModule.class,
|
||||
DialogAskDepositoModule.class,
|
||||
DialogChooseArtFromListaArtsModule.class,
|
||||
DialogUltimeConsegneFiltroAvanzatoModule.class,
|
||||
DialogUltimiArriviFornitoreFiltroAvanzatoModule.class,
|
||||
DialogSelectPositionOfLuModule.class,
|
||||
TrasferimentoPedaneModule.class,
|
||||
DialogAskInfoTrasferimentoModule.class,
|
||||
TrasferimentoPedaneEditModule.class,
|
||||
DialogTrasferimentoPedaneConfirmExportModule.class,
|
||||
DialogChooseArtFromListaArtsModule.class,
|
||||
DialogDeviceEndOfLifeModule.class
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
@@ -205,6 +287,8 @@ public interface MainApplicationComponent {
|
||||
|
||||
BaseDialogFragmentComponent.Factory baseDialogFragmentComponent();
|
||||
|
||||
BaseMaterialAlertDialogBuilderComponent.Factory baseMaterialAlertDialogComponent();
|
||||
|
||||
SplashActivityComponent.Factory splashActivityComponent();
|
||||
|
||||
LoginComponent.Factory loginActivityComponent();
|
||||
@@ -251,6 +335,8 @@ public interface MainApplicationComponent {
|
||||
|
||||
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
|
||||
|
||||
DialogBasketLUComponent.Factory dialogBasketLUComponent();
|
||||
|
||||
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
||||
|
||||
VersamentoMerceComponent.Factory versamentoMerceComponent();
|
||||
@@ -281,8 +367,6 @@ public interface MainApplicationComponent {
|
||||
|
||||
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
||||
|
||||
InfoAggiuntiveLUDialogComponent.Factory infoAggiuntiveLUDialogComponent();
|
||||
|
||||
DialogEditArticoloComponent.Factory dialogEditArticoloComponent();
|
||||
|
||||
DialogPrintOrderSSCCListComponent.Factory dialogPrintOrderSSCCListComponent();
|
||||
@@ -314,6 +398,7 @@ public interface MainApplicationComponent {
|
||||
DialogInfoSituazioneArticoloComponent.Factory dialogInfoSituazioneArticoloComponent();
|
||||
|
||||
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsNewComponent();
|
||||
DialogSelectLottiComponent.Factory dialogSelectLottiComponent();
|
||||
|
||||
DialogSelectArtToOrderComponent.Factory dialogSelectArtToOrderNewComponent();
|
||||
|
||||
@@ -329,6 +414,58 @@ public interface MainApplicationComponent {
|
||||
|
||||
DialogInputQuantityToReturnComponent.Factory dialogInputQuantityToReturnComponent();
|
||||
|
||||
DialogInfoAggiuntiveLUComponent.Factory dialogInfoAggiuntiveLUComponent();
|
||||
|
||||
DialogAskLineaProdComponent.Factory dialogAskLineaProdComponent();
|
||||
|
||||
ProdRiposizionamentoDaProdComponent.Factory prodRiposizionamentoDaprodComponent();
|
||||
|
||||
DialogInfoGiacenzaComponent.Factory dialogInfoGiacenzaComponent();
|
||||
|
||||
ArticoliInGiacenzaComponent.Factory controlloGiacenzeComponent();
|
||||
|
||||
DialogTracciamentoImballiComponent.Factory dialogTracciamentoImballiComponent();
|
||||
|
||||
DialogAskVettoreComponent.Factory dialogAskVettoreComponent();
|
||||
|
||||
DialogAskCommessaComponent.Factory dialogAskCommessaComponent();
|
||||
|
||||
DialogCreateNewArtComponent.Factory dialogCreateNewArtComponent();
|
||||
|
||||
DialogSwitchUserDepoComponent.Factory dialogSwitchUserDepoComponent();
|
||||
|
||||
ProdRientroMerceOrderListComponent.Factory prodRientroMerceOrderListComponent();
|
||||
|
||||
DialogUpdateAvailableComponent.Factory dialogUpdateAvailableComponent();
|
||||
|
||||
DialogAskPositionOfLUComponent.Factory dialogAskPositionOfLUComponent();
|
||||
|
||||
DialogAskLivelloPosizioneComponent.Factory dialogAskLivelloPosizioneComponent();
|
||||
|
||||
VerificaGiacenzeComponent.Factory verificaGiacenzeComponent();
|
||||
|
||||
DialogExtraInfoComponent.Factory dialogExtraInfoComponent();
|
||||
|
||||
DialogAskDepositoComponent.Factory dialogAskDepositoComponent();
|
||||
|
||||
DialogChooseArtFromListaArtsComponent.Factory dialogChooseArtFromListaArtsComponent();
|
||||
|
||||
DialogUltimeConsegneFiltroAvanzatoComponent.Factory dialogUltimeConsegneFiltroAvanzatoComponent();
|
||||
|
||||
DialogUltimiArriviFornitoreFiltroAvanzatoComponent.Factory dialogUltimiArriviFornitoreFiltroAvanzatoComponent();
|
||||
|
||||
DialogSelectPositionOfLuComponent.Factory dialogSelectPositionOfLuComponent();
|
||||
|
||||
TrasferimentoPedaneComponent.Factory trasferimentoPedaneComponent();
|
||||
|
||||
DialogAskInfoTrasferimentoComponent.Factory dialogAskInfoTrasferimentoComponent();
|
||||
|
||||
TrasferimentoPedaneEditComponent.Factory traferimentoPedaneEditComponent();
|
||||
|
||||
DialogTrasferimentoPedaneConfirmExportComponent.Factory dialogTrasferimentoPedaneConfirmExportComponent();
|
||||
|
||||
DialogDeviceEndOfLifeComponent.Factory dialogDeviceEndOfLifeComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
@@ -16,8 +16,11 @@ import it.integry.integrywmsnative.core.context.AppContext;
|
||||
import it.integry.integrywmsnative.core.context.MainContext;
|
||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||
import it.integry.integrywmsnative.core.ean128.Ean128Service;
|
||||
import it.integry.integrywmsnative.core.menu.MenuRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.menu.MenuService;
|
||||
import it.integry.integrywmsnative.core.rest.AuthInterceptor;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.AziendaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
@@ -30,22 +33,29 @@ 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.GiacenzaPvRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ImballiRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoBufferRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PVOrdiniAcquistoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ProduzioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.VettoriRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.sound.SoundAlertService;
|
||||
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.login.rest.AuthenticationRESTConsumer;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
|
||||
@@ -78,8 +88,8 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
public SettingsManager provideSettingsManager(SystemRESTConsumer systemRESTConsumer, AziendaRESTConsumer aziendaRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer, GestSetupRESTConsumer gestSetupRESTConsumer) {
|
||||
return new SettingsManager(mApplication, systemRESTConsumer, aziendaRESTConsumer, gestSetupRESTConsumer, posizioniRESTConsumer);
|
||||
public SettingsManager provideSettingsManager(SystemRESTConsumer systemRESTConsumer, ImballiRESTConsumer imballiRESTConsumer, AziendaRESTConsumer aziendaRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer, GestSetupRESTConsumer gestSetupRESTConsumer) {
|
||||
return new SettingsManager(mApplication, systemRESTConsumer, imballiRESTConsumer, aziendaRESTConsumer, gestSetupRESTConsumer, posizioniRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -90,8 +100,14 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MainContext providesMainContextNew(MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new MainContext(mApplication.getApplicationContext(), menuService, appDatabase, systemRESTConsumer);
|
||||
ServerStatusChecker providesServerStatusChecker(Handler handler) {
|
||||
return new ServerStatusChecker(handler);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MainContext providesMainContextNew(MenuService menuService, AppDatabase appDatabase, AuthenticationRESTConsumer authenticationRESTConsumer, ExecutorService executorService, Handler handler, ServerStatusChecker serverStatusChecker) {
|
||||
return new MainContext(mApplication.getApplicationContext(), menuService, appDatabase, authenticationRESTConsumer, executorService, handler, serverStatusChecker);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -102,6 +118,19 @@ public class MainApplicationModule {
|
||||
return colliDataRecoverService;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
Ean128Service provideEan128Service() {
|
||||
return new Ean128Service();
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
RESTBuilder providesRESTBuilder(AuthInterceptor authInterceptor) {
|
||||
return new RESTBuilder(authInterceptor);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MenuService provideMenuService(MenuRESTConsumer menuRESTConsumer) {
|
||||
@@ -110,8 +139,8 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
UpdatesManager provideUpdatesManager() {
|
||||
return new UpdatesManager();
|
||||
UpdatesManager provideUpdatesManager(ExecutorService executorService, Handler handler, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new UpdatesManager(executorService, handler, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -128,119 +157,139 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
OrdiniRESTConsumer provideOrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
||||
return new OrdiniRESTConsumer(systemRESTConsumer, entityRESTConsumer);
|
||||
OrdiniRESTConsumer provideOrdiniRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService, SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
||||
return new OrdiniRESTConsumer(restBuilder, executorService, systemRESTConsumer, entityRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
GestSetupRESTConsumer provideGestSetupRESTConsumer() {
|
||||
return new GestSetupRESTConsumer();
|
||||
GestSetupRESTConsumer provideGestSetupRESTConsumer(RESTBuilder restBuilder) {
|
||||
return new GestSetupRESTConsumer(restBuilder);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ArticoloRESTConsumer provideArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new ArticoloRESTConsumer(systemRESTConsumer);
|
||||
ArticoloRESTConsumer provideArticoloRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new ArticoloRESTConsumer(restBuilder, executorService, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
CommessaRESTConsumer provideCommessaRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new CommessaRESTConsumer(systemRESTConsumer);
|
||||
CommessaRESTConsumer provideCommessaRESTConsumer(ExecutorService executorService, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new CommessaRESTConsumer(executorService, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DepositoRESTConsumer provideDepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new DepositoRESTConsumer(entityRESTConsumer, systemRESTConsumer);
|
||||
DepositoRESTConsumer provideDepositoRESTConsumer(ExecutorService executorService, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new DepositoRESTConsumer(executorService, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MenuRESTConsumer provideMenuRESTConsumer() {
|
||||
return new MenuRESTConsumer();
|
||||
MenuRESTConsumer provideMenuRESTConsumer(RESTBuilder restBuilder) {
|
||||
return new MenuRESTConsumer(restBuilder);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MagazzinoRESTConsumer provideMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new MagazzinoRESTConsumer(systemRESTConsumer);
|
||||
MagazzinoRESTConsumer provideMagazzinoRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new MagazzinoRESTConsumer(restBuilder, executorService, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MesRESTConsumer provideMesRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new MesRESTConsumer(systemRESTConsumer);
|
||||
MesRESTConsumer provideMesRESTConsumer(ExecutorService executorService, RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new MesRESTConsumer(executorService, restBuilder, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
EntityRESTConsumer provideEntityRESTConsumer() {
|
||||
return new EntityRESTConsumer();
|
||||
EntityRESTConsumer provideEntityRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
|
||||
return new EntityRESTConsumer(restBuilder, executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer(ExecutorService executorService,
|
||||
RESTBuilder restBuilder,
|
||||
SystemRESTConsumer systemRESTConsumer,
|
||||
ArticoloRESTConsumer articoloRESTConsumer,
|
||||
EntityRESTConsumer entityRESTConsumer,
|
||||
SettingsManager settingsManager) {
|
||||
return new ColliMagazzinoRESTConsumer(systemRESTConsumer, articoloRESTConsumer, entityRESTConsumer, settingsManager);
|
||||
return new ColliMagazzinoRESTConsumer(executorService, restBuilder, systemRESTConsumer, articoloRESTConsumer, entityRESTConsumer, settingsManager);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
AziendaRESTConsumer provideAziendaRESTConsumer() {
|
||||
return new AziendaRESTConsumer();
|
||||
AziendaRESTConsumer provideAziendaRESTConsumer(RESTBuilder restBuilder) {
|
||||
return new AziendaRESTConsumer(restBuilder);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
BarcodeRESTConsumer provideBarcodeRESTConsumer() {
|
||||
return new BarcodeRESTConsumer();
|
||||
ProduzioneRESTConsumer provideProduzioneRESTConsumer(RESTBuilder restBuilder) {
|
||||
return new ProduzioneRESTConsumer(restBuilder);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
PrinterRESTConsumer providePrinterRESTConsumer() {
|
||||
return new PrinterRESTConsumer();
|
||||
BarcodeRESTConsumer provideBarcodeRESTConsumer(Ean128Service ean128Service) {
|
||||
return new BarcodeRESTConsumer(ean128Service);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
SystemRESTConsumer provideSystemRESTConsumer() {
|
||||
return new SystemRESTConsumer();
|
||||
PrinterRESTConsumer providePrinterRESTConsumer(ExecutorService executorService, RESTBuilder restBuilder) {
|
||||
return new PrinterRESTConsumer(executorService, restBuilder);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
PVOrdiniAcquistoRESTConsumer providesPVOrdiniAcquistoRESTConsumer(MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||
return new PVOrdiniAcquistoRESTConsumer(magazzinoRESTConsumer);
|
||||
SystemRESTConsumer provideSystemRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
|
||||
return new SystemRESTConsumer(restBuilder, executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
PosizioniRESTConsumer providesPosizioniRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new PosizioniRESTConsumer(systemRESTConsumer);
|
||||
PVOrdiniAcquistoRESTConsumer providesPVOrdiniAcquistoRESTConsumer(RESTBuilder restBuilder, MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||
return new PVOrdiniAcquistoRESTConsumer(restBuilder, magazzinoRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ProdFabbisognoLineeProdRESTConsumer providesProdFabbisognoLineeProdRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new ProdFabbisognoLineeProdRESTConsumer(systemRESTConsumer);
|
||||
PosizioniRESTConsumer providesPosizioniRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer, ExecutorService executorService) {
|
||||
return new PosizioniRESTConsumer(restBuilder, systemRESTConsumer, executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DocInterniRESTConsumer provideDocInterniRESTConsumer(MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||
return new DocInterniRESTConsumer(magazzinoRESTConsumer);
|
||||
DocInterniRESTConsumer provideDocInterniRESTConsumer(RESTBuilder restBuilder, MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||
return new DocInterniRESTConsumer(restBuilder, magazzinoRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
GiacenzaRESTConsumer provideGiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
return new GiacenzaRESTConsumer(systemRESTConsumer, articoloRESTConsumer);
|
||||
GiacenzaRESTConsumer provideGiacenzaRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
return new GiacenzaRESTConsumer(restBuilder, executorService, articoloRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
GiacenzaPvRESTConsumer provideGiacenzaPvRESTConsumer(RESTBuilder restBuilder) {
|
||||
return new GiacenzaPvRESTConsumer(restBuilder);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ImballiRESTConsumer provideImballiRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
|
||||
return new ImballiRESTConsumer(restBuilder, executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
VettoriRESTConsumer provideVettoriRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
|
||||
return new VettoriRESTConsumer(restBuilder, executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -251,44 +300,58 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ProductionLinesRESTConsumer provideProductionLinesRESTConsumer() {
|
||||
return new ProductionLinesRESTConsumer();
|
||||
ProductionLinesRESTConsumer provideProductionLinesRESTConsumer(RESTBuilder restBuilder) {
|
||||
return new ProductionLinesRESTConsumer(restBuilder);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DocumentRESTConsumer provideDocumentiRESTConsumer() {
|
||||
return new DocumentRESTConsumer();
|
||||
DocumentRESTConsumer provideDocumentiRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
|
||||
return new DocumentRESTConsumer(restBuilder, executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ColliAccettazioneRESTConsumer provideColliAccettazioneRESTConsumer() {
|
||||
return new ColliAccettazioneRESTConsumer();
|
||||
ColliAccettazioneRESTConsumer provideColliAccettazioneRESTConsumer(ExecutorService executorService, RESTBuilder restBuilder) {
|
||||
return new ColliAccettazioneRESTConsumer(executorService, restBuilder);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ColliSpedizioneRESTConsumer provideColliSpedizioneRESTConsumer() {
|
||||
return new ColliSpedizioneRESTConsumer();
|
||||
ColliSpedizioneRESTConsumer provideColliSpedizioneRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
|
||||
return new ColliSpedizioneRESTConsumer(restBuilder, executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ColliLavorazioneRESTConsumer provideColliLavorazioneRESTConsumer(SettingsManager settingsManager) {
|
||||
return new ColliLavorazioneRESTConsumer(settingsManager);
|
||||
ColliLavorazioneRESTConsumer provideColliLavorazioneRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService, SettingsManager settingsManager) {
|
||||
return new ColliLavorazioneRESTConsumer(restBuilder, executorService, settingsManager);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MagazzinoAutomaticoRESTConsumer provideMagazzinoAutomaticoRESTConsumer() {
|
||||
return new MagazzinoAutomaticoRESTConsumer();
|
||||
MagazzinoAutomaticoRESTConsumer provideMagazzinoAutomaticoRESTConsumer(ExecutorService executorService, RESTBuilder restBuilder) {
|
||||
return new MagazzinoAutomaticoRESTConsumer(executorService, restBuilder);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MagazzinoBufferRESTConsumer provideMagazzinoBufferRESTConsumer() {
|
||||
return new MagazzinoBufferRESTConsumer();
|
||||
MagazzinoBufferRESTConsumer provideMagazzinoBufferRESTConsumer(RESTBuilder restBuilder) {
|
||||
return new MagazzinoBufferRESTConsumer(restBuilder);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MaterialiRESTConsumer provideMaterialiRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
|
||||
return new MaterialiRESTConsumer(restBuilder, executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
SoundAlertService provideSoundAlertService() {
|
||||
SoundAlertService soundAlertService = new SoundAlertService(mApplication.getApplicationContext());
|
||||
soundAlertService.init();
|
||||
return soundAlertService;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,15 +4,19 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -26,6 +30,7 @@ import it.integry.integrywmsnative.databinding.ActivitySplashBinding;
|
||||
import it.integry.integrywmsnative.gest.login.LoginActivity;
|
||||
import it.integry.integrywmsnative.gest.main.MainActivity;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.device_end_of_life.DialogDeviceEndOfLifeView;
|
||||
|
||||
public class SplashActivity extends BaseActivity implements MainContext.Listener {
|
||||
|
||||
@@ -37,6 +42,9 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
|
||||
@Inject
|
||||
MainContext mainContext;
|
||||
|
||||
@Inject
|
||||
Handler handler;
|
||||
|
||||
private RunnableArgsss<Integer, String[], List<Integer>> onRequestPermissionResult;
|
||||
|
||||
public static void startActivity(Context context) {
|
||||
@@ -61,9 +69,24 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
|
||||
|
||||
UtilityContext.initMainActivity(this);
|
||||
|
||||
LocalDate endSupportDate = LocalDate.of(2026, 1, 31);
|
||||
|
||||
boolean isOldAndroid = Build.VERSION.SDK_INT < Build.VERSION_CODES.O;
|
||||
|
||||
executorService.execute(() -> {
|
||||
|
||||
if (isOldAndroid)
|
||||
showDeviceEndOfLifeMessage();
|
||||
|
||||
handler.post(() -> {
|
||||
if (LocalDate.now().isBefore(endSupportDate) || !isOldAndroid) {
|
||||
initAppVersion();
|
||||
initPermissions(this::init);
|
||||
} else {
|
||||
this.finish();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private void initAppVersion() {
|
||||
@@ -101,14 +124,29 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void showDeviceEndOfLifeMessage() {
|
||||
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
|
||||
DialogDeviceEndOfLifeView.newInstance(latch::countDown)
|
||||
.show(this.getSupportFragmentManager(), "dialog_device_end_of_life");
|
||||
|
||||
try {
|
||||
latch.await();
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDBDataLoading(String item) {
|
||||
mBinding.loadingInfoTextview.setText("Caricamento " + item);
|
||||
handler.post(() -> mBinding.loadingInfoTextview.setText("Caricamento " + item));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMenuLoading() {
|
||||
mBinding.loadingInfoTextview.setText("Caricamento menù");
|
||||
handler.post(() -> mBinding.loadingInfoTextview.setText("Caricamento menù"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -151,11 +189,13 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
|
||||
|
||||
@Override
|
||||
public void onError(Spanned message) {
|
||||
|
||||
DialogSimpleMessageView.makeErrorDialog(
|
||||
handler.post(() -> {
|
||||
DialogSimpleMessageView.makeErrorDialog(this,
|
||||
message, null, this::finish, R.string.logout, () -> {
|
||||
this.mainContext.logout(MainApplication::exit);
|
||||
})
|
||||
.show(this.getSupportFragmentManager(), "tag");
|
||||
.show();
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,19 +24,4 @@ public class CommonConst {
|
||||
public static String RECOVER_COLLO_FILE = "recover_ul.json";
|
||||
}
|
||||
|
||||
public static class Mail {
|
||||
|
||||
public static String[] forErrorsDebug = {
|
||||
"g.scorrano@integry.it",
|
||||
"v.castellana@integry.it"
|
||||
};
|
||||
|
||||
public static String[] forErrors = {
|
||||
// "syslogs@integry.it",
|
||||
"g.scorrano@integry.it",
|
||||
"v.castellana@integry.it"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package it.integry.integrywmsnative.core.authentication;
|
||||
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.Jws;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.io.Decoders;
|
||||
import io.jsonwebtoken.security.Keys;
|
||||
|
||||
public class JwtUtils {
|
||||
|
||||
private final static String SIGNING_KEY = "gICy3bjD56i/YFnBZZKe5ibiz3Snsp08nybGGziCV4ZcvyXBbyqWUnJ2wTrRXhOuf/xdljPXX0yBaqdAgvKthQ==";
|
||||
|
||||
public static Claims parseJwt(String token) {
|
||||
Jws<Claims> jws = Jwts.parser()
|
||||
.verifyWith(Keys.hmacShaKeyFor(Decoders.BASE64.decode(SIGNING_KEY)))
|
||||
.build()
|
||||
.parseSignedClaims(token);
|
||||
|
||||
return jws.getPayload();
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ public class BarcodeCallbackDTO {
|
||||
|
||||
private int ID = -1;
|
||||
|
||||
private boolean enabled = true;
|
||||
private RunnableArgs<BarcodeScanDTO> onScanSuccessfull;
|
||||
private RunnableArgs<Exception> onScanFailed;
|
||||
|
||||
@@ -19,6 +20,15 @@ public class BarcodeCallbackDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public BarcodeCallbackDTO setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<BarcodeScanDTO> getOnScanSuccessfull() {
|
||||
return onScanSuccessfull;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.barcode_reader;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
@@ -24,10 +25,15 @@ public class BarcodeManager {
|
||||
private static BarcodeReaderInterface mCurrentBarcodeInterface;
|
||||
private static final List<BarcodeCallbackDTO> mBarcodeCallbacksStacktrace = new ArrayList<>();
|
||||
|
||||
private static boolean mEnabled = true;
|
||||
// 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 {
|
||||
@@ -56,12 +62,12 @@ public class BarcodeManager {
|
||||
|
||||
mCurrentBarcodeInterface.register(data -> {
|
||||
BarcodeCallbackDTO callback = getValidCallback();
|
||||
if (callback != null && mEnabled) {
|
||||
if (callback != null && callback.isEnabled()) {
|
||||
callback.getOnScanSuccessfull().run(data);
|
||||
}
|
||||
}, ex -> {
|
||||
BarcodeCallbackDTO callback = getValidCallback();
|
||||
if (callback != null && mEnabled) {
|
||||
if (callback != null && callback.isEnabled()) {
|
||||
callback.getOnScanFailed().run(ex);
|
||||
}
|
||||
});
|
||||
@@ -85,7 +91,7 @@ public class BarcodeManager {
|
||||
|
||||
private static BarcodeCallbackDTO getValidCallback() {
|
||||
|
||||
if (mBarcodeCallbacksStacktrace.size() > 0) {
|
||||
if (!mBarcodeCallbacksStacktrace.isEmpty()) {
|
||||
return mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1);
|
||||
} else {
|
||||
return null;
|
||||
@@ -103,10 +109,9 @@ public class BarcodeManager {
|
||||
}
|
||||
|
||||
public static int addCallback(BarcodeCallbackDTO barcodeCallbackDTO) {
|
||||
|
||||
int newID = -1;
|
||||
|
||||
if (mBarcodeCallbacksStacktrace.size() > 0) {
|
||||
if (!mBarcodeCallbacksStacktrace.isEmpty()) {
|
||||
newID = mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1).getID() + 1;
|
||||
} else {
|
||||
newID = 1;
|
||||
@@ -133,18 +138,48 @@ public class BarcodeManager {
|
||||
}
|
||||
|
||||
|
||||
public static void disable() {
|
||||
mEnabled = false;
|
||||
// UtilityLogger.info("Barcode reader disabled");
|
||||
public static void disable(int instanceId) {
|
||||
mBarcodeCallbacksStacktrace.stream().filter(x -> x.getID() == instanceId)
|
||||
.findFirst().ifPresent(x -> {
|
||||
x.setEnabled(false);
|
||||
Log.d("BarcodeManager", "Disabled callback " + x.getID() + ": " + x.getOnScanSuccessfull());
|
||||
});
|
||||
}
|
||||
|
||||
public static void enable() {
|
||||
mEnabled = true;
|
||||
// UtilityLogger.info("Barcode reader enabled");
|
||||
public static void disableLastCallback() {
|
||||
BarcodeCallbackDTO validCallback = getValidCallback();
|
||||
if (validCallback != null) {
|
||||
validCallback.setEnabled(false);
|
||||
// Log.d("BarcodeManager", "Last callback disabled: " + validCallback.getOnScanSuccessfull());
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isEnabled() {
|
||||
return mEnabled;
|
||||
public static void enable(int instanceId) {
|
||||
mBarcodeCallbacksStacktrace.stream().filter(x -> x.getID() == instanceId)
|
||||
.findFirst()
|
||||
.ifPresent(x -> {
|
||||
x.setEnabled(true);
|
||||
// Log.d("BarcodeManager", "Enabled callback " + x.getID() + ": " + x.getOnScanSuccessfull());
|
||||
});
|
||||
}
|
||||
|
||||
public static void enableLastCallback() {
|
||||
BarcodeCallbackDTO validCallback = getValidCallback();
|
||||
if (validCallback != null) {
|
||||
validCallback.setEnabled(true);
|
||||
Log.d("BarcodeManager", "Last callback enabled: " + validCallback.getOnScanSuccessfull());
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isEnabled(int instanceId) {
|
||||
return mBarcodeCallbacksStacktrace.stream().filter(x -> x.getID() == instanceId)
|
||||
.findFirst()
|
||||
.map(BarcodeCallbackDTO::isEnabled)
|
||||
.orElse(false);
|
||||
}
|
||||
|
||||
public static boolean isLastCallbackEnabled() {
|
||||
return getValidCallback() != null && getValidCallback().isEnabled();
|
||||
}
|
||||
|
||||
public static void changeSettings(List<Pair<String, Object>> settings) {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package it.integry.integrywmsnative.core.base;
|
||||
|
||||
public interface Callable<I, O> {
|
||||
O call(I input);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package it.integry.integrywmsnative.core.base;
|
||||
|
||||
public interface CallableII<I, L, O> {
|
||||
O call(I input, L input2);
|
||||
}
|
||||
@@ -2,8 +2,10 @@ 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.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.MainAccettazioneBollaElencoFragment;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazioneOrdiniElencoFragment;
|
||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaFragment;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniFragment;
|
||||
import it.integry.integrywmsnative.gest.inventario.ElencoInventariFragment;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoFragment;
|
||||
@@ -13,11 +15,14 @@ import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisogn
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.ProdLineeProduzioneFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.ProdRiposizionamentoDaProdFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale_su_mag_prossimita.ProdVersamentoMaterialeInBufferFragment;
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaFragment;
|
||||
import it.integry.integrywmsnative.gest.pv_verifica_giacenze.VerificaGiacenzeFragment;
|
||||
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.trasferimento_pedane.TrasferimentoPedaneFragment;
|
||||
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;
|
||||
@@ -85,7 +90,8 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleText(R.string.free_picking)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_picking_libero)
|
||||
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.VENDITA)))
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_picking, GestioneEnum.VENDITA,
|
||||
SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false, false)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_resi_cliente)
|
||||
@@ -113,7 +119,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleText(R.string.prod_ordine_lavorazione_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_lavorazione)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, null)))
|
||||
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, SettingsManager.iDB().isFlagProduzioneShowInfo() ? DialogInfoSituazioneArticoloView.class : null)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_free_lav_picking)
|
||||
@@ -121,7 +127,8 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleText(R.string.free_lav_picking)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
|
||||
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.LAVORAZIONE)))
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_lav_picking, GestioneEnum.LAVORAZIONE,
|
||||
SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false, SettingsManager.iDB().isFlagAskCommessaInPickingLiberoLav())))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_posizionamento_da_ord)
|
||||
@@ -170,6 +177,22 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_materiale)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdVersamentoMaterialeInBufferFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_versamento_su_ordine)
|
||||
.setCodMenu("MG068")
|
||||
.setTitleText(R.string.prod_versamento_su_ordine_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_su_ord)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.prod_versamento_su_ordine_title_fragment, GestioneEnum.LAVORAZIONE, false, true, false)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_riposizionamento_da_ord)
|
||||
.setCodMenu("MG069")
|
||||
.setTitleText(R.string.prod_riposizionamento_da_prod_title)
|
||||
.setTitleIcon(R.drawable.ic_production_line_produzione)
|
||||
.setDrawerIcon(R.drawable.ic_black_load_shelf)
|
||||
.setFragmentFactory(ProdRiposizionamentoDaProdFragment::newInstance))
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
.setGroupText(R.string.internal_handling)
|
||||
@@ -200,6 +223,21 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setDrawerIcon(R.drawable.ic_black_empty_box)
|
||||
.setFragmentFactory(ElencoInventariFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_articoli_in_giacenza)
|
||||
.setCodMenu("MG070")
|
||||
.setTitleText(R.string.articoli_in_giacenza_title)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_articoli_in_giacenza)
|
||||
.setDrawerIcon(R.drawable.ic_black_empty_box)
|
||||
.setFragmentFactory(ArticoliInGiacenzaFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_trasferimento_pedane)
|
||||
.setCodMenu("MG076")
|
||||
.setTitleText(R.string.trasferimento_pedane_title)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_trasferimento_pedane)
|
||||
.setDrawerIcon(R.drawable.ic_black_empty_box)
|
||||
.setFragmentFactory(TrasferimentoPedaneFragment::newInstance))
|
||||
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
@@ -214,6 +252,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.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)
|
||||
@@ -222,6 +261,14 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setDrawerIcon(R.drawable.ic_documents_outline)
|
||||
.setFragmentFactory(DocInterniFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setCodMenu("MG075")
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_pv_verifica_giacenze)
|
||||
.setTitleText(R.string.verifica_giacenze_menu)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_verifica_giacenze)
|
||||
.setDrawerIcon(R.drawable.ic_drawer_verifica_giacenze)
|
||||
.setFragmentFactory(VerificaGiacenzeFragment::newInstance))
|
||||
|
||||
// .addItem(new MenuItem()
|
||||
// .setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto_trasmessi)
|
||||
// .setTitleText(it.integry.integrywmsnative.R.string.transmitted_orders)
|
||||
|
||||
@@ -89,11 +89,25 @@ public class AppContext {
|
||||
private void initLogger() {
|
||||
Logger.addLogAdapter(new AndroidLogAdapter());
|
||||
|
||||
logsFolder = new File(mApplicationContext.getExternalFilesDir(null).getAbsolutePath());
|
||||
int maxBytesSize = 5 * 1024 * 1024;
|
||||
Logger.addLogAdapter(new DiskLogAdapter(logsFolder, maxBytesSize));
|
||||
File dataDir = mApplicationContext.getExternalFilesDir(null);
|
||||
|
||||
logsFolder = new File(dataDir, "logs");
|
||||
|
||||
if (!logsFolder.exists())
|
||||
logsFolder.mkdirs();
|
||||
|
||||
//Temporary clean
|
||||
File[] wrongFilesToBeDeleted = dataDir.listFiles((file, s) -> s.startsWith("logs_"));
|
||||
|
||||
if (wrongFilesToBeDeleted != null)
|
||||
for (File fileToDelete : wrongFilesToBeDeleted) {
|
||||
fileToDelete.delete();
|
||||
}
|
||||
|
||||
removeOldLogs(logsFolder);
|
||||
|
||||
int maxBytesSize = 5 * 1024 * 1024;
|
||||
Logger.addLogAdapter(new DiskLogAdapter(logsFolder, maxBytesSize));
|
||||
}
|
||||
|
||||
private void removeOldLogs(File logsFolder) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.context;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
@@ -9,16 +10,16 @@ import android.text.SpannedString;
|
||||
import com.google.firebase.installations.FirebaseInstallations;
|
||||
|
||||
import java.net.ConnectException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
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;
|
||||
import it.integry.integrywmsnative.gest.login.rest.AuthenticationRESTConsumer;
|
||||
|
||||
@Singleton
|
||||
public class MainContext {
|
||||
@@ -26,19 +27,24 @@ public class MainContext {
|
||||
private final Context applicationContext;
|
||||
private final MenuService menuService;
|
||||
private final AppDatabase appDatabase;
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
private final AuthenticationRESTConsumer authenticationRESTConsumer;
|
||||
private final ExecutorService executorService;
|
||||
private final Handler handler;
|
||||
private final ServerStatusChecker serverStatusChecker;
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
public MainContext(Context applicationContext, MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer) {
|
||||
public MainContext(Context applicationContext, MenuService menuService, AppDatabase appDatabase, AuthenticationRESTConsumer authenticationRESTConsumer, ExecutorService executorService, Handler handler, ServerStatusChecker serverStatusChecker) {
|
||||
this.applicationContext = applicationContext;
|
||||
this.menuService = menuService;
|
||||
this.appDatabase = appDatabase;
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
this.authenticationRESTConsumer = authenticationRESTConsumer;
|
||||
this.executorService = executorService;
|
||||
this.handler = handler;
|
||||
this.serverStatusChecker = serverStatusChecker;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
|
||||
try {
|
||||
BarcodeManager.init(applicationContext);
|
||||
} catch (Exception exception) {
|
||||
@@ -46,20 +52,39 @@ public class MainContext {
|
||||
}
|
||||
|
||||
|
||||
this.initDeviceId(() -> {
|
||||
this.initDBData(() -> {
|
||||
this.initMenu(() -> {
|
||||
executorService.execute(() -> {
|
||||
|
||||
try {
|
||||
this.initDBData();
|
||||
this.initMenu();
|
||||
serverStatusChecker.init();
|
||||
|
||||
if (mListener != null) mListener.onContextInitialized();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
} catch (Exception ex) {
|
||||
Spanned message = null;
|
||||
|
||||
this.initServerStatusChecker();
|
||||
|
||||
if (ex.getCause() != null && ex.getCause() instanceof ConnectException) {
|
||||
message = Html.fromHtml("Impossibile collegarsi all'host <b>" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "</b>. Riprovare più tardi.");
|
||||
} else if (ex.getMessage().startsWith("Status 404:")) {
|
||||
message = Html.fromHtml("Errore 404. Non è stato possibile soddisfare la richiesta sull'host <b>" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "</b>. Riprovare più tardi.");
|
||||
} else {
|
||||
message = new SpannableString(ex.getMessage());
|
||||
}
|
||||
|
||||
if (mListener != null) mListener.onError(message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void initAuthSession(Runnable onComplete) {
|
||||
this.authenticationRESTConsumer.me(obj -> {
|
||||
onComplete.run();
|
||||
}, ex -> {
|
||||
if (mListener != null) mListener.onError(new SpannedString(ex.getMessage()));
|
||||
});
|
||||
}
|
||||
|
||||
private void initDeviceId(Runnable onComplete) {
|
||||
if (SettingsManager.i().getUserSession().getDeviceId() != null) {
|
||||
@@ -72,61 +97,39 @@ public class MainContext {
|
||||
SettingsManager.i().getUserSession().setDeviceId(fid.getResult());
|
||||
SettingsManager.update();
|
||||
|
||||
systemRESTConsumer.registerDevice(onComplete, ex -> {
|
||||
if (mListener != null) mListener.onError(new SpannedString(ex.getMessage()));
|
||||
});
|
||||
// systemRESTConsumer.registerDevice(onComplete, ex -> {
|
||||
// if (mListener != null) mListener.onError(new SpannedString(ex.getMessage()));
|
||||
// });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void logout(Runnable onLoggedOut) {
|
||||
menuService.invalidateCache();
|
||||
UtilityThread.executeParallel(() -> {
|
||||
executorService.execute(() -> {
|
||||
SettingsManager.i().setUser(null);
|
||||
SettingsManager.i().setUserSession(null);
|
||||
SettingsManager.update();
|
||||
appDatabase.clearAllTables();
|
||||
|
||||
handler.post(() -> {
|
||||
onLoggedOut.run();
|
||||
}, true);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private void initServerStatusChecker() {
|
||||
ServerStatusChecker.init();
|
||||
}
|
||||
|
||||
private void initDBData(Runnable onComplete) {
|
||||
|
||||
private void initDBData() throws Exception {
|
||||
|
||||
SettingsManager.loadDBVariables(item -> {
|
||||
if (mListener != null) mListener.onDBDataLoading(item);
|
||||
},
|
||||
onComplete,
|
||||
ex -> {
|
||||
|
||||
Spanned message = null;
|
||||
|
||||
if (ex.getCause() != null && ex.getCause() instanceof ConnectException) {
|
||||
message = Html.fromHtml("Impossibile collegarsi all'host <b>" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "</b>. Riprovare più tardi.");
|
||||
} else if (ex.getMessage().startsWith("Status 404:")) {
|
||||
message = Html.fromHtml("Errore 404. Non è stato possibile soddisfare la richiesta sull'host <b>" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "</b>. Riprovare più tardi.");
|
||||
} else {
|
||||
message = new SpannableString(ex.getMessage());
|
||||
}
|
||||
|
||||
if (mListener != null) mListener.onError(message);
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private void initMenu(Runnable onComplete) {
|
||||
if (mListener != null) mListener.onMenuLoading();
|
||||
this.menuService.init(onComplete, ex -> {
|
||||
if (mListener != null) mListener.onError(new SpannedString(ex.getMessage()));
|
||||
});
|
||||
}
|
||||
|
||||
private void initMenu() throws Exception {
|
||||
if (mListener != null) mListener.onMenuLoading();
|
||||
this.menuService.init();
|
||||
}
|
||||
|
||||
|
||||
public MainContext setListener(Listener listener) {
|
||||
this.mListener = listener;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class DataCache {
|
||||
|
||||
Object foundDataCache = null;
|
||||
|
||||
if(dataCacheTemp != null && dataCacheTemp.size() > 0) {
|
||||
if(dataCacheTemp != null && !dataCacheTemp.isEmpty()) {
|
||||
foundDataCache = dataCacheTemp.get(0).getItem();
|
||||
dataCacheList.remove(dataCacheTemp.get(0));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package it.integry.integrywmsnative.core.data_recover;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
@@ -7,13 +10,26 @@ import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
|
||||
public class ColliDataRecoverDTO {
|
||||
|
||||
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
|
||||
@SerializedName("numCollo")
|
||||
private int numCollo;
|
||||
|
||||
@SerializedName("serCollo")
|
||||
private String serCollo;
|
||||
private String dataCollo;
|
||||
|
||||
@SerializedName("dataCollo")
|
||||
private LocalDate dataCollo;
|
||||
|
||||
@SerializedName("gestioneCollo")
|
||||
private String gestioneCollo;
|
||||
|
||||
@SerializedName("filtro")
|
||||
private String filtro;
|
||||
|
||||
@SerializedName("testateOrdini")
|
||||
private List<OrdineUscitaInevasoDTO> testateOrdini;
|
||||
|
||||
public int getId() {
|
||||
@@ -43,11 +59,11 @@ public class ColliDataRecoverDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDataCollo() {
|
||||
public LocalDate getDataCollo() {
|
||||
return dataCollo;
|
||||
}
|
||||
|
||||
public ColliDataRecoverDTO setDataCollo(String dataCollo) {
|
||||
public ColliDataRecoverDTO setDataCollo(LocalDate dataCollo) {
|
||||
this.dataCollo = dataCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package it.integry.integrywmsnative.core.data_recover;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.android.gms.common.util.IOUtils;
|
||||
import com.google.gson.Gson;
|
||||
@@ -14,6 +13,7 @@ import java.io.InputStream;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -22,6 +22,7 @@ import javax.inject.Singleton;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityGson;
|
||||
|
||||
@Singleton
|
||||
public class ColliDataRecoverService {
|
||||
@@ -45,7 +46,7 @@ public class ColliDataRecoverService {
|
||||
}
|
||||
|
||||
public boolean thereIsAnExistantSession() {
|
||||
return mtbColtsSessions != null && mtbColtsSessions.size() > 0;
|
||||
return mtbColtsSessions != null && !mtbColtsSessions.isEmpty();
|
||||
}
|
||||
|
||||
public List<Integer> getAllSessionIDs() {
|
||||
@@ -64,9 +65,9 @@ public class ColliDataRecoverService {
|
||||
}
|
||||
|
||||
private ColliDataRecoverDTO getIfExists(int id) {
|
||||
Optional<ColliDataRecoverDTO> recoverDTOOptional = Stream.of(mtbColtsSessions)
|
||||
Optional<ColliDataRecoverDTO> recoverDTOOptional = mtbColtsSessions.stream()
|
||||
.filter(x -> x.getId() == id)
|
||||
.findSingle();
|
||||
.findFirst();
|
||||
|
||||
|
||||
return recoverDTOOptional.isPresent() ? recoverDTOOptional.get() : null;
|
||||
@@ -84,7 +85,7 @@ public class ColliDataRecoverService {
|
||||
|
||||
ColliDataRecoverDTO recoverDTO = new ColliDataRecoverDTO()
|
||||
.setId(newId)
|
||||
.setDataCollo(mtbColtSession.getDataColloS())
|
||||
.setDataCollo(mtbColtSession.getDataColloLD())
|
||||
.setNumCollo(mtbColtSession.getNumCollo())
|
||||
.setSerCollo(mtbColtSession.getSerCollo())
|
||||
.setGestioneCollo(mtbColtSession.getGestione())
|
||||
@@ -108,7 +109,7 @@ public class ColliDataRecoverService {
|
||||
|
||||
private void loadLocalFile() {
|
||||
InputStream inputStream;
|
||||
Gson gson = new Gson();
|
||||
Gson gson = UtilityGson.createObject();
|
||||
|
||||
try {
|
||||
inputStream = mApplicationContext.openFileInput(CommonConst.Files.RECOVER_COLLO_FILE);
|
||||
@@ -130,7 +131,7 @@ public class ColliDataRecoverService {
|
||||
private void updateLocalFile() {
|
||||
FileOutputStream outputStream;
|
||||
|
||||
Gson gson = new Gson();
|
||||
Gson gson = UtilityGson.createObject();
|
||||
String jsonText = gson.toJson(mtbColtsSessions);
|
||||
|
||||
try {
|
||||
|
||||
@@ -22,14 +22,22 @@ 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.dao.TrasferimentoPedaneDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.TrasferimentoPedaneRowDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.VerificaGiacenzeDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.VerificaGiacenzeRowDao;
|
||||
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.InventarioEntity;
|
||||
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;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.TrasferimentoPedaneEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.TrasferimentoPedaneRowEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.VerificaGiacenzeEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.VerificaGiacenzeRowEntity;
|
||||
|
||||
@Database(entities = {
|
||||
ArticoloGriglia.class,
|
||||
@@ -38,10 +46,14 @@ import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
ArticoloOrdine.class,
|
||||
SqlMtbColt.class,
|
||||
SqlMtbColr.class,
|
||||
InventarioRoomDTO.class,
|
||||
InventarioRowRoomDTO.class
|
||||
InventarioEntity.class,
|
||||
InventarioRowRoomDTO.class,
|
||||
VerificaGiacenzeEntity.class,
|
||||
VerificaGiacenzeRowEntity.class,
|
||||
TrasferimentoPedaneEntity.class,
|
||||
TrasferimentoPedaneRowEntity.class
|
||||
},
|
||||
version = 17)
|
||||
version = 21)
|
||||
@TypeConverters({
|
||||
DateConverter.class,
|
||||
BigDecimalConverter.class,
|
||||
@@ -70,7 +82,11 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
.addMigrations(MIGRATION_13_14)
|
||||
.addMigrations(MIGRATION_14_15)
|
||||
.addMigrations(MIGRATION_15_16)
|
||||
.addMigrations(MIGRATION_16_17);
|
||||
.addMigrations(MIGRATION_16_17)
|
||||
.addMigrations(MIGRATION_17_18)
|
||||
.addMigrations(MIGRATION_18_19)
|
||||
.addMigrations(MIGRATION_19_20)
|
||||
.addMigrations(MIGRATION_20_21);
|
||||
|
||||
sInstance = builder.build();
|
||||
}
|
||||
@@ -95,6 +111,14 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
|
||||
public abstract InventarioRowDao inventarioRowDao();
|
||||
|
||||
public abstract VerificaGiacenzeDao verificaGiacenzeDao();
|
||||
|
||||
public abstract VerificaGiacenzeRowDao verificaGiacenzeRowDao();
|
||||
|
||||
public abstract TrasferimentoPedaneDao trasferimentoPedaneDao();
|
||||
|
||||
public abstract TrasferimentoPedaneRowDao trasferimentoPedaneRowDao();
|
||||
|
||||
|
||||
|
||||
static final Migration MIGRATION_10_11 = new Migration(10, 11) {
|
||||
@@ -161,11 +185,13 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
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) {
|
||||
@@ -182,4 +208,93 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
database.execSQL("DROP TABLE _inventario_rows_old;");
|
||||
}
|
||||
};
|
||||
|
||||
static final Migration MIGRATION_17_18 = new Migration(17, 18) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS verifica_giacenze (_id INTEGER PRIMARY KEY AUTOINCREMENT, cod_mdep TEXT NOT NULL, data INTEGER, remote_sync_date INTEGER);");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_verifica_giacenze__id ON verifica_giacenze (_id);");
|
||||
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS verifica_giacenze_rows (" +
|
||||
"_id INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
"parent_id INTEGER, " +
|
||||
"created_at INTEGER DEFAULT CURRENT_TIMESTAMP, " +
|
||||
"cod_mart TEXT, " +
|
||||
"partita_mag TEXT, " +
|
||||
"descrizione TEXT, " +
|
||||
"qta_in_giacenza REAL NOT NULL DEFAULT 0, " +
|
||||
"qta REAL NOT NULL DEFAULT 0, " +
|
||||
"num_cnf REAL NOT NULL DEFAULT 0, " +
|
||||
"qta_cnf REAL NOT NULL DEFAULT 0, " +
|
||||
"scan_cod_barre TEXT, " +
|
||||
"remote_sync_date INTEGER, " +
|
||||
"FOREIGN KEY(parent_id) REFERENCES verifica_giacenze(_id) ON UPDATE NO ACTION ON DELETE CASCADE );");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_verifica_giacenze_rows__id ON verifica_giacenze_rows (_id)");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_verifica_giacenze_rows_parent_id ON verifica_giacenze_rows (parent_id)");
|
||||
}
|
||||
};
|
||||
|
||||
static final Migration MIGRATION_18_19 = new Migration(18, 19) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS trasferimento_pedane (" +
|
||||
"cod_mdep_dest TEXT NOT NULL, " +
|
||||
"descrizione_depo_dest TEXT NOT NULL, " +
|
||||
"created_at INTEGER DEFAULT CURRENT_TIMESTAMP, " +
|
||||
"status INTEGER NOT NULL, " +
|
||||
"_id INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
"remote_sync_date INTEGER);");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_trasferimento_pedane__id ON trasferimento_pedane (_id);");
|
||||
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS trasferimento_pedane_rows (" +
|
||||
"parent_id INTEGER, " +
|
||||
"barcode_ul TEXT NOT NUll, " +
|
||||
"progressivo_ul INTEGER, " +
|
||||
"created_at INTEGER DEFAULT CURRENT_TIMESTAMP, " +
|
||||
"flag_inconsistent INTEGER NOT NULL DEFAULT 0, " +
|
||||
"_id INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
"remote_sync_date INTEGER," +
|
||||
"FOREIGN KEY(parent_id) REFERENCES trasferimento_pedane(_id) ON UPDATE NO ACTION ON DELETE CASCADE );");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_trasferimento_pedane_rows__id ON trasferimento_pedane_rows (_id)");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_trasferimento_pedane_rows_parent_id ON trasferimento_pedane_rows (parent_id)");
|
||||
}
|
||||
};
|
||||
|
||||
static final Migration MIGRATION_19_20 = new Migration(19, 20) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("DROP TABLE IF EXISTS trasferimento_pedane_rows;");
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS trasferimento_pedane_rows (" +
|
||||
"parent_id INTEGER NOT NULL, " +
|
||||
"barcode_ul TEXT NOT NULL, " +
|
||||
"progressivo_ul INTEGER NOT NULL, " +
|
||||
"flag_inconsistent INTEGER NOT NULL DEFAULT 0, " +
|
||||
"created_at INTEGER DEFAULT CURRENT_TIMESTAMP, " +
|
||||
"_id INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
"remote_sync_date INTEGER, " +
|
||||
"FOREIGN KEY(parent_id) REFERENCES trasferimento_pedane(_id) ON UPDATE NO ACTION ON DELETE CASCADE );");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_trasferimento_pedane_rows__id ON trasferimento_pedane_rows (_id)");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_trasferimento_pedane_rows_parent_id ON trasferimento_pedane_rows (parent_id)");
|
||||
}
|
||||
};
|
||||
|
||||
static final Migration MIGRATION_20_21 = new Migration(20, 21) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("ALTER TABLE trasferimento_pedane"
|
||||
+ " ADD COLUMN document_cod_anag TEXT;");
|
||||
|
||||
database.execSQL("ALTER TABLE trasferimento_pedane"
|
||||
+ " ADD COLUMN document_cod_dtip TEXT");
|
||||
|
||||
database.execSQL("ALTER TABLE trasferimento_pedane"
|
||||
+ " ADD COLUMN document_num INTEGER");
|
||||
|
||||
database.execSQL("ALTER TABLE trasferimento_pedane"
|
||||
+ " ADD COLUMN document_ser TEXT");
|
||||
|
||||
database.execSQL("ALTER TABLE trasferimento_pedane"
|
||||
+ " ADD COLUMN document_data INTEGER");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,6 +18,10 @@ 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.dao.TrasferimentoPedaneDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.TrasferimentoPedaneRowDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.VerificaGiacenzeDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.VerificaGiacenzeRowDao;
|
||||
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;
|
||||
@@ -32,10 +36,17 @@ import it.integry.integrywmsnative.core.data_store.db.repository.datasource.SqlM
|
||||
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.VerificaGiacenzeRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGiacenzeRowRepository;
|
||||
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.data_store.db.respository_new.data_source.VerificaGiacenzeLocalDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.data_source.VerificaGiacenzeRowLocalDataSource;
|
||||
import it.integry.integrywmsnative.core.mapper.InventarioMapper;
|
||||
import it.integry.integrywmsnative.core.mapper.InventarioRowMapper;
|
||||
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeMapper;
|
||||
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeRowMapper;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaPvRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.InventarioRESTConsumer;
|
||||
|
||||
@Module
|
||||
@@ -108,6 +119,11 @@ public class RoomModule {
|
||||
return appDatabase.inventarioRowDao();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
InventarioMapper providesInventarioMapper(InventarioRowMapper inventarioRowMapper) {
|
||||
return new InventarioMapper(inventarioRowMapper);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
@@ -117,8 +133,38 @@ public class RoomModule {
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
InventarioMapper providesInventarioMapper(InventarioRowMapper inventarioRowMapper) {
|
||||
return new InventarioMapper(inventarioRowMapper);
|
||||
VerificaGiacenzeDao providesVerificaGiacenzeDao(AppDatabase appDatabase) {
|
||||
return appDatabase.verificaGiacenzeDao();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
VerificaGiacenzeRowDao providesVerificaGiacenzeRowDao(AppDatabase appDatabase) {
|
||||
return appDatabase.verificaGiacenzeRowDao();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
TrasferimentoPedaneDao providesTrasferimentoPedaneDao(AppDatabase appDatabase) {
|
||||
return appDatabase.trasferimentoPedaneDao();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
TrasferimentoPedaneRowDao providesTrasferimentoPedaneRowDao(AppDatabase appDatabase) {
|
||||
return appDatabase.trasferimentoPedaneRowDao();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
VerificaGiacenzeMapper providesVerificaGiacenzeMapper(VerificaGiacenzeRowMapper verificaGiacenzeRowMapper) {
|
||||
return new VerificaGiacenzeMapper(verificaGiacenzeRowMapper);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
VerificaGiacenzeRowMapper providesVerificaGiacenzeRowMapper() {
|
||||
return new VerificaGiacenzeRowMapper();
|
||||
}
|
||||
|
||||
|
||||
@@ -182,4 +228,20 @@ public class RoomModule {
|
||||
return new InventarioRowRepository(inventarioRowLocalDataSource, inventarioRESTConsumer, inventarioRowMapper, handler);
|
||||
}
|
||||
|
||||
@Provides
|
||||
VerificaGiacenzeRepository providesVerificaGiacenzeRepository(ExecutorService executorService, Handler handler,
|
||||
VerificaGiacenzeLocalDataSource verificaGiacenzeLocalDataSource,
|
||||
GiacenzaPvRESTConsumer giacenzaPvRESTConsumer,
|
||||
VerificaGiacenzeMapper verificaGiacenzeMapper) {
|
||||
return new VerificaGiacenzeRepository(verificaGiacenzeLocalDataSource, giacenzaPvRESTConsumer, verificaGiacenzeMapper, handler, executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
VerificaGiacenzeRowRepository providesVerificaGiacenzeRowRepository(ExecutorService executorService, Handler handler,
|
||||
VerificaGiacenzeRowLocalDataSource verificaGiacenzeRowLocalDataSource,
|
||||
GiacenzaPvRESTConsumer giacenzaPvRESTConsumer,
|
||||
VerificaGiacenzeRowMapper verificaGiacenzeRowMapper) {
|
||||
return new VerificaGiacenzeRowRepository(verificaGiacenzeRowLocalDataSource, giacenzaPvRESTConsumer, verificaGiacenzeRowMapper, handler, executorService);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,21 +7,21 @@ 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.entity.InventarioEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityDaoInterface;
|
||||
|
||||
@Dao
|
||||
public interface InventarioDao extends EntityDaoInterface<InventarioRoomDTO> {
|
||||
public interface InventarioDao extends EntityDaoInterface<InventarioEntity> {
|
||||
|
||||
|
||||
@Query("SELECT * FROM " + InventarioRoomDTO.TABLE_NAME +
|
||||
@Query("SELECT * FROM " + InventarioEntity.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))")
|
||||
List<InventarioRoomDTO> selectAll(boolean toBeSync);
|
||||
List<InventarioEntity> selectAll(boolean toBeSync);
|
||||
|
||||
|
||||
@Query("SELECT * FROM " + InventarioRoomDTO.TABLE_NAME +
|
||||
@Query("SELECT * FROM " + InventarioEntity.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);
|
||||
" ORDER BY " + InventarioEntity.Columns.DATA_INVENTARIO + " DESC")
|
||||
Flowable<List<InventarioEntity>> selectAllFlowable(boolean toBeSync);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.Transaction;
|
||||
|
||||
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.TrasferimentoPedaneEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityDaoInterface;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.TrasferimentoPedaneWithRowsWrapper;
|
||||
|
||||
@Dao
|
||||
public interface TrasferimentoPedaneDao extends EntityDaoInterface<TrasferimentoPedaneEntity> {
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM " + TrasferimentoPedaneEntity.TABLE_NAME +
|
||||
" WHERE " + BaseSyncDTO.Columns.ID + " = :id")
|
||||
TrasferimentoPedaneWithRowsWrapper select(long id);
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM " + TrasferimentoPedaneEntity.TABLE_NAME +
|
||||
" WHERE " + BaseSyncDTO.Columns.ID + " = :id")
|
||||
Flowable<TrasferimentoPedaneWithRowsWrapper> selectFlowable(long id);
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM " + TrasferimentoPedaneEntity.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))" +
|
||||
" ORDER BY " + TrasferimentoPedaneEntity.Columns.CREATED_AT + " DESC")
|
||||
List<TrasferimentoPedaneWithRowsWrapper> selectAll(boolean toBeSync);
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM " + TrasferimentoPedaneEntity.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))" +
|
||||
" ORDER BY " + TrasferimentoPedaneEntity.Columns.CREATED_AT + " DESC")
|
||||
Flowable<List<TrasferimentoPedaneWithRowsWrapper>> selectAllFlowable(boolean toBeSync);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.Transaction;
|
||||
|
||||
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.TrasferimentoPedaneRowEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityDaoInterface;
|
||||
|
||||
@Dao
|
||||
public interface TrasferimentoPedaneRowDao extends EntityDaoInterface<TrasferimentoPedaneRowEntity> {
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM " + TrasferimentoPedaneRowEntity.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))" +
|
||||
" ORDER BY " + TrasferimentoPedaneRowEntity.Columns.CREATED_AT + " DESC")
|
||||
List<TrasferimentoPedaneRowEntity> selectAll(boolean toBeSync);
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM " + TrasferimentoPedaneRowEntity.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))" +
|
||||
" ORDER BY " + TrasferimentoPedaneRowEntity.Columns.CREATED_AT + " DESC")
|
||||
Flowable<List<TrasferimentoPedaneRowEntity>> selectAllFlowable(boolean toBeSync);
|
||||
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM " + TrasferimentoPedaneRowEntity.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))" +
|
||||
" AND " + TrasferimentoPedaneRowEntity.Columns.PARENT_ID + " = :trasferimentoId " +
|
||||
" ORDER BY " + TrasferimentoPedaneRowEntity.Columns.CREATED_AT + " DESC")
|
||||
List<TrasferimentoPedaneRowEntity> selectAll(long trasferimentoId, boolean toBeSync);
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM " + TrasferimentoPedaneRowEntity.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))" +
|
||||
" AND " + TrasferimentoPedaneRowEntity.Columns.PARENT_ID + " = :trasferimentoId " +
|
||||
" ORDER BY " + TrasferimentoPedaneRowEntity.Columns.CREATED_AT + " DESC")
|
||||
Flowable<List<TrasferimentoPedaneRowEntity>> selectAllFlowable(long trasferimentoId, boolean toBeSync);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.Transaction;
|
||||
|
||||
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.VerificaGiacenzeEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.VerificaGiacenzeRowEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityDaoInterface;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.VerificaGiacenzeWithRowsWrapper;
|
||||
|
||||
@Dao
|
||||
public interface VerificaGiacenzeDao extends EntityDaoInterface<VerificaGiacenzeEntity> {
|
||||
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM " + VerificaGiacenzeEntity.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))")
|
||||
List<VerificaGiacenzeWithRowsWrapper> selectAll(boolean toBeSync);
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM " + VerificaGiacenzeEntity.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))" +
|
||||
" ORDER BY " + VerificaGiacenzeEntity.Columns.DATA + " DESC")
|
||||
Flowable<List<VerificaGiacenzeWithRowsWrapper>> selectAllFlowable(boolean toBeSync);
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM " + VerificaGiacenzeEntity.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))" +
|
||||
" ORDER BY " + VerificaGiacenzeEntity.Columns.DATA + " DESC" +
|
||||
" LIMIT 1")
|
||||
VerificaGiacenzeWithRowsWrapper selectLast(boolean toBeSync);
|
||||
|
||||
@Query("SELECT COALESCE(strftime('%s', 'now') - MAX(" + VerificaGiacenzeRowEntity.Columns.CREATED_AT + ") < :maxMinutes * 60, 0) as any_verifica_to_be_recovered" +
|
||||
" FROM " + VerificaGiacenzeRowEntity.TABLE_NAME +
|
||||
" WHERE (" + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL)")
|
||||
boolean isAnotherVerificaGiacenzeInProgress(int maxMinutes);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
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.VerificaGiacenzeRowEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityDaoInterface;
|
||||
|
||||
@Dao
|
||||
public interface VerificaGiacenzeRowDao extends EntityDaoInterface<VerificaGiacenzeRowEntity> {
|
||||
|
||||
|
||||
@Query("SELECT * FROM " + VerificaGiacenzeRowEntity.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))")
|
||||
List<VerificaGiacenzeRowEntity> selectAll(boolean toBeSync);
|
||||
|
||||
@Query("SELECT * FROM " + VerificaGiacenzeRowEntity.TABLE_NAME +
|
||||
" WHERE ((:toBeSync = 1 AND " + BaseSyncDTO.Columns.COLUMN_REMOTE_SYNC_DATE + " IS NULL) OR (:toBeSync = 0))")
|
||||
Flowable<List<VerificaGiacenzeRowEntity>> selectAllFlowable(boolean toBeSync);
|
||||
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import android.provider.BaseColumns;
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.util.Date;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public abstract class BaseSyncDTO extends BaseRoomDTO {
|
||||
|
||||
@@ -21,7 +21,7 @@ public abstract class BaseSyncDTO extends BaseRoomDTO {
|
||||
private Long id;
|
||||
|
||||
@ColumnInfo(name = Columns.COLUMN_REMOTE_SYNC_DATE)
|
||||
private Date remoteSyncDate;
|
||||
private LocalDateTime remoteSyncDate;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
@@ -31,11 +31,11 @@ public abstract class BaseSyncDTO extends BaseRoomDTO {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Date getRemoteSyncDate() {
|
||||
public LocalDateTime getRemoteSyncDate() {
|
||||
return remoteSyncDate;
|
||||
}
|
||||
|
||||
public void setRemoteSyncDate(Date remoteSyncDate) {
|
||||
public void setRemoteSyncDate(LocalDateTime remoteSyncDate) {
|
||||
this.remoteSyncDate = remoteSyncDate;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ 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 {
|
||||
@Entity(tableName = InventarioEntity.TABLE_NAME)
|
||||
public class InventarioEntity extends BaseSyncDTO implements EntityModelInterface {
|
||||
|
||||
public static final String TABLE_NAME = "inventari";
|
||||
|
||||
@@ -4,7 +4,6 @@ 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;
|
||||
@@ -12,10 +11,11 @@ import java.time.LocalDateTime;
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityModelInterface;
|
||||
|
||||
@Entity(
|
||||
inheritSuperIndices = true,
|
||||
tableName = InventarioRowRoomDTO.TABLE_NAME,
|
||||
foreignKeys = {
|
||||
@ForeignKey(
|
||||
entity = InventarioRoomDTO.class,
|
||||
entity = InventarioEntity.class,
|
||||
parentColumns = {BaseSyncDTO.Columns.ID},
|
||||
childColumns = {InventarioRowRoomDTO.Columns.PARENT_ID},
|
||||
onDelete = ForeignKey.CASCADE
|
||||
@@ -40,13 +40,6 @@ public class InventarioRowRoomDTO extends BaseSyncDTO implements EntityModelInte
|
||||
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;
|
||||
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
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 java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityModelInterface;
|
||||
import it.integry.integrywmsnative.core.model.secondary.TrasferimentoPedaneStatusEnum;
|
||||
|
||||
@Entity(
|
||||
inheritSuperIndices = true,
|
||||
tableName = TrasferimentoPedaneEntity.TABLE_NAME
|
||||
)
|
||||
public class TrasferimentoPedaneEntity extends BaseSyncDTO implements EntityModelInterface {
|
||||
|
||||
public static final String TABLE_NAME = "trasferimento_pedane";
|
||||
|
||||
public static class Columns {
|
||||
public static final String COD_MDEP_DEST = "cod_mdep_dest";
|
||||
public static final String DESCRIZIONE_DEPO_DEST = "descrizione_depo_dest";
|
||||
public static final String STATUS = "status";
|
||||
public static final String DOCUMENT_COD_ANAG = "document_cod_anag";
|
||||
public static final String DOCUMENT_COD_DTIP = "document_cod_dtip";
|
||||
public static final String DOCUMENT_NUM = "document_num";
|
||||
public static final String DOCUMENT_SER = "document_ser";
|
||||
public static final String DOCUMENT_DATA = "document_data";
|
||||
|
||||
public static final String CREATED_AT = "created_at";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@ColumnInfo(name = TrasferimentoPedaneEntity.Columns.COD_MDEP_DEST)
|
||||
private String codMdepDest;
|
||||
|
||||
@NonNull
|
||||
@ColumnInfo(name = Columns.DESCRIZIONE_DEPO_DEST)
|
||||
private String descrizioneDepoDest;
|
||||
|
||||
@NonNull
|
||||
@ColumnInfo(name = Columns.STATUS)
|
||||
private short status = TrasferimentoPedaneStatusEnum.APERTO.getValue();
|
||||
|
||||
@ColumnInfo(name = Columns.DOCUMENT_COD_ANAG)
|
||||
private String documentCodAnag;
|
||||
|
||||
@ColumnInfo(name = Columns.DOCUMENT_COD_DTIP)
|
||||
private String documentCodDtip;
|
||||
|
||||
@ColumnInfo(name = Columns.DOCUMENT_NUM)
|
||||
private Integer documentNum;
|
||||
|
||||
@ColumnInfo(name = Columns.DOCUMENT_SER)
|
||||
private String documentSer;
|
||||
|
||||
@ColumnInfo(name = Columns.DOCUMENT_DATA)
|
||||
private LocalDate documentData;
|
||||
|
||||
@ColumnInfo(name = TrasferimentoPedaneEntity.Columns.CREATED_AT, defaultValue = "CURRENT_TIMESTAMP")
|
||||
private LocalDateTime createdAt = LocalDateTime.now();
|
||||
|
||||
@Ignore
|
||||
private List<TrasferimentoPedaneRowEntity> trasferimentoPedaneRowList;
|
||||
|
||||
@NonNull
|
||||
public String getCodMdepDest() {
|
||||
return codMdepDest;
|
||||
}
|
||||
|
||||
public void setCodMdepDest(@NonNull String codMdepDest) {
|
||||
this.codMdepDest = codMdepDest;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getDescrizioneDepoDest() {
|
||||
return descrizioneDepoDest;
|
||||
}
|
||||
|
||||
public void setDescrizioneDepoDest(@NonNull String descrizioneDepoDest) {
|
||||
this.descrizioneDepoDest = descrizioneDepoDest;
|
||||
}
|
||||
|
||||
public short getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(short status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDocumentCodAnag() {
|
||||
return documentCodAnag;
|
||||
}
|
||||
|
||||
public void setDocumentCodAnag(String documentCodAnag) {
|
||||
this.documentCodAnag = documentCodAnag;
|
||||
}
|
||||
|
||||
public String getDocumentCodDtip() {
|
||||
return documentCodDtip;
|
||||
}
|
||||
|
||||
public void setDocumentCodDtip(String documentCodDtip) {
|
||||
this.documentCodDtip = documentCodDtip;
|
||||
}
|
||||
|
||||
public Integer getDocumentNum() {
|
||||
return documentNum;
|
||||
}
|
||||
|
||||
public void setDocumentNum(Integer documentNum) {
|
||||
this.documentNum = documentNum;
|
||||
}
|
||||
|
||||
public String getDocumentSer() {
|
||||
return documentSer;
|
||||
}
|
||||
|
||||
public void setDocumentSer(String documentSer) {
|
||||
this.documentSer = documentSer;
|
||||
}
|
||||
|
||||
public LocalDate getDocumentData() {
|
||||
return documentData;
|
||||
}
|
||||
|
||||
public void setDocumentData(LocalDate documentData) {
|
||||
this.documentData = documentData;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(LocalDateTime createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public List<TrasferimentoPedaneRowEntity> getTrasferimentoPedaneRowList() {
|
||||
return trasferimentoPedaneRowList;
|
||||
}
|
||||
|
||||
public void setTrasferimentoPedaneRowList(List<TrasferimentoPedaneRowEntity> trasferimentoPedaneRowList) {
|
||||
this.trasferimentoPedaneRowList = trasferimentoPedaneRowList;
|
||||
}
|
||||
|
||||
|
||||
@Ignore
|
||||
public TrasferimentoPedaneStatusEnum getStatusEnum() {
|
||||
return TrasferimentoPedaneStatusEnum.fromValue(getStatus());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
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.Ignore;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityModelInterface;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
@Entity(
|
||||
inheritSuperIndices = true,
|
||||
tableName = TrasferimentoPedaneRowEntity.TABLE_NAME,
|
||||
foreignKeys = {
|
||||
@ForeignKey(
|
||||
entity = TrasferimentoPedaneEntity.class,
|
||||
parentColumns = {BaseSyncDTO.Columns.ID},
|
||||
childColumns = {TrasferimentoPedaneRowEntity.Columns.PARENT_ID},
|
||||
onDelete = ForeignKey.CASCADE
|
||||
)
|
||||
}
|
||||
)
|
||||
public class TrasferimentoPedaneRowEntity extends BaseSyncDTO implements EntityModelInterface, Cloneable {
|
||||
public static final String TABLE_NAME = "trasferimento_pedane_rows";
|
||||
|
||||
public static class Columns {
|
||||
public static final String PARENT_ID = "parent_id";
|
||||
public static final String CREATED_AT = "created_at";
|
||||
public static final String BARCODE_UL = "barcode_ul";
|
||||
public static final String PROGRESSIVO_UL = "progressivo_ul";
|
||||
public static final String FLAG_INCONSISTENT = "flag_inconsistent";
|
||||
// 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_IN_GIACENZA = "qta_in_giacenza";
|
||||
// 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 SCAN_COD_BARRE = "scan_cod_barre";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@ColumnInfo(index = true, name = TrasferimentoPedaneRowEntity.Columns.PARENT_ID)
|
||||
private Long parentId;
|
||||
|
||||
@NonNull
|
||||
@ColumnInfo(name = Columns.BARCODE_UL)
|
||||
private String barcodeUl;
|
||||
|
||||
@NonNull
|
||||
@ColumnInfo(name = Columns.PROGRESSIVO_UL)
|
||||
private int progressivoUl;
|
||||
|
||||
@ColumnInfo(name = Columns.FLAG_INCONSISTENT, defaultValue = "0")
|
||||
private boolean flagInconsistent = false;
|
||||
|
||||
|
||||
@ColumnInfo(name = TrasferimentoPedaneRowEntity.Columns.CREATED_AT, defaultValue = "CURRENT_TIMESTAMP")
|
||||
private LocalDateTime createdAt = LocalDateTime.now();
|
||||
|
||||
|
||||
@Ignore
|
||||
private MtbColt detailMtbColt;
|
||||
|
||||
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getBarcodeUl() {
|
||||
return barcodeUl;
|
||||
}
|
||||
|
||||
public void setBarcodeUl(String barcodeUl) {
|
||||
this.barcodeUl = barcodeUl;
|
||||
}
|
||||
|
||||
public int getProgressivoUl() {
|
||||
return progressivoUl;
|
||||
}
|
||||
|
||||
public void setProgressivoUl(int progressivoUl) {
|
||||
this.progressivoUl = progressivoUl;
|
||||
}
|
||||
|
||||
|
||||
public boolean isFlagInconsistent() {
|
||||
return flagInconsistent;
|
||||
}
|
||||
|
||||
public void setFlagInconsistent(boolean flagInconsistent) {
|
||||
this.flagInconsistent = flagInconsistent;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(LocalDateTime createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
|
||||
public MtbColt getDetailMtbColt() {
|
||||
return detailMtbColt;
|
||||
}
|
||||
|
||||
public void setDetailMtbColt(MtbColt detailMtbColt) {
|
||||
this.detailMtbColt = detailMtbColt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
TrasferimentoPedaneRowEntity that = (TrasferimentoPedaneRowEntity) o;
|
||||
return getProgressivoUl() == that.getProgressivoUl() && isFlagInconsistent() == that.isFlagInconsistent() && Objects.equals(getParentId(), that.getParentId()) && Objects.equals(getBarcodeUl(), that.getBarcodeUl()) && Objects.equals(getCreatedAt(), that.getCreatedAt());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getParentId(), getBarcodeUl(), getProgressivoUl(), isFlagInconsistent(), getCreatedAt());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
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 java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityModelInterface;
|
||||
|
||||
@Entity(
|
||||
inheritSuperIndices = true,
|
||||
tableName = VerificaGiacenzeEntity.TABLE_NAME
|
||||
)
|
||||
public class VerificaGiacenzeEntity extends BaseSyncDTO implements EntityModelInterface {
|
||||
|
||||
public static final String TABLE_NAME = "verifica_giacenze";
|
||||
|
||||
public static class Columns {
|
||||
public static final String COD_MDEP = "cod_mdep";
|
||||
public static final String DATA = "data";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@ColumnInfo(name = VerificaGiacenzeEntity.Columns.COD_MDEP)
|
||||
private String codMdep;
|
||||
|
||||
@ColumnInfo(name = VerificaGiacenzeEntity.Columns.DATA)
|
||||
private LocalDateTime data;
|
||||
|
||||
@Ignore
|
||||
private List<VerificaGiacenzeRowEntity> verificaGiacenzeRowList;
|
||||
|
||||
@NonNull
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public void setCodMdep(@NonNull String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
}
|
||||
|
||||
public LocalDateTime getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(LocalDateTime data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public List<VerificaGiacenzeRowEntity> getVerificaGiacenzeRowList() {
|
||||
return verificaGiacenzeRowList;
|
||||
}
|
||||
|
||||
public void setVerificaGiacenzeRowList(List<VerificaGiacenzeRowEntity> verificaGiacenzeRowList) {
|
||||
this.verificaGiacenzeRowList = verificaGiacenzeRowList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
VerificaGiacenzeEntity that = (VerificaGiacenzeEntity) o;
|
||||
return getId().equals(that.getId()) && getCodMdep().equals(that.getCodMdep()) && Objects.equals(getData(), that.getData()) && Objects.equals(getVerificaGiacenzeRowList(), that.getVerificaGiacenzeRowList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = getId().hashCode();
|
||||
result = 31 * result + getCodMdep().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getData());
|
||||
result = 31 * result + Objects.hashCode(getVerificaGiacenzeRowList());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
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 java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityModelInterface;
|
||||
|
||||
@Entity(
|
||||
inheritSuperIndices = true,
|
||||
tableName = VerificaGiacenzeRowEntity.TABLE_NAME,
|
||||
foreignKeys = {
|
||||
@ForeignKey(
|
||||
entity = VerificaGiacenzeEntity.class,
|
||||
parentColumns = {BaseSyncDTO.Columns.ID},
|
||||
childColumns = {VerificaGiacenzeRowEntity.Columns.PARENT_ID},
|
||||
onDelete = ForeignKey.CASCADE
|
||||
)
|
||||
}
|
||||
)
|
||||
public class VerificaGiacenzeRowEntity extends BaseSyncDTO implements EntityModelInterface, Cloneable {
|
||||
public static final String TABLE_NAME = "verifica_giacenze_rows";
|
||||
|
||||
public static class Columns {
|
||||
public static final String PARENT_ID = "parent_id";
|
||||
public static final String CREATED_AT = "created_at";
|
||||
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_IN_GIACENZA = "qta_in_giacenza";
|
||||
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 SCAN_COD_BARRE = "scan_cod_barre";
|
||||
}
|
||||
|
||||
@ColumnInfo(index = true, name = Columns.PARENT_ID)
|
||||
private Long parentId;
|
||||
|
||||
@ColumnInfo(name = Columns.CREATED_AT, defaultValue = "CURRENT_TIMESTAMP")
|
||||
private LocalDateTime createdAt = LocalDateTime.now();
|
||||
|
||||
@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_IN_GIACENZA, defaultValue = "0")
|
||||
private BigDecimal qtaInGiacenza;
|
||||
|
||||
@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;
|
||||
|
||||
@ColumnInfo(name = Columns.SCAN_COD_BARRE)
|
||||
private String scanCodBarre;
|
||||
|
||||
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(LocalDateTime createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public void setCodMart(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 getQtaInGiacenza() {
|
||||
return qtaInGiacenza;
|
||||
}
|
||||
|
||||
public void setQtaInGiacenza(@NonNull BigDecimal qtaInGiacenza) {
|
||||
this.qtaInGiacenza = qtaInGiacenza;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
public String getScanCodBarre() {
|
||||
return scanCodBarre;
|
||||
}
|
||||
|
||||
public void setScanCodBarre(String scanCodBarre) {
|
||||
this.scanCodBarre = scanCodBarre;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
VerificaGiacenzeRowEntity that = (VerificaGiacenzeRowEntity) o;
|
||||
return getId().equals(that.getId()) && getParentId().equals(that.getParentId()) && getCodMart().equals(that.getCodMart()) && Objects.equals(getPartitaMag(), that.getPartitaMag()) && getQta().equals(that.getQta()) && getNumConf().equals(that.getNumConf()) && getQtaConf().equals(that.getQtaConf()) && Objects.equals(getScanCodBarre(), that.getScanCodBarre());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = getId().hashCode();
|
||||
result = 31 * result + getParentId().hashCode();
|
||||
result = 31 * result + getCodMart().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getPartitaMag());
|
||||
result = 31 * result + getQta().hashCode();
|
||||
result = 31 * result + getNumConf().hashCode();
|
||||
result = 31 * result + getQtaConf().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getScanCodBarre());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public VerificaGiacenzeRowEntity clone() throws CloneNotSupportedException {
|
||||
try {
|
||||
VerificaGiacenzeRowEntity clone = (VerificaGiacenzeRowEntity) super.clone();
|
||||
|
||||
// Clona ID
|
||||
clone.setId(getId() != null ? new Long(getId()) : null);
|
||||
clone.setParentId(getParentId() != null ? new Long(getParentId()) : null);
|
||||
|
||||
// Clona le stringhe
|
||||
clone.setCodMart(getCodMart() != null ? new String(getCodMart()) : null);
|
||||
clone.setPartitaMag(getPartitaMag() != null ? new String(getPartitaMag()) : null);
|
||||
clone.setDescrizione(getDescrizione() != null ? new String(getDescrizione()) : null);
|
||||
clone.setScanCodBarre(getScanCodBarre() != null ? new String(getScanCodBarre()) : null);
|
||||
|
||||
// Clona i BigDecimal
|
||||
clone.setQta(getQta() != null ? new BigDecimal(getQta().toString()) : null);
|
||||
clone.setNumConf(getNumConf() != null ? new BigDecimal(getNumConf().toString()) : null);
|
||||
clone.setQtaConf(getQtaConf() != null ? new BigDecimal(getQtaConf().toString()) : null);
|
||||
|
||||
return clone;
|
||||
} catch (CloneNotSupportedException e) {
|
||||
throw new AssertionError(); // Can't happen
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import android.util.Log;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -15,7 +16,7 @@ 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.entity.InventarioEntity;
|
||||
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;
|
||||
@@ -24,13 +25,13 @@ 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> {
|
||||
public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioEntity, InventarioMapper, InventarioLocalDataSource, InventarioRESTConsumer> {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
|
||||
private final Handler handler;
|
||||
|
||||
private final MutableLiveData<List<InventarioRoomDTO>> internalLiveData = new MutableLiveData<>();
|
||||
private final MutableLiveData<List<InventarioEntity>> internalLiveData = new MutableLiveData<>();
|
||||
|
||||
@Inject
|
||||
public InventarioRepository(InventarioLocalDataSource localDataSource,
|
||||
@@ -44,7 +45,7 @@ public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioR
|
||||
}
|
||||
|
||||
|
||||
public LiveData<List<InventarioRoomDTO>> retrieve(Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
public LiveData<List<InventarioEntity>> retrieve(Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
localDataSource.makeSynchronousRetrieveAllLive(false)
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(internalLiveData::postValue);
|
||||
@@ -84,15 +85,15 @@ public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioR
|
||||
});
|
||||
}
|
||||
|
||||
public void insert(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
public void insert(InventarioEntity 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) {
|
||||
public void export(InventarioEntity inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
remoteDataSource.makeInsertRequest(dataMapper.mapRoomToRest(inventarioDTO), () -> {
|
||||
inventarioDTO.setRemoteSyncDate(new Date());
|
||||
inventarioDTO.setRemoteSyncDate(LocalDateTime.now());
|
||||
|
||||
localDataSource.makeUpdateRequest(inventarioDTO, (ignored) -> {
|
||||
handler.post(onComplete);
|
||||
@@ -100,7 +101,7 @@ public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioR
|
||||
}, onError);
|
||||
}
|
||||
|
||||
public void delete(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
public void delete(InventarioEntity inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
localDataSource.makeDeleteRequest(inventarioDTO, onComplete, onError);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
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 java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.TrasferimentoPedaneEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.data_source.TrasferimentoPedaneLocalDataSource;
|
||||
import it.integry.integrywmsnative.core.mapper.TrasferimentoPedaneMapper;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.TrasferimentoPedaneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.trasferimento_pedane.TrasferimentoPedaneDTO;
|
||||
|
||||
@Singleton
|
||||
public class TrasferimentoPedaneRepository extends _BaseRepository<TrasferimentoPedaneDTO, TrasferimentoPedaneEntity, TrasferimentoPedaneMapper, TrasferimentoPedaneLocalDataSource, TrasferimentoPedaneRESTConsumer> {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
private final Handler handler;
|
||||
|
||||
@Inject
|
||||
public TrasferimentoPedaneRepository(TrasferimentoPedaneLocalDataSource localDataSource,
|
||||
TrasferimentoPedaneRESTConsumer remoteDataSource,
|
||||
TrasferimentoPedaneMapper dataMapper,
|
||||
Handler handler,
|
||||
ExecutorService executorService) {
|
||||
super(dataMapper, localDataSource, remoteDataSource);
|
||||
this.handler = handler;
|
||||
this.executorService = executorService;
|
||||
}
|
||||
|
||||
|
||||
public LiveData<TrasferimentoPedaneEntity> retrieveLive(long id) {
|
||||
MutableLiveData<TrasferimentoPedaneEntity> internalLiveData = new MutableLiveData<>();
|
||||
|
||||
localDataSource.makeRetrieveRequest(id)
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(internalLiveData::postValue);
|
||||
|
||||
return internalLiveData;
|
||||
}
|
||||
|
||||
|
||||
public TrasferimentoPedaneEntity retrieve(long id) {
|
||||
return localDataSource.makeSynchronousRetrieveRequest(id);
|
||||
}
|
||||
|
||||
|
||||
public LiveData<List<TrasferimentoPedaneEntity>> retrieveLive() {
|
||||
MutableLiveData<List<TrasferimentoPedaneEntity>> internalLiveData = new MutableLiveData<>();
|
||||
|
||||
localDataSource.makeSynchronousRetrieveAllLive(false)
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(internalLiveData::postValue);
|
||||
|
||||
return internalLiveData;
|
||||
}
|
||||
|
||||
public long insert(String codMdepDest, String descrizioneDepoDest) {
|
||||
var trasferimentoPedane = new TrasferimentoPedaneEntity();
|
||||
trasferimentoPedane.setCodMdepDest(codMdepDest);
|
||||
trasferimentoPedane.setDescrizioneDepoDest(descrizioneDepoDest);
|
||||
localDataSource.makeSynchronousInsertRequest(trasferimentoPedane);
|
||||
|
||||
return trasferimentoPedane.getId();
|
||||
}
|
||||
|
||||
public void updateSynchronized(TrasferimentoPedaneEntity entity) {
|
||||
localDataSource.makeSynchronousUpdateRequest(entity);
|
||||
}
|
||||
|
||||
public void deleteSynchronized(TrasferimentoPedaneEntity entity) {
|
||||
localDataSource.makeSynchronousDeleteRequest(entity);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
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 java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.TrasferimentoPedaneRowEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.data_source.TrasferimentoPedaneRowsLocalDataSource;
|
||||
import it.integry.integrywmsnative.core.mapper.TrasferimentoPedaneRowMapper;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.TrasferimentoPedaneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.trasferimento_pedane.TrasferimentoPedaneRowDTO;
|
||||
|
||||
@Singleton
|
||||
public class TrasferimentoPedaneRowRepository extends _BaseRepository<TrasferimentoPedaneRowDTO, TrasferimentoPedaneRowEntity, TrasferimentoPedaneRowMapper, TrasferimentoPedaneRowsLocalDataSource, TrasferimentoPedaneRESTConsumer> {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
private final Handler handler;
|
||||
|
||||
@Inject
|
||||
public TrasferimentoPedaneRowRepository(TrasferimentoPedaneRowsLocalDataSource localDataSource,
|
||||
TrasferimentoPedaneRESTConsumer remoteDataSource,
|
||||
TrasferimentoPedaneRowMapper dataMapper,
|
||||
Handler handler,
|
||||
ExecutorService executorService) {
|
||||
super(dataMapper, localDataSource, remoteDataSource);
|
||||
this.handler = handler;
|
||||
this.executorService = executorService;
|
||||
}
|
||||
|
||||
|
||||
public LiveData<List<TrasferimentoPedaneRowEntity>> retrieve(long trasferimentoPedaneId) {
|
||||
MutableLiveData<List<TrasferimentoPedaneRowEntity>> internalLiveData = new MutableLiveData<>();
|
||||
|
||||
localDataSource.makeSynchronousRetrieveAllLive(trasferimentoPedaneId, false)
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(internalLiveData::postValue);
|
||||
|
||||
return internalLiveData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public TrasferimentoPedaneRowEntity insertSynchronized(long parentId, String barcodeUl, int progressivoUl) {
|
||||
TrasferimentoPedaneRowEntity entity = new TrasferimentoPedaneRowEntity() {{
|
||||
setParentId(parentId);
|
||||
setBarcodeUl(barcodeUl);
|
||||
setProgressivoUl(progressivoUl);
|
||||
}};
|
||||
localDataSource.makeSynchronousInsertRequest(entity);
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public void updateSynchronized(TrasferimentoPedaneRowEntity entity) {
|
||||
localDataSource.makeSynchronousUpdateRequest(entity);
|
||||
}
|
||||
|
||||
public void updateAllSynchronized(List<TrasferimentoPedaneRowEntity> entities) {
|
||||
localDataSource.makeSynchronousUpdateAllRequest(entities);
|
||||
}
|
||||
|
||||
public void deleteSynchronized(TrasferimentoPedaneRowEntity entity) {
|
||||
localDataSource.makeSynchronousDeleteRequest(entity);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.respository_new;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.VerificaGiacenzeEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.data_source.VerificaGiacenzeLocalDataSource;
|
||||
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeMapper;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaPvRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.pv.VerificaGiacenzeDTO;
|
||||
|
||||
public class VerificaGiacenzeRepository extends _BaseRepository<VerificaGiacenzeDTO, VerificaGiacenzeEntity, VerificaGiacenzeMapper, VerificaGiacenzeLocalDataSource, GiacenzaPvRESTConsumer> {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
private final Handler handler;
|
||||
|
||||
|
||||
public VerificaGiacenzeRepository(VerificaGiacenzeLocalDataSource localDataSource,
|
||||
GiacenzaPvRESTConsumer remoteDataSource,
|
||||
VerificaGiacenzeMapper dataMapper,
|
||||
Handler handler,
|
||||
ExecutorService executorService) {
|
||||
super(dataMapper, localDataSource, remoteDataSource);
|
||||
this.handler = handler;
|
||||
this.executorService = executorService;
|
||||
}
|
||||
|
||||
|
||||
public List<VerificaGiacenzeEntity> retrieve() {
|
||||
return localDataSource.makeSynchronousRetrieveAllRequest(false);
|
||||
}
|
||||
|
||||
public VerificaGiacenzeEntity retrieveLast() {
|
||||
return localDataSource.makeSynchronousRetrieveLastRequest(false);
|
||||
}
|
||||
|
||||
|
||||
public boolean isAnotherVerificaGiacenzeInProgress(int maxMinutes) {
|
||||
return localDataSource.isAnotherVerificaGiacenzeInProgress(maxMinutes);
|
||||
}
|
||||
|
||||
public void clearPreviousSessions() {
|
||||
var entities = retrieve();
|
||||
for (var entity : entities) {
|
||||
localDataSource.makeSynchronousDeleteRequest(entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void insert(VerificaGiacenzeEntity entity) {
|
||||
localDataSource.makeSynchronousInsertRequest(entity);
|
||||
}
|
||||
|
||||
public void delete(VerificaGiacenzeEntity entity) {
|
||||
localDataSource.makeSynchronousDeleteRequest(entity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.respository_new;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.VerificaGiacenzeRowEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.data_source.VerificaGiacenzeRowLocalDataSource;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeRowMapper;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaPvRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.pv.VerificaGiacenzeRowDTO;
|
||||
|
||||
public class VerificaGiacenzeRowRepository extends _BaseRepository<VerificaGiacenzeRowDTO, VerificaGiacenzeRowEntity, VerificaGiacenzeRowMapper, VerificaGiacenzeRowLocalDataSource, GiacenzaPvRESTConsumer> {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
private final Handler handler;
|
||||
|
||||
|
||||
public VerificaGiacenzeRowRepository(VerificaGiacenzeRowLocalDataSource localDataSource,
|
||||
GiacenzaPvRESTConsumer remoteDataSource,
|
||||
VerificaGiacenzeRowMapper dataMapper,
|
||||
Handler handler,
|
||||
ExecutorService executorService) {
|
||||
super(dataMapper, localDataSource, remoteDataSource);
|
||||
this.handler = handler;
|
||||
this.executorService = executorService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void insertSynchronized(VerificaGiacenzeRowEntity entity) {
|
||||
localDataSource.makeSynchronousInsertRequest(entity);
|
||||
}
|
||||
|
||||
public void insert(VerificaGiacenzeRowEntity entity, RunnableArgs<VerificaGiacenzeRowEntity> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
localDataSource.makeInsertRequest(entity, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public void updateSynchronized(VerificaGiacenzeRowEntity entity) {
|
||||
localDataSource.makeSynchronousUpdateRequest(entity);
|
||||
}
|
||||
|
||||
public void update(VerificaGiacenzeRowEntity entity, RunnableArgs<VerificaGiacenzeRowEntity> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
localDataSource.makeUpdateRequest(entity, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public void deleteSynchronized(VerificaGiacenzeRowEntity entity) {
|
||||
localDataSource.makeSynchronousDeleteRequest(entity);
|
||||
}
|
||||
|
||||
public void delete(VerificaGiacenzeRowEntity entity, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
localDataSource.makeDeleteRequest(entity, onComplete, onFailed);
|
||||
}
|
||||
}
|
||||
@@ -8,24 +8,24 @@ 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;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioEntity;
|
||||
|
||||
@Singleton
|
||||
public class InventarioLocalDataSource extends _BaseRoomDataSource<InventarioRoomDTO, InventarioDao> {
|
||||
public class InventarioLocalDataSource extends _BaseRoomDataSource<InventarioEntity, InventarioDao> {
|
||||
|
||||
@Inject
|
||||
public InventarioLocalDataSource(ExecutorService executorService, InventarioDao entityDao) {
|
||||
super(executorService, entityDao, InventarioRoomDTO.TABLE_NAME);
|
||||
super(executorService, entityDao, InventarioEntity.TABLE_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InventarioRoomDTO> makeSynchronousRetrieveAllRequest(boolean onlyToBeSync) {
|
||||
public List<InventarioEntity> makeSynchronousRetrieveAllRequest(boolean onlyToBeSync) {
|
||||
return entityDao
|
||||
.selectAll(onlyToBeSync);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flowable<List<InventarioRoomDTO>> makeSynchronousRetrieveAllLive(boolean onlyToBeSync) {
|
||||
public Flowable<List<InventarioEntity>> makeSynchronousRetrieveAllLive(boolean onlyToBeSync) {
|
||||
return entityDao
|
||||
.selectAllFlowable(onlyToBeSync);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.respository_new.data_source;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import io.reactivex.rxjava3.core.Flowable;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.TrasferimentoPedaneDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.TrasferimentoPedaneEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.TrasferimentoPedaneWithRowsWrapper;
|
||||
|
||||
@Singleton
|
||||
public class TrasferimentoPedaneLocalDataSource extends _BaseRoomDataSource<TrasferimentoPedaneEntity, TrasferimentoPedaneDao> {
|
||||
|
||||
@Inject
|
||||
public TrasferimentoPedaneLocalDataSource(ExecutorService executorService, TrasferimentoPedaneDao entityDao) {
|
||||
super(executorService, entityDao, TrasferimentoPedaneEntity.TABLE_NAME);
|
||||
}
|
||||
|
||||
public Flowable<TrasferimentoPedaneEntity> makeRetrieveRequest(long id) {
|
||||
var data = entityDao
|
||||
.selectFlowable(id);
|
||||
|
||||
return data.map(x -> x.trasferimentoPedane);
|
||||
}
|
||||
|
||||
public TrasferimentoPedaneEntity makeSynchronousRetrieveRequest(long id) {
|
||||
var data = entityDao
|
||||
.select(id);
|
||||
|
||||
return data.trasferimentoPedane;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TrasferimentoPedaneEntity> makeSynchronousRetrieveAllRequest(boolean onlyToBeSync) {
|
||||
var data = entityDao
|
||||
.selectAll(onlyToBeSync);
|
||||
|
||||
return data.stream()
|
||||
.map(x -> {
|
||||
x.trasferimentoPedane.setTrasferimentoPedaneRowList(x.rowList);
|
||||
return x.trasferimentoPedane;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flowable<List<TrasferimentoPedaneEntity>> makeSynchronousRetrieveAllLive(boolean onlyToBeSync) {
|
||||
Flowable<List<TrasferimentoPedaneWithRowsWrapper>> listFlowable = entityDao
|
||||
.selectAllFlowable(onlyToBeSync);
|
||||
|
||||
return listFlowable.map(x ->
|
||||
x.stream()
|
||||
.map(y -> {
|
||||
y.trasferimentoPedane.setTrasferimentoPedaneRowList(y.rowList);
|
||||
return y.trasferimentoPedane;
|
||||
})
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.respository_new.data_source;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import io.reactivex.rxjava3.core.Flowable;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.TrasferimentoPedaneRowDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.TrasferimentoPedaneRowEntity;
|
||||
|
||||
@Singleton
|
||||
public class TrasferimentoPedaneRowsLocalDataSource extends _BaseRoomDataSource<TrasferimentoPedaneRowEntity, TrasferimentoPedaneRowDao> {
|
||||
|
||||
@Inject
|
||||
public TrasferimentoPedaneRowsLocalDataSource(ExecutorService executorService, TrasferimentoPedaneRowDao entityDao) {
|
||||
super(executorService, entityDao, TrasferimentoPedaneRowEntity.TABLE_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TrasferimentoPedaneRowEntity> makeSynchronousRetrieveAllRequest(boolean onlyToBeSync) {
|
||||
var data = entityDao
|
||||
.selectAll(onlyToBeSync);
|
||||
|
||||
return data.stream()
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flowable<List<TrasferimentoPedaneRowEntity>> makeSynchronousRetrieveAllLive(boolean onlyToBeSync) {
|
||||
Flowable<List<TrasferimentoPedaneRowEntity>> listFlowable = entityDao
|
||||
.selectAllFlowable(onlyToBeSync);
|
||||
|
||||
return listFlowable.map(x ->
|
||||
x.stream()
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
|
||||
public List<TrasferimentoPedaneRowEntity> makeSynchronousRetrieveAllRequest(long parentId, boolean onlyToBeSync) {
|
||||
var data = entityDao
|
||||
.selectAll(parentId, onlyToBeSync);
|
||||
|
||||
return data.stream()
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public Flowable<List<TrasferimentoPedaneRowEntity>> makeSynchronousRetrieveAllLive(long parentId, boolean onlyToBeSync) {
|
||||
Flowable<List<TrasferimentoPedaneRowEntity>> listFlowable = entityDao
|
||||
.selectAllFlowable(parentId, onlyToBeSync);
|
||||
|
||||
return listFlowable.map(x ->
|
||||
x.stream()
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.respository_new.data_source;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import io.reactivex.rxjava3.core.Flowable;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.VerificaGiacenzeDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.VerificaGiacenzeEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.VerificaGiacenzeWithRowsWrapper;
|
||||
|
||||
@Singleton
|
||||
public class VerificaGiacenzeLocalDataSource extends _BaseRoomDataSource<VerificaGiacenzeEntity, VerificaGiacenzeDao> {
|
||||
|
||||
@Inject
|
||||
public VerificaGiacenzeLocalDataSource(ExecutorService executorService, VerificaGiacenzeDao entityDao) {
|
||||
super(executorService, entityDao, VerificaGiacenzeEntity.TABLE_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VerificaGiacenzeEntity> makeSynchronousRetrieveAllRequest(boolean onlyToBeSync) {
|
||||
var data = entityDao
|
||||
.selectAll(onlyToBeSync);
|
||||
|
||||
return data.stream()
|
||||
.map(x -> {
|
||||
x.verificaGiacenze.setVerificaGiacenzeRowList(x.verificaGiacenzeRowList);
|
||||
return x.verificaGiacenze;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flowable<List<VerificaGiacenzeEntity>> makeSynchronousRetrieveAllLive(boolean onlyToBeSync) {
|
||||
Flowable<List<VerificaGiacenzeWithRowsWrapper>> listFlowable = entityDao
|
||||
.selectAllFlowable(onlyToBeSync);
|
||||
|
||||
return listFlowable.map(x ->
|
||||
x.stream()
|
||||
.map(y -> {
|
||||
y.verificaGiacenze.setVerificaGiacenzeRowList(y.verificaGiacenzeRowList);
|
||||
return y.verificaGiacenze;
|
||||
})
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
|
||||
public VerificaGiacenzeEntity makeSynchronousRetrieveLastRequest(boolean onlyToBeSync) {
|
||||
var lastEntity = entityDao
|
||||
.selectLast(onlyToBeSync);
|
||||
|
||||
lastEntity.verificaGiacenze.setVerificaGiacenzeRowList(lastEntity.verificaGiacenzeRowList);
|
||||
|
||||
return lastEntity.verificaGiacenze;
|
||||
}
|
||||
|
||||
public boolean isAnotherVerificaGiacenzeInProgress(int maxMinutes) {
|
||||
return entityDao.isAnotherVerificaGiacenzeInProgress(maxMinutes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
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.VerificaGiacenzeRowDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.VerificaGiacenzeRowEntity;
|
||||
|
||||
@Singleton
|
||||
public class VerificaGiacenzeRowLocalDataSource extends _BaseRoomDataSource<VerificaGiacenzeRowEntity, VerificaGiacenzeRowDao> {
|
||||
|
||||
@Inject
|
||||
public VerificaGiacenzeRowLocalDataSource(ExecutorService executorService, VerificaGiacenzeRowDao entityDao) {
|
||||
super(executorService, entityDao, VerificaGiacenzeRowEntity.TABLE_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VerificaGiacenzeRowEntity> makeSynchronousRetrieveAllRequest(boolean onlyToBeSync) {
|
||||
var data = entityDao
|
||||
.selectAll(onlyToBeSync);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flowable<List<VerificaGiacenzeRowEntity>> makeSynchronousRetrieveAllLive(boolean onlyToBeSync) {
|
||||
return entityDao
|
||||
.selectAllFlowable(onlyToBeSync);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.wrappers;
|
||||
|
||||
import androidx.room.DatabaseView;
|
||||
import androidx.room.Embedded;
|
||||
import androidx.room.Relation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.BaseSyncDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.TrasferimentoPedaneEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.TrasferimentoPedaneRowEntity;
|
||||
|
||||
@DatabaseView
|
||||
public class TrasferimentoPedaneWithRowsWrapper {
|
||||
|
||||
@Embedded
|
||||
public TrasferimentoPedaneEntity trasferimentoPedane;
|
||||
|
||||
@Relation(
|
||||
parentColumn = BaseSyncDTO.Columns.ID,
|
||||
entityColumn = TrasferimentoPedaneRowEntity.Columns.PARENT_ID
|
||||
)
|
||||
public List<TrasferimentoPedaneRowEntity> rowList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.wrappers;
|
||||
|
||||
import androidx.room.DatabaseView;
|
||||
import androidx.room.Embedded;
|
||||
import androidx.room.Relation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.BaseSyncDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.VerificaGiacenzeEntity;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.VerificaGiacenzeRowEntity;
|
||||
|
||||
@DatabaseView
|
||||
public class VerificaGiacenzeWithRowsWrapper {
|
||||
|
||||
@Embedded
|
||||
public VerificaGiacenzeEntity verificaGiacenze;
|
||||
|
||||
@Relation(
|
||||
parentColumn = BaseSyncDTO.Columns.ID,
|
||||
entityColumn = VerificaGiacenzeRowEntity.Columns.PARENT_ID
|
||||
)
|
||||
public List<VerificaGiacenzeRowEntity> verificaGiacenzeRowList;
|
||||
}
|
||||
@@ -4,9 +4,6 @@ import androidx.databinding.BaseObservable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
|
||||
public class BindableFloat extends BaseObservable {
|
||||
private Float value;
|
||||
|
||||
@@ -15,10 +12,6 @@ public class BindableFloat extends BaseObservable {
|
||||
}
|
||||
|
||||
public BigDecimal getBigDecimal() {
|
||||
int numberOfDigits = UtilityNumber.countNumberOfDecimalDigits(get());
|
||||
|
||||
if(numberOfDigits > CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS) numberOfDigits = CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS;
|
||||
|
||||
return BigDecimal.valueOf(get());
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.ColorRes;
|
||||
import androidx.appcompat.widget.AppCompatCheckBox;
|
||||
@@ -24,6 +25,11 @@ import androidx.databinding.BindingAdapter;
|
||||
import androidx.databinding.BindingConversion;
|
||||
import androidx.databinding.Observable;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewTreeLifecycleOwner;
|
||||
|
||||
import com.google.android.material.datepicker.MaterialDatePicker;
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
@@ -33,14 +39,17 @@ import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.LocaleDecimalKeyListener;
|
||||
import it.integry.integrywmsnative.core.helper.ContextHelper;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
@@ -105,6 +114,28 @@ public class Converters {
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableField, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = observableField != null ? observableField.get() : "";
|
||||
if (!view.getText().toString().equals(newValue)) {
|
||||
view.setText(newValue);
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindEditText(AppCompatTextView view, final ValidatableObservableField<String> observableField) {
|
||||
Pair<ValidatableObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableField) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if (observableField != null) observableField.set(s.toString());
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableField, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = observableField.get();
|
||||
if (!view.getText().toString().equals(newValue)) {
|
||||
view.setText(newValue);
|
||||
@@ -156,6 +187,28 @@ public class Converters {
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindEditText(EditText view, final ValidatableObservableField<String> observableString) {
|
||||
Pair<ValidatableObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableString) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
observableString.set(s.toString());
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableString, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = observableString.get();
|
||||
if (!view.getText().toString().equals(newValue)) {
|
||||
view.setText(newValue);
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindEditText(AutoCompleteTextView view, final ObservableField<String> observableString) {
|
||||
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
@@ -211,16 +264,19 @@ public class Converters {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
BigDecimal value = null;
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = new BigDecimal(s.toString());
|
||||
value = UtilityNumber.parseBigDecimal(s.toString(), Locale.getDefault());
|
||||
|
||||
observableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableBigDecimal, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
|
||||
BigDecimal newValue = observableBigDecimal.get();
|
||||
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
||||
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? UtilityNumber.parseBigDecimal(view.getText().toString(), Locale.getDefault()) : null;
|
||||
|
||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
view.setText(UtilityNumber.decimalToString(newValue));
|
||||
@@ -238,8 +294,11 @@ public class Converters {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
BigDecimal value = null;
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = new BigDecimal(s.toString());
|
||||
String newValueString = s.toString().trim();
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(newValueString))
|
||||
value = UtilityNumber.parseBigDecimal(newValueString, Locale.getDefault());
|
||||
|
||||
observableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
@@ -247,7 +306,37 @@ public class Converters {
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
BigDecimal newValue = observableBigDecimal.get();
|
||||
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
||||
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? UtilityNumber.parseBigDecimal(view.getText().toString(), Locale.getDefault()) : null;
|
||||
|
||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
view.setText(UtilityNumber.decimalToString(newValue));
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextBigDecimal(EditText view, final ValidatableObservableField<BigDecimal> observableBigDecimal) {
|
||||
Pair<ValidatableObservableField<BigDecimal>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableBigDecimal) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
BigDecimal value = null;
|
||||
String newValueString = s.toString().trim();
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(newValueString))
|
||||
value = UtilityNumber.parseBigDecimal(newValueString, Locale.getDefault());
|
||||
|
||||
observableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableBigDecimal, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
BigDecimal newValue = observableBigDecimal.get();
|
||||
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? UtilityNumber.parseBigDecimal(view.getText().toString(), Locale.getDefault()) : null;
|
||||
|
||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
view.setText(UtilityNumber.decimalToString(newValue));
|
||||
@@ -266,7 +355,8 @@ public class Converters {
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
BigDecimal value = null;
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = new BigDecimal(s.toString());
|
||||
value = UtilityNumber.parseBigDecimal(s.toString(), Locale.getDefault());
|
||||
|
||||
bindableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
@@ -274,7 +364,7 @@ public class Converters {
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
BigDecimal newValue = bindableBigDecimal.get();
|
||||
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
||||
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? UtilityNumber.parseBigDecimal(view.getText().toString(), Locale.getDefault()) : null;
|
||||
|
||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
view.setText(UtilityNumber.decimalToString(newValue));
|
||||
@@ -301,7 +391,7 @@ public class Converters {
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
Integer newValue = bindableInteger.get();
|
||||
Integer viewValue = view.getText().toString().trim().length() > 0 ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
|
||||
Integer viewValue = !view.getText().toString().trim().isEmpty() ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
|
||||
|
||||
if (!(viewValue.compareTo(newValue) == 0)) {
|
||||
view.setText(newValue.toString());
|
||||
@@ -352,7 +442,7 @@ public class Converters {
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
Integer newValue = observableInteger.get();
|
||||
Integer viewValue = view.getText().toString().trim().length() > 0 ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
|
||||
Integer viewValue = !view.getText().toString().trim().isEmpty() ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
|
||||
|
||||
if (!viewValue.equals(newValue) && newValue != null) {
|
||||
view.setText(newValue.toString());
|
||||
@@ -379,15 +469,16 @@ public class Converters {
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
Long newValue = observableLong.get();
|
||||
Long viewValue = view.getText().toString().trim().length() > 0 ? Long.valueOf(view.getText().toString()) : Long.valueOf(0);
|
||||
Long viewValue = !view.getText().toString().trim().isEmpty() ? Long.valueOf(view.getText().toString()) : Long.valueOf(0);
|
||||
|
||||
if (!viewValue.equals(newValue) && newValue != null) {
|
||||
view.setText(newValue.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"binding", "parentView", "warningOnOldDates"}, requireAll = false)
|
||||
public static void bindTextInputEditTextDate(TextInputEditText view, final ObservableField<Date> observableDate, BaseDialogFragment parentFragment, boolean warningOnOldDates) {
|
||||
|
||||
@BindingAdapter(value = {"binding", "warningOnOldDates"}, requireAll = false)
|
||||
public static void bindTextInputEditTextDate(TextInputEditText view, final ObservableField<Date> observableDate, boolean warningOnOldDates) {
|
||||
Pair<ObservableField<Date>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableDate) {
|
||||
if (pair != null) {
|
||||
@@ -422,15 +513,15 @@ public class Converters {
|
||||
var calendar = UtilityDate.getCalendarInstance();
|
||||
calendar.setTimeInMillis(timeInMillis);
|
||||
|
||||
if (parentFragment != null && warningOnOldDates && calendar.before(UtilityDate.getCalendarInstance())) {
|
||||
if (warningOnOldDates && calendar.before(UtilityDate.getCalendarInstance())) {
|
||||
DialogSimpleMessageView
|
||||
.makeWarningDialog(new SpannableString("Hai scelto una data precedente a quella odierna. Continuare?"), null, () -> {
|
||||
.makeWarningDialog(view.getContext(), 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");
|
||||
.show();
|
||||
} else {
|
||||
view.setText(UtilityDate.formatDate(calendar.getTime(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
observableDate.set(calendar.getTime());
|
||||
@@ -442,7 +533,7 @@ public class Converters {
|
||||
}
|
||||
});
|
||||
|
||||
datePicker.show(parentFragment.requireActivity().getSupportFragmentManager(), "tag");
|
||||
datePicker.show(ContextHelper.getFragmentManagerFromContext(view.getContext()), "tag");
|
||||
};
|
||||
|
||||
//Adding click-listener
|
||||
@@ -456,8 +547,126 @@ 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) {
|
||||
|
||||
@BindingAdapter(value = {"binding", "warningOnOldDates"}, requireAll = false)
|
||||
public static void bindTextInputEditTextDate(TextInputEditText view, final MutableLiveData<Date> liveDataDate, boolean warningOnOldDates) {
|
||||
// Ottieni il LifecycleOwner dalla view
|
||||
LifecycleOwner lifecycleOwner = ViewTreeLifecycleOwner.get(view);
|
||||
if (lifecycleOwner == null) {
|
||||
// Non è possibile osservare LiveData senza un LifecycleOwner
|
||||
// Potresti loggare un errore o gestire questo caso come preferisci
|
||||
Log.e("BindingAdapters", "LifecycleOwner not found for view " + view.getId());
|
||||
return;
|
||||
}
|
||||
|
||||
// Rimuovi eventuali TextWatcher o listener precedenti per evitare duplicazioni
|
||||
// Questo è importante se il BindingAdapter viene chiamato più volte per la stessa view
|
||||
Object oldTag = view.getTag(R.id.bound_observable_date_listener);
|
||||
if (oldTag instanceof TextWatcherAdapter) {
|
||||
view.removeTextChangedListener((TextWatcherAdapter) oldTag);
|
||||
}
|
||||
Object oldLiveDataTag = view.getTag(R.id.bound_observable_date_livedata);
|
||||
if (oldLiveDataTag instanceof MutableLiveData) {
|
||||
// Se c'era un observer precedente su un altro LiveData, rimuovilo
|
||||
// Questo scenario è meno comune ma è bene gestirlo
|
||||
Observer<Date> existingObserver = (Observer<Date>) view.getTag(R.id.bound_observable_date_observer);
|
||||
if (existingObserver != null) {
|
||||
((MutableLiveData<Date>) oldLiveDataTag).removeObserver(existingObserver);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Imposta il listener per il click per aprire il DatePicker
|
||||
RunnableArgs<View> onClick = v -> {
|
||||
Calendar c = UtilityDate.getCalendarInstance();
|
||||
if (liveDataDate.getValue() != null) {
|
||||
c.setTime(liveDataDate.getValue());
|
||||
}
|
||||
|
||||
MaterialDatePicker<Long> datePicker =
|
||||
MaterialDatePicker.Builder.datePicker()
|
||||
.setSelection(c.getTimeInMillis())
|
||||
.build();
|
||||
|
||||
datePicker.addOnPositiveButtonClickListener(selection -> {
|
||||
Calendar calendar = UtilityDate.getCalendarInstance();
|
||||
calendar.setTimeInMillis(selection);
|
||||
Date selectedDate = calendar.getTime();
|
||||
|
||||
if (warningOnOldDates && calendar.before(UtilityDate.getCalendarInstance())) {
|
||||
DialogSimpleMessageView
|
||||
.makeWarningDialog(view.getContext(), new SpannableString("Hai scelto una data precedente a quella odierna. Continuare?"), null, () -> {
|
||||
liveDataDate.postValue(selectedDate);
|
||||
}, () -> {
|
||||
// Non fare nulla se l'utente annulla
|
||||
})
|
||||
.show();
|
||||
} else {
|
||||
liveDataDate.postValue(selectedDate);
|
||||
}
|
||||
});
|
||||
datePicker.addOnNegativeButtonClickListener(dialog -> {
|
||||
// Utente ha annullato, potresti voler resettare o non fare nulla
|
||||
});
|
||||
datePicker.addOnCancelListener(dialog -> {
|
||||
// Utente ha cancellato (es. premendo back), potresti voler resettare o non fare nulla
|
||||
});
|
||||
|
||||
|
||||
datePicker.show(ContextHelper.getFragmentManagerFromContext(view.getContext()), "MaterialDatePicker");
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
// Osserva il LiveData per aggiornare la view quando il valore cambia
|
||||
Observer<Date> dateObserver = date -> {
|
||||
String formattedDate = UtilityDate.formatDate(date, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN);
|
||||
if (!view.getText().toString().equals(formattedDate)) {
|
||||
view.setText(formattedDate);
|
||||
}
|
||||
};
|
||||
|
||||
// Rimuovi l'observer precedente se stiamo ri-bindando allo stesso LiveData
|
||||
Observer<Date> existingObserver = (Observer<Date>) view.getTag(R.id.bound_observable_date_observer);
|
||||
if (view.getTag(R.id.bound_observable_date_livedata) == liveDataDate && existingObserver != null) {
|
||||
liveDataDate.removeObserver(existingObserver);
|
||||
}
|
||||
|
||||
liveDataDate.observe(lifecycleOwner, dateObserver);
|
||||
|
||||
// Salva il LiveData e l'observer nel tag per poterli rimuovere in futuro se necessario
|
||||
view.setTag(R.id.bound_observable_date_livedata, liveDataDate);
|
||||
view.setTag(R.id.bound_observable_date_observer, dateObserver);
|
||||
|
||||
// Imposta il valore iniziale
|
||||
Date initialDate = liveDataDate.getValue();
|
||||
view.setText(UtilityDate.formatDate(initialDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
|
||||
// Aggiungi un TextWatcher fittizio se necessario per coerenza con altri binding,
|
||||
// ma in questo caso il LiveData guida l'aggiornamento.
|
||||
// Se non hai bisogno di reagire ai cambiamenti di testo *dalla view al LiveData*
|
||||
// (perché il DatePicker lo fa già), questo TextWatcher potrebbe non essere strettamente necessario.
|
||||
// Tuttavia, per mantenere la struttura simile agli altri, lo includiamo.
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// Normalmente qui si aggiornerebbe il LiveData,
|
||||
// ma il DatePicker gestisce l'aggiornamento.
|
||||
// Potresti aggiungere logica qui se l'utente può modificare il testo direttamente
|
||||
// e vuoi che ciò si rifletta nel LiveData (richiederebbe parsing della data).
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable_date_listener, watcher); // Salva il watcher nel tag
|
||||
// view.addTextChangedListener(watcher); // Aggiungi solo se necessario
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter(value = {"binding", "warningOnOldDates"}, requireAll = false)
|
||||
public static void bindEditTextDate(EditText view, final ObservableField<LocalDate> observableDate, boolean warningOnOldDates) {
|
||||
Pair<ObservableField<LocalDate>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableDate) {
|
||||
if (pair != null) {
|
||||
@@ -488,15 +697,15 @@ public class Converters {
|
||||
var nowTime = UtilityDate.millisTimeToLocalDate(selectedTimeInMillis, null);
|
||||
|
||||
|
||||
if (parentFragment != null && warningOnOldDates && nowTime.isBefore(UtilityDate.getNow())) {
|
||||
if (warningOnOldDates && nowTime.isBefore(UtilityDate.getNow())) {
|
||||
DialogSimpleMessageView
|
||||
.makeWarningDialog(new SpannableString("Hai scelto una data precedente a quella odierna. Continuare?"), null, () -> {
|
||||
.makeWarningDialog(view.getContext(), 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");
|
||||
.show();
|
||||
} else {
|
||||
view.setText(UtilityDate.formatDate(nowTime, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
observableDate.set(nowTime);
|
||||
@@ -508,7 +717,7 @@ public class Converters {
|
||||
}
|
||||
});
|
||||
|
||||
datePicker.show(parentFragment.requireActivity().getSupportFragmentManager(), "tag");
|
||||
datePicker.show(ContextHelper.getFragmentManagerFromContext(view.getContext()), "tag");
|
||||
};
|
||||
|
||||
//Adding click-listener
|
||||
@@ -522,6 +731,67 @@ public class Converters {
|
||||
view.setText(UtilityDate.formatDate(newValue, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindAutoCompleteTextView(AutoCompleteTextView view, final MutableLiveData<String> liveDataString) {
|
||||
LifecycleOwner lifecycleOwner = ViewTreeLifecycleOwner.get(view);
|
||||
if (lifecycleOwner == null) {
|
||||
Log.e("BindingAdapters", "LifecycleOwner not found for view " + view.getId());
|
||||
return;
|
||||
}
|
||||
|
||||
// Rimuovi TextWatcher precedente
|
||||
Object oldWatcherTag = view.getTag(R.id.bound_observable_actv_watcher);
|
||||
if (oldWatcherTag instanceof TextWatcherAdapter) {
|
||||
view.removeTextChangedListener((TextWatcherAdapter) oldWatcherTag);
|
||||
}
|
||||
|
||||
// Rimuovi Observer precedente se il LiveData è cambiato
|
||||
Object oldLiveDataTag = view.getTag(R.id.bound_observable_actv_livedata);
|
||||
if (oldLiveDataTag instanceof MutableLiveData && oldLiveDataTag != liveDataString) {
|
||||
Observer<String> existingObserver = (Observer<String>) view.getTag(R.id.bound_observable_actv_observer);
|
||||
if (existingObserver != null) {
|
||||
((MutableLiveData<String>) oldLiveDataTag).removeObserver(existingObserver);
|
||||
}
|
||||
}
|
||||
|
||||
// TextWatcher per aggiornare il LiveData quando il testo cambia nella View
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if (liveDataString.getValue() == null || !liveDataString.getValue().equals(s.toString())) {
|
||||
liveDataString.setValue(s.toString());
|
||||
}
|
||||
}
|
||||
};
|
||||
view.addTextChangedListener(watcher);
|
||||
view.setTag(R.id.bound_observable_actv_watcher, watcher);
|
||||
|
||||
// Observer per aggiornare la View quando il LiveData cambia
|
||||
Observer<String> observer = newValue -> {
|
||||
if (!view.getText().toString().equals(newValue)) {
|
||||
view.setText(newValue, false); // Il 'false' evita di far scattare il dropdown
|
||||
}
|
||||
};
|
||||
|
||||
// Rimuovi l'observer precedente se stiamo ri-bindando allo stesso LiveData
|
||||
Observer<String> existingObserver = (Observer<String>) view.getTag(R.id.bound_observable_actv_observer);
|
||||
if (view.getTag(R.id.bound_observable_actv_livedata) == liveDataString && existingObserver != null) {
|
||||
liveDataString.removeObserver(existingObserver);
|
||||
}
|
||||
|
||||
liveDataString.observe(lifecycleOwner, observer);
|
||||
|
||||
// Salva il LiveData e l'observer nel tag
|
||||
view.setTag(R.id.bound_observable_actv_livedata, liveDataString);
|
||||
view.setTag(R.id.bound_observable_actv_observer, observer);
|
||||
|
||||
// Imposta il valore iniziale
|
||||
String initialValue = liveDataString.getValue();
|
||||
if (initialValue != null && !view.getText().toString().equals(initialValue)) {
|
||||
view.setText(initialValue);
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindAutoCompleteTextView(AutoCompleteTextView view, final BindableString bindableString) {
|
||||
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
@@ -651,6 +921,30 @@ public class Converters {
|
||||
view.setChecked(newValue);
|
||||
}
|
||||
|
||||
@BindingAdapter("checked")
|
||||
public static void bindCheckbox(AppCompatCheckBox view, final ObservableField<Boolean> bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
view.setOnCheckedChangeListener((compoundButton, b) -> {
|
||||
bindableBoolean.set(b);
|
||||
});
|
||||
}
|
||||
Boolean newValue = bindableBoolean.get();
|
||||
view.setChecked(newValue);
|
||||
}
|
||||
|
||||
@BindingAdapter("checked")
|
||||
public static void bindCheckbox(AppCompatCheckBox view, final ValidatableObservableField<Boolean> bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
view.setOnCheckedChangeListener((compoundButton, b) -> {
|
||||
bindableBoolean.set(b);
|
||||
});
|
||||
}
|
||||
Boolean newValue = bindableBoolean.get();
|
||||
view.setChecked(newValue);
|
||||
}
|
||||
|
||||
@BindingAdapter("checked")
|
||||
public static void bindCheckbox(CheckBox view, final BindableBoolean bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
@@ -709,16 +1003,160 @@ public class Converters {
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("visibility")
|
||||
public static void bindViewVisibility(View view, final LiveData<Boolean> liveDataBoolean) {
|
||||
if (liveDataBoolean == null) {
|
||||
return;
|
||||
}
|
||||
LifecycleOwner lifecycleOwner = ViewTreeLifecycleOwner.get(view);
|
||||
if (lifecycleOwner == null) {
|
||||
Log.e("Converters", "Cannot find LifecycleOwner for view " + view);
|
||||
return;
|
||||
}
|
||||
|
||||
Observer<Boolean> observer = isVisible -> {
|
||||
if (isVisible != null) {
|
||||
view.setVisibility(isVisible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
};
|
||||
|
||||
// Rimuovi l'observer precedente se il LiveData è cambiato
|
||||
Object oldTag = view.getTag(R.id.bound_observable_visibility);
|
||||
if (oldTag instanceof Pair) {
|
||||
Pair<LiveData<Boolean>, Observer<Boolean>> pair = (Pair<LiveData<Boolean>, Observer<Boolean>>) oldTag;
|
||||
if (pair.first != liveDataBoolean) {
|
||||
pair.first.removeObserver(pair.second);
|
||||
}
|
||||
}
|
||||
|
||||
liveDataBoolean.observe(lifecycleOwner, observer);
|
||||
view.setTag(R.id.bound_observable_visibility, new Pair<>(liveDataBoolean, observer));
|
||||
|
||||
// Imposta il valore iniziale
|
||||
Boolean initialValue = liveDataBoolean.getValue();
|
||||
if (initialValue != null) {
|
||||
view.setVisibility(initialValue ? View.VISIBLE : View.GONE);
|
||||
} else {
|
||||
view.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("visibility")
|
||||
public static void bindViewVisibility(View view, boolean bool) {
|
||||
view.setVisibility(bool ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("visibilityWhenNotNull")
|
||||
public static void bindViewVisibilityObservableFieldWhenNotNull(View view, ObservableField<?> bindableObject) {
|
||||
if(bindableObject == null) return;
|
||||
|
||||
if (view.getTag(R.id.bound_observable_visibility) != bindableObject) {
|
||||
view.setTag(R.id.bound_observable_visibility, bindableObject);
|
||||
}
|
||||
|
||||
bindableObject.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
view.setVisibility(bindableObject.get() == null ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
view.setVisibility(bindableObject.get() == null ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("visibilityWhenNotNull")
|
||||
public static void bindViewVisibilityLiveDataWhenNotNull(View view, LiveData<?> liveData) {
|
||||
// Se il LiveData è null, nascondi la view e esci
|
||||
if (liveData == null) {
|
||||
view.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
|
||||
// Ottieni il LifecycleOwner dalla view
|
||||
LifecycleOwner lifecycleOwner = ViewTreeLifecycleOwner.get(view);
|
||||
if (lifecycleOwner == null) return;
|
||||
|
||||
// Rimuovi eventuali observer precedenti
|
||||
Observer<Object> oldObserver = (Observer<Object>) view.getTag(R.id.bound_observable_visibility);
|
||||
if (oldObserver != null) {
|
||||
liveData.removeObserver(oldObserver);
|
||||
}
|
||||
|
||||
// Crea e registra il nuovo observer
|
||||
Observer<Object> newObserver = value ->
|
||||
view.setVisibility(value == null ? View.GONE : View.VISIBLE);
|
||||
|
||||
liveData.observe(lifecycleOwner, newObserver);
|
||||
view.setTag(R.id.bound_observable_visibility, newObserver);
|
||||
|
||||
// Imposta lo stato iniziale
|
||||
view.setVisibility(liveData.getValue() == null ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("visibilityWhenNotNull")
|
||||
public static void bindViewVisibilityWhenNotNull(View view, Object genericObject) {
|
||||
view.setVisibility(genericObject == null ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("visibilityWhenNull")
|
||||
public static void bindViewVisibilityObservableFieldWhenNull(View view, ObservableField<?> bindableObject) {
|
||||
|
||||
if (view.getTag(R.id.bound_observable_visibility) != bindableObject) {
|
||||
view.setTag(R.id.bound_observable_visibility, bindableObject);
|
||||
}
|
||||
|
||||
view.setVisibility(bindableObject == null || bindableObject.get() == null ? View.VISIBLE : View.GONE);
|
||||
|
||||
if(bindableObject == null) return;
|
||||
|
||||
bindableObject.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
view.setVisibility(bindableObject.get() == null ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("visibilityWhenNull")
|
||||
public static void bindViewVisibilityLiveDataWhenNull(View view, LiveData<?> liveData) {
|
||||
// Se il LiveData è null, nascondi la view e esci
|
||||
if (liveData == null) {
|
||||
view.setVisibility(View.VISIBLE);
|
||||
return;
|
||||
}
|
||||
|
||||
// Ottieni il LifecycleOwner dalla view
|
||||
LifecycleOwner lifecycleOwner = ViewTreeLifecycleOwner.get(view);
|
||||
if (lifecycleOwner == null) return;
|
||||
|
||||
// Rimuovi eventuali observer precedenti
|
||||
Observer<Object> oldObserver = (Observer<Object>) view.getTag(R.id.bound_observable_visibility);
|
||||
if (oldObserver != null) {
|
||||
liveData.removeObserver(oldObserver);
|
||||
}
|
||||
|
||||
// Crea e registra il nuovo observer
|
||||
Observer<Object> newObserver = value ->
|
||||
view.setVisibility(value == null ? View.VISIBLE : View.GONE);
|
||||
|
||||
liveData.observe(lifecycleOwner, newObserver);
|
||||
view.setTag(R.id.bound_observable_visibility, newObserver);
|
||||
|
||||
// Imposta lo stato iniziale
|
||||
view.setVisibility(liveData.getValue() == null ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter({"reverse_visibility"})
|
||||
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
if (view.getTag(R.id.bound_reverse_visibility) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_reverse_visibility, bindableBoolean);
|
||||
}
|
||||
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
@@ -761,4 +1199,64 @@ public class Converters {
|
||||
view.setLayoutParams(layoutParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* BindingAdapter per bindare una LocalDate diretta su una TextView con un formato specificato.
|
||||
* Esempio di utilizzo in XML:
|
||||
* app:localDateText="@{myLocalDate}" app:dateFormat="@{@string/my_date_format}"
|
||||
*/
|
||||
@BindingAdapter(value = {"localDateText", "dateFormat"}, requireAll = false)
|
||||
public static void bindLocalDateText(TextView view, LocalDate date, String dateFormat) {
|
||||
if (date == null) {
|
||||
view.setText("");
|
||||
return;
|
||||
}
|
||||
String pattern = dateFormat != null ? dateFormat : "dd/MM/yyyy";
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||
view.setText(date.format(formatter));
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"localDateTimeText", "dateFormat"}, requireAll = false)
|
||||
public static void bindLocalDateText(TextView view, LocalDateTime date, String dateFormat) {
|
||||
if (date == null) {
|
||||
view.setText("");
|
||||
return;
|
||||
}
|
||||
String pattern = dateFormat != null ? dateFormat : "dd/MM/yyyy hh:mm";
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||
view.setText(date.format(formatter));
|
||||
}
|
||||
|
||||
/**
|
||||
* BindingAdapter per bindare una ObservableField<LocalDate> su una TextView con un formato specificato.
|
||||
* Esempio di utilizzo in XML:
|
||||
* app:localDateObservableText="@{myObservableLocalDate}" app:dateFormat="@{@string/my_date_format}"
|
||||
*/
|
||||
@BindingAdapter(value = {"localDateObservableText", "dateFormat"}, requireAll = false)
|
||||
public static void bindObservableLocalDateText(TextView view, ObservableField<LocalDate> observableDate, String dateFormat) {
|
||||
if (observableDate == null) {
|
||||
view.setText("");
|
||||
return;
|
||||
}
|
||||
LocalDate date = observableDate.get();
|
||||
if (date == null) {
|
||||
view.setText("");
|
||||
return;
|
||||
}
|
||||
String pattern = dateFormat != null ? dateFormat : "dd/MM/yyyy";
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||
view.setText(date.format(formatter));
|
||||
}
|
||||
|
||||
/**
|
||||
* BindingAdapter che applica automaticamente il KeyListener localizzato
|
||||
* ai campi con inputType numberDecimal, permettendo l'uso della virgola
|
||||
* come separatore decimale in base al locale del dispositivo.
|
||||
*/
|
||||
@BindingAdapter("useLocaleDecimalInput")
|
||||
public static void setLocaleDecimalInput(EditText view, boolean useLocaleInput) {
|
||||
if (useLocaleInput) {
|
||||
view.setKeyListener(LocaleDecimalKeyListener.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class MutableListLiveData<T> extends MutableLiveData<List<T>> {
|
||||
|
||||
public MutableListLiveData() {
|
||||
super(new ArrayList<>());
|
||||
}
|
||||
|
||||
public MutableListLiveData(List<T> initialValue) {
|
||||
super(initialValue);
|
||||
}
|
||||
|
||||
public void add(T item, boolean immediateSet) {
|
||||
List<T> current = getValue();
|
||||
List<T> newList = new ArrayList<>(current);
|
||||
newList.add(item);
|
||||
|
||||
if(immediateSet)
|
||||
setValue(newList);
|
||||
else postValue(newList);
|
||||
}
|
||||
|
||||
public void add(T item) {
|
||||
add(item, false);
|
||||
}
|
||||
|
||||
public void add(int index, T item, boolean immediateSet) {
|
||||
List<T> current = getValue();
|
||||
List<T> newList = new ArrayList<>(current);
|
||||
newList.add(index, item);
|
||||
|
||||
if(immediateSet)
|
||||
setValue(newList);
|
||||
else postValue(newList);
|
||||
}
|
||||
|
||||
public void add(int index, T item) {
|
||||
add(index, item, false);
|
||||
}
|
||||
|
||||
public void remove(T item, boolean immediateSet) {
|
||||
List<T> current = getValue();
|
||||
List<T> newList = new ArrayList<>(current);
|
||||
newList.remove(item);
|
||||
|
||||
if(immediateSet)
|
||||
setValue(newList);
|
||||
else postValue(newList);
|
||||
}
|
||||
|
||||
public void remove(T item) {
|
||||
remove(item, false);
|
||||
}
|
||||
|
||||
public void update(Consumer<List<T>> updater) {
|
||||
List<T> current = getValue();
|
||||
List<T> newList = new ArrayList<>(current);
|
||||
updater.accept(newList);
|
||||
postValue(newList);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
List<T> newList = new ArrayList<>();
|
||||
postValue(newList);
|
||||
}
|
||||
|
||||
public void addAll(List<T> items) {
|
||||
List<T> current = getValue();
|
||||
List<T> newList = new ArrayList<>(current);
|
||||
newList.addAll(items);
|
||||
postValue(newList);
|
||||
}
|
||||
|
||||
public MutableListLiveData<T> clone() {
|
||||
MutableListLiveData<T> clone = new MutableListLiveData<>();
|
||||
List<T> current = getValue();
|
||||
if (current != null) {
|
||||
clone.postValue(new ArrayList<>(current));
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
List<T> current = getValue();
|
||||
return current == null || current.isEmpty();
|
||||
}
|
||||
|
||||
public T get(int index) {
|
||||
List<T> current = getValue();
|
||||
if (current != null && index >= 0 && index < current.size()) {
|
||||
return current.get(index);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
List<T> current = getValue();
|
||||
return current != null ? current.size() : 0;
|
||||
}
|
||||
|
||||
public java.util.stream.Stream<T> stream() {
|
||||
List<T> current = getValue();
|
||||
return current != null ? current.stream() : java.util.stream.Stream.empty();
|
||||
}
|
||||
|
||||
public void removeAll(Collection<T> items) {
|
||||
List<T> current = getValue();
|
||||
List<T> newList = new ArrayList<>(current);
|
||||
newList.removeAll(items);
|
||||
postValue(newList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Classe che gestisce la serializzazione e deserializzazione di MutableListLiveData con Gson
|
||||
*
|
||||
* @param <T> tipo degli elementi nella lista
|
||||
*/
|
||||
public class MutableListLiveDataTypeAdapter<T> implements JsonSerializer<MutableListLiveData<T>>, JsonDeserializer<MutableListLiveData<T>> {
|
||||
|
||||
private final Handler handler = new Handler(Looper.getMainLooper());
|
||||
|
||||
/**
|
||||
* Serializza un oggetto MutableListLiveData in un JsonElement
|
||||
*/
|
||||
@Override
|
||||
public JsonElement serialize(MutableListLiveData<T> src, Type typeOfSrc, JsonSerializationContext context) {
|
||||
// Ottiene la lista interna da MutableListLiveData e la serializza
|
||||
List<T> list = src.getValue();
|
||||
return context.serialize(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializza un JsonElement in un oggetto MutableListLiveData
|
||||
*/
|
||||
@Override
|
||||
public MutableListLiveData<T> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
// Determina il tipo degli elementi nella lista
|
||||
Type listType = getListType(typeOfT);
|
||||
|
||||
// Deserializza il JsonElement in una lista
|
||||
List<T> list = context.deserialize(json, listType);
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
|
||||
// Crea una nuova istanza di MutableListLiveData e aggiunge tutti gli elementi
|
||||
MutableListLiveData<T> result = new MutableListLiveData<>(list);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Estrae il tipo della lista da un tipo parametrizzato di MutableListLiveData<T>
|
||||
*/
|
||||
private Type getListType(Type mutableListLiveDataType) {
|
||||
if (mutableListLiveDataType instanceof ParameterizedType) {
|
||||
ParameterizedType parameterizedType = (ParameterizedType) mutableListLiveDataType;
|
||||
Type[] typeArguments = parameterizedType.getActualTypeArguments();
|
||||
if (typeArguments.length > 0) {
|
||||
// Crea un tipo di List<T> usando il parametro di tipo T
|
||||
return TypeToken.getParameterized(List.class, typeArguments[0]).getType();
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback per List<Object> se non riusciamo a determinare il tipo
|
||||
return TypeToken.getParameterized(List.class, Object.class).getType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Crea un'istanza del TypeAdapter per MutableListLiveData<T>
|
||||
*
|
||||
* @param elementType il tipo T degli elementi nella lista
|
||||
* @return un'istanza del TypeAdapter
|
||||
*/
|
||||
public static <T> MutableListLiveDataTypeAdapter<T> create(Type elementType) {
|
||||
return new MutableListLiveDataTypeAdapter<>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Classe che gestisce la serializzazione e deserializzazione di MutableListLiveData con Gson
|
||||
*
|
||||
* @param <T> tipo degli elementi nella lista
|
||||
*/
|
||||
public class ObservableArrayListDataTypeAdapter<T> implements JsonSerializer<ObservableArrayList<T>>, JsonDeserializer<ObservableArrayList<T>> {
|
||||
|
||||
private final Handler handler = new Handler(Looper.getMainLooper());
|
||||
|
||||
/**
|
||||
* Serializza un oggetto MutableListLiveData in un JsonElement
|
||||
*/
|
||||
@Override
|
||||
public JsonElement serialize(ObservableArrayList<T> src, Type typeOfSrc, JsonSerializationContext context) {
|
||||
// Ottiene la lista interna da MutableListLiveData e la serializza
|
||||
ArrayList<T> list = new ArrayList<>(src);
|
||||
return context.serialize(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializza un JsonElement in un oggetto MutableListLiveData
|
||||
*/
|
||||
@Override
|
||||
public ObservableArrayList<T> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
// Determina il tipo degli elementi nella lista
|
||||
Type listType = getListType(typeOfT);
|
||||
|
||||
// Deserializza il JsonElement in una lista
|
||||
List<T> list = context.deserialize(json, listType);
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
|
||||
// Crea una nuova istanza di MutableListLiveData e aggiunge tutti gli elementi
|
||||
ObservableArrayList<T> result = new ObservableArrayList<>();
|
||||
|
||||
result.addAll(list);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Estrae il tipo della lista da un tipo parametrizzato di MutableListLiveData<T>
|
||||
*/
|
||||
private Type getListType(Type mutableListLiveDataType) {
|
||||
if (mutableListLiveDataType instanceof ParameterizedType) {
|
||||
ParameterizedType parameterizedType = (ParameterizedType) mutableListLiveDataType;
|
||||
Type[] typeArguments = parameterizedType.getActualTypeArguments();
|
||||
if (typeArguments.length > 0) {
|
||||
// Crea un tipo di List<T> usando il parametro di tipo T
|
||||
return TypeToken.getParameterized(List.class, typeArguments[0]).getType();
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback per List<Object> se non riusciamo a determinare il tipo
|
||||
return TypeToken.getParameterized(List.class, Object.class).getType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Crea un'istanza del TypeAdapter per MutableListLiveData<T>
|
||||
*
|
||||
* @param elementType il tipo T degli elementi nella lista
|
||||
* @return un'istanza del TypeAdapter
|
||||
*/
|
||||
public static <T> ObservableArrayListDataTypeAdapter<T> create(Type elementType) {
|
||||
return new ObservableArrayListDataTypeAdapter<>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.BaseObservable;
|
||||
import androidx.databinding.Bindable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.core.di.validators.Validator;
|
||||
|
||||
public class ValidatableObservableField<T> extends BaseObservable {
|
||||
private T mValue;
|
||||
private final List<Validator<T>> validators = new ArrayList<>();
|
||||
public String errorMessage;
|
||||
|
||||
public ValidatableObservableField() {
|
||||
}
|
||||
|
||||
public ValidatableObservableField(T value) {
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the stored value.
|
||||
*/
|
||||
@Nullable
|
||||
public T get() {
|
||||
return mValue;
|
||||
}
|
||||
|
||||
public void set(T value) {
|
||||
if (value != mValue) {
|
||||
mValue = value;
|
||||
notifyChange();
|
||||
validate();
|
||||
}
|
||||
}
|
||||
|
||||
public void addValidator(Validator<T> validator) {
|
||||
validators.add(validator);
|
||||
}
|
||||
|
||||
public boolean validate() {
|
||||
for (Validator<T> validator : validators) {
|
||||
if (!validator.isValid(mValue)) {
|
||||
setErrorMessage(validator.getErrorMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
setErrorMessage(null);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
private void setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
notifyPropertyChanged(BR.errorMessage); // Notifica il cambiamento di errorMessage
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,25 @@ package it.integry.integrywmsnative.core.di.binders;
|
||||
|
||||
public class AutoCompleteTextViewBinders {
|
||||
|
||||
|
||||
// @BindingAdapter("binding")
|
||||
// public static void bindUntMisText(AppCompatAutoCompleteTextView view, ObservableField<MtbUntMis> untMisField) {
|
||||
// Pair<ObservableField<MtbUntMis>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
// if (pair == null || pair.first != untMisField) {
|
||||
// if (pair != null) {
|
||||
// view.removeTextChangedListener(pair.second);
|
||||
// }
|
||||
// TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
// @Override
|
||||
// public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// if (untMisField != null) untMisField.set(s.toString());
|
||||
// }
|
||||
// };
|
||||
// view.setTag(R.id.bound_observable, new Pair<>(untMisField, watcher));
|
||||
// view.addTextChangedListener(watcher);
|
||||
// }
|
||||
// String newValue = untMisField != null && untMisField.get() != null ? Objects.requireNonNull(untMisField.get()).getUntMis() : "";
|
||||
// if (!view.getText().toString().equals(newValue)) {
|
||||
// view.setText(newValue);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.di.binders;
|
||||
|
||||
import androidx.databinding.BindingAdapter;
|
||||
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
public class TextInputLayoutBinders {
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package it.integry.integrywmsnative.core.di.binders.recyclerview;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableList;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class GreaterThenValidator implements Validator<BigDecimal> {
|
||||
private final String errorMessage;
|
||||
private final BigDecimal greaterThanValue;
|
||||
|
||||
public GreaterThenValidator(BigDecimal greaterThanValue, String errorMessage) {
|
||||
this.greaterThanValue = greaterThanValue;
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(BigDecimal value) {
|
||||
return value != null && value.compareTo(greaterThanValue) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
public class MinLengthValidator implements Validator<String> {
|
||||
private final int minLength;
|
||||
private final String errorMessage;
|
||||
|
||||
public MinLengthValidator(int minLength, String errorMessage) {
|
||||
this.minLength = minLength;
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(String value) {
|
||||
return value != null && value.length() >= minLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
public class NotEmptyValidator implements Validator<String> {
|
||||
private final String errorMessage;
|
||||
|
||||
public NotEmptyValidator(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(String value) {
|
||||
return value != null && !value.trim().isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
public class NotNullValidator<T> implements Validator<T>{
|
||||
private final String errorMessage;
|
||||
|
||||
public NotNullValidator(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(T value) {
|
||||
return value != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
public interface Validator<T> {
|
||||
boolean isValid(T value);
|
||||
|
||||
String getErrorMessage();
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package it.integry.integrywmsnative.core.diff;
|
||||
|
||||
import androidx.recyclerview.widget.DiffUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
|
||||
public class MtbColrDiffCallback extends DiffUtil.Callback {
|
||||
private final List<MtbColr> oldList;
|
||||
private final List<MtbColr> newList;
|
||||
|
||||
public MtbColrDiffCallback(List<MtbColr> oldList, List<MtbColr> newList) {
|
||||
this.oldList = oldList;
|
||||
this.newList = newList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOldListSize() {
|
||||
return oldList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNewListSize() {
|
||||
return newList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
|
||||
MtbColr oldItem = oldList.get(oldItemPosition);
|
||||
MtbColr newItem = newList.get(newItemPosition);
|
||||
|
||||
return oldItem.getKey().equals(newItem.getKey()); // Placeholder, idealmente confrontare ID univoci
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
|
||||
// Assicurarsi che MtbColr.equals() confronti i contenuti rilevanti per la UI
|
||||
return oldList.get(oldItemPosition).equals(newList.get(newItemPosition));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
public enum Ean128AI {
|
||||
|
||||
|
||||
NULL, //Valore nullo (usato solo in logica)
|
||||
SSCC, //Numero sequenziale del collo n2+n18
|
||||
GTIN, //Codice EAN/UCC unità logistica n2+n14
|
||||
CONTENT, //Codice EAN/UCC dei prodotti contenuti all'interno di unità log n2+n14
|
||||
BATCH_LOT, //Numero del lotto di fabbricazione n2+an.20
|
||||
PROD_DATE, //Data di produzione (yymmdd) 0~50 (2000~2050) - 51~99 (1951~1999) n2+n6
|
||||
DUE_DATE, //Data di scadenza pagamento fattura n2+n6
|
||||
PACK_DATE, //Data di confezionamento n2+n6
|
||||
BEST_BEFORE,//Data minima di validità n2+n6
|
||||
EXPIRY, //Data massima di validità n2+n6
|
||||
VARIANT, //Variante di prodotto - uso interno aziendale n2+n2
|
||||
SERIAL, //Numero di serie n2+an.20
|
||||
QTY_DATE_BATCH, //Dati supplementari per prodotti farmaceutici n2+an.29
|
||||
ADDITIONAL_ID, //Numedi di identificazione supplementare del prodotto n3+an.30
|
||||
CUST_PART_NO, //Codice prodotto interno del cliente n3+an.30
|
||||
SECONDARY_SERIAL, //Numero di serie secondario n3+an.30
|
||||
REF_TO_SOURCE, //Entità di origine o marca auricolare n3+an.30
|
||||
VAR_COUNT, //Quantità variabile n2+n.8
|
||||
|
||||
//Misure commerciali e logistiche FORMATO: n4+n6
|
||||
NET_WEIGHT_KG, //Peso netto in Kg
|
||||
LENGTH_M, //Lunghezza o 1° dimensione, in mt, uso commerciale
|
||||
WIDTH_M, //Larghezza, diametro o 2° dimensione, in mt, uso commerciale
|
||||
HEIGHT_M, //Profondità, spessore, altezza o 3° dimensione, in mt, uso commerciale
|
||||
AREA_M2, //Superficie, in metriquadri, uso commerciale
|
||||
NET_VOLUME_L, //Volume, in litri, uso commerciale
|
||||
NET_VOLUME_M3, //Volume, in metricubi, uso commerciale
|
||||
NET_WEIGHT_LB, //Peso netto, in libbre, uso commerciale
|
||||
LENGTH_I, //Lunghezza o 1° dimensione, in pollici, uso commerciale
|
||||
LENGTH_F, //Lunghezza o 1° dimensione, in piedi, uso commerciale
|
||||
LENGTH_Y, //Lunghezza o 1° dimensione, in yards, uso commerciale
|
||||
WIDTH_I, //Larghezza, diametro o 2° dimensione, in pollici, uso commerciale
|
||||
WIDTH_F, //Larghezza, diametro o 2° dimensione, in piedi, uso commerciale
|
||||
WIDTH_Y, //Larghezza, diametro o 2° dimensione, in yards, uso commerciale
|
||||
HEIGHT_I, //Profondità, spessore, altezza o 3° dimensione, in pollici, uso commerciale
|
||||
HEIGHT_F, //Profondità, spessore, altezza o 3° dimensione, in piedi, uso commerciale
|
||||
HEIGHT_Y, //Profondità, spessore, altezza o 3° dimensione, in yards, uso commerciale
|
||||
CROSSWEIGHT_KG_LOG, //Peso lordo, in Kg, uso logistico
|
||||
LENGTH_M_LOG, //Lunghezza o 1° dimensione, in metri, uso logistico
|
||||
WIDTH_M_LOG, //Larghezza, diametro o 2° dimensione, in metri, uso logistico
|
||||
HEIGHT_M_LOG, //Profondità, spessore, altezza o 3° dimensione, in metri, uso logistico
|
||||
AREA_M2_LOG, //Superficie, in metriquadri, uso logistico
|
||||
VOLUME_L_LOG, //Volume lordo, in litri, uso logistico
|
||||
VOLUME_M3_LOG, //Volume lordo, in metricubi, uso logistico
|
||||
CROSSWEIGHT_LB_LOG, //Peso lordo, in libbre, uso logistico
|
||||
LENGTH_I_LOG, //Lunghezza o 1° dimensione, in pollici, uso logistico
|
||||
LENGTH_F_LOG, //Lunghezza o 1° dimensione, in piedi, uso logistico
|
||||
LENGTH_Y_LOG, //Lunghezza o 1° dimensione, in yards, uso logistico
|
||||
WIDTH_I_LOG, //Larghezza, diametro o 2° dimensione, in pollici, uso logistico
|
||||
WIDTH_F_LOG, //Larghezza, diametro o 2° dimensione, in piedi, uso logistico
|
||||
WIDTH_Y_LOG, //Larghezza, diametro o 2° dimensione, in yards, uso logistico
|
||||
HEIGHT_I_LOG, //Profondità, spessore, altezza o 3° dimensione, in pollici, uso logistico
|
||||
HEIGHT_F_LOG, //Profondità, spessore, altezza o 3° dimensione, in piedi, uso logistico
|
||||
HEIGHT_Y_LOG, //Profondità, spessore, altezza o 3° dimensione, in yards, uso logistico
|
||||
AREA_I2, //Superficie, in pollici quadrati, uso commerciale
|
||||
AREA_F2, //Superficie, in piedi quadrati, uso commerciale
|
||||
AREA_Y2, //Superficie, in yards quadrati, uso commerciale
|
||||
AREA_I2_LOG, //Superficie, in pollici quadrati, uso logistico
|
||||
AREA_F2_LOG, //Superficie, in piedi quadrati, uso logistico
|
||||
AREA_Y2_LOG, //Superficie, in yards quadrati, uso logistico
|
||||
NET_WEIGHT_T, //Peso netto, in once troy, uso commerciale
|
||||
NET_VOLUME_OZ, //Volume netto, in once (U.S.), uso commerciale
|
||||
NET_VOLUME_LB, //Volume netto, in quarti di gallone, uso commerciale
|
||||
NET_VOLUME_G, //Volume netto, in galloni (U.S.), uso commerciale
|
||||
VOLUME_Q_LOG, //Volume lordo, in quarti di gallone, uso logistico
|
||||
VOLUME_G_LOG, //Volume lordo, in galloni (U.S.), uso logistico
|
||||
NET_VOLUME_I3, //Volume netto, in pollici cubi, uso commerciale
|
||||
NET_VOLUME_F3, //Volume netto, in piedi cubi, uso commerciale
|
||||
NET_VOLUME_Y3, //Volume netto, in yards cubi, uso commerciale
|
||||
VOLUME_I3_LOG, //Volume lordo, in pollici cubi, uso logistico
|
||||
VOLUME_F3_LOG, //Volume lordo, in piedi cubi, uso logistico
|
||||
VOLUME_Y3_LOG, //Volume lordo, in yards cubi, uso logistico
|
||||
COUNT, //Quantità prodotti contenuti in un'unità logistica
|
||||
AMOUNT, //Importo da pagare singola area monetaria
|
||||
AMOUNT_ISO, //Importo da pagare con codice valuta ISO
|
||||
PRICE, //Importo da pagare singola unità monetaria (prodotti a peso variabile)
|
||||
PRICE_ISO, //Importo da pagare con codice valuta ISO (prodotti a peso variabile)
|
||||
ORDER_NUMBER, //Numero d'ordine d'acquisto cliente
|
||||
CONSIGNMENT, //Numero di consegna
|
||||
SHIPMENT_NO, //Numero di spedizione
|
||||
ROUTE, //Codice di smistamento pacchi
|
||||
SHIP_TO_LOC, //Codice di locazione EAN/UCC "Spedire a, Consegnare a"
|
||||
BILL_TO_LOC, //Codice di locazione EAN/UCC "Fatturare a"
|
||||
PURCHASE_FROM_LOC, //Codice di locazione EAN/UCC "Acquistato da"
|
||||
SHIP_FOR_LOC, //Codice di locazione EAN/UCC "Sperdire per, Consegnare per, Inoltrare a"
|
||||
LOC_NO, //Codice di locazione EAN/UCC: identificazione di una locazione fisica
|
||||
PAY_TO_LOC, //Codice di locazione EAN/UCC di chi emette la fattura
|
||||
SHIP_TO_POST, //Codice postale "Spedire a, Consegnare a" (nazionale)
|
||||
SHIP_TO_POST_ISO, //Codice postale "Spedire a, Consegnare a" con codice nazione ISO
|
||||
ORIGIN, //Paese di origine del prodotto
|
||||
COUNTRY_INITIAL_PROCESS, //Paese di lavorazione iniziale del prodotto con codice nazionale ISO
|
||||
COUNTRY_PROCESS, //Paese di lavorazione con codice nazionale ISO
|
||||
COUNTRY_DISASSEMBLY, //Paese di scomposizione con codice nazionale ISO
|
||||
COUNTRY_FULL_PROCESS,//Paese di lavorazione completa con codice nazionale ISO
|
||||
NSN, //Numero di stock NATO
|
||||
MEAT_CUT, //Carcasse animali e classificazione dei tagli UN/ECE
|
||||
PROCESSORS, //Numero di approvazione del laboratorio di lavorazione intermedio con codice nazionale ISO
|
||||
DIMENSIONS, //Prodotti in rotoli - larghezza, lunghezza, diametro interno, senso di svolgimento e giunte
|
||||
CMT_NO, //Numero sequenziale elettronico per applicazioni di telefonia cellulare
|
||||
GRAI, //Numero di identificazione per beni a rendere,
|
||||
GIAI, //Numero di identificazione globale per beni individuali
|
||||
PRICE_PER_UNIT, //Prezzo per unità di misura
|
||||
GCTIN, //Identificazione dei componenti di un prodotto
|
||||
IBAN, //Numero di contocorrente bancario internazionale
|
||||
PROD_TIME, //Data e ora di produzione
|
||||
GSRN, //Numedo Globale di Relazione di Servizio
|
||||
REF_NO, //Numero del bollettino di pagamento
|
||||
COUPON_1, //Codice esteso per i coupons, UCC
|
||||
COUPON_2, //Codice esteso per i coupons, UCC
|
||||
COUPON_3, //Codice esteso per i coupons, UCC
|
||||
INTERNAL_PART, //Informazioni concordate tra i partners commerciali
|
||||
INTERNAL_1, //Informazioni interne
|
||||
INTERNAL_2, //Informazioni interne
|
||||
INTERNAL_3, //Informazioni interne
|
||||
INTERNAL_4, //Informazioni interne
|
||||
INTERNAL_5, //Informazioni interne
|
||||
INTERNAL_6, //Informazioni interne
|
||||
INTERNAL_7, //Informazioni interne
|
||||
INTERNAL_8, //Informazioni interne
|
||||
INTERNAL_9, //Informazioni interne
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
public class Ean128AIModel implements Cloneable {
|
||||
|
||||
|
||||
public Ean128AI AI;
|
||||
|
||||
public String code;
|
||||
|
||||
public int dataLength;
|
||||
|
||||
public boolean flagVariableLength;
|
||||
|
||||
public boolean flagOnlyNumeric;
|
||||
|
||||
public int decimalDigits;
|
||||
|
||||
public Ean128AIModel(Ean128AI AI, String code, int dataLength, boolean flagVariableLength, boolean flagOnlyNumeric, int decimalDigits) {
|
||||
this.AI = AI;
|
||||
this.code = code;
|
||||
this.dataLength = dataLength;
|
||||
this.flagVariableLength = flagVariableLength;
|
||||
this.flagOnlyNumeric = flagOnlyNumeric;
|
||||
this.decimalDigits = decimalDigits;
|
||||
}
|
||||
|
||||
public Ean128AIModel(Ean128AI AI, String code, int dataLength, boolean flagVariableLength, boolean flagOnlyNumeric) {
|
||||
this.AI = AI;
|
||||
this.code = code;
|
||||
this.dataLength = dataLength;
|
||||
this.flagVariableLength = flagVariableLength;
|
||||
this.flagOnlyNumeric = flagOnlyNumeric;
|
||||
}
|
||||
|
||||
protected Object clone() throws CloneNotSupportedException {
|
||||
return super.clone();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
import java.util.regex.MatchResult;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Ean128AIModelBij {
|
||||
|
||||
private final Ean128AIModel[] _aiModelArray = new Ean128AIModel[]{
|
||||
new Ean128AIModel(Ean128AI.SSCC, "^00", 18, false, true),
|
||||
new Ean128AIModel(Ean128AI.GTIN, "^01", 14, false, true),
|
||||
new Ean128AIModel(Ean128AI.CONTENT, "^02", 14, false, true),
|
||||
new Ean128AIModel(Ean128AI.BATCH_LOT, "^10", 20, true, false),
|
||||
new Ean128AIModel(Ean128AI.PROD_DATE, "^11", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.DUE_DATE, "^12", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.PACK_DATE, "^13", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.BEST_BEFORE, "^15", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.EXPIRY, "^17", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VARIANT, "^20", 2, false, true),
|
||||
new Ean128AIModel(Ean128AI.SERIAL, "^21", 20, true, false),
|
||||
new Ean128AIModel(Ean128AI.QTY_DATE_BATCH, "^22", 29, true, false),
|
||||
new Ean128AIModel(Ean128AI.ADDITIONAL_ID, "^240", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.CUST_PART_NO, "^241", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.SECONDARY_SERIAL, "^250", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.REF_TO_SOURCE, "^251", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.VAR_COUNT, "^30", 8, true, true),
|
||||
new Ean128AIModel(Ean128AI.NET_WEIGHT_KG, "^310(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_M, "^311(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_M, "^312(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_M, "^313(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_M2, "^314(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_L, "^315(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_M3, "^316(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_WEIGHT_LB, "^320(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_I, "^321(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_F, "^322(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_Y, "^323(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_I, "^324(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_F, "^325(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_Y, "^326(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_I, "^327(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_F, "^328(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_Y, "^329(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.CROSSWEIGHT_KG_LOG, "^330(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_M_LOG, "^331(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_M_LOG, "^332(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_M_LOG, "^333(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_M2_LOG, "^334(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_L_LOG, "^335(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_M3_LOG, "^336(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.CROSSWEIGHT_LB_LOG, "^340(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_I_LOG, "^341(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_F_LOG, "^342(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_Y_LOG, "^343(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_I_LOG, "^344(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_F_LOG, "^345(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_Y_LOG, "^346(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_I_LOG, "^347(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_F_LOG, "^348(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_Y_LOG, "^349(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_I2, "^350(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_F2, "^351(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_Y2, "^352(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_I2_LOG, "^353(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_F2_LOG, "^354(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_Y2_LOG, "^355(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_WEIGHT_T, "^356(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_OZ, "^357(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_LB, "^360(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_G, "^361(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_Q_LOG, "^362(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_G_LOG, "^363(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_I3, "^364(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_F3, "^365(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_Y3, "^366(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_I3_LOG, "^367(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_F3_LOG, "^368(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_Y3_LOG, "^369(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUNT, "^37", 8, true, true),
|
||||
new Ean128AIModel(Ean128AI.AMOUNT, "^390(\\d{1})", 15, true, true),
|
||||
new Ean128AIModel(Ean128AI.AMOUNT_ISO, "^391(\\d{1})", 18, true, true),
|
||||
new Ean128AIModel(Ean128AI.PRICE, "^392(\\d{1})", 15, true, true),
|
||||
new Ean128AIModel(Ean128AI.PRICE_ISO, "^393(\\d{1})", 18, true, true),
|
||||
new Ean128AIModel(Ean128AI.ORDER_NUMBER, "^400", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.CONSIGNMENT, "^401", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.SHIPMENT_NO, "^402", 17, false, true),
|
||||
new Ean128AIModel(Ean128AI.ROUTE, "^403", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.SHIP_TO_LOC, "^410", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.BILL_TO_LOC, "^411", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.PURCHASE_FROM_LOC, "^412", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.SHIP_FOR_LOC, "^413", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.LOC_NO, "^414", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.PAY_TO_LOC, "^415", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.SHIP_TO_POST, "^420", 20, true, false),
|
||||
new Ean128AIModel(Ean128AI.SHIP_TO_POST_ISO, "^421", 12, true, false),
|
||||
new Ean128AIModel(Ean128AI.ORIGIN, "^422", 3, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUNTRY_INITIAL_PROCESS, "^423", 15, true, true),
|
||||
new Ean128AIModel(Ean128AI.COUNTRY_PROCESS, "^424", 3, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUNTRY_DISASSEMBLY, "^425", 3, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUNTRY_FULL_PROCESS, "^426", 3, false, true),
|
||||
new Ean128AIModel(Ean128AI.NSN, "^7001", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.MEAT_CUT, "^7002", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.DIMENSIONS, "^8001", 14, false, true),
|
||||
new Ean128AIModel(Ean128AI.CMT_NO, "^8002", 20, true, false),
|
||||
new Ean128AIModel(Ean128AI.GRAI, "^8003", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.GIAI, "^8004", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.PRICE_PER_UNIT, "^8005", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.GCTIN, "^8006", 18, false, false),
|
||||
new Ean128AIModel(Ean128AI.IBAN, "^8007", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.PROD_TIME, "^8008", 12, true, true),
|
||||
new Ean128AIModel(Ean128AI.GSRN, "^8018", 18, false, true),
|
||||
new Ean128AIModel(Ean128AI.REF_NO, "^8020", 25, true, false),
|
||||
new Ean128AIModel(Ean128AI.COUPON_1, "^8100", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUPON_2, "^8101", 10, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUPON_3, "^8102", 2, false, true),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_PART, "^90", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_1, "^91", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_2, "^92", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_3, "^93", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_4, "^94", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_5, "^95", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_6, "^96", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_7, "^97", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_8, "^98", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_9, "^99", 30, true, false)
|
||||
};
|
||||
|
||||
|
||||
public int checkAI(String aiToCheck) {
|
||||
int count = -1;
|
||||
|
||||
if (aiToCheck.length() > 1) {
|
||||
for (int i = 0; i < _aiModelArray.length; i++) {
|
||||
final String groupSeparatorCharInHexForRegex = "\\x1D";
|
||||
String codePattern = "";
|
||||
|
||||
if (aiToCheck.charAt(0) == (char) 29) {
|
||||
codePattern += groupSeparatorCharInHexForRegex;
|
||||
}
|
||||
|
||||
codePattern += _aiModelArray[i].code;
|
||||
|
||||
|
||||
Pattern pattern = Pattern.compile(codePattern, Pattern.CASE_INSENSITIVE);
|
||||
Matcher matcher = pattern.matcher(aiToCheck);
|
||||
|
||||
|
||||
if (matcher.find()) {
|
||||
count = i;
|
||||
MatchResult matchResult = matcher.toMatchResult();
|
||||
|
||||
if (matchResult.groupCount() >= 1) {
|
||||
String digitsString = matchResult.group(1);
|
||||
_aiModelArray[i].decimalDigits = Integer.parseInt(digitsString);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
public Ean128AIModel readAI(String aiToSearch) {
|
||||
|
||||
Ean128AIModel barcodeAIModel = null;
|
||||
|
||||
for (Ean128AIModel singleBarcodeAIModel : _aiModelArray) {
|
||||
final String groupSeparatorCharInHexForRegex = "\\x1D";
|
||||
String codePattern = "";
|
||||
|
||||
if (aiToSearch.charAt(0) == (char) 29) {
|
||||
codePattern += groupSeparatorCharInHexForRegex;
|
||||
}
|
||||
|
||||
codePattern += singleBarcodeAIModel.code;
|
||||
|
||||
|
||||
Pattern pattern = Pattern.compile(codePattern, Pattern.CASE_INSENSITIVE);
|
||||
Matcher matcher = pattern.matcher(aiToSearch);
|
||||
|
||||
if (matcher.matches()) {
|
||||
try {
|
||||
barcodeAIModel = (Ean128AIModel) singleBarcodeAIModel.clone();
|
||||
|
||||
MatchResult matchResult = matcher.toMatchResult();
|
||||
|
||||
if (matchResult.groupCount() > 1) {
|
||||
String digitsString = matchResult.group(1);
|
||||
barcodeAIModel.decimalDigits = Integer.parseInt(digitsString);
|
||||
}
|
||||
break;
|
||||
} catch (CloneNotSupportedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return barcodeAIModel;
|
||||
}
|
||||
|
||||
public Ean128AIModel getAI(int index) {
|
||||
return _aiModelArray[index];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
public class Ean128ISOValueModel<T> {
|
||||
|
||||
public String ISOCode;
|
||||
public T Value;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,328 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.base.Callable;
|
||||
import it.integry.integrywmsnative.core.base.CallableII;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
|
||||
public class Ean128Service {
|
||||
|
||||
public Ean128Model decode(BarcodeScanDTO barcodeScanDTO) throws Exception {
|
||||
byte[] inputEan128ByteArr = barcodeScanDTO.getStringValue().replaceAll("" + ((char) 29), "|").getBytes();
|
||||
Ean128AIModelBij ean128AIModelBij = new Ean128AIModelBij();
|
||||
|
||||
String aiCodeBuffer = "";
|
||||
|
||||
Ean128Model model = new Ean128Model();
|
||||
|
||||
for (int i = 0; i < inputEan128ByteArr.length; i++) {
|
||||
aiCodeBuffer += (char) inputEan128ByteArr[i];
|
||||
|
||||
if (aiCodeBuffer.startsWith("|")) {
|
||||
aiCodeBuffer = aiCodeBuffer.substring(1);
|
||||
}
|
||||
|
||||
if (aiCodeBuffer.length() <= 5) {
|
||||
int aiIndex = ean128AIModelBij.checkAI(aiCodeBuffer);
|
||||
|
||||
if (aiIndex != -1) {
|
||||
|
||||
Ean128AIModel aiModel = ean128AIModelBij.getAI(aiIndex);
|
||||
|
||||
StringBuilder aiValue = new StringBuilder();
|
||||
|
||||
if (!aiModel.flagVariableLength) {
|
||||
|
||||
for (int j = (i + 1); j < (i + 1) + aiModel.dataLength; j++) {
|
||||
aiValue.append((char) inputEan128ByteArr[j]);
|
||||
}
|
||||
|
||||
//aiValue = barcodeAsString.Substring(i + 1, aiModel.DataLength);
|
||||
i += aiModel.dataLength;
|
||||
} else {
|
||||
String tempBuffer = "";
|
||||
|
||||
i++;
|
||||
|
||||
while (i < inputEan128ByteArr.length && i < (aiModel.dataLength + i)) {
|
||||
byte currentChar = inputEan128ByteArr[i];
|
||||
|
||||
if (currentChar != 29 && currentChar != '|') { //Controllo carattere FNC1
|
||||
tempBuffer += (char) currentChar;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
aiValue = new StringBuilder(tempBuffer.replace("\r", "").replace("\n", ""));
|
||||
}
|
||||
|
||||
switch (aiModel.AI) {
|
||||
case SSCC -> {
|
||||
model.Sscc = aiValue.toString();
|
||||
}
|
||||
case GTIN -> {
|
||||
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
||||
aiValue = new StringBuilder(aiValue.substring(1));
|
||||
}
|
||||
model.Gtin = aiValue.toString();
|
||||
}
|
||||
case CONTENT -> {
|
||||
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
||||
aiValue = new StringBuilder(aiValue.substring(1));
|
||||
}
|
||||
model.Content = aiValue.toString();
|
||||
}
|
||||
case BATCH_LOT -> model.BatchLot = aiValue.toString();
|
||||
case PROD_DATE -> model.ProdDate = convertToDateTime(aiValue.toString());
|
||||
case DUE_DATE -> model.DueDate = convertToDateTime(aiValue.toString());
|
||||
case PACK_DATE -> model.PackDate = convertToDateTime(aiValue.toString());
|
||||
case BEST_BEFORE ->
|
||||
model.BestBefore = UtilityDate.formatDate(convertToDateTime(aiValue.toString()), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
|
||||
case EXPIRY -> model.Expiry = UtilityDate.formatDate(convertToDateTime(aiValue.toString()), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
|
||||
case VARIANT -> model.Variant = aiValue.toString();
|
||||
case SERIAL -> model.Serial = aiValue.toString();
|
||||
case QTY_DATE_BATCH -> model.QtyDateBatch = aiValue.toString();
|
||||
case ADDITIONAL_ID -> model.AdditionalID = aiValue.toString();
|
||||
case CUST_PART_NO -> model.CustPartNumber = aiValue.toString();
|
||||
case SECONDARY_SERIAL -> model.SecondarySerial = aiValue.toString();
|
||||
case REF_TO_SOURCE -> model.RefToSource = aiValue.toString();
|
||||
case VAR_COUNT -> model.VarCount = aiValue.toString();
|
||||
case NET_WEIGHT_KG ->
|
||||
model.NetWeightKg = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_M ->
|
||||
model.LengthM = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_M ->
|
||||
model.WidthM = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_M ->
|
||||
model.HeightM = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_M2 ->
|
||||
model.AreaM2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_L ->
|
||||
model.NetVolumeL = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_M3 ->
|
||||
model.NetVolumeM3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_WEIGHT_LB ->
|
||||
model.NetWeightLb = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_I ->
|
||||
model.LengthI = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_F ->
|
||||
model.LengthF = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_Y ->
|
||||
model.LengthY = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_I ->
|
||||
model.WidthI = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_F ->
|
||||
model.WidthF = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_Y ->
|
||||
model.WidthY = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_I ->
|
||||
model.HeightI = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_F ->
|
||||
model.HeightF = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_Y ->
|
||||
model.HeightY = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case CROSSWEIGHT_KG_LOG ->
|
||||
model.CrossweightKgLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case CROSSWEIGHT_LB_LOG ->
|
||||
model.CrossweightLbLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_M_LOG ->
|
||||
model.LengthMLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_M_LOG ->
|
||||
model.WidthMLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_M_LOG ->
|
||||
model.HeigthMLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_M2_LOG ->
|
||||
model.AreaM2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_L_LOG ->
|
||||
model.VolumeLLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_M3_LOG ->
|
||||
model.VolumeM3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_I_LOG ->
|
||||
model.LengthILog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_F_LOG ->
|
||||
model.LengthFLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_Y_LOG ->
|
||||
model.LengthYLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_I_LOG ->
|
||||
model.WidthILog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_F_LOG ->
|
||||
model.WidthFLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_Y_LOG ->
|
||||
model.WidthYLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_I_LOG ->
|
||||
model.HeigthILog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_F_LOG ->
|
||||
model.HeigthFLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_Y_LOG ->
|
||||
model.HeigthYLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_I2 ->
|
||||
model.AreaI2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_F2 ->
|
||||
model.AreaF2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_Y2 ->
|
||||
model.AreaY2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_I2_LOG ->
|
||||
model.AreaI2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_F2_LOG ->
|
||||
model.AreaF2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_Y2_LOG ->
|
||||
model.AreaY2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_WEIGHT_T ->
|
||||
model.NetWeightT = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_OZ ->
|
||||
model.NetVolumeOz = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_LB ->
|
||||
model.NetVolumeLb = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_G ->
|
||||
model.NetVolumeG = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_Q_LOG ->
|
||||
model.VolumeQLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_G_LOG ->
|
||||
model.VolumeGLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_I3 ->
|
||||
model.NetVolumeI3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_F3 ->
|
||||
model.NetVolumeF3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_Y3 ->
|
||||
model.NetVolumeY3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_I3_LOG ->
|
||||
model.VolumeI3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_F3_LOG ->
|
||||
model.VolumeF3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_Y3_LOG ->
|
||||
model.VolumeY3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case COUNT -> model.Count = Integer.parseInt(aiValue.toString());
|
||||
case AMOUNT ->
|
||||
model.Amount = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AMOUNT_ISO ->
|
||||
model.AmountISO = convertToIsoValueModel(aiValue.toString(), aiModel.decimalDigits,
|
||||
Double::parseDouble,
|
||||
(input, input2) -> String.valueOf(convertToDecimalString(input, input2)));
|
||||
case PRICE ->
|
||||
model.Price = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case PRICE_ISO ->
|
||||
model.PriceISO = convertToIsoValueModel(aiValue.toString(), aiModel.decimalDigits,
|
||||
Double::parseDouble,
|
||||
(input, input2) -> String.valueOf(convertToDecimalString(input, input2)));
|
||||
case ORDER_NUMBER -> model.OrderNumber = aiValue.toString();
|
||||
case CONSIGNMENT -> model.Consignment = aiValue.toString();
|
||||
case SHIPMENT_NO -> model.ShipmentNo = aiValue.toString();
|
||||
case ROUTE -> model.Route = aiValue.toString();
|
||||
case SHIP_TO_LOC -> model.ShipToLoc = aiValue.toString();
|
||||
case BILL_TO_LOC -> model.BillToLoc = aiValue.toString();
|
||||
case PURCHASE_FROM_LOC -> model.PurchaseFromLoc = aiValue.toString();
|
||||
case SHIP_FOR_LOC -> model.ShipForLoc = aiValue.toString();
|
||||
case LOC_NO -> model.LocationNumber = aiValue.toString();
|
||||
case PAY_TO_LOC -> model.PayToLoc = aiValue.toString();
|
||||
case SHIP_TO_POST -> model.ShipToPost = aiValue.toString();
|
||||
case SHIP_TO_POST_ISO ->
|
||||
model.ShipToPostISO = convertToIsoValueModel(aiValue.toString(), 0,
|
||||
new Callable<>() {
|
||||
@Override
|
||||
public String call(String input) {
|
||||
return input;
|
||||
}
|
||||
},
|
||||
new CallableII<>() {
|
||||
@Override
|
||||
public String call(String input, Integer input2) {
|
||||
return input;
|
||||
}
|
||||
});
|
||||
case ORIGIN -> model.Origin = aiValue.toString();
|
||||
case COUNTRY_INITIAL_PROCESS ->
|
||||
model.ShipToPostISO = convertToIsoValueModel(aiValue.toString(), 0,
|
||||
input -> input,
|
||||
(input, input2) -> input);
|
||||
case COUNTRY_PROCESS -> model.CountryProcess = aiValue.toString();
|
||||
case COUNTRY_DISASSEMBLY -> model.CountryDisassembly = aiValue.toString();
|
||||
case COUNTRY_FULL_PROCESS -> model.CountryFullProcess = aiValue.toString();
|
||||
case NSN -> model.NSN = aiValue.toString();
|
||||
case MEAT_CUT -> model.MeatCut = aiValue.toString();
|
||||
case DIMENSIONS -> model.Dimensions = aiValue.toString();
|
||||
case CMT_NO -> model.CmtNo = aiValue.toString();
|
||||
case GRAI -> model.Grai = aiValue.toString();
|
||||
case GIAI -> model.Giai = aiValue.toString();
|
||||
case PRICE_PER_UNIT -> model.PricePerUnit = aiValue.toString();
|
||||
case GCTIN -> model.Gctin = aiValue.toString();
|
||||
case IBAN -> model.Iban = aiValue.toString();
|
||||
case PROD_TIME -> model.ProdTime = convertToDateTime(aiValue.toString());
|
||||
case GSRN -> model.Gsrn = aiValue.toString();
|
||||
case REF_NO -> model.RefNo = aiValue.toString();
|
||||
case COUPON_1 -> model.Coupon1 = aiValue.toString();
|
||||
case COUPON_2 -> model.Coupon2 = aiValue.toString();
|
||||
case COUPON_3 -> model.Coupon3 = aiValue.toString();
|
||||
case INTERNAL_PART -> model.InternalPart = aiValue.toString();
|
||||
case INTERNAL_1 -> model.Internal1 = aiValue.toString();
|
||||
case INTERNAL_2 -> model.Internal2 = aiValue.toString();
|
||||
case INTERNAL_3 -> model.Internal3 = aiValue.toString();
|
||||
case INTERNAL_4 -> model.Internal4 = aiValue.toString();
|
||||
case INTERNAL_5 -> model.Internal5 = aiValue.toString();
|
||||
case INTERNAL_6 -> model.Internal6 = aiValue.toString();
|
||||
case INTERNAL_7 -> model.Internal7 = aiValue.toString();
|
||||
case INTERNAL_8 -> model.Internal8 = aiValue.toString();
|
||||
case INTERNAL_9 -> model.Internal9 = aiValue.toString();
|
||||
default -> {
|
||||
}
|
||||
}
|
||||
|
||||
aiCodeBuffer = "";
|
||||
}
|
||||
} else {
|
||||
throw new Exception(String.format("Il barcode non è un EAN128 valido (%s)", new String(inputEan128ByteArr)));
|
||||
}
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
private float convertToDecimalString(String sourceString, int numberOfdecimalDigits) {
|
||||
|
||||
int divider = (int) Math.pow(10, numberOfdecimalDigits);
|
||||
|
||||
return Float.parseFloat(sourceString) / divider;
|
||||
}
|
||||
|
||||
private <T> Ean128ISOValueModel<T> convertToIsoValueModel(String sourceString, int numberOfDecimalDigits, Callable<String, T> castFunc, CallableII<String, Integer, String> splitFunc) {
|
||||
String isoCode = sourceString.substring(0, 3);
|
||||
|
||||
T value = castFunc.call(splitFunc.call(sourceString.substring(3), numberOfDecimalDigits));
|
||||
|
||||
Ean128ISOValueModel<T> isoModel = new Ean128ISOValueModel<>();
|
||||
isoModel.ISOCode = isoCode;
|
||||
isoModel.Value = value;
|
||||
|
||||
return isoModel;
|
||||
}
|
||||
|
||||
private Date convertToDateTime(String sourceString) {
|
||||
int year = Integer.parseInt(sourceString.substring(0, 2));
|
||||
|
||||
//Se l'anno è minore di 50 indica 2000-2050 altrimenti 1951-1999
|
||||
int correctedYear = year <= 50 ? (2000 + year) : (1900 + year);
|
||||
|
||||
int month = Integer.parseInt(sourceString.substring(2, 4));
|
||||
int day = Integer.parseInt(sourceString.substring(4, 6));
|
||||
|
||||
Date d = null;
|
||||
|
||||
try {
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
|
||||
d = formatter.parse(day + "/" + month + "/" + correctedYear);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package it.integry.integrywmsnative.core.event;
|
||||
|
||||
public class SessionExpiredEvent {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.giacenza.GetColloInGiacResponseDTO;
|
||||
|
||||
public class AnomaliaUlException extends RuntimeException {
|
||||
public AnomaliaUlException(GetColloInGiacResponseDTO colloInGiac) {
|
||||
super(String.format("%s: %s", colloInGiac.getDescrizioneLivelloAnomalia(), colloInGiac.getDescrizioneAnomalia()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
public class InvalidCodMdepBarcodeException extends RuntimeException {
|
||||
|
||||
public InvalidCodMdepBarcodeException(String message) {
|
||||
super("Il deposito scansionato non è valido: " + message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public final class InvalidCodMdepException extends Exception {
|
||||
|
||||
public InvalidCodMdepException() {
|
||||
super(UtilityResources.getString(R.string.invalid_codmdep_error_message));
|
||||
}
|
||||
|
||||
public InvalidCodMdepException(String codMdep) {
|
||||
super(UtilityResources.getString(R.string.invalid_codmdep_error_message) + "(" + codMdep + ")");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public class InvalidLineaProdBarcodeException extends Exception {
|
||||
|
||||
public InvalidLineaProdBarcodeException() {
|
||||
super(UtilityResources.getString(R.string.no_result_from_linea_prod_barcode));
|
||||
}
|
||||
|
||||
public InvalidLineaProdBarcodeException(String barcode) {
|
||||
super(UtilityResources.getString(R.string.no_result_from_linea_prod_barcode) + " (" + barcode + ")");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
public final class InvalidPositionException extends Exception {
|
||||
|
||||
public InvalidPositionException() {
|
||||
super("La posizione scansionata non è valida");
|
||||
}
|
||||
|
||||
public InvalidPositionException(String message) {
|
||||
super("La posizione scansionata non è valida: " + message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public class NoOrdersScheduledException extends Exception {
|
||||
|
||||
public NoOrdersScheduledException() {
|
||||
super(UtilityResources.getString(R.string.no_orders_scheduled));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
public class UnauthorizedAccessException extends Exception {
|
||||
public UnauthorizedAccessException() {
|
||||
super("Accesso non autorizzato. Si prega di effettuare nuovamente l'accesso e riprovare");
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user