Compare commits
1465 Commits
20240410_1
...
20241010_0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e14b8a0a76 | ||
| eadc35561d | |||
| 2481dd3dc8 | |||
| b619a14b13 | |||
| 6f09c4903f | |||
| f689531e18 | |||
| b873013798 | |||
| 825c9c9827 | |||
| 5ae0b44e99 | |||
| 2284e54833 | |||
| 8361ae1b83 | |||
| 3181ae391d | |||
| e445b72f7d | |||
| 3358989914 | |||
| 5dddc7ae80 | |||
| c3d81765d3 | |||
| f48960ddb9 | |||
| adc02cc9fe | |||
| 5287d0d779 | |||
| dbb0f2e03b | |||
| 9f4543358d | |||
| 9607b0f91a | |||
| ce3c6faae4 | |||
| 6953e339db | |||
| 325545be5c | |||
| 85d787105f | |||
| 0b3b21c73c | |||
| d9bbcd821e | |||
| 36690c988c | |||
| 044306ca0d | |||
| 36cd762fc9 | |||
| 7f0210e150 | |||
| aab5f154b4 | |||
| ff678bd97f | |||
| a0731205ff | |||
| 12ebad7ae2 | |||
| 10840631b7 | |||
| 07e86a3c91 | |||
| 0531b865c4 | |||
| a24fab203e | |||
| 8c9db78a2d | |||
| 6f81a86a7d | |||
| 41afab06d6 | |||
| 07f20765cb | |||
| 509148632f | |||
| 6c7ddef35c | |||
| 7507fd4a9f | |||
| bcbb2a9504 | |||
| 7ba2b75864 | |||
| 9f88e36b61 | |||
| 03d8960e5a | |||
| ef463d31f5 | |||
| f904ee7040 | |||
| aabee3022c | |||
| ff5972298c | |||
| e064d63bce | |||
| 5d4a9c0702 | |||
| ca82ea83e6 | |||
| 27fa0aa24c | |||
| 01d955200f | |||
| ea779be68f | |||
| a10155a5fd | |||
| 4491b932de | |||
| 8736af3e55 | |||
| c3dcaeb944 | |||
| 8ed1527e95 | |||
| ad02a0e54c | |||
| 0e64ff7c05 | |||
| 74e356f3bb | |||
| dcdfb7e03d | |||
| 4335c1b0f7 | |||
| b96479962c | |||
| 311b0a1705 | |||
| 99a4df9256 | |||
| c010e6f3bc | |||
| 0a824da8c6 | |||
| 090e5f6d94 | |||
| a4a172b069 | |||
| 21c8ffdf18 | |||
| c49c2aabe4 | |||
| 38a603ada6 | |||
| cbb8e97d03 | |||
| 0037360a36 | |||
| 8ded3f4a91 | |||
| 1553c3b457 | |||
| 4763bc5965 | |||
| e467ebb5e2 | |||
| a961d0bb63 | |||
| 4cf0c42375 | |||
| 495876bc65 | |||
| 90e6e64c91 | |||
| 42d0c68c7f | |||
| 0a27df0352 | |||
| 6e2a9e9743 | |||
| bfb33d0d1f | |||
| c8a31a10fe | |||
| 5df5f3b662 | |||
| b45154e486 | |||
| 352f0e31d1 | |||
| f674b9a359 | |||
| 9a2bada3cd | |||
| 10b0fad6a6 | |||
| c0d7fe5f8e | |||
| ff39e731de | |||
| bbf62915b5 | |||
| bf1e04997c | |||
| d6bf039007 | |||
| 56f9d2041e | |||
| f8004fab38 | |||
| c6ff9bf898 | |||
| ad2b7b3905 | |||
| 6c445cc0e4 | |||
| f8e857ab26 | |||
| b2df910a51 | |||
| af80a0711a | |||
| 57e6bc8bf1 | |||
| 2d07f7e23c | |||
| d42e6d9bc1 | |||
| 0c06a2f04d | |||
| f3a2027fb1 | |||
| bdc4359ad0 | |||
| 2211fb890b | |||
| 3a0667df22 | |||
| 87597ab83b | |||
| 08144fd5ea | |||
| e417eb762c | |||
| 50ce405dd7 | |||
| d52ecd7457 | |||
| ef7e3624fd | |||
| 17178edd4f | |||
| a168edc3c2 | |||
| fb019fcd1a | |||
| d7541b5fa8 | |||
| 9759e7b4d5 | |||
| 0c582d6a91 | |||
| af100ad02e | |||
| 0deb7a519f | |||
| de6186895a | |||
| ed493ca159 | |||
| 8547bbdd08 | |||
| c6ee4364a2 | |||
| 9561f42283 | |||
| a5faa8c671 | |||
| 27a48d221c | |||
| b9b0caa9fd | |||
| daa9dc3116 | |||
| 0859e13a22 | |||
| 173c27d98a | |||
| cdc00bf9d3 | |||
| 060487d40f | |||
| 676d411191 | |||
| 1f2bd32da9 | |||
| 3c43ce55c4 | |||
| dbe0563dad | |||
| d604707800 | |||
| ebf84daf89 | |||
| a401490d4b | |||
| 2bbddc0df5 | |||
| 4022505656 | |||
| ac785fc135 | |||
| 74c69af243 | |||
| d155771914 | |||
| 25a7acb865 | |||
| dd3d71a9e0 | |||
| 835633ca4c | |||
| cd76a5655b | |||
| 617f28594d | |||
| 35494375dc | |||
| 4822c68e32 | |||
| 787cbeacec | |||
| 962e3c8208 | |||
| a711305b13 | |||
| 490defe829 | |||
| a557d59700 | |||
| d6125204dd | |||
| b8e03337ee | |||
| b5b854851b | |||
| bda9427eb8 | |||
| 789a73fa78 | |||
| c6008c4171 | |||
| 93832a5e60 | |||
| c1b9e900f4 | |||
| 5e2d3fb38c | |||
| 1f351ae36f | |||
| fc8831799d | |||
| 38a270a5de | |||
| 4296ab94f0 | |||
| 2ed3438b0c | |||
| 17b70036a6 | |||
| e3321d83d0 | |||
| efeacadb33 | |||
| 6e908c02a2 | |||
| 663acfee7e | |||
| d3b2ca57de | |||
| 8b5645118f | |||
| 761f89d8a1 | |||
| 2fcb5eab65 | |||
| d464948fc9 | |||
| d17208d158 | |||
| 113be95c26 | |||
| 04a226859e | |||
| fc9009072a | |||
| c0abde4fd0 | |||
| 898a79a6a4 | |||
| 4579c64744 | |||
| a115c8e607 | |||
| 18acbfa324 | |||
| 955e6d37c2 | |||
| f617edbf27 | |||
| f97de2de08 | |||
| d2bf587d57 | |||
| 941e5948c8 | |||
| 94a52168f7 | |||
| 1d408a1460 | |||
| 63858fa63e | |||
| 8fd558360d | |||
| 2f191e012d | |||
| fcae5341bd | |||
| 5fa18833e7 | |||
| 724c875f72 | |||
| 30e599140d | |||
| 7ae54057a4 | |||
| b7f41fdd33 | |||
| a456690c89 | |||
| ec5b635a13 | |||
| 110ee85863 | |||
| 175befb82f | |||
| 17e8cad14b | |||
| d27b4ac4b7 | |||
| db37651a65 | |||
| 4da0144be7 | |||
| c1660b4821 | |||
| 9db3002acc | |||
| 10c69c022c | |||
| 44f127ab9b | |||
| e7fcd977f7 | |||
| 9892418137 | |||
| 0b884b97ce | |||
| 7bf36fcdf5 | |||
| d930c23677 | |||
| 409cee499d | |||
| 8f1cba7756 | |||
| 32323a0323 | |||
| fac88c991b | |||
| c6f6ca31f0 | |||
| 9df7e2ad73 | |||
| 3ea63962a2 | |||
| 2a657043d7 | |||
| 450b458f29 | |||
| 8e862e3e41 | |||
| 441804f254 | |||
| 67c0ceefdd | |||
| 3647fb995d | |||
| 9534dabdf1 | |||
| 31a123789a | |||
| 94625a04f1 | |||
| fd52f5bf3a | |||
| aad189abb0 | |||
| dac51332c4 | |||
| 296e828f84 | |||
| 2cf7e8896d | |||
| 7140170b01 | |||
| ac953a7668 | |||
| 1abf04e112 | |||
| c97ac8ef24 | |||
| 32c6fe13d1 | |||
| 12210508cf | |||
| 517e614a67 | |||
| c109ba1d8f | |||
| 1089324b48 | |||
| d35f1fd3e7 | |||
| 98346a4263 | |||
| 9f03ce827f | |||
| efebad843a | |||
| 89430c96e3 | |||
| d5a8032514 | |||
| 26c18df76e | |||
| eab51f4f81 | |||
| ecd3e14cc5 | |||
| adccc2bb1a | |||
| 3af2aefa47 | |||
| 2fd4d75df0 | |||
| 67904d5e78 | |||
| 0246331940 | |||
| 450ab46281 | |||
| bee4ec324a | |||
| af1e06d765 | |||
| d4b35cccd4 | |||
| 46b8842db1 | |||
| 9fa40e5e3c | |||
| 1dc43f7760 | |||
| f37afb6e51 | |||
| f70130e7bd | |||
| 11b6853979 | |||
| 4236989e20 | |||
| 772c69f7dc | |||
| 83ee7eb720 | |||
| 18d99158f5 | |||
| 611560f365 | |||
| 6c54599f1a | |||
| 132a4d176c | |||
| dbf79d9cc6 | |||
| 40557913ba | |||
| b1f28f9462 | |||
| 3e14bafe61 | |||
| 9e38f3da92 | |||
| fb690a3f2d | |||
| 3064ca55da | |||
| 665f193692 | |||
| 043f424a80 | |||
| 46df55e70e | |||
| c396715e83 | |||
| 6177cfb56b | |||
| b3e7f76efc | |||
| 08d75b06cb | |||
| 7dbeb2ce91 | |||
| a4db651ec6 | |||
| 8f921ecd13 | |||
| de9bcceb21 | |||
| a4a360ca90 | |||
| d221eb16b5 | |||
| 17236668e7 | |||
| 1030781c2d | |||
| 27e60d558f | |||
| 872419006b | |||
| 2637081af7 | |||
| 6a96c920f1 | |||
| c6d107465c | |||
| bfa24280bf | |||
| b2a572ea84 | |||
| cab6025e41 | |||
| 91ee2082ab | |||
| f79c311573 | |||
| 183e794657 | |||
| e50e9b37c6 | |||
| 537dbe7695 | |||
| 8c3ae2d854 | |||
| 620b3daf5a | |||
| 2e70316bc6 | |||
| afc06b38b3 | |||
| 1c7db830ea | |||
| 5cf060920e | |||
| f7d6e527b9 | |||
| 80a0d68fc3 | |||
| 6498e2a123 | |||
| ace9cbe4a8 | |||
| a42c0e1ad9 | |||
| ba35c03032 | |||
| 550b2889f7 | |||
| 28a1c49d3a | |||
| 1e97a37dd7 | |||
| dcb14913a6 | |||
| cb380d090d | |||
| cbea692c05 | |||
| 8e686ce633 | |||
| b05c52a668 | |||
| 9f901d1341 | |||
| 9c3064ba82 | |||
| 079854109f | |||
| 331eb1efb0 | |||
| 8578e2fa7c | |||
| 40b49300dc | |||
| f149d54350 | |||
| 2e989c2752 | |||
| 1bdb592755 | |||
| 0d77488056 | |||
| ae259cfc10 | |||
| ecb45f2ccb | |||
| ebe93e2ca0 | |||
| 859c50334a | |||
| 982c3e4676 | |||
| b4ddf1f587 | |||
| d6bfb1efbc | |||
| 009a523aa9 | |||
| 05213c1053 | |||
| 7c1cfa010f | |||
| d2e9ee8f44 | |||
| e282fe5d0a | |||
| 71652f0e55 | |||
| 0e08fc2aa1 | |||
| 9409204e96 | |||
| 6adce3e2f6 | |||
| 395e8b8c34 | |||
| fef3901f63 | |||
| 6d8e5baffe | |||
| b714d66f2e | |||
| 1bd2a0ffb5 | |||
| 45989f6b0d | |||
| 4669c21085 | |||
| 93b6cbdf6e | |||
| 1e3cd71f0c | |||
| 1500fb56a2 | |||
| 0c20232661 | |||
| 4a5dfa3c58 | |||
| 351f0733a3 | |||
| dbf96ac0eb | |||
| fd0a686078 | |||
| 2262b6db2e | |||
| 2b817b10a1 | |||
| 52ccc41694 | |||
| d4648148ba | |||
| 6fd583521b | |||
| 201a556ad5 | |||
| f2b783d970 | |||
| 6e66ce8dac | |||
| 61c1c89dde | |||
| aa080067df | |||
| 39760e5e94 | |||
| a5e1af3f54 | |||
| b28b27d8ae | |||
| e2d50a4233 | |||
| 3bcfd78adb | |||
| 368154b80a | |||
| 8bfd37d9aa | |||
| 3b99091bfa | |||
| 2410b95969 | |||
| 077f002fbe | |||
| ebe5f91e45 | |||
| a162b6c3f8 | |||
| 66d3fd4bc9 | |||
| 2a5276cddb | |||
| aba96c11b7 | |||
| 48c8981015 | |||
| 05fc8d9d61 | |||
| 1a685140b9 | |||
| d344257b0c | |||
| 46a4ef3f05 | |||
| 23beff9772 | |||
| 8d53d0b825 | |||
| e5014e602b | |||
| 61a6c58a8a | |||
| effd05cf46 | |||
| f01ea9470d | |||
| 3b33018019 | |||
| 23d061be0c | |||
| 5f6669343b | |||
| e33ac3f0cc | |||
| e64a3821b8 | |||
| 95f4a99991 | |||
| 4f10590254 | |||
| 7628f7325c | |||
| 81b2edde0c | |||
| 09a922098c | |||
| 5cf3d2c732 | |||
| d80f1d1fb8 | |||
| 54033ca781 | |||
| b24182eb9e | |||
| 50228dcb90 | |||
| a698651c24 | |||
| ba7c89e626 | |||
| 09270bf4b8 | |||
| b9df8c14e3 | |||
| 8194b4099d | |||
| bf1a1b6251 | |||
| da231585f3 | |||
| 2481bee5fa | |||
| 48e54129d3 | |||
| fc4edde981 | |||
| f494126e97 | |||
| b9fb539d02 | |||
| 2e0086880f | |||
| bfe72399fd | |||
| d8dec26f5d | |||
| 7b5366839c | |||
| 6ee276be2c | |||
| 03d5335909 | |||
| 8a85015f5f | |||
| c1f432e8aa | |||
| f7b7b0c91f | |||
| 622de7b531 | |||
| 59da080298 | |||
| b9d342901b | |||
| aef2e68828 | |||
| f21085de30 | |||
| 5ca91469a5 | |||
| ae7cc990a0 | |||
| 555f6d5dc4 | |||
| cad940bdff | |||
| 3e73c4e663 | |||
| e66fc3d672 | |||
| cd526f04c8 | |||
| 1723a8fd86 | |||
| b5d5d15072 | |||
| 2a52cbf3da | |||
| 9b2749dff2 | |||
| a87814bf02 | |||
| 99bc8fb39c | |||
| 884dfd3400 | |||
| 3b4935bd1d | |||
| a3869198aa | |||
| d7e97fd2fc | |||
| fac71baad3 | |||
| 144ea8eaaa | |||
| 12d6a6dc56 | |||
| 7394ef79bd | |||
| 606a0ebdb7 | |||
| 69902b7f6a | |||
| 91d1d202bf | |||
| 51668a9f25 | |||
| 54c226c98a | |||
| 6027cef5b0 | |||
| aad2aba9e2 | |||
| 9f7db88a4a | |||
| 7691c5018f | |||
| 5dd158c824 | |||
| d930e2928f | |||
| 1ab0cf2d13 | |||
| db73af8d91 | |||
| 676b58835a | |||
| 5ae50ecf08 | |||
| 52611d61d4 | |||
| 5b8b68dec1 | |||
| 2a0c6abff5 | |||
| 01552d5335 | |||
| 7b93c6e0a3 | |||
| e5df127ee0 | |||
| 1fb9c25fae | |||
| 261f8c0877 | |||
| 015820ccc4 | |||
| f2d1f810f7 | |||
| 5cf7b89472 | |||
| 7d002f2e56 | |||
| 1f925e5852 | |||
| 30d1c061e4 | |||
| 3a3c0ae1c3 | |||
| eb404a0872 | |||
| abd823e6ef | |||
| 2b879d0356 | |||
| 0d3028657b | |||
| 3684213b97 | |||
| 511ee19120 | |||
| 37f38ed2f7 | |||
| 52816af36f | |||
| c09c4ce194 | |||
| dd83ab2ad5 | |||
| aa8a0228b7 | |||
| 169dcf3867 | |||
| 2acac4fdcb | |||
| 11b2c94064 | |||
| 401eb4c28a | |||
| 8dcc672ff6 | |||
| 86694bf5c5 | |||
| d1cb72b7b8 | |||
| 2cfd5ff050 | |||
| e99d2daa45 | |||
| 60fa52e62b | |||
| f0ffeb4e05 | |||
| 4eafcf7742 | |||
| 525e521dbb | |||
| 4bc7c5c678 | |||
| cd04fcc42e | |||
| 8626ced5ba | |||
| 51ceb69192 | |||
| a08578a361 | |||
| d80d843400 | |||
| c0321cc006 | |||
| d528bcbd72 | |||
| fb6d2f32a7 | |||
| c408580898 | |||
| 1c7d9c1775 | |||
| 86ea8ccc36 | |||
| a0be59c532 | |||
| 7052434ff1 | |||
| 42a69dd21b | |||
| 96a10237ff | |||
| 54ca8f193e | |||
| c6560933d5 | |||
| 848efdc3e4 | |||
| 4252d5faf9 | |||
| d257a00f67 | |||
| ffa6d4be7a | |||
| 0cb0ac8aa5 | |||
| 2a9bf4f18e | |||
| 2949f5cf3a | |||
| ce735aa5df | |||
| 0377e1c73d | |||
| 791dad2aed | |||
| f941b63f54 | |||
| aa267a6b2c | |||
| d7d5c413a7 | |||
| 7d39957614 | |||
| cb9ac26602 | |||
| f7e82b4089 | |||
| 4098b1296e | |||
| 754a43a05f | |||
| 407fb28206 | |||
| f84e64ad5a | |||
| f2be08e500 | |||
| a5d596ae1c | |||
| 15ac3df1ce | |||
| 7a86247e12 | |||
| 074506fa0c | |||
| c274ce3fcc | |||
| e81fa79d85 | |||
| e0b31bef6d | |||
| 50a9e940f1 | |||
| 2d2cd07478 | |||
| 9c8804d905 | |||
| 0f80faaf0d | |||
| 2c9e0ce455 | |||
| dcb2af5c43 | |||
| c477d64413 | |||
| 7a41e22ba4 | |||
| 3ef60fa238 | |||
| 6f5442486d | |||
| 01d39fd652 | |||
| a67f8104c5 | |||
| cb6717fb93 | |||
| f229824dfa | |||
| fa5b0393eb | |||
| e52b9896d0 | |||
| 05204ed269 | |||
| 4f08220893 | |||
| be536a9c38 | |||
| 4c57f2ac34 | |||
| 6f54902862 | |||
| 36afcc836c | |||
| ddd70ecf64 | |||
| 6a7ec32d66 | |||
| fce0b0e81a | |||
| 6f4d0f1072 | |||
| 26dc422f3d | |||
| b8a9e2bcc1 | |||
| 158269f6f3 | |||
| e3765a9638 | |||
| 0330046f69 | |||
| bc03755afa | |||
| cd16233da5 | |||
| 67a320dac3 | |||
| 580b2257cc | |||
| 52954b5a52 | |||
| 284f23bd83 | |||
| 3a6eb612e0 | |||
| fd3b5bcdfd | |||
| 2524d5442a | |||
| 68ad7af07a | |||
| 4ef27af2c0 | |||
| fdda76eb5c | |||
| 1857428cd0 | |||
| 1e8b1ca28b | |||
| 6fd6431f7e | |||
| 66c41d10eb | |||
| 8586308fde | |||
| bfe78c4a81 | |||
| 8bd8c94eff | |||
| 30acf97b57 | |||
| 9016f5956f | |||
| e9c7e94db3 | |||
| 471cf93d96 | |||
| 644ea03201 | |||
| a9ab0a253a | |||
| ef47cc5616 | |||
| 7795c6c248 | |||
| a11ef715a1 | |||
| 7985811e71 | |||
| d4292fdb72 | |||
| 980f541a18 | |||
| 1fae705d64 | |||
| 465e725782 | |||
| 79d13dc1c7 | |||
| 25abcbb869 | |||
| b553122d3e | |||
| 10158cf46b | |||
| 1dc0ddc5df | |||
| c91165dc96 | |||
| ac1cbff3ba | |||
| 644010dbda | |||
| a5b6220a7e | |||
| a6d63a1f51 | |||
| 45f53d5d80 | |||
| fe84a31f66 | |||
| 1f09e82245 | |||
| 205dce88b8 | |||
| 1b6f7d6e35 | |||
| 61f59ac4a3 | |||
| 481471d9b6 | |||
| f0e587e1f3 | |||
| 118e43b849 | |||
| 19f5450243 | |||
| 236d0dcdec | |||
| df8a1de401 | |||
| 5fd3b5668a | |||
| 489089b9a4 | |||
| 54390e7198 | |||
| b3acb22495 | |||
| 8e2196d23f | |||
| 99ad3d7b48 | |||
| d83e658a9c | |||
| 0176176e84 | |||
| 1cb33d1c99 | |||
| a05005edf9 | |||
| 25f3b7710a | |||
| dd06da4e2c | |||
| 74117a4ea2 | |||
| 65dce87abf | |||
| 0d175b693a | |||
| b47c8ecb7b | |||
| 8397e7c6aa | |||
| 68a76ca0c2 | |||
| 9ba1078d5a | |||
| 043a8b62d8 | |||
| 3cb2b9d8e9 | |||
| dfb34df5e9 | |||
| 44c3721116 | |||
| ba68f631a1 | |||
| 7a6c81feb6 | |||
| d27415fb7b | |||
| bd06beff71 | |||
| 99234b2f94 | |||
| 74be9d3b20 | |||
| 9d15ebd65e | |||
| 7716a01e81 | |||
| 3feb507013 | |||
| 9e682093ae | |||
| 058334fb0b | |||
| aa0a69409c | |||
| 225af5f087 | |||
| f66a3ccdfb | |||
| b981ece98a | |||
| 3e8e44871d | |||
| 75d4bdfc4d | |||
| b79c88c23c | |||
| 3c945a4be5 | |||
| c300dff9f0 | |||
| 32ed6f1188 | |||
| a4fbf3138d | |||
| 6056e4dccc | |||
| 493ca43226 | |||
| 81394cc6fa | |||
| cd1f71952b | |||
| 432de33a60 | |||
| 6078e9770e | |||
| d6add3cf65 | |||
| 6a03fd5010 | |||
| e04e5166ce | |||
| 012f27d460 | |||
| d8a9337d30 | |||
| 71f7a665c8 | |||
| cc7db6a529 | |||
| b2522ecc38 | |||
| 356e1bdd12 | |||
| 4eae593bce | |||
| 40055a6c03 | |||
| 48edcf2e9d | |||
| 49214b500e | |||
| d6d4c3583b | |||
| 049e1b4921 | |||
| 672195fb4a | |||
| ffa3ea8cff | |||
| de3f04a6ca | |||
| d76fd941a8 | |||
| 05a6b2b5d4 | |||
| 8e846a6598 | |||
| 1f8252db21 | |||
| 08cae9e3bb | |||
| 513fa6f5f0 | |||
| 9c1bb13d7a | |||
| ab6a08ab60 | |||
| 5793fd1908 | |||
| 641f39784c | |||
| 64850e628a | |||
| 88d0d82544 | |||
| cabc38b216 | |||
| 04841eec4e | |||
| 3a12327b16 | |||
| 1d3b96395e | |||
| 7341cc625b | |||
| 2ee729449d | |||
| 87fb1868f0 | |||
| 446db73fe7 | |||
| 05a6e363c9 | |||
| 0b91e53f96 | |||
| a5518de1c1 | |||
| 0dd3403946 | |||
| 0e316cba9c | |||
| 27e14f99ee | |||
| 79dcb073df | |||
| 0d2b4c01f3 | |||
| 463dd423a0 | |||
| d849ff54e7 | |||
| 5148a4d571 | |||
| 73d94f077e | |||
| cde50e6c57 | |||
| f7e9fca83f | |||
| d88c7647db | |||
| d5f4d73dc4 | |||
| cf63edb453 | |||
| f7b71cc4ee | |||
| 971ea7bd7a | |||
| 2e02fd38ad | |||
| 7cfc702ea0 | |||
| 09bc88241d | |||
| c702d7410b | |||
| fd67662dc2 | |||
| 08e4162620 | |||
| 6c3fc25ef8 | |||
| 73c882684c | |||
| 3336b4ce20 | |||
| 41dd98e1f9 | |||
| 9f66f92984 | |||
| 5ef4cf2ff5 | |||
| d97a7305cc | |||
| 0b60ab7a06 | |||
| ed30d129d5 | |||
| 674c1ce5de | |||
| 308f883b15 | |||
| 8c9421325f | |||
| 63e9f325f3 | |||
| 706b4e3c21 | |||
| fb8aeea028 | |||
| 41ee89c94e | |||
| 21e2267340 | |||
| 0b0a2ea918 | |||
| aef6b1e937 | |||
| ce5673cd24 | |||
| 3045529df8 | |||
| 96cbf6f844 | |||
| fd09483123 | |||
| 832d411426 | |||
| fc8262a203 | |||
| 6d8cba5d07 | |||
| 4abf1c2b01 | |||
| 12901abd2d | |||
| f93fa6678c | |||
| 819f0c8ce0 | |||
| e13611a328 | |||
| bb8bc2b7fd | |||
| f13c81f119 | |||
| abdfb4c1ef | |||
| b435488b7d | |||
| 167183ac64 | |||
| 43d101719c | |||
| 62a1e49e7c | |||
| 65fceec62e | |||
| 3e2dc62fba | |||
| a5b979f53d | |||
| 5f59100142 | |||
| 4bbc909563 | |||
| 2770cac483 | |||
| 702d529a8b | |||
| 6b5a2cafaf | |||
| 255d82cec5 | |||
| 66ac02a7a9 | |||
| 32daa9fbe7 | |||
| 349c47ce52 | |||
| 3828e5cbec | |||
| 73f1b01fed | |||
| 007e66aff7 | |||
| a1ab5da08a | |||
| 5cb6e30ed6 | |||
| ea82bff88a | |||
| cfad878bc2 | |||
| ac68ea4ea5 | |||
| e2ad0a7c65 | |||
| 3e6c38b51f | |||
| a0cd0cbec5 | |||
| 087189a0b0 | |||
| b2df536011 | |||
| 2f863e1489 | |||
| 7705b8a5fd | |||
| 5b2c5c2676 | |||
| 3757f511e0 | |||
| 3842cc0f6e | |||
| 747e2615b3 | |||
| fcea8f5267 | |||
| ea2b8c7593 | |||
| b144d84549 | |||
| 48c7de51f7 | |||
| d7f1992154 | |||
| 11f5056fd0 | |||
| 9147b6be27 | |||
| 9492a646ba | |||
| ec8b8547c5 | |||
| 49dd2269af | |||
| ac5c3ff2dd | |||
| 069d497566 | |||
| 207b557655 | |||
| 76fc878585 | |||
| 80c41b1fcc | |||
| 94994d696f | |||
| d0065a1219 | |||
| eeba09920f | |||
| 6d69f6c059 | |||
| 2f7bd7596a | |||
| a3a99f687f | |||
| 0f96873847 | |||
| 8f3406fa4d | |||
| b347cf1aff | |||
| b720b08088 | |||
| 42169a5646 | |||
| c17cd3d83e | |||
| 1d92895df6 | |||
| 46c3419751 | |||
| 69b0f37254 | |||
| efc38970ff | |||
| 83156e8623 | |||
| 3a2e6a405b | |||
| 105309ef4f | |||
| 7da201e24f | |||
| cb88dfbead | |||
| 36efa1c628 | |||
| fb80695cba | |||
| ce1b0df102 | |||
| a713368d62 | |||
| bf32d9be5c | |||
| e93d54c986 | |||
| a4caa25c05 | |||
| 5db1aa0948 | |||
| 95e18001ef | |||
| 026a4890d1 | |||
| afa1342e8f | |||
| 46692dd75e | |||
| dd23b7b7fb | |||
| 9c1332f385 | |||
| 63061e576a | |||
| 7b18f23794 | |||
| 2e496d6b60 | |||
| 4c148ccbd9 | |||
| c7b8cae326 | |||
| 599df1fc16 | |||
| 7175380045 | |||
| 33c9d32262 | |||
| 8d09a02f1c | |||
| 83d48df47d | |||
| bd3d295f6f | |||
| 9672fce01f | |||
| 6b5274f2c3 | |||
| fc3dfc13cf | |||
| f4b7eba1d8 | |||
| 25fade5f48 | |||
| 9fd75d10b6 | |||
| 25eabec6e6 | |||
| 88c2f06386 | |||
| f90ac6f64a | |||
| fe414ec431 | |||
| 5671ba07d5 | |||
| 35e3e1447d | |||
| d4840aa672 | |||
| 1d0711ebd4 | |||
| 5bbbea25fa | |||
| 5298ec4949 | |||
| 61fc69ae89 | |||
| 4401c05464 | |||
| a12d5198b1 | |||
| 1aa0f7518f | |||
| 7423754900 | |||
| 26b5c5b6a3 | |||
| b69d79381b | |||
| 606a486f82 | |||
| ba0e4650ce | |||
| 8c43abd739 | |||
| 1cbc9489f1 | |||
| 0c14e7b987 | |||
| 4f33830879 | |||
| 500a39bbc9 | |||
| c04e08a575 | |||
| 7b842ca014 | |||
| cd72eed0cc | |||
| 9fbcf5b074 | |||
| c041d3fc48 | |||
| 3578afa37b | |||
| a030dd13b3 | |||
| bfe7e3c972 | |||
| 0b6a1b871f | |||
| f301eacef3 | |||
| 1b51013d0f | |||
| 3dab6a9cf1 | |||
| 8b56c4f136 | |||
| a14e9f85e1 | |||
| 56326bcb94 | |||
| d2247e559c | |||
| d5059a49a9 | |||
| 5ff6412128 | |||
| 25a08389df | |||
| 2171dfc16c | |||
| 8346d16d7d | |||
| bed96c9ed4 | |||
| e67ca853b8 | |||
| 7ebf5af9f9 | |||
| e626f1e1c2 | |||
| 8818d7c839 | |||
| c506709c33 | |||
| 97c458b674 | |||
| 638ab3b5ed | |||
| 414d62aa6c | |||
| 917cf529d8 | |||
| 6a39ca8972 | |||
| aaa03da726 | |||
| 7115254c53 | |||
| 8926fe4cf4 | |||
| 777ab4c223 | |||
| fb66797fe0 | |||
| b1bed3bfab | |||
| ed7a2a0374 | |||
| c9fb344849 | |||
| fcd45a187a | |||
| e6319eb7c8 | |||
| 35702757b9 | |||
| 2a59351e09 | |||
| 5067eff40b | |||
| b8c4caaa9b | |||
| fad75298f9 | |||
| f125e339f5 | |||
| f69848f748 | |||
| 27a1c0efe9 | |||
| 2bed8730c5 | |||
| cf56f61962 | |||
| 81d05fa0ae | |||
| 067a059532 | |||
| 94ac3fb90c | |||
| cdc3bb92cc | |||
| 8153291184 | |||
| 6f20b34196 | |||
| 6d01cfd280 | |||
| 1a1cbaed28 | |||
| d18f51ca6d | |||
| abd843ad7a | |||
| 43297555f0 | |||
| a4717ba245 | |||
| a51325ede0 | |||
| 4a81d6e988 | |||
| c9f9c63ef2 | |||
| a6958eee39 | |||
| b6eec691f5 | |||
| 90cbc94e6a | |||
| 02ca6eea4a | |||
| 9629be196a | |||
| 3e461bc692 | |||
| 1878ce5673 | |||
| 4b55c57da1 | |||
| 7814e3c0db | |||
| 129e52a116 | |||
| d97e582802 | |||
| e98bf98a3b | |||
| 12b9e432aa | |||
| b411e331a9 | |||
| d1d5c7ca21 | |||
| c348be1365 | |||
| ddff8bb078 | |||
| 0b7ece1c48 | |||
| 8722de1d68 | |||
| b1b2e00b87 | |||
| d895eccda3 | |||
| bf57c1442e | |||
| dbd9bad7e7 | |||
| c466abb836 | |||
| 203808d323 | |||
| 7189cae9e3 | |||
| ebce20e389 | |||
| d1c5d4d29f | |||
| 90f5a08c50 | |||
| 966bc1e9b3 | |||
| 6179d07564 | |||
| 946168517e | |||
| ec6b888840 | |||
| 3fdf558b6c | |||
| c57344e334 | |||
| 4c5b847c14 | |||
| 30faa66519 | |||
| 476ff92f30 | |||
| 18dd9dc8a3 | |||
| d292ab6ac0 | |||
| 9a90387df6 | |||
| c1909b58ab | |||
| 9b77c4a693 | |||
| cf672c349b | |||
| 800f1d84d9 | |||
| f72c0962c8 | |||
| d4303b053f | |||
| 6737226d91 | |||
| b0492de6d4 | |||
| 4c4d608ac1 | |||
| 6648d4f655 | |||
| 2a4e57de0d | |||
| 9ab0e5fc0f | |||
| 6a605f9db0 | |||
| a7fbe6e491 | |||
| b4252581b5 | |||
| fcde03ce4b | |||
| 363258f6ac | |||
| 06580f507b | |||
| 82db179601 | |||
| 565336e454 | |||
| 692a68d65e | |||
| db819a69f1 | |||
| 6fe25e1405 | |||
| 165770699e | |||
| 3ae6180584 | |||
| bb11ae9d36 | |||
| 8e56d53796 | |||
| 6d2f268ff3 | |||
| 5362c4f39a | |||
| 875821df08 | |||
| 51ae525983 | |||
| 141f7b6751 | |||
| 4c5c628d23 | |||
| 1d8449773d | |||
| 5479e9dbcd | |||
| 52a0b1df5c | |||
| e0f5c9814a | |||
| 39b928b118 | |||
| 378fc24198 | |||
| b6737aca0f | |||
| 12115880a1 | |||
| b3a248d754 | |||
| c41502a829 | |||
| 47f3ebcf4d | |||
| b7646d8ce3 | |||
| e2e2e09bbb | |||
| 98e024ed5a | |||
| a2fe597ed6 | |||
| 946089e307 | |||
| 990e0e7fdc | |||
| d16225e111 | |||
| d4530567d7 | |||
| a82106edf0 | |||
| 5c3e25b41c | |||
| ce74ff45d7 | |||
| b66938e367 | |||
| 067c7c24fc | |||
| ebb9db1b92 | |||
| c5ef5c6f83 | |||
| ff96e73483 | |||
| 6fe75d1b57 | |||
| f306d53d3a | |||
| d7c73745ff | |||
| d479180337 | |||
| a664c1b7e5 | |||
| f89eb0fc2f | |||
| 9d403f87f4 | |||
| 6b47fb3ad3 | |||
| b78180374e | |||
| d148de7617 | |||
| a6fd50b523 | |||
| 95a49495c3 | |||
| 457e9e2a45 | |||
| b30d0deeda | |||
| 34c441eaff | |||
| 4f3b0c81c7 | |||
| 6729807363 | |||
| cdedd25c23 | |||
| c0ae8f98f8 | |||
| 83e770fb00 | |||
| a2de1582cc | |||
| 0296fc1666 | |||
| 4fd700d771 | |||
| cc5401f193 | |||
| c0654f4ab3 | |||
| 475fbe7c2c | |||
| 842cece89f | |||
| 035fe7c8bc | |||
| 7e54ca7b92 | |||
| 4892d75946 | |||
| 3c821317f5 | |||
| 8073f9cd28 | |||
| 55933b974e | |||
| 29e4748521 | |||
| b192f0db5d | |||
| 5e975a62b9 | |||
| 9eec9b81ae | |||
| 65cbe8644b | |||
| 997cd9ee31 | |||
| 78b68dc135 | |||
| 0b62b93484 | |||
| 3831cfd4c7 | |||
| efa2b3a8af | |||
| 862ca8fbbd | |||
| 6cca2bf89e | |||
| 2620d061b4 | |||
| bf4a4359f7 | |||
| 075d441ecc | |||
| ed0a654e9a | |||
| a37a878c92 | |||
| 32d888472f | |||
| 68f7123eec | |||
| 099093c66a | |||
| 921ca80eef | |||
| 8796b14d39 | |||
| 01737e7fa8 | |||
| 2cb14e2452 | |||
| f18aacd809 | |||
| a805edc181 | |||
| 1bb2416059 | |||
| 2342bbf4d4 | |||
| 13bc0e665e | |||
| 396b6b7d80 | |||
| 9c09c36a0b | |||
| c4dae52dff | |||
| 5f96e7b0dd | |||
| 5a2e7b75b4 | |||
| 1d39fb8ad1 | |||
| 9c0e1258a3 | |||
| 513a3ad610 | |||
| c7f17f771b | |||
| a9fd75ff52 | |||
| ef3e7d0fa6 | |||
| 9c802252c6 | |||
| 4928fd1f0c | |||
| 9d80c66605 | |||
| 8607c70bbe | |||
| a7d235e53a | |||
| 0ca0182687 | |||
| 2190cf2221 | |||
| e86fdce970 | |||
| 63b067cb7e | |||
| abf274f0c5 | |||
| fd01e0446d | |||
| 4a371cda80 | |||
| d1da0d0f9e | |||
| 6fe356bad7 | |||
| 40d9aa1790 | |||
| b7cac443c1 | |||
| 93fbd9d154 | |||
| 13a5ce024e | |||
| a60a6c028c | |||
| 37bb46db79 | |||
| db56a05559 | |||
| a35003d750 | |||
| cd3caf9b76 | |||
| 864f4303a0 | |||
| c4eadb03b9 | |||
| a9e7ccb870 | |||
| ff518e3525 | |||
| 03b03e8831 | |||
| ee96e8e91b | |||
| 31e1df6786 | |||
| f75c2c7fc9 | |||
| 3b115b5e08 | |||
| 542a0d7a8a | |||
| 0c869066b4 | |||
| 6ec4bf91e0 | |||
| e8d316cb83 | |||
| 0c8d4e2dc4 | |||
| 63c7ed7faf | |||
| 82bcf9ee15 | |||
| e8d116cbb8 | |||
| eeac0a0348 | |||
| 2a01d0ed7d | |||
| 0567665ca1 | |||
| 1b38a00056 | |||
| 47cfdb6e7f | |||
| a86664ee2e | |||
| e420cd2d54 | |||
| b1d1c548b4 | |||
| 3a99747e2a | |||
| 66a3d9c140 | |||
| f92e35ccc6 | |||
| 1d859f3c73 | |||
| 55c97f3441 | |||
| c6d88346d1 | |||
| 03b3a25b86 | |||
| 5c46e4aed5 | |||
| 7743569034 | |||
| b1d10af821 | |||
| cf526b8003 | |||
| 4311b93611 | |||
| 432e52536b | |||
| 3f062c9370 | |||
| 9cc3abe964 | |||
| b1a7ea4482 | |||
| 37219b4fb6 | |||
| 4d38fd8fb3 | |||
| 0376b4c790 | |||
| 88b73f950d | |||
| 21ab0fdc0d | |||
| 21021cec1f | |||
| 4187aabd11 | |||
| 7d23d4c288 | |||
| d7da677fdb | |||
| 53d546f99a | |||
| 8fce6a446f | |||
| 08d48a4601 | |||
| d31d55b00e | |||
| ec4d0076b6 | |||
| 1365aadaf0 | |||
| 957bcfb52f | |||
| 007f0c5808 | |||
| fa9c1f83eb | |||
| 98d479e82c | |||
| 9fa386ea8c | |||
| df20c13204 | |||
| 2d24a1beb3 | |||
| ecb6175c64 | |||
| 5b1a866996 | |||
| 1004c66965 | |||
| 1fbf875c16 | |||
| ad8109ed65 | |||
| 05ae4be472 | |||
| 406513488b | |||
| 71fdc5c9ea | |||
| d2e68c7c9b | |||
| 2bdbbcfa75 | |||
| 6ba4d0d310 | |||
| e14cbb49c3 | |||
| b5a7ba0054 | |||
| 74ec8ff9eb | |||
| d1726b65ff | |||
| 91994256d7 | |||
| cdc3f0076a | |||
| 0fa7eb5568 | |||
| ca0559bf7f | |||
| 1a02d73154 | |||
| e899ea74b9 | |||
| f8623173cb | |||
| 67c9211123 | |||
| e76bc1e38e | |||
| 49576b0558 | |||
| 9a6b6f88d9 | |||
| 8388e939d3 | |||
| 932bc290d4 | |||
| fdc7f9bf10 | |||
| e88489166b | |||
| 83ae87b5d4 | |||
| 1e278e4d7b | |||
| 9cb671fc43 | |||
| aedf5cde77 | |||
| 2a5831c971 | |||
| 84cc42cc40 | |||
| 4cf9437688 | |||
| eb15585c03 | |||
| 144b26bd5d | |||
| 0fbfffbdea | |||
| 892733b66d | |||
| 54735e3476 | |||
| a599c46cfc | |||
| 1c2ec14677 | |||
| b0d18a151d | |||
| 2d2d5d6bae | |||
| 374fe08fe2 | |||
| 3f8bb86e15 | |||
| 1e2190b1ad | |||
| 09bb658367 | |||
| c91e4f83e0 | |||
| 8c0fbede36 | |||
| 61788b2c7f | |||
| 8ff0ed5756 | |||
| e242956c61 | |||
| 58e8c56d37 | |||
| 9b615738f3 | |||
| 26b19bb545 | |||
| 8577366285 | |||
| 65b82c29d4 | |||
| e86d728acd | |||
| 87b3030b9e | |||
| dfc61ec50c | |||
| 70b72d950a | |||
| 6302fbd5a9 | |||
| e1a3dc034e | |||
| 4e934ed31c | |||
| 3f5d3a9d64 | |||
| e72b00fe17 | |||
| 5e73631377 | |||
| df04dba03f | |||
| ed35819ae5 | |||
| 2aac7353e2 | |||
| 1cb380de45 | |||
| 27bc8a2b32 | |||
| 2e367f398f | |||
| f022e89a73 | |||
| 5b46046b87 | |||
| b62104ae91 | |||
| 76a2e5b8ba | |||
| 4f9eb6ea13 | |||
| 0c0e0d2ba6 | |||
| fc51f4fc74 | |||
| 8583f29082 | |||
| fc6a944f61 | |||
| 1d0234f9ed | |||
| 75bd2abe12 | |||
| 06bce9f7e2 | |||
| 2a9bebc416 | |||
| 0a021baf09 | |||
| 34331c2312 | |||
| 8eef4083c8 | |||
| 869da4fa6c | |||
| 7048d0a4d9 | |||
| e029bb2e89 | |||
| 6cd612fbb8 | |||
| 41c9f25c6b | |||
| 3b4ade02a5 | |||
| bf4a70b0e5 | |||
| 30ec953aa1 | |||
| 5edade9076 | |||
| 225501b1a5 | |||
| 9df682b4ef | |||
| 9d6a23658f | |||
| 408b106c2f | |||
| 713989bcb9 | |||
| 7ce4703235 | |||
| a1013c878a | |||
| 27ff4b1d69 | |||
| 61d03a9ece | |||
| baf5d9151f | |||
| eb02131482 | |||
| 504910cbc7 | |||
| 47c0fadb40 | |||
| 203b14064f | |||
| fe7e9aee68 | |||
| bf1307c3a8 | |||
| e65a9eab8f | |||
| fb27d1a17c | |||
| 6ffc809fac | |||
| 8a11d7b4b6 | |||
| 1336cbda98 | |||
| f30cf71f27 | |||
| 8ff6dc4cd4 | |||
| 4a9681ae26 | |||
| bf80b77374 | |||
| c9c8450cbb | |||
| df0d3d4972 | |||
| 026f76cb4a | |||
| 338c13947d | |||
| 81eb1ec9a5 | |||
| 4b625ab9ea | |||
| 9f76cf6762 | |||
| 427839fe52 | |||
| 6146eb074b | |||
| 69309bf40b | |||
| 8a48701cbf | |||
| a369bf0297 | |||
| d863468175 | |||
| abf19e0c0d | |||
| 4d6998371f | |||
| ce600f5bd0 | |||
| 912a208dfe | |||
| cf5f52e696 | |||
| af40f38ca3 | |||
| bc9de1344d | |||
| 5c33542b35 | |||
| 64d077df8b | |||
| 5c7254a827 | |||
| 10508da2f4 | |||
| 248ecaf778 | |||
| d42c139490 | |||
| 051f3b5ce5 | |||
| 4d1b79b1b5 | |||
| 446a57b1e2 | |||
| 22d812a305 | |||
| 21cc84f7a1 | |||
| 7604bd0b4a | |||
| d8e4f45827 | |||
| 9a75993848 | |||
| daf4bc347e | |||
| 840805f39f | |||
| 4c4a3a99c2 | |||
| 6f0ec7ad47 | |||
| 92c10d50c8 | |||
| 44e78b336f | |||
| 688af6c815 | |||
| 19bdd5e160 | |||
| 5ae6961b2f | |||
| b2f7dd77bb | |||
| 1ebb61c1b4 | |||
| ea4d196ca2 | |||
| caad874c62 | |||
| bd8942617f | |||
| 033dee9393 | |||
| bdafc2ad36 | |||
| e0e233b50e | |||
| 79022c1612 | |||
| 961a7bd278 | |||
| efd595f45b | |||
| d683d75924 | |||
| 119bcd82bf | |||
| 4fa27e5ec0 |
16
.gitignore
vendored
16
.gitignore
vendored
@@ -35,14 +35,14 @@
|
||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||
# since they will be recreated, and may cause churn. Uncomment if using
|
||||
# auto-import.
|
||||
.idea/artifacts
|
||||
.idea/compiler.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/modules.xml
|
||||
.idea/*.iml
|
||||
.idea/modules
|
||||
*.iml
|
||||
*.ipr
|
||||
.idea/artifacts
|
||||
.idea/compiler.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/modules.xml
|
||||
.idea/*.iml
|
||||
.idea/modules
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
# CMake
|
||||
cmake-build-*/
|
||||
|
||||
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
6
.idea/git_toolbox_blame.xml
generated
Normal file
6
.idea/git_toolbox_blame.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxBlameSettings">
|
||||
<option name="version" value="2" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,java.lang.foreign.Arena,ofAuto,java.lang.foreign.Arena,global,com.annimon.stream.Stream,of" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
6
.idea/jenkinsSettings.xml
generated
Normal file
6
.idea/jenkinsSettings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Jenkins.Application.Settings">
|
||||
<option name="serverUrl" value="https://ci.studioml.it" />
|
||||
</component>
|
||||
</project>
|
||||
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
@@ -8,5 +8,8 @@
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="PWA">
|
||||
<option name="wasEnabledAtLeastOnce" value="true" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
|
||||
</project>
|
||||
@@ -7,6 +7,10 @@
|
||||
<option name="HOST" value="serverdev" />
|
||||
<option name="PORT" value="8001" />
|
||||
<option name="AUTO_RESTART" value="false" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
<option name="DEBUG_PORT" value="8001" />
|
||||
<option name="LOCAL" value="false" />
|
||||
</RunnerSettings>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
16
.idea/runConfigurations/Tomcat_9__RistoCash_.xml
generated
Normal file
16
.idea/runConfigurations/Tomcat_9__RistoCash_.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat 9 (RistoCash)" type="Remote">
|
||||
<module name="ems-engine" />
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" />
|
||||
<option name="HOST" value="127.0.0.1" />
|
||||
<option name="PORT" value="8001" />
|
||||
<option name="AUTO_RESTART" value="false" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
<option name="DEBUG_PORT" value="8001" />
|
||||
<option name="LOCAL" value="false" />
|
||||
</RunnerSettings>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
16
.idea/runConfigurations/Tomcat__1__GestSRV_.xml
generated
Normal file
16
.idea/runConfigurations/Tomcat__1__GestSRV_.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat #1 (GestSRV)" type="Remote" folderName="Carelli">
|
||||
<module name="ems-engine" />
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" />
|
||||
<option name="HOST" value="172.16.30.238" />
|
||||
<option name="PORT" value="8001" />
|
||||
<option name="AUTO_RESTART" value="false" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
<option name="DEBUG_PORT" value="8001" />
|
||||
<option name="LOCAL" value="false" />
|
||||
</RunnerSettings>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
16
.idea/runConfigurations/Tomcat__1__Rosso_Gargano_.xml
generated
Normal file
16
.idea/runConfigurations/Tomcat__1__Rosso_Gargano_.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat #1 (Rosso Gargano)" type="Remote" folderName="Rosso Gargano">
|
||||
<module name="ems-engine" />
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" />
|
||||
<option name="HOST" value="192.168.1.13" />
|
||||
<option name="PORT" value="8001" />
|
||||
<option name="AUTO_RESTART" value="false" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
<option name="DEBUG_PORT" value="8001" />
|
||||
<option name="LOCAL" value="false" />
|
||||
</RunnerSettings>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -7,6 +7,10 @@
|
||||
<option name="HOST" value="localhost" />
|
||||
<option name="PORT" value="8000" />
|
||||
<option name="AUTO_RESTART" value="false" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
<option name="DEBUG_PORT" value="8000" />
|
||||
<option name="LOCAL" value="false" />
|
||||
</RunnerSettings>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
16
.idea/runConfigurations/Tomcat__2__GestSRV_.xml
generated
Normal file
16
.idea/runConfigurations/Tomcat__2__GestSRV_.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat #2 (GestSRV)" type="Remote" folderName="Carelli">
|
||||
<module name="ems-engine" />
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" />
|
||||
<option name="HOST" value="172.16.30.238" />
|
||||
<option name="PORT" value="8002" />
|
||||
<option name="AUTO_RESTART" value="false" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
<option name="DEBUG_PORT" value="8002" />
|
||||
<option name="LOCAL" value="false" />
|
||||
</RunnerSettings>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
16
.idea/runConfigurations/Tomcat__AnydeskTunnel_.xml
generated
Normal file
16
.idea/runConfigurations/Tomcat__AnydeskTunnel_.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat (AnydeskTunnel)" type="Remote">
|
||||
<module name="ems-engine" />
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" />
|
||||
<option name="HOST" value="servertomcat" />
|
||||
<option name="PORT" value="8000" />
|
||||
<option name="AUTO_RESTART" value="false" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
<option name="DEBUG_PORT" value="8000" />
|
||||
<option name="LOCAL" value="false" />
|
||||
</RunnerSettings>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
2
.idea/runConfigurations/Tomcat__FAST_.xml
generated
2
.idea/runConfigurations/Tomcat__FAST_.xml
generated
@@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat (FAST)" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat" ALTERNATIVE_JRE_ENABLED="false">
|
||||
<option name="COMMON_VM_ARGUMENTS" value="-DDISABLE_DROOLS_COMPILE=TRUE -Xms512m -Xmx2048m" />
|
||||
<option name="COMMON_VM_ARGUMENTS" value="-DDISABLE_DROOLS_COMPILE=TRUE -Xms6G -Xmx6G -XX:MaxPermSize=1G -XX:PermSize=512M" />
|
||||
<deployment>
|
||||
<artifact name="ems-engine:war exploded">
|
||||
<settings>
|
||||
|
||||
16
.idea/runConfigurations/Tosca_Cloud.xml
generated
Normal file
16
.idea/runConfigurations/Tosca_Cloud.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tosca Cloud" type="Remote" folderName="Tosca">
|
||||
<module name="ems-engine" />
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" />
|
||||
<option name="HOST" value="4.232.161.31" />
|
||||
<option name="PORT" value="8001" />
|
||||
<option name="AUTO_RESTART" value="false" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
<option name="DEBUG_PORT" value="8001" />
|
||||
<option name="LOCAL" value="false" />
|
||||
</RunnerSettings>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
16
.idea/runConfigurations/Tosca_Verona.xml
generated
Normal file
16
.idea/runConfigurations/Tosca_Verona.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tosca Verona" type="Remote" folderName="Tosca">
|
||||
<module name="ems-engine" />
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" />
|
||||
<option name="HOST" value="10.19.178.6" />
|
||||
<option name="PORT" value="8001" />
|
||||
<option name="AUTO_RESTART" value="false" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
<option name="DEBUG_PORT" value="8001" />
|
||||
<option name="LOCAL" value="false" />
|
||||
</RunnerSettings>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
122
build/Jenkinsfile.groovy
Normal file
122
build/Jenkinsfile.groovy
Normal file
@@ -0,0 +1,122 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage ('PreBuild Steps (Master)') {
|
||||
when {
|
||||
expression {
|
||||
return env.GIT_BRANCH == "master"
|
||||
}
|
||||
}
|
||||
steps {
|
||||
echo "Creo version tag su Git"
|
||||
bat 'build\\create_build_tag.bat'
|
||||
}
|
||||
}
|
||||
stage('Maven Build') {
|
||||
steps {
|
||||
echo "${WORKSPACE}"
|
||||
withMaven(jdk: 'JDK 17.0.6 x64', traceability: true, maven: 'Maven 3.9.5') {
|
||||
bat(script: 'mvn clean install -t toolchains-jenkins.xml', returnStdout: true)
|
||||
archiveArtifacts(artifacts: 'ems-engine/target/*.war*', onlyIfSuccessful: true)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish Develop') {
|
||||
when {
|
||||
expression {
|
||||
return env.GIT_BRANCH == "develop"
|
||||
}
|
||||
}
|
||||
parallel {
|
||||
stage('Tomcat update') {
|
||||
stages {
|
||||
stage('Update Tomcat 1') {
|
||||
steps {
|
||||
echo "Updating Tomcat9 from ${WORKSPACE}"
|
||||
powershell returnStdout: true, script: "build\\update_tomcat.ps1 -serviceName \"Tomcat9\" -httpPort \"8081\" -updatedArtifactPath \"${WORKSPACE}\\ems-engine\\target\\ems-api.war\""
|
||||
}
|
||||
}
|
||||
stage('Update Tomcat 2') {
|
||||
steps {
|
||||
echo "Updating Tomcat9 from ${WORKSPACE}"
|
||||
powershell returnStdout: true, script: "build\\update_tomcat.ps1 -serviceName \"Tomcat9Backup\" -httpPort \"8082\" -updatedArtifactPath \"${WORKSPACE}\\ems-engine\\target\\ems-api.war\""
|
||||
bat 'curl -k https://devservices.studioml.it/ems-api/updateWMSApp'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish over FTP') {
|
||||
steps {
|
||||
echo "Publish over FTP"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish Master') {
|
||||
when {
|
||||
expression {
|
||||
return env.GIT_BRANCH == "master"
|
||||
}
|
||||
}
|
||||
parallel {
|
||||
stage('Tomcat update') {
|
||||
stages {
|
||||
stage('Update Tomcat 1') {
|
||||
steps {
|
||||
echo "Updating Tomcat9 from ${WORKSPACE}"
|
||||
sshPublisher(publishers: [sshPublisherDesc(configName: 'Production Linux Tomcat Server (192.168.3.16)', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '''sudo /usr/bin/systemctl stop tomcat9
|
||||
rm -R tomcat9/webapps/ems-api
|
||||
sudo /usr/bin/systemctl start tomcat9
|
||||
|
||||
/home/studioml/./wait_tomcat_startup.sh 8081''', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/tomcat9/webapps', remoteDirectorySDF: false, removePrefix: 'ems-engine/target/', sourceFiles: 'ems-engine/target/*.war*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
|
||||
}
|
||||
}
|
||||
stage('Update Tomcat 2') {
|
||||
steps {
|
||||
echo "Updating Tomcat9 from ${WORKSPACE}"
|
||||
sshPublisher(publishers: [sshPublisherDesc(configName: 'Production Linux Tomcat Server (192.168.3.16)', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '''sudo /usr/bin/systemctl stop tomcat9backup
|
||||
rm -R tomcat9backup/webapps/ems-api
|
||||
sudo /usr/bin/systemctl start tomcat9backup
|
||||
|
||||
/home/studioml/./wait_tomcat_startup.sh 8082
|
||||
|
||||
sleep 10''', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/tomcat9backup/webapps', remoteDirectorySDF: false, removePrefix: 'ems-engine/target/', sourceFiles: 'ems-engine/target/*.war*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
|
||||
bat 'curl -k https://services.studioml.it/ems-api/updateWMSApp'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish over FTP') {
|
||||
steps {
|
||||
ftpPublisher alwaysPublishFromMaster: false,
|
||||
continueOnError: false,
|
||||
failOnError: false,
|
||||
masterNodeName: '',
|
||||
paramPublish: null,
|
||||
publishers: [[configName: 'OVH Linux Web Server (51.38.112.23)',
|
||||
transfers: [[asciiMode: false,
|
||||
cleanRemote: false,
|
||||
excludes: '',
|
||||
flatten: false,
|
||||
makeEmptyDirs: false,
|
||||
noDefaultExcludes: false,
|
||||
patternSeparator: '[, ]+',
|
||||
remoteDirectory: '/download/Aggiornamenti',
|
||||
remoteDirectorySDF: false,
|
||||
removePrefix: 'ems-engine/target/',
|
||||
sourceFiles: 'ems-engine/target/*.war*']],
|
||||
usePromotionTimestamp: false,
|
||||
useWorkspaceInPromotion: false,
|
||||
verbose: true]]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
43
build/create_build_tag.bat
Normal file
43
build/create_build_tag.bat
Normal file
@@ -0,0 +1,43 @@
|
||||
REM SET YEAR
|
||||
set YEAR=%date:~6,4%
|
||||
|
||||
REM SET MONTH
|
||||
set MONTH=%date:~3,2%
|
||||
if %MONTH% LSS 10 set MONTH=%MONTH:~1,2%
|
||||
if %MONTH% LSS 10 set MONTH=0%MONTH%
|
||||
|
||||
REM SET DAY
|
||||
set DAY=%date:~0,2%
|
||||
if %DAY% LSS 10 set DAY=%DAY:~1,2%
|
||||
if %DAY% LSS 10 set DAY=0%DAY%
|
||||
|
||||
REM SET HOUR
|
||||
set HOUR=%time:~0,2%
|
||||
if %HOUR% LSS 10 set HOUR=%HOUR:~1,2%
|
||||
if %HOUR% LSS 10 set HOUR=0%HOUR%
|
||||
|
||||
REM SET MINUTE
|
||||
set MINUTE=%time:~3,2%
|
||||
if %MINUTE% LSS 10 set MINUTE=%MINUTE:~1,2%
|
||||
if %MINUTE% LSS 10 set MINUTE=0%MINUTE%
|
||||
|
||||
REM SET SECOND
|
||||
set SECOND=%time:~6,2%
|
||||
if %SECOND% LSS 10 set SECOND=%SECOND:~1,2%
|
||||
if %SECOND% LSS 10 set SECOND=0%SECOND%
|
||||
|
||||
set mydate=%YEAR%%MONTH%%DAY%_%HOUR%%MINUTE%%SECOND%
|
||||
|
||||
|
||||
|
||||
echo #spring.profiles.active=@activatedProperties@ > ems-core\src\main\resources\configs\env.properties
|
||||
echo project.version=%mydate% >> ems-core\src\main\resources\configs\env.properties
|
||||
|
||||
|
||||
git add . -A
|
||||
git commit -m "%mydate%"
|
||||
git tag "%mydate%"
|
||||
|
||||
|
||||
git push https://git.studioml.it/Integry/IntegryManagementSystem.git --tags
|
||||
git push https://git.studioml.it/Integry/IntegryManagementSystem.git --all
|
||||
153
build/update_tomcat.ps1
Normal file
153
build/update_tomcat.ps1
Normal file
@@ -0,0 +1,153 @@
|
||||
Param(
|
||||
[string]$serviceName, #Argomento passato dal chiamante
|
||||
[Int32]$httpPort, #Argomento passato dal chiamante
|
||||
[string]$updatedArtifactPath #Argomento passato dal chiamante
|
||||
)
|
||||
|
||||
$max_attempts = 48
|
||||
$attempt = 0
|
||||
$webappsPath = "C:\Program Files\$serviceName\webapps"
|
||||
|
||||
# Funzione per eseguire la chiamata GET e controllare lo status code
|
||||
function Check-Status {
|
||||
try {
|
||||
$request = Invoke-WebRequest -Uri "http://localhost:$httpPort/ems-api/system/ok" -Method Get -ErrorAction Stop
|
||||
$statusCode = $request.StatusCode
|
||||
if ($statusCode -eq 200) {
|
||||
Write-Host "Status code 200 ricevuto, processo completato."
|
||||
exit 0
|
||||
} else {
|
||||
Write-Host "Status code $statusCode ricevuto, continuo a provare..."
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Errore: $_"
|
||||
}
|
||||
}
|
||||
|
||||
# Funzione per cancellare una cartella e un file
|
||||
function Delete-FilesAndFolder
|
||||
{
|
||||
param (
|
||||
[string]$folderPath,
|
||||
[string]$filePath
|
||||
)
|
||||
|
||||
try {
|
||||
# Cancellare la cartella specificata
|
||||
if (Test-Path -Path $folderPath) {
|
||||
Remove-Item -Path $folderPath -Recurse -Force
|
||||
Write-Host "Cartella $folderPath eliminata con successo."
|
||||
} else {
|
||||
Write-Host "La cartella $folderPath non esiste."
|
||||
}
|
||||
|
||||
# Cancellare il file specificato
|
||||
if (Test-Path -Path $filePath) {
|
||||
Remove-Item -Path $filePath -Force
|
||||
Write-Host "File $filePath eliminato con successo."
|
||||
} else {
|
||||
Write-Host "Il file $filePath non esiste."
|
||||
}
|
||||
|
||||
} catch {
|
||||
Write-Host "Errore nella cancellazione di file o cartella: $_"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Funzione per copiare un file
|
||||
function Copy-File {
|
||||
param (
|
||||
[string]$sourceFilePath,
|
||||
[string]$destinationFilePath
|
||||
)
|
||||
|
||||
try {
|
||||
if (Test-Path -Path $sourceFilePath) {
|
||||
Copy-Item -Path $sourceFilePath -Destination $destinationFilePath -Force
|
||||
Write-Host "File copiato da $sourceFilePath a $destinationFilePath con successo."
|
||||
} else {
|
||||
Write-Host "Il file sorgente $sourceFilePath non esiste."
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Errore nella copia del file: $_"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Funzione per stoppare un servizio e attendere che sia completamente fermato
|
||||
function Stop-ServiceAndWait {
|
||||
param (
|
||||
[string]$serviceName
|
||||
)
|
||||
|
||||
# Tentativo di stoppare il servizio
|
||||
try {
|
||||
Write-Host "Sto stoppando il servizio $serviceName..."
|
||||
Stop-Service -Name $serviceName -Force
|
||||
|
||||
# Attesa finché il servizio non viene stoppato
|
||||
$service = Get-Service -Name $serviceName
|
||||
while ($service.Status -ne 'Stopped') {
|
||||
Write-Host "Attendo che il servizio $serviceName si fermi..."
|
||||
Start-Sleep -Seconds 5
|
||||
$service = Get-Service -Name $serviceName
|
||||
}
|
||||
|
||||
Write-Host "Il servizio $serviceName è stato fermato con successo."
|
||||
} catch {
|
||||
Write-Host "Errore nello stoppare il servizio ${serviceName}: $_"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Funzione per avviare nuovamente un servizio e attendere che sia in esecuzione
|
||||
function Start-ServiceAndWait {
|
||||
param (
|
||||
[string]$serviceName
|
||||
)
|
||||
|
||||
try {
|
||||
Write-Host "Sto avviando il servizio $serviceName..."
|
||||
Start-Service -Name $serviceName
|
||||
|
||||
# Attesa finché il servizio non viene avviato
|
||||
$service = Get-Service -Name $serviceName
|
||||
while ($service.Status -ne 'Running') {
|
||||
Write-Host "Attendo che il servizio $serviceName si avvii..."
|
||||
Start-Sleep -Seconds 5
|
||||
$service = Get-Service -Name $serviceName
|
||||
}
|
||||
|
||||
Write-Host "Il servizio $serviceName è stato avviato con successo."
|
||||
|
||||
} catch {
|
||||
Write-Host "Errore nell'avvio del servizio ${serviceName}: $_"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Chiamare la funzione per stoppare il servizio
|
||||
Stop-ServiceAndWait -serviceName $serviceName
|
||||
|
||||
# Subito dopo lo stop, cancellare la cartella e il file
|
||||
$emsApiPath = "$webappsPath\ems-api"
|
||||
$emsWarFilePath = "$webappsPath\ems-api.war"
|
||||
Delete-FilesAndFolder -folderPath $emsApiPath -filePath $emsWarFilePath
|
||||
|
||||
# Chiamare la funzione per copiare il file
|
||||
Write-Host "Copio $updatedArtifactPath in $emsWarFilePath"
|
||||
Copy-File -sourceFilePath $updatedArtifactPath -destinationFilePath $emsWarFilePath
|
||||
|
||||
# Avvia nuovamente il servizio
|
||||
Start-ServiceAndWait -serviceName $serviceName
|
||||
|
||||
# Ciclo fino a quando lo status code non è 200 o superiamo il numero massimo di tentativi
|
||||
while ($attempt -lt $max_attempts) {
|
||||
$attempt++
|
||||
Check-Status
|
||||
Start-Sleep -Seconds 5 # Attendere per 5 secondi prima di fare un altro tentativo
|
||||
}
|
||||
|
||||
Write-Host "Numero massimo di tentativi superato. Nessuna risposta 200 ricevuta."
|
||||
exit 1
|
||||
105
ems-core/pom.xml
105
ems-core/pom.xml
@@ -42,19 +42,38 @@
|
||||
<target>${java.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.4.0</version>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
<mainClass>it.integry.ems_model.rulescompleting.KieStaticCompiler</mainClass>
|
||||
<longClasspath>true</longClasspath>
|
||||
<longModulepath>true</longModulepath>
|
||||
<toolchain>jdk</toolchain>
|
||||
<executable>java</executable>
|
||||
<cleanupDaemonThreads>false</cleanupDaemonThreads>
|
||||
<skip>false</skip>
|
||||
<arguments>
|
||||
<argument>-classpath</argument>
|
||||
<!-- automatically creates the classpath using all project dependencies,
|
||||
also adding the project build directory -->
|
||||
<classpath/>
|
||||
<argument>it.integry.ems_model.rulescompleting.KieStaticCompiler</argument>
|
||||
<argument>src/main/resources/rules/</argument>
|
||||
<argument>../ems-engine/src/main/webapp/drools/</argument>
|
||||
</arguments>
|
||||
<systemProperties>
|
||||
<projectProperties/>
|
||||
<exec.longClasspath>true</exec.longClasspath>
|
||||
</systemProperties>
|
||||
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>post-clean</phase>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>java</goal>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
@@ -120,7 +139,7 @@
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.2</version>
|
||||
<version>2.11.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -154,19 +173,24 @@
|
||||
<version>1.13</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>8.4.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SWAGGER
|
||||
<!-- SWAGGER -->
|
||||
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<artifactId>springfox-oas</artifactId>
|
||||
<version>${swagger.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.version}</version>
|
||||
</dependency> -->
|
||||
</dependency>
|
||||
|
||||
<!-- REST CLIENT -->
|
||||
<dependency>
|
||||
@@ -181,7 +205,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-jackson-provider</artifactId>
|
||||
<artifactId>resteasy-jackson2-provider</artifactId>
|
||||
<version>${resteasy.version}</version>
|
||||
</dependency>
|
||||
|
||||
@@ -216,7 +240,7 @@
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
<version>0.9.10</version>
|
||||
<version>0.10.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mail -->
|
||||
@@ -226,29 +250,17 @@
|
||||
<version>1.4.7</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlbeans</groupId>
|
||||
<artifactId>xmlbeans</artifactId>
|
||||
<version>2.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- JASPER REPORT -->
|
||||
<dependency>
|
||||
<groupId>net.sf.jasperreports</groupId>
|
||||
<artifactId>jasperreports</artifactId>
|
||||
<version>6.16.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.lowagie</groupId>
|
||||
<artifactId>itext</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lowagie</groupId>
|
||||
<artifactId>itext</artifactId>
|
||||
<version>2.1.7.js8</version>
|
||||
<version>${jaspersoft.version}</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.lowagie</groupId>-->
|
||||
<!-- <artifactId>itext</artifactId>-->
|
||||
<!-- <version>2.1.7.js8</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>net.sf.jasperreports</groupId>
|
||||
<artifactId>jasperreports-htmlcomponent</artifactId>
|
||||
@@ -257,12 +269,12 @@
|
||||
<dependency>
|
||||
<groupId>net.sf.jasperreports</groupId>
|
||||
<artifactId>jasperreports-fonts</artifactId>
|
||||
<version>6.16.0</version>
|
||||
<version>${jaspersoft.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.jasperreports</groupId>
|
||||
<artifactId>jasperreports-functions</artifactId>
|
||||
<version>6.16.0</version>
|
||||
<version>${jaspersoft.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>it.integry.font</groupId>
|
||||
@@ -358,14 +370,14 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>3.9</version>
|
||||
<version>5.2.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>3.9</version>
|
||||
<version>5.2.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -421,11 +433,21 @@
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-csv</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
@@ -445,11 +467,6 @@
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-instrument-tomcat</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-oxm</artifactId>
|
||||
@@ -499,6 +516,7 @@
|
||||
<version>${drools.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- log4j -->
|
||||
<dependency>
|
||||
<groupId>com.lmax</groupId>
|
||||
@@ -537,7 +555,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
<version>3.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -555,11 +573,6 @@
|
||||
</dependency>
|
||||
|
||||
<!-- UTILS -->
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>${guava.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
@@ -686,7 +699,7 @@
|
||||
<dependency>
|
||||
<groupId>com.google.firebase</groupId>
|
||||
<artifactId>firebase-admin</artifactId>
|
||||
<version>7.0.1</version>
|
||||
<version>9.2.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -717,7 +730,7 @@
|
||||
<dependency>
|
||||
<groupId>com.github.javaparser</groupId>
|
||||
<artifactId>javaparser-symbol-solver-core</artifactId>
|
||||
<version>3.25.9</version>
|
||||
<version>3.26.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package it.integry.FoodProcess.api;
|
||||
|
||||
import javax.ws.rs.client.ClientRequestContext;
|
||||
import javax.ws.rs.client.ClientRequestFilter;
|
||||
import java.io.IOException;
|
||||
|
||||
public class AddApiKeyHeaderRequestFilter implements ClientRequestFilter {
|
||||
private final String apiKey;
|
||||
|
||||
public AddApiKeyHeaderRequestFilter(String apiKey) {
|
||||
this.apiKey = apiKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void filter(ClientRequestContext clientRequestContext) throws IOException {
|
||||
clientRequestContext.getHeaders().add("X-Api-Key", apiKey);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package it.integry.FoodProcess.api;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import it.integry.FoodProcess.dto.response.ErrorResponse;
|
||||
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.client.ClientRequestContext;
|
||||
import javax.ws.rs.client.ClientResponseContext;
|
||||
import javax.ws.rs.client.ClientResponseFilter;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.io.IOException;
|
||||
|
||||
public class ErrorMessageResponseFilter implements ClientResponseFilter {
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
|
||||
if (responseContext.getStatus() != Response.Status.OK.getStatusCode()) {
|
||||
if (responseContext.hasEntity()) {
|
||||
ErrorResponse error = objectMapper.readValue(responseContext.getEntityStream(), ErrorResponse.class);
|
||||
String message = error.getErrorMessage();
|
||||
|
||||
Response.Status status = Response.Status.fromStatusCode(responseContext.getStatus());
|
||||
WebApplicationException webAppException;
|
||||
switch (status) {
|
||||
case BAD_REQUEST:
|
||||
webAppException = new BadRequestException(message);
|
||||
break;
|
||||
case UNAUTHORIZED:
|
||||
webAppException = new NotAuthorizedException(message, Response.status(Response.Status.UNAUTHORIZED).build());
|
||||
break;
|
||||
case FORBIDDEN:
|
||||
webAppException = new ForbiddenException(message);
|
||||
break;
|
||||
case NOT_FOUND:
|
||||
webAppException = new NotFoundException(message);
|
||||
break;
|
||||
case METHOD_NOT_ALLOWED:
|
||||
webAppException = new NotAllowedException(message);
|
||||
break;
|
||||
case NOT_ACCEPTABLE:
|
||||
webAppException = new NotAcceptableException(message);
|
||||
break;
|
||||
case UNSUPPORTED_MEDIA_TYPE:
|
||||
webAppException = new NotSupportedException(message);
|
||||
break;
|
||||
case INTERNAL_SERVER_ERROR:
|
||||
webAppException = new InternalServerErrorException(message);
|
||||
break;
|
||||
case SERVICE_UNAVAILABLE:
|
||||
webAppException = new ServiceUnavailableException(message);
|
||||
break;
|
||||
default:
|
||||
webAppException = new WebApplicationException(message);
|
||||
}
|
||||
|
||||
throw webAppException;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package it.integry.FoodProcess.api;
|
||||
|
||||
import it.integry.FoodProcess.dto.*;
|
||||
import it.integry.FoodProcess.dto.response.*;
|
||||
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.List;
|
||||
|
||||
public interface FoodProcessClient {
|
||||
// Orders
|
||||
|
||||
@GET
|
||||
@Path("/getorderstatuses")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
List<OrderStatusResponse> getOrderStatuses(@QueryParam("order_ids") List<String> orderIds);
|
||||
|
||||
@POST
|
||||
@Path("/importorders")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
ImportOrdersResponse importOrders(ImportOrdersRequest importOrdersRequest);
|
||||
|
||||
// Master data
|
||||
|
||||
@GET
|
||||
@Path("/getarticles")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
List<Article> getArticles();
|
||||
|
||||
@POST
|
||||
@Path("/importarticles")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
ImportArticlesResponse importArticles(ImportArticlesRequest importArticlesRequest);
|
||||
|
||||
@GET
|
||||
@Path("/getbusinesspartners")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
List<BusinessPartner> getBusinessPartners();
|
||||
|
||||
@POST
|
||||
@Path("/importbusinesspartners")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
ImportBusinessPartnersResponse importBusinessPartners(ImportBusinessPartnersRequest importBusinessPartnersRequest);
|
||||
|
||||
@GET
|
||||
@Path("/getpackagingmaterials")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
List<PackagingMaterial> getPackagingMaterials();
|
||||
|
||||
@POST
|
||||
@Path("/importpackagingmaterials")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
ImportPackagingMaterialsResponse importPackagingMaterials(ImportPackagingMaterialsRequest importPackagingMaterialsRequest);
|
||||
|
||||
@GET
|
||||
@Path("/getrawmaterials")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
List<RawMaterial> getRawMaterials();
|
||||
|
||||
@POST
|
||||
@Path("/importrawmaterials")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
ImportRawMaterialsResponse importRawMaterials(ImportRawMaterialsRequest importRawMaterialsRequest);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package it.integry.FoodProcess.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider;
|
||||
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.MultivaluedMap;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
@Provider
|
||||
public class JacksonProvider extends ResteasyJackson2Provider {
|
||||
@Override
|
||||
public void writeTo(Object value, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException {
|
||||
ObjectMapper mapper = locateMapper(type, MediaType.APPLICATION_JSON_TYPE);
|
||||
|
||||
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
|
||||
super.writeTo(value, type, genericType, annotations, mediaType, httpHeaders, entityStream);
|
||||
}
|
||||
}
|
||||
116
ems-core/src/main/java/it/integry/FoodProcess/dto/Article.java
Normal file
116
ems-core/src/main/java/it/integry/FoodProcess/dto/Article.java
Normal file
@@ -0,0 +1,116 @@
|
||||
package it.integry.FoodProcess.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Article {
|
||||
@SqlField
|
||||
private String id;
|
||||
|
||||
@SqlField
|
||||
private String code;
|
||||
|
||||
@SqlField
|
||||
private String name;
|
||||
|
||||
@JsonProperty("raw_materials")
|
||||
private List<ArticleRawMaterial> rawMaterials;
|
||||
|
||||
@JsonProperty("packaging_material_id")
|
||||
private String packagingMaterialId;
|
||||
|
||||
@JsonProperty("packaging_material_code")
|
||||
private String packagingMaterialCode;
|
||||
|
||||
@JsonProperty("packaging_material_name")
|
||||
private String packagingMaterialName;
|
||||
|
||||
@SqlField
|
||||
private String note;
|
||||
|
||||
@JsonProperty("is_archived")
|
||||
private boolean isArchived;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Article setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public Article setCode(String code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Article setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<ArticleRawMaterial> getRawMaterials() {
|
||||
return rawMaterials;
|
||||
}
|
||||
|
||||
public Article setRawMaterials(List<ArticleRawMaterial> rawMaterials) {
|
||||
this.rawMaterials = rawMaterials;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPackagingMaterialId() {
|
||||
return packagingMaterialId;
|
||||
}
|
||||
|
||||
public Article setPackagingMaterialId(String packagingMaterialId) {
|
||||
this.packagingMaterialId = packagingMaterialId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPackagingMaterialCode() {
|
||||
return packagingMaterialCode;
|
||||
}
|
||||
|
||||
public Article setPackagingMaterialCode(String packagingMaterialCode) {
|
||||
this.packagingMaterialCode = packagingMaterialCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPackagingMaterialName() {
|
||||
return packagingMaterialName;
|
||||
}
|
||||
|
||||
public Article setPackagingMaterialName(String packagingMaterialName) {
|
||||
this.packagingMaterialName = packagingMaterialName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public Article setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getIsArchived() {
|
||||
return isArchived;
|
||||
}
|
||||
|
||||
public Article setIsArchived(boolean isArchived) {
|
||||
this.isArchived = isArchived;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package it.integry.FoodProcess.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ArticleRawMaterial {
|
||||
private String id;
|
||||
|
||||
private String code;
|
||||
|
||||
private String name;
|
||||
|
||||
@JsonProperty("weight_kg")
|
||||
private Double weightKg;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public ArticleRawMaterial setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public ArticleRawMaterial setCode(String code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public ArticleRawMaterial setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Double getWeightKg() {
|
||||
return weightKg;
|
||||
}
|
||||
|
||||
public ArticleRawMaterial setWeightKg(Double weightKg) {
|
||||
this.weightKg = weightKg;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package it.integry.FoodProcess.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
|
||||
public class BusinessPartner {
|
||||
@SqlField
|
||||
private String id;
|
||||
|
||||
@SqlField
|
||||
private String code;
|
||||
|
||||
@SqlField
|
||||
private String name;
|
||||
|
||||
@SqlField
|
||||
@JsonProperty("is_customer")
|
||||
private boolean isCustomer;
|
||||
|
||||
@SqlField
|
||||
@JsonProperty("is_supplier")
|
||||
private boolean isSupplier;
|
||||
|
||||
@SqlField
|
||||
private String note;
|
||||
|
||||
@SqlField
|
||||
@JsonProperty("is_archived")
|
||||
private boolean isArchived;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public BusinessPartner setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public BusinessPartner setCode(String code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public BusinessPartner setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getIsCustomer() {
|
||||
return isCustomer;
|
||||
}
|
||||
|
||||
public BusinessPartner setIsCustomer(boolean isCustomer) {
|
||||
this.isCustomer = isCustomer;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getIsSupplier() {
|
||||
return isSupplier;
|
||||
}
|
||||
|
||||
public BusinessPartner setIsSupplier(boolean isSupplier) {
|
||||
this.isSupplier = isSupplier;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public BusinessPartner setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getIsArchived() {
|
||||
return isArchived;
|
||||
}
|
||||
|
||||
public BusinessPartner setIsArchived(boolean isArchived) {
|
||||
this.isArchived = isArchived;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package it.integry.FoodProcess.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ImportArticlesRequest {
|
||||
private List<Article> articles;
|
||||
|
||||
public List<Article> getArticles() {
|
||||
return articles;
|
||||
}
|
||||
|
||||
public ImportArticlesRequest setArticles(List<Article> articles) {
|
||||
this.articles = articles;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.FoodProcess.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ImportBusinessPartnersRequest {
|
||||
@JsonProperty("business_partners")
|
||||
private List<BusinessPartner> businessPartners;
|
||||
|
||||
public List<BusinessPartner> getBusinessPartners() {
|
||||
return businessPartners;
|
||||
}
|
||||
|
||||
public ImportBusinessPartnersRequest setBusinessPartners(List<BusinessPartner> businessPartners) {
|
||||
this.businessPartners = businessPartners;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package it.integry.FoodProcess.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ImportOrdersRequest {
|
||||
private List<RequestOrder> orders;
|
||||
|
||||
public List<RequestOrder> getOrders() {
|
||||
return orders;
|
||||
}
|
||||
|
||||
public ImportOrdersRequest setOrders(List<RequestOrder> orders) {
|
||||
this.orders = orders;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.FoodProcess.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ImportPackagingMaterialsRequest {
|
||||
@JsonProperty("packaging_materials")
|
||||
private List<PackagingMaterial> packagingMaterials;
|
||||
|
||||
public List<PackagingMaterial> getPackagingMaterials() {
|
||||
return packagingMaterials;
|
||||
}
|
||||
|
||||
public ImportPackagingMaterialsRequest setPackagingMaterials(List<PackagingMaterial> packagingMaterials) {
|
||||
this.packagingMaterials = packagingMaterials;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.FoodProcess.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ImportRawMaterialsRequest {
|
||||
@JsonProperty("raw_materials")
|
||||
private List<RawMaterial> rawMaterials;
|
||||
|
||||
public List<RawMaterial> getRawMaterials() {
|
||||
return rawMaterials;
|
||||
}
|
||||
|
||||
public ImportRawMaterialsRequest setRawMaterials(List<RawMaterial> rawMaterials) {
|
||||
this.rawMaterials = rawMaterials;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package it.integry.FoodProcess.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class PackagingMaterial {
|
||||
private String id;
|
||||
|
||||
private String code;
|
||||
|
||||
private String name;
|
||||
|
||||
private PackagingMaterialType type;
|
||||
|
||||
@JsonProperty("weight_kg")
|
||||
private Double weightKg;
|
||||
|
||||
@JsonProperty("length_mm")
|
||||
private Double lengthMm;
|
||||
|
||||
@JsonProperty("width_mm")
|
||||
private Double widthMm;
|
||||
|
||||
@JsonProperty("height_mm")
|
||||
private Double heightMm;
|
||||
|
||||
private String note;
|
||||
|
||||
@JsonProperty("is_archived")
|
||||
private boolean isArchived;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public PackagingMaterial setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public PackagingMaterial setCode(String code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public PackagingMaterial setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PackagingMaterialType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public PackagingMaterial setType(PackagingMaterialType type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Double getWeightKg() {
|
||||
return weightKg;
|
||||
}
|
||||
|
||||
public PackagingMaterial setWeightKg(Double weightKg) {
|
||||
this.weightKg = weightKg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Double getLengthMm() {
|
||||
return lengthMm;
|
||||
}
|
||||
|
||||
public PackagingMaterial setLengthMm(Double lengthMm) {
|
||||
this.lengthMm = lengthMm;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Double getWidthMm() {
|
||||
return widthMm;
|
||||
}
|
||||
|
||||
public PackagingMaterial setWidthMm(Double widthMm) {
|
||||
this.widthMm = widthMm;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Double getHeightMm() {
|
||||
return heightMm;
|
||||
}
|
||||
|
||||
public PackagingMaterial setHeightMm(Double heightMm) {
|
||||
this.heightMm = heightMm;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public PackagingMaterial setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getIsArchived() {
|
||||
return isArchived;
|
||||
}
|
||||
|
||||
public PackagingMaterial setIsArchived(boolean isArchived) {
|
||||
this.isArchived = isArchived;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package it.integry.FoodProcess.dto;
|
||||
|
||||
public enum PackagingMaterialType {
|
||||
PUNNET,
|
||||
TRAY,
|
||||
BAG,
|
||||
CARTON,
|
||||
CRATE,
|
||||
PALLET
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package it.integry.FoodProcess.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class RawMaterial {
|
||||
private String id;
|
||||
|
||||
private String code;
|
||||
|
||||
private String name;
|
||||
|
||||
private String note;
|
||||
|
||||
@JsonProperty("is_archived")
|
||||
private boolean isArchived;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public RawMaterial setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public RawMaterial setCode(String code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public RawMaterial setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public RawMaterial setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getIsArchived() {
|
||||
return isArchived;
|
||||
}
|
||||
|
||||
public RawMaterial setIsArchived(boolean isArchived) {
|
||||
this.isArchived = isArchived;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
package it.integry.FoodProcess.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class RequestOrder {
|
||||
private String id;
|
||||
|
||||
private String type;
|
||||
|
||||
@JsonProperty("article_id")
|
||||
private String articleId;
|
||||
|
||||
@JsonProperty("article_code")
|
||||
private String articleCode;
|
||||
|
||||
@JsonProperty("customer_id")
|
||||
private String customerId;
|
||||
|
||||
@JsonProperty("customer_code")
|
||||
private String customerCode;
|
||||
|
||||
@JsonProperty("secondary_packaging_material_id")
|
||||
private String secondaryPackagingMaterialId;
|
||||
|
||||
@JsonProperty("secondary_packaging_material_code")
|
||||
private String secondaryPackagingMaterialCode;
|
||||
|
||||
@JsonProperty("tertiary_packaging_material_id")
|
||||
private String tertiaryPackagingMaterialId;
|
||||
|
||||
@JsonProperty("tertiary_packaging_material_code")
|
||||
private String tertiaryPackagingMaterialCode;
|
||||
|
||||
@JsonProperty("units_per_secondary_packaging")
|
||||
private int unitsPerSecondaryPackaging;
|
||||
|
||||
@JsonProperty("units_per_pallet_layer")
|
||||
private int unitsPerPalletLayer;
|
||||
|
||||
@JsonProperty("pallet_layer_quantity")
|
||||
private int palletLayerQuantity;
|
||||
|
||||
@JsonProperty("target_quantity")
|
||||
private double targetQuantity;
|
||||
|
||||
@JsonProperty("target_quantity_unit")
|
||||
private TargetQuantityUnit targetQuantityUnit;
|
||||
|
||||
@JsonProperty("scheduled_for")
|
||||
private LocalDateTime scheduledFor;
|
||||
|
||||
@JsonProperty("to_be_completed_until")
|
||||
private LocalDateTime toBeCompletedUntil;
|
||||
|
||||
@JsonProperty("best_before_date")
|
||||
private LocalDate bestBeforeDate;
|
||||
|
||||
@JsonProperty("production_lot")
|
||||
private String productionLot;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public RequestOrder setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public RequestOrder setType(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getArticleId() {
|
||||
return articleId;
|
||||
}
|
||||
|
||||
public RequestOrder setArticleId(String articleId) {
|
||||
this.articleId = articleId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getArticleCode() {
|
||||
return articleCode;
|
||||
}
|
||||
|
||||
public RequestOrder setArticleCode(String articleCode) {
|
||||
this.articleCode = articleCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCustomerId() {
|
||||
return customerId;
|
||||
}
|
||||
|
||||
public RequestOrder setCustomerId(String customerId) {
|
||||
this.customerId = customerId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCustomerCode() {
|
||||
return customerCode;
|
||||
}
|
||||
|
||||
public RequestOrder setCustomerCode(String customerCode) {
|
||||
this.customerCode = customerCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSecondaryPackagingMaterialId() {
|
||||
return secondaryPackagingMaterialId;
|
||||
}
|
||||
|
||||
public RequestOrder setSecondaryPackagingMaterialId(String secondaryPackagingMaterialId) {
|
||||
this.secondaryPackagingMaterialId = secondaryPackagingMaterialId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSecondaryPackagingMaterialCode() {
|
||||
return secondaryPackagingMaterialCode;
|
||||
}
|
||||
|
||||
public RequestOrder setSecondaryPackagingMaterialCode(String secondaryPackagingMaterialCode) {
|
||||
this.secondaryPackagingMaterialCode = secondaryPackagingMaterialCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTertiaryPackagingMaterialId() {
|
||||
return tertiaryPackagingMaterialId;
|
||||
}
|
||||
|
||||
public RequestOrder setTertiaryPackagingMaterialId(String tertiaryPackagingMaterialId) {
|
||||
this.tertiaryPackagingMaterialId = tertiaryPackagingMaterialId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTertiaryPackagingMaterialCode() {
|
||||
return tertiaryPackagingMaterialCode;
|
||||
}
|
||||
|
||||
public RequestOrder setTertiaryPackagingMaterialCode(String tertiaryPackagingMaterialCode) {
|
||||
this.tertiaryPackagingMaterialCode = tertiaryPackagingMaterialCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getUnitsPerSecondaryPackaging() {
|
||||
return unitsPerSecondaryPackaging;
|
||||
}
|
||||
|
||||
public RequestOrder setUnitsPerSecondaryPackaging(int unitsPerSecondaryPackaging) {
|
||||
this.unitsPerSecondaryPackaging = unitsPerSecondaryPackaging;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getUnitsPerPalletLayer() {
|
||||
return unitsPerPalletLayer;
|
||||
}
|
||||
|
||||
public RequestOrder setUnitsPerPalletLayer(int unitsPerPalletLayer) {
|
||||
this.unitsPerPalletLayer = unitsPerPalletLayer;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getPalletLayerQuantity() {
|
||||
return palletLayerQuantity;
|
||||
}
|
||||
|
||||
public RequestOrder setPalletLayerQuantity(int palletLayerQuantity) {
|
||||
this.palletLayerQuantity = palletLayerQuantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public double getTargetQuantity() {
|
||||
return targetQuantity;
|
||||
}
|
||||
|
||||
public RequestOrder setTargetQuantity(double targetQuantity) {
|
||||
this.targetQuantity = targetQuantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TargetQuantityUnit getTargetQuantityUnit() {
|
||||
return targetQuantityUnit;
|
||||
}
|
||||
|
||||
public RequestOrder setTargetQuantityUnit(TargetQuantityUnit targetQuantityUnit) {
|
||||
this.targetQuantityUnit = targetQuantityUnit;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDateTime getScheduledFor() {
|
||||
return scheduledFor;
|
||||
}
|
||||
|
||||
public RequestOrder setScheduledFor(LocalDateTime scheduledFor) {
|
||||
this.scheduledFor = scheduledFor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDateTime getToBeCompletedUntil() {
|
||||
return toBeCompletedUntil;
|
||||
}
|
||||
|
||||
public RequestOrder setToBeCompletedUntil(LocalDateTime toBeCompletedUntil) {
|
||||
this.toBeCompletedUntil = toBeCompletedUntil;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDate getBestBeforeDate() {
|
||||
return bestBeforeDate;
|
||||
}
|
||||
|
||||
public RequestOrder setBestBeforeDate(LocalDate bestBeforeDate) {
|
||||
this.bestBeforeDate = bestBeforeDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProductionLot() {
|
||||
return productionLot;
|
||||
}
|
||||
|
||||
public RequestOrder setProductionLot(String productionLot) {
|
||||
this.productionLot = productionLot;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package it.integry.FoodProcess.dto;
|
||||
|
||||
public enum TargetQuantityUnit {
|
||||
PIECE,
|
||||
SECONDARY_PACKAGING,
|
||||
TERTIARY_PACKAGING,
|
||||
KILOGRAM
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ErrorResponse {
|
||||
@JsonProperty("error_message")
|
||||
private String errorMessage;
|
||||
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
public ErrorResponse setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ImportArticleStatus extends ResponseStatus {
|
||||
@JsonProperty("article_id")
|
||||
private String articleId;
|
||||
|
||||
public String getArticleId() {
|
||||
return articleId;
|
||||
}
|
||||
|
||||
public ImportArticleStatus setArticleId(String articleId) {
|
||||
this.articleId = articleId;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ImportArticlesResponse {
|
||||
private List<ImportArticleStatus> statuses;
|
||||
|
||||
public List<ImportArticleStatus> getStatuses() {
|
||||
return statuses;
|
||||
}
|
||||
|
||||
public ImportArticlesResponse setStatuses(List<ImportArticleStatus> statuses) {
|
||||
this.statuses = statuses;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ImportBusinessPartnerStatus extends ResponseStatus {
|
||||
@JsonProperty("business_partner_id")
|
||||
private String businessPartnerId;
|
||||
|
||||
public String getBusinessPartnerId() {
|
||||
return businessPartnerId;
|
||||
}
|
||||
|
||||
public ImportBusinessPartnerStatus setBusinessPartnerId(String businessPartnerId) {
|
||||
this.businessPartnerId = businessPartnerId;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ImportBusinessPartnersResponse {
|
||||
private List<ImportBusinessPartnerStatus> statuses;
|
||||
|
||||
public List<ImportBusinessPartnerStatus> getStatuses() {
|
||||
return statuses;
|
||||
}
|
||||
|
||||
public ImportBusinessPartnersResponse setStatuses(List<ImportBusinessPartnerStatus> statuses) {
|
||||
this.statuses = statuses;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ImportOrderStatus extends ResponseStatus {
|
||||
@JsonProperty("order_id")
|
||||
private String orderId;
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public ImportOrderStatus setOrderId(String orderId) {
|
||||
this.orderId = orderId;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ImportOrdersResponse {
|
||||
private List<ImportOrderStatus> statuses;
|
||||
|
||||
public List<ImportOrderStatus> getStatuses() {
|
||||
return statuses;
|
||||
}
|
||||
|
||||
public ImportOrdersResponse setStatuses(List<ImportOrderStatus> statuses) {
|
||||
this.statuses = statuses;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ImportPackagingMaterialStatus extends ResponseStatus {
|
||||
@JsonProperty("packaging_material_id")
|
||||
private String packagingMaterialId;
|
||||
|
||||
public String getPackagingMaterialId() {
|
||||
return packagingMaterialId;
|
||||
}
|
||||
|
||||
public ImportPackagingMaterialStatus setPackagingMaterialId(String packagingMaterialId) {
|
||||
this.packagingMaterialId = packagingMaterialId;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ImportPackagingMaterialsResponse {
|
||||
private List<ImportPackagingMaterialStatus> statuses;
|
||||
|
||||
public List<ImportPackagingMaterialStatus> getStatuses() {
|
||||
return statuses;
|
||||
}
|
||||
|
||||
public ImportPackagingMaterialsResponse setStatuses(List<ImportPackagingMaterialStatus> statuses) {
|
||||
this.statuses = statuses;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ImportRawMaterialStatus extends ResponseStatus {
|
||||
@JsonProperty("raw_material_id")
|
||||
private String rawMaterialId;
|
||||
|
||||
public String getRawMaterialId() {
|
||||
return rawMaterialId;
|
||||
}
|
||||
|
||||
public ImportRawMaterialStatus setRawMaterialId(String rawMaterialId) {
|
||||
this.rawMaterialId = rawMaterialId;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ImportRawMaterialsResponse {
|
||||
private List<ImportRawMaterialStatus> statuses;
|
||||
|
||||
public List<ImportRawMaterialStatus> getStatuses() {
|
||||
return statuses;
|
||||
}
|
||||
|
||||
public ImportRawMaterialsResponse setStatuses(List<ImportRawMaterialStatus> statuses) {
|
||||
this.statuses = statuses;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
public enum OrderStatus {
|
||||
NEW,
|
||||
ASSIGNED,
|
||||
ACTIVE,
|
||||
CLOSED,
|
||||
CANCELED
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class OrderStatusResponse {
|
||||
@JsonProperty("order_id")
|
||||
private String orderId;
|
||||
|
||||
@JsonProperty("order_status")
|
||||
private OrderStatus orderStatus;
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public OrderStatusResponse setOrderId(String orderId) {
|
||||
this.orderId = orderId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public OrderStatus getOrderStatus() {
|
||||
return orderStatus;
|
||||
}
|
||||
|
||||
public OrderStatusResponse setOrderStatus(OrderStatus orderStatus) {
|
||||
this.orderStatus = orderStatus;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package it.integry.FoodProcess.dto.response;
|
||||
|
||||
public class ResponseStatus {
|
||||
private boolean success;
|
||||
private String message;
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public ResponseStatus setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public ResponseStatus setMessage(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package it.integry.FoodProcess.service;
|
||||
|
||||
import it.integry.FoodProcess.api.AddApiKeyHeaderRequestFilter;
|
||||
import it.integry.FoodProcess.api.ErrorMessageResponseFilter;
|
||||
import it.integry.FoodProcess.api.FoodProcessClient;
|
||||
import it.integry.FoodProcess.api.JacksonProvider;
|
||||
import it.integry.FoodProcess.dto.Article;
|
||||
import it.integry.FoodProcess.dto.ImportArticlesRequest;
|
||||
import it.integry.FoodProcess.dto.response.ImportArticlesResponse;
|
||||
import it.integry.ems.service.EntityProcessor;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityEntity;
|
||||
import it.integry.ems_model.entity.MtbAart;
|
||||
import it.integry.ems_model.entity.MtbAartAnag;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.Query;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityList;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import org.jboss.resteasy.client.jaxrs.ResteasyClient;
|
||||
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
|
||||
import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Service
|
||||
@Scope("request")
|
||||
public class FoodProcessRestService {
|
||||
private final Pattern ID_REGEX = Pattern.compile("^[0-9A-Fa-f]{1,}$");
|
||||
|
||||
private final SetupGest setupGest;
|
||||
private final MultiDBTransactionManager multiDBTransactionManager;
|
||||
private final EntityProcessor entityProcessor;
|
||||
|
||||
public FoodProcessRestService(SetupGest setupGest, MultiDBTransactionManager multiDBTransactionManager, EntityProcessor entityProcessor) {
|
||||
this.setupGest = setupGest;
|
||||
this.multiDBTransactionManager = multiDBTransactionManager;
|
||||
this.entityProcessor = entityProcessor;
|
||||
}
|
||||
|
||||
public FoodProcessClient makeInstance() throws Exception {
|
||||
String endpoint = setupGest.getSetup("FOODPROCESS", "SETUP", "ENDPOINT");
|
||||
|
||||
if (UtilityString.isNullOrEmpty(endpoint)) {
|
||||
throw new Exception("Endpoint per il servizio di FoodProcess non configurato.\nImpostarlo in FOODPROCESS->SETUP->ENDPOINT.");
|
||||
}
|
||||
|
||||
String apiKey = setupGest.getSetup("FOODPROCESS", "SETUP", "API_KEY");
|
||||
|
||||
if (UtilityString.isNullOrEmpty(apiKey)) {
|
||||
throw new Exception("Api key per il servizio di FoodProcess non configurato.\nImpostarlo in FOODPROCESS->SETUP->API_KEY.");
|
||||
}
|
||||
|
||||
ResteasyClient client = new ResteasyClientBuilder().build();
|
||||
|
||||
client.register(new JacksonProvider());
|
||||
client.register(new ErrorMessageResponseFilter());
|
||||
client.register(new AddApiKeyHeaderRequestFilter(apiKey));
|
||||
|
||||
ResteasyWebTarget target = client.target(endpoint);
|
||||
|
||||
return target.proxy(FoodProcessClient.class);
|
||||
}
|
||||
|
||||
public ImportArticlesResponse importArticles(ImportArticlesRequest importArticlesRequest) throws Exception {
|
||||
if (UtilityList.isNullOrEmpty(importArticlesRequest.getArticles())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String codAnagTopControl = setupGest.getSetup("FOODPROCESS", "SETUP", "TOPCONTROL_CODANAG");
|
||||
|
||||
if (UtilityString.isNullOrEmpty(codAnagTopControl)) {
|
||||
throw new Exception("Cod. anag. di Top Control non configurato.\nImpostarlo in FOODPROCESS->SETUP->TOPCONTROL_CODANAG.");
|
||||
}
|
||||
|
||||
FoodProcessClient client = makeInstance();
|
||||
|
||||
List<Article> foodProcessArticles = client.getArticles();
|
||||
|
||||
List<MtbAart> entityList = new ArrayList<>();
|
||||
|
||||
for (Article article : importArticlesRequest.getArticles()) {
|
||||
if (UtilityString.isNullOrEmpty(article.getId()) || !ID_REGEX.matcher(article.getId()).matches()) {
|
||||
String sql;
|
||||
MtbAartAnag mtbAartAnag = null;
|
||||
|
||||
// Cerco negli articoli loro
|
||||
Optional<Article> optionalFoodProcessArticle = foodProcessArticles.stream()
|
||||
.filter(x -> !x.getIsArchived())
|
||||
.filter(x -> x.getCode().equalsIgnoreCase(article.getCode()))
|
||||
.findFirst();
|
||||
|
||||
if (optionalFoodProcessArticle.isPresent()) {
|
||||
Article foodProcessArticle = optionalFoodProcessArticle.get();
|
||||
|
||||
mtbAartAnag = new MtbAartAnag()
|
||||
.setCodAnag(codAnagTopControl)
|
||||
.setCodMartAnag(foodProcessArticle.getId())
|
||||
.setCodMart(article.getId());
|
||||
|
||||
mtbAartAnag.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
}
|
||||
|
||||
// Cerco id in nostra anagrafica
|
||||
if (mtbAartAnag == null && !UtilityString.isNullOrEmpty(article.getId())) {
|
||||
sql = Query.format(
|
||||
"SELECT id, cod_mart_anag\n" +
|
||||
"FROM mtb_aart_anag\n" +
|
||||
"WHERE cod_anag = %s\n" +
|
||||
" AND cod_mart = %s",
|
||||
codAnagTopControl,
|
||||
article.getId()
|
||||
);
|
||||
|
||||
mtbAartAnag = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, MtbAartAnag.class);
|
||||
}
|
||||
|
||||
// Articolo nuovo, creo un nuovo id
|
||||
if (mtbAartAnag == null) {
|
||||
sql = Query.format(
|
||||
"SELECT CAST(ISNULL(MAX(CAST(cod_mart_anag AS INT)), 0) + 1 AS VARCHAR) AS cod_mart_anag\n" +
|
||||
"FROM mtb_aart_anag\n" +
|
||||
"WHERE cod_anag = %s",
|
||||
codAnagTopControl
|
||||
);
|
||||
|
||||
String codMartAnag = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||
|
||||
mtbAartAnag = new MtbAartAnag()
|
||||
.setCodAnag(codAnagTopControl)
|
||||
.setCodMartAnag(codMartAnag);
|
||||
|
||||
mtbAartAnag.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
}
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(mtbAartAnag)) {
|
||||
if (!mtbAartAnag.getOperation().equals(OperationType.SELECT_OBJECT)) {
|
||||
MtbAart mtbAart = entityList.stream()
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(article.getId()))
|
||||
.findFirst()
|
||||
.orElseGet(() -> {
|
||||
MtbAart newMtbAart = new MtbAart()
|
||||
.setCodMart(article.getId())
|
||||
.setMtbAartAnag(new ArrayList<>());
|
||||
|
||||
newMtbAart.setOperation(OperationType.NO_OP);
|
||||
|
||||
entityList.add(newMtbAart);
|
||||
|
||||
return newMtbAart;
|
||||
});
|
||||
|
||||
mtbAart.getMtbAartAnag().add(mtbAartAnag);
|
||||
}
|
||||
|
||||
article.setId(mtbAartAnag.getCodMartAnag());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!UtilityList.isNullOrEmpty(entityList)) {
|
||||
entityProcessor.processEntityList(entityList, false);
|
||||
|
||||
UtilityEntity.throwEntitiesException(entityList);
|
||||
}
|
||||
|
||||
return client.importArticles(importArticlesRequest);
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import it.integry.WooCommerce.dto.order.WooCommerceOrderDTO;
|
||||
import it.integry.WooCommerce.service.WooCommerceService;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.json.JSONObjectMapper;
|
||||
import it.integry.ems.json.ResponseJSONObjectMapper;
|
||||
import it.integry.ems.response.ServiceRestResponse;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -26,7 +26,7 @@ public class WooCommerceController {
|
||||
@Autowired
|
||||
private WooCommerceService wooService;
|
||||
@Autowired
|
||||
private JSONObjectMapper jsonObjectMapper;
|
||||
private ResponseJSONObjectMapper jsonObjectMapper;
|
||||
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_WOO_NEW_ORDER, method = RequestMethod.POST)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package it.integry.WooCommerce.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
import org.codehaus.jackson.annotate.JsonProperty;
|
||||
|
||||
public class AttributeDTO {
|
||||
@SqlField("attributo")
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package it.integry.WooCommerce.dto.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import it.integry.WooCommerce.enums.OrderStatus;
|
||||
import org.codehaus.jackson.JsonNode;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -768,7 +768,8 @@ public class WooCommerceService {
|
||||
|
||||
private void sendErrorMail(String errorMsg, String service, byte[] content, String filename, List<AnomalieDTO> anomalie) {
|
||||
try {
|
||||
mailService.sendErrorMail(multiDBTransactionManager, service, "WOOCOMMERCE", null, content, filename, anomalie);
|
||||
mailService.sendErrorMailByGestNameSection(multiDBTransactionManager, service, "WOOCOMMERCE", "Errore WooCommerce",
|
||||
null, content, filename, anomalie);
|
||||
} catch (Exception exception) {
|
||||
logger.error(service, exception);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package it.integry.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target(FIELD)
|
||||
@Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.ANNOTATION_TYPE})
|
||||
public @interface PostContextAutowired {
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ public enum EntityImportType {
|
||||
ORDINI("ORDINI"),
|
||||
ORDINI_WEB("ORDINI WEB"),
|
||||
ORDINI_ACQUISTO("ORDINI ACQUISTO"),
|
||||
ORDINI_VENDITA("ORDINI VENDITA"),
|
||||
DOCUMENTI("DOCUMENTI"),
|
||||
DOCUMENTI_ACQUISTO("DOCUMENTI ACQUISTO"),
|
||||
DOCUMENTI_LAVORAZIONE("DOCUMENTI LAVORAZIONE"),
|
||||
@@ -22,7 +23,9 @@ public enum EntityImportType {
|
||||
RAPPORTINI_FG("RAPPORTINI FG"),
|
||||
SCONTRINI("SCONTRINI"),
|
||||
MOVIMENTI_CONTABILI("MOVIMENTI CONTABILI"),
|
||||
GRIGLIA_ACQUISTO("GRIGLIA ACQUISTO");
|
||||
GRIGLIA_VENDITA("GRIGLIA VENDITA"),
|
||||
GRIGLIA_ACQUISTO("GRIGLIA ACQUISTO"),
|
||||
SCADENZE("SCADENZE");
|
||||
|
||||
private String text;
|
||||
|
||||
|
||||
@@ -5,17 +5,9 @@ import com.microsoft.sqlserver.jdbc.SQLServerDriver;
|
||||
import it.integry.annotations.PostContextAutowired;
|
||||
import it.integry.annotations.PostContextConstruct;
|
||||
import it.integry.annotations.PostWebServerConstruct;
|
||||
import it.integry.ems.properties.EmsProperties;
|
||||
import it.integry.ems.schedule.new_cron_job.dto.AutomatedOperationTypeEnum;
|
||||
import it.integry.ems.schedule.new_cron_job.dto.operations.ServiceCallAutomatedOperationDTO;
|
||||
import it.integry.ems.schedule.new_cron_job.dto.operations.base_classes.BaseAutomatedOperationDTO;
|
||||
import it.integry.ems.schedule.new_cron_job.service.AutomatedOperationHandlerComponent;
|
||||
import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import it.integry.ems.settings.SettingsController;
|
||||
import it.integry.ems.sync.MultiDBTransaction.AdvancedDataSource;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityDebug;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.postgresql.Driver;
|
||||
@@ -33,10 +25,12 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.sql.DriverManager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.reflections.scanners.Scanners.TypesAnnotated;
|
||||
|
||||
@Component
|
||||
public class EmsCoreContext implements ApplicationListener<ContextRefreshedEvent> {
|
||||
@@ -53,9 +47,6 @@ public class EmsCoreContext implements ApplicationListener<ContextRefreshedEvent
|
||||
@Autowired
|
||||
private SettingsModel settingsModel;
|
||||
|
||||
@Autowired
|
||||
private EmsProperties emsProperties;
|
||||
|
||||
private boolean contextInitialized = false;
|
||||
|
||||
private boolean firstStart = true;
|
||||
@@ -116,13 +107,11 @@ public class EmsCoreContext implements ApplicationListener<ContextRefreshedEvent
|
||||
|
||||
private void dispatchPostContextConstruct(MultiDBTransactionManager multiDBTransactionManager) throws InvocationTargetException, IllegalAccessException {
|
||||
Reflections reflections = new Reflections("it.integry");
|
||||
final Set<Class<?>> typesAnnotatedWith = reflections.getTypesAnnotatedWith(Component.class);
|
||||
|
||||
typesAnnotatedWith.addAll(reflections.getTypesAnnotatedWith(Service.class));
|
||||
final Set<Class<?>> typesAnnotatedWith = reflections.get(TypesAnnotated.with(Component.class, Service.class).asClass());
|
||||
|
||||
List<Class<?>> classesWithPostContextConstruct = Stream.of(typesAnnotatedWith)
|
||||
.filter(x -> Stream.of(x.getDeclaredMethods()).anyMatch(y -> y.isAnnotationPresent(PostContextConstruct.class)))
|
||||
.sortBy(x -> Stream.of(x.getDeclaredMethods())
|
||||
.filter(x -> Arrays.stream(x.getDeclaredMethods()).anyMatch(y -> y.isAnnotationPresent(PostContextConstruct.class)))
|
||||
.sortBy(x -> Arrays.stream(x.getDeclaredMethods())
|
||||
.filter(y -> y.isAnnotationPresent(PostContextConstruct.class))
|
||||
.findFirst()
|
||||
.get()
|
||||
@@ -134,9 +123,9 @@ public class EmsCoreContext implements ApplicationListener<ContextRefreshedEvent
|
||||
logger.debug("PostContextConstruct - " + classType.getSimpleName() + " - START");
|
||||
Object beanInstance = ContextLoader.getCurrentWebApplicationContext().getBean(classType);
|
||||
|
||||
List<Field> fieldsToInject = Stream.of(classType.getDeclaredFields())
|
||||
List<Field> fieldsToInject = Arrays.stream(classType.getDeclaredFields())
|
||||
.filter(y -> y.isAnnotationPresent(PostContextAutowired.class))
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (Field fieldToInject : fieldsToInject) {
|
||||
fieldToInject.setAccessible(true);
|
||||
@@ -146,7 +135,7 @@ public class EmsCoreContext implements ApplicationListener<ContextRefreshedEvent
|
||||
}
|
||||
}
|
||||
|
||||
Method constructor = Stream.of(classType.getDeclaredMethods())
|
||||
Method constructor = Arrays.stream(classType.getDeclaredMethods())
|
||||
.filter(y -> y.isAnnotationPresent(PostContextConstruct.class))
|
||||
.findFirst()
|
||||
.get();
|
||||
@@ -159,13 +148,11 @@ public class EmsCoreContext implements ApplicationListener<ContextRefreshedEvent
|
||||
|
||||
private void dispatchPostWebServerConstruct(MultiDBTransactionManager multiDBTransactionManager) throws InvocationTargetException, IllegalAccessException {
|
||||
Reflections reflections = new Reflections("it.integry");
|
||||
final Set<Class<?>> typesAnnotatedWith = reflections.getTypesAnnotatedWith(Component.class);
|
||||
|
||||
typesAnnotatedWith.addAll(reflections.getTypesAnnotatedWith(Service.class));
|
||||
final Set<Class<?>> typesAnnotatedWith = reflections.get(TypesAnnotated.with(Component.class, Service.class).asClass());
|
||||
|
||||
List<Class<?>> classesWithPostWebServerConstruct = Stream.of(typesAnnotatedWith)
|
||||
.filter(x -> Stream.of(x.getDeclaredMethods()).anyMatch(y -> y.isAnnotationPresent(PostWebServerConstruct.class)))
|
||||
.sortBy(x -> Stream.of(x.getDeclaredMethods())
|
||||
.filter(x -> Arrays.stream(x.getDeclaredMethods()).anyMatch(y -> y.isAnnotationPresent(PostWebServerConstruct.class)))
|
||||
.sortBy(x -> Arrays.stream(x.getDeclaredMethods())
|
||||
.filter(y -> y.isAnnotationPresent(PostWebServerConstruct.class))
|
||||
.findFirst()
|
||||
.get()
|
||||
@@ -177,9 +164,9 @@ public class EmsCoreContext implements ApplicationListener<ContextRefreshedEvent
|
||||
logger.debug("PostWebServerConstruct - " + classType.getSimpleName() + " - START");
|
||||
Object beanInstance = ContextLoader.getCurrentWebApplicationContext().getBean(classType);
|
||||
|
||||
List<Field> fieldsToInject = Stream.of(classType.getDeclaredFields())
|
||||
List<Field> fieldsToInject = Arrays.stream(classType.getDeclaredFields())
|
||||
.filter(y -> y.isAnnotationPresent(PostContextAutowired.class))
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (Field fieldToInject : fieldsToInject) {
|
||||
fieldToInject.setAccessible(true);
|
||||
@@ -189,7 +176,7 @@ public class EmsCoreContext implements ApplicationListener<ContextRefreshedEvent
|
||||
}
|
||||
}
|
||||
|
||||
Method constructor = Stream.of(classType.getDeclaredMethods())
|
||||
Method constructor = Arrays.stream(classType.getDeclaredMethods())
|
||||
.filter(y -> y.isAnnotationPresent(PostWebServerConstruct.class))
|
||||
.findFirst()
|
||||
.get();
|
||||
|
||||
@@ -3,18 +3,16 @@ package it.integry.ems._context;
|
||||
import it.integry.annotations.PostContextConstruct;
|
||||
import it.integry.common.var.EmsDBConst;
|
||||
import it.integry.ems.datasource.DataSource;
|
||||
import it.integry.ems.dynamic_cache.DynamicCacheService;
|
||||
import it.integry.ems.expansion.RunnableArgs;
|
||||
import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import it.integry.ems.settings.SettingsController;
|
||||
import it.integry.ems.sync.MultiDBTransaction.AdvancedDataSource;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.user.UserCacheService;
|
||||
import it.integry.ems.user.service.UserCacheService;
|
||||
import it.integry.ems_model.entity.Azienda;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityHashMap;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -22,9 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class EmsCoreDBLoader {
|
||||
|
||||
@@ -1,20 +1,27 @@
|
||||
package it.integry.ems.adapter;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
|
||||
public class JsonDateAdapterDeserializer extends JsonDeserializer<Date> {
|
||||
public class JsonDateAdapterDeserializer extends StdDeserializer<Date> {
|
||||
|
||||
public JsonDateAdapterDeserializer() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
protected JsonDateAdapterDeserializer(Class<?> vc) {
|
||||
super(vc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date deserialize(JsonParser jp, DeserializationContext arg1)
|
||||
throws IOException, JsonProcessingException {
|
||||
throws IOException {
|
||||
|
||||
if (UtilityString.isNullOrEmpty(jp.getText()))
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package it.integry.ems.configuration;
|
||||
|
||||
import it.integry.ems.json.ResponseJSONObjectMapper;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
public class JsonConfig implements WebMvcConfigurer {
|
||||
|
||||
@Bean
|
||||
public ResponseJSONObjectMapper jacksonResponseObjectMapper() {
|
||||
final ResponseJSONObjectMapper objectMapper = new ResponseJSONObjectMapper();
|
||||
|
||||
return objectMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
|
||||
configurer.defaultContentType(MediaType.APPLICATION_JSON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
final MappingJackson2HttpMessageConverter httpMessageConverter = converters.stream()
|
||||
.filter(x -> x instanceof MappingJackson2HttpMessageConverter)
|
||||
.map(x -> (MappingJackson2HttpMessageConverter) x)
|
||||
.findFirst()
|
||||
.get();
|
||||
|
||||
httpMessageConverter.setDefaultCharset(StandardCharsets.UTF_8);
|
||||
httpMessageConverter.setObjectMapper(jacksonResponseObjectMapper());
|
||||
|
||||
int oldIndex = converters.indexOf(httpMessageConverter);
|
||||
converters.remove(oldIndex);
|
||||
|
||||
converters.add(0, httpMessageConverter);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package it.integry.ems.configuration;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.oas.annotations.EnableOpenApi;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
|
||||
@Configuration
|
||||
//@EnableSwagger2
|
||||
@EnableWebMvc
|
||||
@EnableOpenApi
|
||||
public class SwaggerConfig implements WebMvcConfigurer {
|
||||
|
||||
@Bean
|
||||
public Docket api() {
|
||||
return new Docket(DocumentationType.OAS_30)
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.any())
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/swagger-ui/**")
|
||||
.addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/")
|
||||
.resourceChain(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addViewControllers(ViewControllerRegistry registry) {
|
||||
registry.addViewController("/swagger-ui/")
|
||||
.setViewName("forward:" + "swagger-ui/index.html");
|
||||
}
|
||||
}
|
||||
@@ -7,13 +7,13 @@ import it.integry.ems.Import.base.EntityImportResponse;
|
||||
import it.integry.ems.Import.dto.ImportRequestDTO;
|
||||
import it.integry.ems.download.DownloadFileHandlerService;
|
||||
import it.integry.ems.download.dto.DownloadFileDto;
|
||||
import it.integry.ems.dto.EntityHierarchyDTO;
|
||||
import it.integry.ems.dto.CreateZipDTO;
|
||||
import it.integry.ems.dto.EntityHierarchy;
|
||||
import it.integry.ems.export.base.EntityExportResponse;
|
||||
import it.integry.ems.export.base.EntityExportedFile;
|
||||
import it.integry.ems.javabeans.RequestDataDTO;
|
||||
import it.integry.ems.media.MediaImageService;
|
||||
import it.integry.ems.media.MimeTypesHandler;
|
||||
import it.integry.ems.metrics.service.MetricService;
|
||||
import it.integry.ems.model.EntityModel;
|
||||
import it.integry.ems.model.FieldModel;
|
||||
import it.integry.ems.model.PKFieldModel;
|
||||
@@ -49,6 +49,8 @@ import org.quartz.*;
|
||||
import org.quartz.impl.matchers.GroupMatcher;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.mail.javamail.ConfigurableMimeFileTypeMap;
|
||||
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -96,9 +98,6 @@ public class EmsController {
|
||||
@Autowired
|
||||
private ServiceChecker serviceChecker;
|
||||
|
||||
@Autowired
|
||||
private MetricService metricService;
|
||||
|
||||
@Autowired
|
||||
private SchedulerFactoryBean quartzScheduler;
|
||||
|
||||
@@ -183,17 +182,6 @@ public class EmsController {
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/metric/count", method = RequestMethod.GET)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse metricCount(HttpServletRequest request) {
|
||||
try {
|
||||
return ServiceRestResponse.createPositiveResponse(metricService.getJsonCountMetric());
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
return ServiceRestResponse.createNegativeResponse(e);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/decodeUcs", method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
String decodeUcs(@RequestBody String encodedUcs) {
|
||||
@@ -557,8 +545,7 @@ public class EmsController {
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_EXPORT, method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse export(
|
||||
public @ResponseBody ServiceRestResponse export(
|
||||
HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@RequestParam(value = EmsRestConstants.TYPE) String typeExport,
|
||||
@@ -566,44 +553,39 @@ public class EmsController {
|
||||
@RequestParam(required = false, defaultValue = "false") Boolean binaryDownload,
|
||||
@RequestParam(required = false, defaultValue = "true") boolean headless,
|
||||
@RequestBody(required = false) JsonNode body) throws Exception {
|
||||
ServiceRestResponse sr = null;
|
||||
|
||||
try {
|
||||
EntityExportResponse<?> entityExportResponse = emsServices.export(typeExport, formatExport, body, headless);
|
||||
EntityExportResponse<?> entityExportResponse = emsServices.export(typeExport, formatExport, body, headless);
|
||||
|
||||
sr = new ServiceRestResponse(EsitoType.OK);
|
||||
if (entityExportResponse != null) {
|
||||
ServiceRestResponse sr = ServiceRestResponse.createPositiveResponse();
|
||||
if (entityExportResponse != null) {
|
||||
|
||||
if (binaryDownload) {
|
||||
List<DownloadFileDto> downloadableFileList = new ArrayList<>();
|
||||
for (EntityExportedFile exportedFile : (List<EntityExportedFile>) entityExportResponse.getResponse()) {
|
||||
downloadableFileList.add(downloadFileHandlerService.generateDownloadItem(exportedFile.getFile()));
|
||||
}
|
||||
sr.setJsonObject(downloadableFileList);
|
||||
|
||||
|
||||
} else if (entityExportResponse.isResponseToB64()) {
|
||||
List<File> listaFile = new ArrayList<>();
|
||||
|
||||
for (EntityExportedFile exportedFile : (List<EntityExportedFile>) entityExportResponse.getResponse()) {
|
||||
listaFile.add(exportedFile.getFile());
|
||||
}
|
||||
|
||||
sr.setJsonObject(EncodedB64File.fromFileList(listaFile));
|
||||
|
||||
} else {
|
||||
sr.setJsonObject(entityExportResponse.getResponse());
|
||||
if (binaryDownload) {
|
||||
List<DownloadFileDto> downloadableFileList = new ArrayList<>();
|
||||
for (EntityExportedFile exportedFile : (List<EntityExportedFile>) entityExportResponse.getResponse()) {
|
||||
downloadableFileList.add(downloadFileHandlerService.generateDownloadItem(exportedFile.getFile()));
|
||||
}
|
||||
if (!UtilityString.isNullOrEmpty(entityExportResponse.getMessageContent())) {
|
||||
sr.initMessageList();
|
||||
sr.getMessages().add(new MessageDTO()
|
||||
.setLevel(MessageDTO.Level.INFO)
|
||||
.setText(entityExportResponse.getMessageContent()));
|
||||
sr.setJsonObject(downloadableFileList);
|
||||
|
||||
|
||||
} else if (entityExportResponse.isResponseToB64()) {
|
||||
List<File> listaFile = new ArrayList<>();
|
||||
|
||||
for (EntityExportedFile exportedFile : (List<EntityExportedFile>) entityExportResponse.getResponse()) {
|
||||
listaFile.add(exportedFile.getFile());
|
||||
}
|
||||
|
||||
sr.setJsonObject(EncodedB64File.fromFileList(listaFile));
|
||||
|
||||
} else {
|
||||
sr.setJsonObject(entityExportResponse.getResponse());
|
||||
}
|
||||
if (!UtilityString.isNullOrEmpty(entityExportResponse.getMessageContent())) {
|
||||
sr.initMessageList();
|
||||
sr.getMessages()
|
||||
.add(new MessageDTO()
|
||||
.setLevel(MessageDTO.Level.INFO)
|
||||
.setText(entityExportResponse.getMessageContent()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
sr = new ServiceRestResponse(EsitoType.KO, multiDBTransactionManager.getPrimaryDatasource().getProfile(), e);
|
||||
}
|
||||
|
||||
return sr;
|
||||
@@ -616,70 +598,64 @@ public class EmsController {
|
||||
@RequestParam(value = EmsRestConstants.TYPE) String importType,
|
||||
@RequestParam(value = EmsRestConstants.FORMAT) String importFormat,
|
||||
@RequestParam(required = false, defaultValue = "true") boolean headless,
|
||||
@RequestBody(required = false) ImportRequestDTO requestBody) {
|
||||
@RequestBody(required = false) ImportRequestDTO requestBody) throws Exception {
|
||||
|
||||
EntityImportResponse<List<EntityBase>> importResponse = emsServices.importEntity(importType, importFormat, requestBody, headless);
|
||||
List<EntityBase> entities = importResponse.getResponse();
|
||||
|
||||
|
||||
ServiceRestResponse response;
|
||||
if (entities != null && entities.size() > 0 && Stream.of(entities).anyMatch(x -> x instanceof EntityBase)) {
|
||||
List<MessageDTO> errorMessages = Stream.of(entities)
|
||||
.filter(x -> x.getException() != null)
|
||||
.map(x -> MessageDTO.error(x.getException().getMessage()))
|
||||
.toList();
|
||||
|
||||
try {
|
||||
EntityImportResponse<List<EntityBase>> importResponse = emsServices.importEntity(importType, importFormat, requestBody, headless);
|
||||
List<EntityBase> entities = importResponse.getResponse();
|
||||
List<MessageDTO> messages = Stream.of(importResponse.getAnomalie())
|
||||
.filter(x -> x.getTipo() != null)
|
||||
.map(x -> {
|
||||
switch (x.getTipo()) {
|
||||
case ERROR:
|
||||
return MessageDTO.error(x.getMessage());
|
||||
case WARNING:
|
||||
default:
|
||||
return MessageDTO.warning(x.getMessage());
|
||||
}
|
||||
})
|
||||
.toList();
|
||||
|
||||
errorMessages.addAll(messages);
|
||||
|
||||
if (entities != null && entities.size() > 0 && Stream.of(entities).anyMatch(x -> x instanceof EntityBase)) {
|
||||
List<MessageDTO> errorMessages = Stream.of(entities)
|
||||
.filter(x -> x.getException() != null)
|
||||
.map(x -> MessageDTO.error(x.getException().getMessage()))
|
||||
.toList();
|
||||
|
||||
List<MessageDTO> messages = Stream.of(importResponse.getAnomalie())
|
||||
.filter(x -> x.getTipo() != null)
|
||||
.map(x -> {
|
||||
switch (x.getTipo()) {
|
||||
case ERROR:
|
||||
return MessageDTO.error(x.getMessage());
|
||||
case WARNING:
|
||||
default:
|
||||
return MessageDTO.warning(x.getMessage());
|
||||
}
|
||||
})
|
||||
.toList();
|
||||
|
||||
errorMessages.addAll(messages);
|
||||
|
||||
if (errorMessages.size() > 0) {
|
||||
response = ServiceRestResponse.createNegativeResponse();
|
||||
} else {
|
||||
response = ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
response.setMessages(errorMessages);
|
||||
response.setEntityList(Stream.of(entities).filter(x -> x.getException() == null).toList());
|
||||
|
||||
if (errorMessages.size() > 0) {
|
||||
response = ServiceRestResponse.createNegativeResponse();
|
||||
} else {
|
||||
if (importResponse.getAnomalie() != null) {
|
||||
|
||||
if (!importResponse.getAnomalie().isEmpty()) {
|
||||
|
||||
List<MessageDTO> messages = Stream.of(importResponse.getAnomalie())
|
||||
.map(x -> {
|
||||
switch (x.getTipo()) {
|
||||
case ERROR:
|
||||
return MessageDTO.error(x.getMessage());
|
||||
case WARNING:
|
||||
default:
|
||||
return MessageDTO.warning(x.getMessage());
|
||||
}
|
||||
})
|
||||
.toList();
|
||||
|
||||
response = ServiceRestResponse.createNegativeResponse();
|
||||
response.setMessages(messages);
|
||||
} else response = ServiceRestResponse.createPositiveResponse();
|
||||
|
||||
} else throw new Exception("Non ci sono dati da importare");
|
||||
response = ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
response = ServiceRestResponse.createNegativeResponse(e);
|
||||
logger.error("Import " + httpRequest.getRequestURI(), e.getMessage());
|
||||
response.setMessages(errorMessages);
|
||||
response.setEntityList(Stream.of(entities).filter(x -> x.getException() == null).toList());
|
||||
|
||||
} else {
|
||||
if (importResponse.getAnomalie() != null) {
|
||||
|
||||
if (!importResponse.getAnomalie().isEmpty()) {
|
||||
|
||||
List<MessageDTO> messages = Stream.of(importResponse.getAnomalie())
|
||||
.map(x -> {
|
||||
switch (x.getTipo()) {
|
||||
case ERROR:
|
||||
return MessageDTO.error(x.getMessage());
|
||||
case WARNING:
|
||||
default:
|
||||
return MessageDTO.warning(x.getMessage());
|
||||
}
|
||||
})
|
||||
.toList();
|
||||
|
||||
response = ServiceRestResponse.createNegativeResponse();
|
||||
response.setMessages(messages);
|
||||
} else response = ServiceRestResponse.createPositiveResponse();
|
||||
|
||||
} else throw new Exception("Non ci sono dati da importare");
|
||||
}
|
||||
|
||||
return response;
|
||||
@@ -778,47 +754,42 @@ public class EmsController {
|
||||
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_DOWNLOAD_STB_FILE_ATTACHMENT + "/{idAttach}/{filename}", method = RequestMethod.GET)
|
||||
public byte[] downloadStbFileAttachment(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@PathVariable String idAttach,
|
||||
@PathVariable String filename,
|
||||
@RequestParam(defaultValue = "false") boolean requestThumbnail) throws Exception {
|
||||
|
||||
@ResponseBody
|
||||
public ResponseEntity<byte[]> downloadStbFileAttachment(
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@PathVariable String idAttach,
|
||||
@PathVariable String filename,
|
||||
@RequestParam(defaultValue = "false") boolean requestThumbnail) throws Exception {
|
||||
AttachmentDTO attachmentDTO = emsServices.downloadStbFileAttachment(idAttach, requestThumbnail);
|
||||
|
||||
if (attachmentDTO != null) {
|
||||
response.setContentType(attachmentDTO.getMimeType());
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.addHeader("Content-Disposition", "attachment; filename=\"" + attachmentDTO.getFileName() + "\"");
|
||||
|
||||
response.setContentLength((int) attachmentDTO.getFileSize());
|
||||
return attachmentDTO.getFileContent();
|
||||
return ResponseEntity.ok()
|
||||
.contentType(MediaType.parseMediaType(attachmentDTO.getMimeType()))
|
||||
.contentLength(attachmentDTO.getFileSize())
|
||||
.header("Content-Disposition", "attachment; filename=\"" + attachmentDTO.getFileName() + "\"")
|
||||
.body(attachmentDTO.getFileContent());
|
||||
}
|
||||
|
||||
response.sendError(404, "Allegato non trovato");
|
||||
return null;
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_DOWNLOAD_STB_FILE_ATTACHMENT, method = RequestMethod.GET)
|
||||
public byte[] downloadStbFileAttachmentPath(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestParam String idAttach,
|
||||
@RequestParam(defaultValue = "false") boolean requestThumbnail) throws Exception {
|
||||
|
||||
public ResponseEntity<byte[]> downloadStbFileAttachmentPath(
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestParam String idAttach,
|
||||
@RequestParam(defaultValue = "false") boolean requestThumbnail) throws Exception {
|
||||
AttachmentDTO attachmentDTO = emsServices.downloadStbFileAttachment(idAttach, requestThumbnail);
|
||||
|
||||
if (attachmentDTO != null) {
|
||||
response.setContentType(attachmentDTO.getMimeType());
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.addHeader("Content-Disposition", "attachment; filename=\"" + attachmentDTO.getFileName() + "\"");
|
||||
|
||||
response.setContentLength((int) attachmentDTO.getFileSize());
|
||||
return attachmentDTO.getFileContent();
|
||||
return ResponseEntity.ok()
|
||||
.contentType(MediaType.parseMediaType(attachmentDTO.getMimeType()))
|
||||
.contentLength(attachmentDTO.getFileSize())
|
||||
.header("Content-Disposition", "attachment; filename=\"" + attachmentDTO.getFileName() + "\"")
|
||||
.body(attachmentDTO.getFileContent());
|
||||
}
|
||||
|
||||
response.sendError(404, "Allegato non trovato");
|
||||
return null;
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
|
||||
|
||||
@@ -943,6 +914,7 @@ public class EmsController {
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestParam(required = false) String idAttach,
|
||||
@RequestParam(required = false) String descrizione,
|
||||
@RequestParam(required = false) String typeAttach,
|
||||
@RequestPart() MultipartFile[] files
|
||||
) {
|
||||
try {
|
||||
@@ -957,6 +929,7 @@ public class EmsController {
|
||||
files[0].getBytes(),
|
||||
descrizione,
|
||||
files[0].getContentType(),
|
||||
typeAttach,
|
||||
null, null);
|
||||
|
||||
stbFilesAttached.setOnlyPkMaster(false);
|
||||
@@ -1101,6 +1074,11 @@ public class EmsController {
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "createZipFromFiles", method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse createZipFromFiles(@RequestBody CreateZipDTO createZipDTO) throws Exception {
|
||||
return ServiceRestResponse.createPositiveResponse(emsServices.createZipFromFiles(createZipDTO));
|
||||
}
|
||||
|
||||
// @RequestMapping(value = EmsRestConstants.PATH_UPLOAD_STB_EMAIL_CONTENT, method = RequestMethod.POST)
|
||||
// public ServiceRestResponse uploadStbFileAttachment(HttpServletRequest request, HttpServletResponse response,
|
||||
@@ -1168,7 +1146,7 @@ public class EmsController {
|
||||
public @ResponseBody
|
||||
ServiceRestResponse getEntityMapping(@RequestParam(CommonConstants.PROFILE_DB) String config) throws Exception {
|
||||
try {
|
||||
List<EntityHierarchyDTO> mapping = emsServices.getEntityMapping();
|
||||
List<EntityHierarchy> mapping = emsServices.getEntityMapping();
|
||||
return ServiceRestResponse.createPositiveResponse(mapping);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
|
||||
@@ -3,7 +3,7 @@ package it.integry.ems.directory;
|
||||
import com.fasterxml.jackson.databind.node.ArrayNode;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.datasource.DataSource;
|
||||
import it.integry.ems.json.JSONObjectMapper;
|
||||
import it.integry.ems.json.ResponseJSONObjectMapper;
|
||||
import it.integry.ems.properties.EmsProperties;
|
||||
import it.integry.ems.response.EsitoType;
|
||||
import it.integry.ems.response.FileItem;
|
||||
@@ -39,10 +39,10 @@ public class EmailWatcherListener extends TimerTask {
|
||||
private EmailListenerInfo emailListenerInfo;
|
||||
private EmsProperties prop;
|
||||
private SetupGest setupGest;
|
||||
private JSONObjectMapper jsonObjectMapper;
|
||||
private ResponseJSONObjectMapper jsonObjectMapper;
|
||||
|
||||
public EmailWatcherListener(EmailListenerInfo emailListenerInfo, EmsProperties prop,
|
||||
SetupGest setupGest, JSONObjectMapper jsonObjectMapper) {
|
||||
SetupGest setupGest, ResponseJSONObjectMapper jsonObjectMapper) {
|
||||
super();
|
||||
this.emailListenerInfo = emailListenerInfo;
|
||||
this.prop = prop;
|
||||
|
||||
132
ems-core/src/main/java/it/integry/ems/dto/CreateZipDTO.java
Normal file
132
ems-core/src/main/java/it/integry/ems/dto/CreateZipDTO.java
Normal file
@@ -0,0 +1,132 @@
|
||||
package it.integry.ems.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import it.integry.ems.report.dto.JasperDTO;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.entity.DtbDocPdf;
|
||||
import it.integry.ems_model.entity.MtbAartLink;
|
||||
import it.integry.ems_model.entity.MtbUntMis;
|
||||
import it.integry.ems_model.entity.StbActivityFile;
|
||||
import it.integry.ems_model.entity._enum.IBaseEnum;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class CreateZipDTO {
|
||||
private List<String> listIdAttach;
|
||||
|
||||
private List<StbActivityFile> listStbActivityFile;
|
||||
|
||||
private List<MtbAartLink> listMtbAartLink;
|
||||
|
||||
private List<DtbDocPdf> listDtbDocPdf;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private SaveMode saveMode = SaveMode.STB_FILES_ATTACHED;
|
||||
|
||||
private EntityBase entityToSaveTo;
|
||||
|
||||
public List<String> getListIdAttach() {
|
||||
return listIdAttach;
|
||||
}
|
||||
|
||||
public CreateZipDTO setListIdAttach(List<String> listIdAttach) {
|
||||
this.listIdAttach = listIdAttach;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<StbActivityFile> getListStbActivityFile() {
|
||||
return listStbActivityFile;
|
||||
}
|
||||
|
||||
public CreateZipDTO setListStbActivityFile(List<StbActivityFile> listStbActivityFile) {
|
||||
this.listStbActivityFile = listStbActivityFile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbAartLink> getListMtbAartLink() {
|
||||
return listMtbAartLink;
|
||||
}
|
||||
|
||||
public CreateZipDTO setListMtbAartLink(List<MtbAartLink> listMtbAartLink) {
|
||||
this.listMtbAartLink = listMtbAartLink;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<DtbDocPdf> getListDtbDocPdf() {
|
||||
return listDtbDocPdf;
|
||||
}
|
||||
|
||||
public CreateZipDTO setListDtbDocPdf(List<DtbDocPdf> listDtbDocPdf) {
|
||||
this.listDtbDocPdf = listDtbDocPdf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public CreateZipDTO setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SaveMode getSaveMode() {
|
||||
return saveMode;
|
||||
}
|
||||
|
||||
public CreateZipDTO setSaveMode(SaveMode saveMode) {
|
||||
this.saveMode = saveMode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public EntityBase getEntityToSaveTo() {
|
||||
return entityToSaveTo;
|
||||
}
|
||||
|
||||
public CreateZipDTO setEntityToSaveTo(EntityBase entityToSaveTo) {
|
||||
this.entityToSaveTo = entityToSaveTo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public enum SaveMode implements IBaseEnum<SaveMode> {
|
||||
STB_FILES_ATTACHED((short) 0),
|
||||
STB_ACTIVITY_FILE((short) 1);
|
||||
|
||||
private final short value;
|
||||
|
||||
SaveMode(final short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static SaveMode from(Object value) {
|
||||
short castValue = (short) value;
|
||||
for (SaveMode b : SaveMode.values()) {
|
||||
if (b.value == castValue)
|
||||
return b;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public short getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object get() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SaveMode fromInternal(Object val) {
|
||||
return from(val);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
180
ems-core/src/main/java/it/integry/ems/dto/EntityHierarchy.java
Normal file
180
ems-core/src/main/java/it/integry/ems/dto/EntityHierarchy.java
Normal file
@@ -0,0 +1,180 @@
|
||||
package it.integry.ems.dto;
|
||||
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.base.EntityInterface;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EntityHierarchy {
|
||||
|
||||
private Class<? extends EntityBase> clazz;
|
||||
private String entityName;
|
||||
private String tableName;
|
||||
private java.lang.reflect.Field parentField; //Used for entityChild
|
||||
private boolean master;
|
||||
private boolean equatable;
|
||||
private List<EntityHierarchy> children;
|
||||
private List<Field> fields;
|
||||
|
||||
public Class<? extends EntityInterface> getClazz() {
|
||||
return clazz;
|
||||
}
|
||||
|
||||
public EntityHierarchy setClazz(Class<? extends EntityBase> clazz) {
|
||||
this.clazz = clazz;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getEntityName() {
|
||||
return entityName;
|
||||
}
|
||||
|
||||
public void setEntityName(String entityName) {
|
||||
this.entityName = entityName;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public java.lang.reflect.Field getParentField() {
|
||||
return parentField;
|
||||
}
|
||||
|
||||
public EntityHierarchy setParentField(java.lang.reflect.Field parentField) {
|
||||
this.parentField = parentField;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isMaster() {
|
||||
return master;
|
||||
}
|
||||
|
||||
public EntityHierarchy setMaster(boolean master) {
|
||||
this.master = master;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<EntityHierarchy> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<EntityHierarchy> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public void addChild(EntityHierarchy child) {
|
||||
this.children.add(child);
|
||||
}
|
||||
|
||||
public void removeChild(EntityHierarchy child) {
|
||||
this.children.remove(child);
|
||||
}
|
||||
|
||||
public List<Field> getFields() {
|
||||
return fields;
|
||||
}
|
||||
|
||||
public EntityHierarchy setFields(List<Field> fields) {
|
||||
this.fields = fields;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEquatable() {
|
||||
return equatable;
|
||||
}
|
||||
|
||||
public EntityHierarchy setEquatable(boolean equatable) {
|
||||
this.equatable = equatable;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public static class Field {
|
||||
private java.lang.reflect.Field field;
|
||||
private Identity identity;
|
||||
private SqlField sqlField;
|
||||
private ObjectStorage objectStorage;
|
||||
private Blob blob;
|
||||
private Clob clob;
|
||||
|
||||
public java.lang.reflect.Field getField() {
|
||||
return field;
|
||||
}
|
||||
|
||||
public Field setField(java.lang.reflect.Field field) {
|
||||
this.field = field;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isSqlField() {
|
||||
return sqlField != null;
|
||||
}
|
||||
|
||||
public boolean isObjectStorage() {
|
||||
return objectStorage != null;
|
||||
}
|
||||
|
||||
public boolean isBlob() {
|
||||
return blob != null;
|
||||
}
|
||||
|
||||
public boolean isClob() {
|
||||
return clob != null;
|
||||
}
|
||||
|
||||
public boolean isIdentity() {
|
||||
return identity != null;
|
||||
}
|
||||
|
||||
public Identity getIdentity() {
|
||||
return identity;
|
||||
}
|
||||
|
||||
public Field setIdentity(Identity identity) {
|
||||
this.identity = identity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SqlField getSqlField() {
|
||||
return sqlField;
|
||||
}
|
||||
|
||||
public Field setSqlField(SqlField sqlField) {
|
||||
this.sqlField = sqlField;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ObjectStorage getObjectStorage() {
|
||||
return objectStorage;
|
||||
}
|
||||
|
||||
public Field setObjectStorage(ObjectStorage objectStorage) {
|
||||
this.objectStorage = objectStorage;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Blob getBlob() {
|
||||
return blob;
|
||||
}
|
||||
|
||||
public Field setBlob(Blob blob) {
|
||||
this.blob = blob;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Clob getClob() {
|
||||
return clob;
|
||||
}
|
||||
|
||||
public Field setClob(Clob clob) {
|
||||
this.clob = clob;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
package it.integry.ems.dto;
|
||||
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
public class EntityHierarchyDTO {
|
||||
|
||||
private Class<? extends EntityBase> clazz;
|
||||
private String entityName;
|
||||
private String tableName;
|
||||
private Field field;
|
||||
private boolean master;
|
||||
private List<EntityHierarchyDTO> children;
|
||||
|
||||
public Class<? extends EntityBase> getClazz() {
|
||||
return clazz;
|
||||
}
|
||||
|
||||
public EntityHierarchyDTO setClazz(Class<? extends EntityBase> clazz) {
|
||||
this.clazz = clazz;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getEntityName() {
|
||||
return entityName;
|
||||
}
|
||||
|
||||
public void setEntityName(String entityName) {
|
||||
this.entityName = entityName;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public Field getField() {
|
||||
return field;
|
||||
}
|
||||
|
||||
public EntityHierarchyDTO setField(Field field) {
|
||||
this.field = field;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isMaster() {
|
||||
return master;
|
||||
}
|
||||
|
||||
public EntityHierarchyDTO setMaster(boolean master) {
|
||||
this.master = master;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<EntityHierarchyDTO> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<EntityHierarchyDTO> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public void addChild(EntityHierarchyDTO child) {
|
||||
this.children.add(child);
|
||||
}
|
||||
|
||||
public void removeChild(EntityHierarchyDTO child) {
|
||||
this.children.remove(child);
|
||||
}
|
||||
}
|
||||
46
ems-core/src/main/java/it/integry/ems/dto/Result.java
Normal file
46
ems-core/src/main/java/it/integry/ems/dto/Result.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package it.integry.ems.dto;
|
||||
|
||||
public abstract class Result<T> {
|
||||
private Result() {}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (this instanceof Result.Success) {
|
||||
Result.Success<?> success = (Result.Success<?>) this;
|
||||
return "Success[data=" + success.getData().toString() + "]";
|
||||
} else if (this instanceof Result.Error) {
|
||||
Result.Error error = (Result.Error) this;
|
||||
return "Error[exception=" + error.getError().toString() + "]";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static final class Success<T> extends Result<T> {
|
||||
private final T data;
|
||||
|
||||
public Success() {
|
||||
data = null;
|
||||
}
|
||||
|
||||
public Success(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
public static final class Error<T> extends Result<T> {
|
||||
private final Exception exception;
|
||||
|
||||
public Error(Exception exception) {
|
||||
exception.printStackTrace();
|
||||
this.exception = exception;
|
||||
}
|
||||
|
||||
public Exception getError() {
|
||||
return exception;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.ems.ecedi.enums;
|
||||
|
||||
public enum EuritmoCCIAppIdentifier {
|
||||
CCI37("37"),
|
||||
CCI00("00"),
|
||||
CCI10("10"),
|
||||
CCI17("17"),
|
||||
|
||||
@@ -12,15 +12,16 @@ import com.github.javaparser.ast.type.ClassOrInterfaceType;
|
||||
import it.integry.ems.entity_development.dto.CreateEntityItemRequestDTO;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.component.SQLServerDBSchemaManager;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.dto.DatabaseForeignKey;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.dto.DatabaseTable;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.dto.DatabaseTableColumn;
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.dto.DatabaseTableView;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityDirs;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
@@ -29,9 +30,11 @@ import org.springframework.stereotype.Service;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.AbstractMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.github.javaparser.ast.Modifier.Keyword.*;
|
||||
@@ -53,7 +56,7 @@ public class EntityDevelopmentService {
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (CreateEntityItemRequestDTO createEntityItemRequestDTO : createEntityItemRequestList) {
|
||||
final DatabaseTable tableData = sourceDBSchema.getTable(createEntityItemRequestDTO.getTableName());
|
||||
final DatabaseTableView tableData = sourceDBSchema.getTable(createEntityItemRequestDTO.getTableName());
|
||||
final CompilationUnit javaClassDeclaration =
|
||||
createJavaClassDeclaration(createEntityItemRequestDTO, tableData, createEntityItemRequestDTO.isMaster() ? entityChilds : null);
|
||||
|
||||
@@ -70,9 +73,13 @@ public class EntityDevelopmentService {
|
||||
}
|
||||
|
||||
|
||||
private CompilationUnit createJavaClassDeclaration(CreateEntityItemRequestDTO createEntityItemRequestDTO, final DatabaseTable databaseTable, final List<CreateEntityItemRequestDTO> childEntities) throws Exception {
|
||||
private CompilationUnit createJavaClassDeclaration(CreateEntityItemRequestDTO createEntityItemRequestDTO, final DatabaseTableView databaseTable, final List<CreateEntityItemRequestDTO> childEntities) throws Exception {
|
||||
CompilationUnit javaClassCompilation = new CompilationUnit();
|
||||
// addImportInstructions(javaClassCompilation);
|
||||
|
||||
javaClassCompilation.setPackageDeclaration("it.integry.ems_model.entity");
|
||||
javaClassCompilation.addImport(LogManager.class);
|
||||
javaClassCompilation.addImport(List.class);
|
||||
javaClassCompilation.addImport(ArrayList.class);
|
||||
|
||||
String javaClassName = UtilityString.sqlToCamelCase(databaseTable.getTableName());
|
||||
javaClassName = javaClassName.substring(0, 1).toUpperCase() + javaClassName.substring(1);
|
||||
@@ -96,20 +103,12 @@ public class EntityDevelopmentService {
|
||||
javaClass.addAndGetAnnotation(JsonTypeName.class)
|
||||
.addPair("value", new FieldAccessExpr(new NameExpr(javaClassName), "ENTITY"));
|
||||
|
||||
final FieldDeclaration entityField = javaClass.addField(String.class, "ENTITY", PUBLIC, FINAL, STATIC);
|
||||
ClassOrInterfaceType entityFieldType = entityField.getElementType().asClassOrInterfaceType();
|
||||
entityFieldType.setName("String");
|
||||
|
||||
entityField.setVariable(0, new VariableDeclarator(entityFieldType, "ENTITY",
|
||||
new StringLiteralExpr(databaseTable.getTableName())));
|
||||
final FieldDeclaration entityField = javaClass.addFieldWithInitializer(String.class, "ENTITY", new StringLiteralExpr(databaseTable.getTableName()), PUBLIC, FINAL, STATIC);
|
||||
final FieldDeclaration serialVersionUIDField = javaClass.addFieldWithInitializer(Long.class, "serialVersionUID", new LongLiteralExpr("1L"), PRIVATE, FINAL, STATIC);
|
||||
final FieldDeclaration loggerField = javaClass.addFieldWithInitializer(Logger.class, "logger", new MethodCallExpr("LogManager.getLogger"), PRIVATE, FINAL, STATIC);
|
||||
|
||||
|
||||
final FieldDeclaration serialVersionUIDField = javaClass.addField(Long.class, "serialVersionUID", PRIVATE, FINAL, STATIC);
|
||||
ClassOrInterfaceType serialVersionUIDFieldType = serialVersionUIDField.getElementType().asClassOrInterfaceType();
|
||||
serialVersionUIDFieldType.setName("long");
|
||||
|
||||
serialVersionUIDField.setVariable(0, new VariableDeclarator(serialVersionUIDFieldType, "serialVersionUID",
|
||||
new LongLiteralExpr("1L")));
|
||||
createEntityConstructor(javaClass);
|
||||
|
||||
List<FieldDeclaration> entityFields = new ArrayList<>();
|
||||
|
||||
@@ -122,10 +121,16 @@ public class EntityDevelopmentService {
|
||||
String entityChildClassName = UtilityString.sqlToCamelCase(child.getTableName());
|
||||
entityChildClassName = entityChildClassName.substring(0, 1).toUpperCase() + entityChildClassName.substring(1);
|
||||
|
||||
String variableName = entityChildClassName.substring(0, 1).toLowerCase() + entityChildClassName.substring(1);
|
||||
|
||||
final FieldDeclaration fieldDeclaration = javaClass.addField(
|
||||
"List<" + entityChildClassName + ">",
|
||||
entityChildClassName.substring(0, 1).toLowerCase() + entityChildClassName.substring(1),
|
||||
variableName,
|
||||
PRIVATE);
|
||||
|
||||
//final InitializerDeclaration initializerDeclaration = new InitializerDeclaration(false, new BlockStmt().addStatement("new ArrayList<>()"));
|
||||
|
||||
fieldDeclaration.setVariable(0, new VariableDeclarator(fieldDeclaration.getElementType(), variableName, new MethodCallExpr("new ArrayList<>")));
|
||||
entityFields.add(fieldDeclaration);
|
||||
|
||||
fieldDeclaration.addAnnotation(EntityChild.class);
|
||||
@@ -147,6 +152,16 @@ public class EntityDevelopmentService {
|
||||
return javaClassCompilation;
|
||||
}
|
||||
|
||||
private void createEntityConstructor(ClassOrInterfaceDeclaration javaClass) {
|
||||
final ConstructorDeclaration constructorDeclaration = javaClass.addConstructor(PUBLIC);
|
||||
|
||||
final BlockStmt constructorBlockStmt = constructorDeclaration.getBody();
|
||||
|
||||
constructorBlockStmt.addStatement(new MethodCallExpr("super",
|
||||
new NameExpr("logger")));
|
||||
|
||||
}
|
||||
|
||||
private FieldDeclaration createEntityField(ClassOrInterfaceDeclaration javaClass, DatabaseTableColumn databaseColumn) throws Exception {
|
||||
final Class<?> aClass = UtilityDB.sqlTypeToJavaClass(databaseColumn.getDataType().toSqlDataType());
|
||||
|
||||
@@ -169,11 +184,6 @@ public class EntityDevelopmentService {
|
||||
sqlFieldAnnotation
|
||||
.addPair("nullable", new BooleanLiteralExpr(databaseColumn.isNullable()));
|
||||
|
||||
// if (databaseColumn.getColumnDefault() != null)
|
||||
// sqlFieldValues.add(new MemberValuePair("defaultObjectValue", new StringLiteralExpr(databaseColumn.getColumnDefault())));
|
||||
|
||||
|
||||
|
||||
//Create @FK annotations
|
||||
if (databaseColumn.getForeignKeys() != null) {
|
||||
for (DatabaseForeignKey fkInfo : databaseColumn.getForeignKeys()) {
|
||||
|
||||
@@ -5,9 +5,9 @@ import com.microsoft.sqlserver.jdbc.SQLServerException;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.dto.*;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityHashMap;
|
||||
import it.integry.ems_model.utility.UtilityLocalDate;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.orm.jpa.vendor.Database;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.Connection;
|
||||
@@ -82,8 +82,15 @@ public class SQLServerDBSchemaManager {
|
||||
return UtilityDB.executeSimpleQueryDTO(this.mConnection, sql, DatabaseFile.class);
|
||||
}
|
||||
|
||||
|
||||
public DatabaseTable getTable(String tableName) throws Exception {
|
||||
return getTableOrView(tableName, DatabaseObjectTypeEnum.TABLE, DatabaseTable.class);
|
||||
}
|
||||
|
||||
public DatabaseView getView(String viewName) throws Exception {
|
||||
return getTableOrView(viewName, DatabaseObjectTypeEnum.VIEW, DatabaseView.class);
|
||||
}
|
||||
|
||||
public <T extends DatabaseTableView> T getTableOrView(String objectName, DatabaseObjectTypeEnum type, Class<T> classType) throws Exception {
|
||||
String sql = "SELECT TABLE_CATALOG,\n" +
|
||||
" COLUMNS.TABLE_SCHEMA,\n" +
|
||||
" COLUMNS.TABLE_NAME,\n" +
|
||||
@@ -121,18 +128,18 @@ public class SQLServerDBSchemaManager {
|
||||
" ON pk.TABLE_NAME = COLUMNS.TABLE_NAME AND\n" +
|
||||
" pk.COLUMN_NAME = COLUMNS.COLUMN_NAME AND\n" +
|
||||
" pk.TABLE_SCHEMA = COLUMNS.TABLE_SCHEMA\n" +
|
||||
" WHERE type = " + UtilityDB.valueToString(DatabaseObjectTypeEnum.TABLE.getText()) +
|
||||
" AND COLUMNS.TABLE_NAME = " + UtilityDB.valueToString(tableName);
|
||||
" WHERE type = " + UtilityDB.valueToString(type.getText()) +
|
||||
" AND COLUMNS.TABLE_NAME = " + UtilityDB.valueToString(objectName);
|
||||
|
||||
List<HashMap<String, Object>> result = UtilityDB.executeSimpleQuery(this.mConnection, sql);
|
||||
|
||||
if (result.isEmpty())
|
||||
return null;
|
||||
|
||||
HashMap<String, ArrayList<DatabaseForeignKey>> foreignKeysResults = getForeignKeys(tableName);
|
||||
HashMap<String, ArrayList<DatabaseForeignKey>> foreignKeysResults = getForeignKeys(objectName);
|
||||
|
||||
DatabaseTable databaseTable = new DatabaseTable()
|
||||
.setTableName(tableName);
|
||||
T databaseTable = (T) classType.newInstance()
|
||||
.setTableName(objectName);
|
||||
|
||||
List<DatabaseTableColumn> databaseTableColumns = new ArrayList<>();
|
||||
for (HashMap<String, Object> column : result) {
|
||||
@@ -167,7 +174,15 @@ public class SQLServerDBSchemaManager {
|
||||
}
|
||||
|
||||
public List<DatabaseTable> getTables() throws Exception {
|
||||
List<DatabaseTable> tableList = new ArrayList<>();
|
||||
return getTablesOrViews(DatabaseObjectTypeEnum.TABLE, DatabaseTable.class);
|
||||
}
|
||||
|
||||
public List<DatabaseView> getViews() throws Exception {
|
||||
return getTablesOrViews(DatabaseObjectTypeEnum.VIEW, DatabaseView.class);
|
||||
}
|
||||
|
||||
private <T extends DatabaseTableView> List<T> getTablesOrViews(DatabaseObjectTypeEnum type, Class<T> classType) throws Exception {
|
||||
List<T> tableList = new ArrayList<>();
|
||||
|
||||
String sql = "SELECT TABLE_CATALOG,\n" +
|
||||
" COLUMNS.TABLE_SCHEMA,\n" +
|
||||
@@ -193,7 +208,8 @@ public class SQLServerDBSchemaManager {
|
||||
" COLLATION_NAME,\n" +
|
||||
" DOMAIN_CATALOG,\n" +
|
||||
" DOMAIN_SCHEMA,\n" +
|
||||
" DOMAIN_NAME\n" +
|
||||
" DOMAIN_NAME,\n" +
|
||||
" CAST(create_date AS DATE) AS CREATE_DATE\n" +
|
||||
"FROM INFORMATION_SCHEMA.COLUMNS\n" +
|
||||
" INNER JOIN sys.objects ON TABLE_NAME = name\n" +
|
||||
" LEFT OUTER JOIN (SELECT TABLE_NAME,\n" +
|
||||
@@ -206,16 +222,26 @@ public class SQLServerDBSchemaManager {
|
||||
" ON pk.TABLE_NAME = COLUMNS.TABLE_NAME AND\n" +
|
||||
" pk.COLUMN_NAME = COLUMNS.COLUMN_NAME AND\n" +
|
||||
" pk.TABLE_SCHEMA = COLUMNS.TABLE_SCHEMA\n" +
|
||||
" WHERE type = " + UtilityDB.valueToString(DatabaseObjectTypeEnum.TABLE.getText());
|
||||
" WHERE type = " + UtilityDB.valueToString(type.getText());
|
||||
|
||||
List<HashMap<String, Object>> result = UtilityDB.executeSimpleQuery(this.mConnection, sql);
|
||||
final HashMap<String, HashMap<String, ArrayList<DatabaseForeignKey>>> foreignKeys = getForeignKeys();
|
||||
|
||||
|
||||
Stream.of(result)
|
||||
.groupBy(x -> UtilityHashMap.<String>getValueIfExists(x, "TABLE_NAME"))
|
||||
.forEach(x -> {
|
||||
DatabaseTable databaseTable = new DatabaseTable()
|
||||
.setTableName(x.getKey());
|
||||
T databaseTable = null;
|
||||
try {
|
||||
databaseTable = (T) classType.newInstance();
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
|
||||
databaseTable
|
||||
.setTableName(x.getKey())
|
||||
.setCreationDate(UtilityLocalDate.localDateFromDate(UtilityHashMap.getValueIfExists(x.getValue().get(0), "CREATE_DATE")));
|
||||
|
||||
HashMap<String, ArrayList<DatabaseForeignKey>> foreignKeysResults = foreignKeys.getOrDefault(x.getKey(), new HashMap<>());
|
||||
|
||||
@@ -239,7 +265,8 @@ public class SQLServerDBSchemaManager {
|
||||
.setCharacterSetSchema(UtilityHashMap.getValueIfExists(column, "CHARACTER_SET_SCHEMA"))
|
||||
.setCharacterSetName(UtilityHashMap.getValueIfExists(column, "CHARACTER_SET_NAME"));
|
||||
|
||||
databaseTableColumn.setIdentity(databaseTableColumn.isPrimaryKey() && UtilityHashMap.<Boolean>getValueIfExists(column, "TABLE_HAS_IDENTITY"));
|
||||
Boolean tableHasIdentity = UtilityHashMap.<Boolean>getValueIfExists(column, "TABLE_HAS_IDENTITY", false);
|
||||
databaseTableColumn.setIdentity(databaseTableColumn.isPrimaryKey() && tableHasIdentity != null && tableHasIdentity);
|
||||
|
||||
if (foreignKeysResults != null && foreignKeysResults.containsKey(databaseTableColumn.getColumnName()))
|
||||
databaseTableColumn.setForeignKeys(foreignKeysResults.get(databaseTableColumn.getColumnName()));
|
||||
@@ -339,7 +366,7 @@ public class SQLServerDBSchemaManager {
|
||||
return hashMap;
|
||||
}
|
||||
|
||||
public String createTableSyntax(DatabaseTable databaseTable) throws Exception {
|
||||
public String createTableSyntax(DatabaseTableView databaseTable) throws Exception {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("CREATE TABLE [" + databaseTable.getTableName() + "] (");
|
||||
|
||||
@@ -354,14 +381,29 @@ public class SQLServerDBSchemaManager {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void createTable(DatabaseTable databaseTable) throws Exception {
|
||||
public void createTable(DatabaseTableView databaseTable) throws Exception {
|
||||
String sql = createTableSyntax(databaseTable);
|
||||
|
||||
execTableAlterSQL(sql);
|
||||
this.mConnection.commit();
|
||||
}
|
||||
|
||||
public String addTableColumnsSyntax(DatabaseTable deltaTable) throws Exception {
|
||||
|
||||
public void dropTable(DatabaseTable databaseTable) throws Exception {
|
||||
String dropSql = "DROP TABLE " + databaseTable.getTableName();
|
||||
execTableAlterSQL(dropSql);
|
||||
this.mConnection.commit();
|
||||
}
|
||||
|
||||
|
||||
public void dropView(DatabaseView databaseTable) throws Exception {
|
||||
String dropSql = "DROP VIEW " + databaseTable.getTableName();
|
||||
execTableAlterSQL(dropSql);
|
||||
this.mConnection.commit();
|
||||
}
|
||||
|
||||
|
||||
public String addTableColumnsSyntax(DatabaseTableView deltaTable) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("ALTER TABLE [" + deltaTable.getTableName() + "] ADD ");
|
||||
@@ -377,7 +419,7 @@ public class SQLServerDBSchemaManager {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void addTableColumns(DatabaseTable deltaTable) throws Exception {
|
||||
public void addTableColumns(DatabaseTableView deltaTable) throws Exception {
|
||||
|
||||
String sql = addTableColumnsSyntax(deltaTable);
|
||||
execTableAlterSQL(sql);
|
||||
@@ -385,6 +427,74 @@ public class SQLServerDBSchemaManager {
|
||||
}
|
||||
|
||||
|
||||
private String dropTableColumnsSyntax(DatabaseTableView deltaTable) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("ALTER TABLE [" + deltaTable.getTableName() + "] DROP COLUMN ");
|
||||
|
||||
List<DatabaseTableColumn> sourceColumns = deltaTable.getColumns();
|
||||
List<String> columnsTempSql = new ArrayList<>();
|
||||
for (DatabaseTableColumn sourceColumn : sourceColumns) {
|
||||
columnsTempSql.add(sourceColumn.getColumnName());
|
||||
}
|
||||
|
||||
sb.append(StringUtils.join(columnsTempSql, ", "));
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void dropTableColumns(DatabaseTableView deltaTable) throws Exception {
|
||||
|
||||
String sql = dropTableColumnsSyntax(deltaTable);
|
||||
execTableAlterSQL(sql);
|
||||
this.mConnection.commit();
|
||||
}
|
||||
|
||||
|
||||
private List<String> updateTableColumnsSyntax(DatabaseTableView deltaTable) {
|
||||
List<String> alterSqls = new ArrayList<>();
|
||||
|
||||
List<DatabaseTableColumn> sourceColumns = deltaTable.getColumns();
|
||||
|
||||
for (DatabaseTableColumn sourceColumn : sourceColumns) {
|
||||
alterSqls.add("ALTER TABLE [" + deltaTable.getTableName() + "] ALTER COLUMN " + generateAddColumnSyntax(sourceColumn));
|
||||
}
|
||||
|
||||
|
||||
return alterSqls;
|
||||
}
|
||||
|
||||
public void updateTableColumns(DatabaseTableView deltaTable) throws Exception {
|
||||
|
||||
List<String> sqls = updateTableColumnsSyntax(deltaTable);
|
||||
for (String sql : sqls)
|
||||
execTableAlterSQL(sql);
|
||||
|
||||
this.mConnection.commit();
|
||||
}
|
||||
|
||||
|
||||
public List<String> generateAlterTableToDisableAnsiPadding() throws SQLException {
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstColumn(this.mConnection, "SELECT 'ALTER TABLE ' + OBJECT_SCHEMA_NAME(sys.objects.object_id) + '.' + \n" +
|
||||
" sys.objects.name + ' ALTER COLUMN [' + sys.columns.name + '] ' + \n" +
|
||||
" sys.types.name + CASE WHEN sys.types.name IN ('text','ntext') THEN ''\n" +
|
||||
" WHEN sys.types.name IN ('char','varchar') \n" +
|
||||
" THEN '('+IIF(sys.columns.max_length = -1, 'MAX', CAST(sys.columns.max_length AS varchar(10)))+')'\n" +
|
||||
" WHEN sys.types.name IN ('nchar','nvarchar') \n" +
|
||||
" THEN '('+CAST(sys.columns.max_length/2 AS varchar(10))+')' END +\n" +
|
||||
" ' ' + CASE WHEN sys.columns.is_nullable = 0 \n" +
|
||||
" THEN 'NOT NULL' ELSE 'NULL' END\n" +
|
||||
"FROM sys.columns\n" +
|
||||
"JOIN sys.types\n" +
|
||||
" ON sys.columns.user_type_id = sys.types.user_type_id\n" +
|
||||
"JOIN sys.objects\n" +
|
||||
" ON sys.columns.object_id = sys.objects.object_id\n" +
|
||||
"WHERE is_ansi_padded = 0\n" +
|
||||
" AND sys.types.name in ('char','varchar')\n" +
|
||||
" AND sys.objects.type = 'U'");
|
||||
}
|
||||
|
||||
|
||||
private String generateAddColumnSyntax(DatabaseTableColumn tableColumn) {
|
||||
String columnSize = null;
|
||||
|
||||
|
||||
@@ -1,37 +1,10 @@
|
||||
package it.integry.ems.entity_logger.db_schema_manager.dto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
public class DatabaseTable extends DatabaseTableView {
|
||||
|
||||
public class DatabaseTable implements Cloneable {
|
||||
private final DatabaseObjectTypeEnum type = DatabaseObjectTypeEnum.TABLE;
|
||||
|
||||
private String tableName;
|
||||
private List<DatabaseTableColumn> columns = new ArrayList<>();
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public DatabaseTable setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<DatabaseTableColumn> getColumns() {
|
||||
return columns;
|
||||
}
|
||||
|
||||
public DatabaseTable setColumns(List<DatabaseTableColumn> columns) {
|
||||
this.columns = columns;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseTable clone() {
|
||||
try {
|
||||
return (DatabaseTable) super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
public DatabaseObjectTypeEnum getType() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package it.integry.ems.entity_logger.db_schema_manager.dto;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DatabaseTableView implements Cloneable {
|
||||
|
||||
private String tableName;
|
||||
private LocalDate creationDate;
|
||||
private List<DatabaseTableColumn> columns = new ArrayList<>();
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public DatabaseTableView setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDate getCreationDate() {
|
||||
return creationDate;
|
||||
}
|
||||
|
||||
public DatabaseTableView setCreationDate(LocalDate creationDate) {
|
||||
this.creationDate = creationDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<DatabaseTableColumn> getColumns() {
|
||||
return columns;
|
||||
}
|
||||
|
||||
public DatabaseTableView setColumns(List<DatabaseTableColumn> columns) {
|
||||
this.columns = columns;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseTableView clone() {
|
||||
try {
|
||||
return (DatabaseTableView) super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package it.integry.ems.entity_logger.db_schema_manager.dto;
|
||||
|
||||
public class DatabaseView extends DatabaseTableView {
|
||||
|
||||
private final DatabaseObjectTypeEnum type = DatabaseObjectTypeEnum.VIEW;
|
||||
|
||||
public DatabaseObjectTypeEnum getType() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,8 @@ package it.integry.ems.entity_logger.service;
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
import it.integry.annotations.PostContextConstruct;
|
||||
import it.integry.ems.dynamic_cache.DynamicCacheService;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.component.SQLServerDBSchemaManager;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.dto.DatabaseFile;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.dto.DatabaseTable;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.dto.DatabaseTableColumn;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.dto.DatabaseTableColumnDataType;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.dto.*;
|
||||
import it.integry.ems.looper.service.LooperService;
|
||||
import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
@@ -130,16 +126,16 @@ public class EntityLoggerComponent {
|
||||
|
||||
for (DatabaseTable sourceTable : sourceTables) {
|
||||
|
||||
Optional<DatabaseTable> optDestTable = Stream.of(destTables)
|
||||
java.util.Optional<DatabaseTable> optDestTable = destTables.stream()
|
||||
.filter(x -> x.getTableName().equalsIgnoreCase(sourceTable.getTableName()))
|
||||
.findFirst();
|
||||
DatabaseTable destTable;
|
||||
DatabaseTableView destTable;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if (optDestTable.isEmpty()) {
|
||||
if (!optDestTable.isPresent()) {
|
||||
|
||||
Stream.of(sourceTable.getColumns())
|
||||
sourceTable.getColumns()
|
||||
.forEach(x -> x.setNullable(true));
|
||||
|
||||
int maxOrdinalPosition = Stream.of(sourceTable.getColumns())
|
||||
@@ -182,7 +178,7 @@ public class EntityLoggerComponent {
|
||||
} else {
|
||||
destTable = optDestTable.get();
|
||||
|
||||
DatabaseTable cloneDatabaseTableADD = destTable.clone();
|
||||
DatabaseTable cloneDatabaseTableADD = (DatabaseTable) destTable.clone();
|
||||
cloneDatabaseTableADD.setColumns(new ArrayList<>());
|
||||
|
||||
List<DatabaseTableColumn> sourceColumns = sourceTable.getColumns();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package it.integry.ems.exception;
|
||||
|
||||
public class MissingDataException extends Exception {
|
||||
public MissingDataException(String method) {
|
||||
super("Dati mancanti in " + method);
|
||||
public MissingDataException(String error) {
|
||||
super("Dati mancanti: " + error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package it.integry.ems.expansion;
|
||||
|
||||
public interface RunnableArgsThrowable<T> {
|
||||
|
||||
T run() throws Exception;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package it.integry.ems.expansion;
|
||||
|
||||
public interface RunnableThrowable {
|
||||
|
||||
void run() throws Exception;
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package it.integry.ems.export.base;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.exc.MismatchedInputException;
|
||||
@@ -20,7 +19,7 @@ import it.integry.ems.file_sharer.sharers.ftp.FTPFileSharerSettings;
|
||||
import it.integry.ems.file_sharer.sharers.sftp.SFTPFileAttachment;
|
||||
import it.integry.ems.file_sharer.sharers.sftp.SFTPFileSharer;
|
||||
import it.integry.ems.file_sharer.sharers.sftp.SFTPFileSharerSettings;
|
||||
import it.integry.ems.json.JSONObjectMapper;
|
||||
import it.integry.ems.json.ResponseJSONObjectMapper;
|
||||
import it.integry.ems.properties.EmsProperties;
|
||||
import it.integry.ems.response.EsitoType;
|
||||
import it.integry.ems.response.FileItem;
|
||||
@@ -29,7 +28,6 @@ import it.integry.ems.service.HttpRestWrapper;
|
||||
import it.integry.ems.service.MailService;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityDirs;
|
||||
import it.integry.ems_model.entity.Azienda;
|
||||
import it.integry.ems_model.entity.WtbUsersInfo;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
@@ -41,8 +39,10 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -251,7 +251,7 @@ public abstract class BaseEntityExporter implements IEntityExporter {
|
||||
|
||||
case WEBSERVICES:
|
||||
|
||||
JSONObjectMapper objectMapper = new JSONObjectMapper();
|
||||
ResponseJSONObjectMapper objectMapper = new ResponseJSONObjectMapper();
|
||||
|
||||
String url = wtbUserInfo.getWsEndpoint();
|
||||
|
||||
@@ -399,7 +399,7 @@ public abstract class BaseEntityExporter implements IEntityExporter {
|
||||
}
|
||||
}
|
||||
|
||||
if (counterTotalSend > 0 && counterFailedSend != 0 && retException != null) {
|
||||
if (counterTotalSend > 0 && counterFailedSend == counterTotalSend && retException != null) {
|
||||
//Se gli invii precedenti sono andati bene usciamo
|
||||
throw retException;
|
||||
}
|
||||
@@ -421,20 +421,10 @@ public abstract class BaseEntityExporter implements IEntityExporter {
|
||||
private void sendNotificationMail(String notificationEmail) {
|
||||
|
||||
try {
|
||||
String nomeDitta = Azienda.getDefaultAzienda(multiDBTransactionManager.getPrimaryConnection()).getNomeDitta();
|
||||
|
||||
String mailSubject = String.format("Esportazione di %s - %s (%s)", getType(), getFormat(), nomeDitta);
|
||||
|
||||
URL url = new URL("https://www2.studioml.it/ems-api/mail_models/info_mail.php");
|
||||
InputStream is = url.openStream();
|
||||
String htmlMailBody = IOUtils.toString(is);
|
||||
|
||||
htmlMailBody = htmlMailBody.replaceAll("%%USER%%", "cliente");
|
||||
htmlMailBody = htmlMailBody.replaceAll("%%MESSAGE%%", String.format("come da accordi, l'esportazione %s - %s è stata completata.", getType(), getFormat()));
|
||||
htmlMailBody = htmlMailBody.replaceAll("%%NOME_DITTA%%", nomeDitta);
|
||||
|
||||
MailService mailService = ContextLoader.getCurrentWebApplicationContext().getBean(MailService.class);
|
||||
mailService.sendMailPrimary(null, null, notificationEmail, null, null, mailSubject, htmlMailBody, true, false, null, null, null);
|
||||
mailService.sendInfoMail(multiDBTransactionManager, notificationEmail,
|
||||
String.format("Esportazione di %s - %s", getType(), getFormat()),
|
||||
String.format("come da accordi, l'esportazione %s - %s è stata completata.", getType(), getFormat()));
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -17,7 +17,8 @@ public enum EntityExportType {
|
||||
RAPPORTINI("RAPPORTINI"),
|
||||
VARIAZIONE_PV("VARIAZIONE PV"),
|
||||
LISTINI_ACQUISTO("LISTINI ACQUISTO"),
|
||||
COLLI("COLLI");
|
||||
COLLI("COLLI"),
|
||||
SCADENZE("SCADENZE");
|
||||
|
||||
private String text;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
|
||||
public class TxtMapper<T> {
|
||||
|
||||
private Logger logger = LogManager.getLogger();
|
||||
private final Logger logger = LogManager.getLogger();
|
||||
|
||||
private String fieldsSplitChar = " ";
|
||||
|
||||
@@ -29,20 +29,10 @@ public class TxtMapper<T> {
|
||||
|
||||
|
||||
public String serialize(T object) {
|
||||
|
||||
Class Tclass = object.getClass();
|
||||
Class<?> Tclass = object.getClass();
|
||||
|
||||
List<Field> declaredFields = Arrays.asList(Tclass.getDeclaredFields());
|
||||
|
||||
List<Field> sortedFields = Stream.of(declaredFields)
|
||||
.filter(x -> x.getAnnotation(DtoField.class) != null && x.getAnnotation(DtoField.class).startPosition() >= 0)
|
||||
.sortBy(x -> x.getAnnotation(DtoField.class).startPosition())
|
||||
.toList();
|
||||
|
||||
sortedFields.addAll(Stream.of(declaredFields)
|
||||
.filter(x -> x.getAnnotation(DtoField.class) != null && x.getAnnotation(DtoField.class).startPosition() < 0)
|
||||
.toList());
|
||||
|
||||
List<Field> sortedFields = sortFields(declaredFields);
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
@@ -52,18 +42,7 @@ public class TxtMapper<T> {
|
||||
declaredField.setAccessible(true);
|
||||
|
||||
try {
|
||||
// if(dtoField.startPosition() > stringBuilder.length()) {
|
||||
// int spacesNeeded = dtoField.startPosition() - stringBuilder.length() - 1;
|
||||
// int counter = 0;
|
||||
// do {
|
||||
// stringBuilder.append(" ");
|
||||
// counter ++;
|
||||
// } while (counter < spacesNeeded);
|
||||
//
|
||||
// stringBuilder.append(fieldsSplitChar);
|
||||
// }
|
||||
|
||||
String value = applyDtoAnnotation(declaredField.get(object), dtoField);
|
||||
String value = applyDtoAnnotationForSerialization(declaredField.get(object), dtoField);
|
||||
|
||||
if (value == null) {
|
||||
value = "";
|
||||
@@ -101,7 +80,7 @@ public class TxtMapper<T> {
|
||||
|
||||
public String serialize(List<T> objectList) {
|
||||
|
||||
if (objectList == null || objectList.size() == 0)
|
||||
if (objectList == null || objectList.isEmpty())
|
||||
return null;
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
@@ -109,12 +88,63 @@ public class TxtMapper<T> {
|
||||
for (int i = 0; i < objectList.size(); i++) {
|
||||
stringBuilder.append(serialize(objectList.get(i)));
|
||||
|
||||
if (i < objectList.size() - 1) stringBuilder.append(System.getProperty("line.separator"));
|
||||
if (i < objectList.size() - 1) stringBuilder.append(System.lineSeparator());
|
||||
}
|
||||
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
public T deserialize(String line, Class<T> clazz) {
|
||||
try {
|
||||
T instance = clazz.getDeclaredConstructor().newInstance();
|
||||
List<Field> declaredFields = Arrays.asList(clazz.getDeclaredFields());
|
||||
List<Field> sortedFields = sortFields(declaredFields);
|
||||
|
||||
for (Field field : sortedFields) {
|
||||
DtoField dtoField = field.getAnnotation(DtoField.class);
|
||||
field.setAccessible(true);
|
||||
|
||||
String value = null;
|
||||
if (ignorePosition) {
|
||||
String[] tokens = line.split(fieldsSplitChar);
|
||||
value = tokens[sortedFields.indexOf(field)];
|
||||
} else {
|
||||
int startPosition = dtoField.startPosition();
|
||||
int endPosition = Math.min(line.length(), startPosition + dtoField.maxLength());
|
||||
|
||||
if (startPosition < endPosition && endPosition <= line.length()) {
|
||||
value = line.substring(startPosition, endPosition).trim();
|
||||
}
|
||||
}
|
||||
|
||||
applyDtoAnnotationForDeserialization(field, instance, value, dtoField);
|
||||
}
|
||||
|
||||
return instance;
|
||||
} catch (Exception e) {
|
||||
logger.error("Error during deserialization", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public List<T> deserialize(List<String> lines, Class<T> clazz) {
|
||||
return Stream.of(lines)
|
||||
.map(line -> deserialize(line, clazz))
|
||||
.toList();
|
||||
}
|
||||
|
||||
private List<Field> sortFields(List<Field> declaredFields) {
|
||||
List<Field> sortedFields = Stream.of(declaredFields)
|
||||
.filter(x -> x.getAnnotation(DtoField.class) != null && x.getAnnotation(DtoField.class).startPosition() >= 0)
|
||||
.sortBy(x -> x.getAnnotation(DtoField.class).startPosition())
|
||||
.toList();
|
||||
|
||||
sortedFields.addAll(Stream.of(declaredFields)
|
||||
.filter(x -> x.getAnnotation(DtoField.class) != null && x.getAnnotation(DtoField.class).startPosition() < 0)
|
||||
.toList());
|
||||
|
||||
return sortedFields;
|
||||
}
|
||||
|
||||
public String getFieldsSplitChar() {
|
||||
return fieldsSplitChar;
|
||||
@@ -162,13 +192,11 @@ public class TxtMapper<T> {
|
||||
}
|
||||
|
||||
|
||||
private String applyDtoAnnotation(Object value, DtoField dtoField) {
|
||||
private String applyDtoAnnotationForSerialization(Object value, DtoField dtoField) {
|
||||
if (value != null) {
|
||||
if (!UtilityString.isNullOrEmpty(dtoField.format()) && value instanceof Date) {
|
||||
value = new SimpleDateFormat(dtoField.format()).format(value);
|
||||
} else if (!UtilityString.isNullOrEmpty(dtoField.formula()) && value instanceof BigDecimal) {
|
||||
// String regex = "[0-9]+\\.[0-9]{"+dtoField.scale()+"}+";
|
||||
// if(Pattern.matches(regex, columnValue.toString())
|
||||
value = ((BigDecimal) value).setScale(dtoField.scale(), RoundingMode.HALF_DOWN);
|
||||
String formula = dtoField.formula().replaceAll("this", value.toString());
|
||||
String[] opList = formula.split("\\*");
|
||||
@@ -193,4 +221,29 @@ public class TxtMapper<T> {
|
||||
|
||||
return value != null ? value.toString() : null;
|
||||
}
|
||||
|
||||
private void applyDtoAnnotationForDeserialization(Field field, T instance, String value, DtoField dtoField) throws Exception {
|
||||
if (!UtilityString.isNullOrEmpty(value)) {
|
||||
Class<?> fieldType = field.getType();
|
||||
|
||||
if (fieldType == Integer.class) {
|
||||
field.set(instance, Integer.parseInt(value));
|
||||
} else if (fieldType == BigDecimal.class) {
|
||||
BigDecimal bigDecimalValue = new BigDecimal(value);
|
||||
if (!UtilityString.isNullOrEmpty(dtoField.moltiplicatore())) {
|
||||
bigDecimalValue = bigDecimalValue.divide(new BigDecimal(dtoField.moltiplicatore()));
|
||||
}
|
||||
field.set(instance, bigDecimalValue.setScale(dtoField.scale(), RoundingMode.HALF_DOWN));
|
||||
} else if (fieldType == Boolean.class) {
|
||||
field.set(instance, value.equalsIgnoreCase(defaultBooleanTrueValue));
|
||||
} else if (fieldType == Date.class) {
|
||||
if (!UtilityString.isNullOrEmpty(dtoField.format())) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(dtoField.format());
|
||||
field.set(instance, sdf.parse(value));
|
||||
}
|
||||
} else {
|
||||
field.set(instance, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package it.integry.ems.javabeans;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.json.JSONObjectMapper;
|
||||
import it.integry.ems.json.ResponseJSONObjectMapper;
|
||||
import it.integry.ems.model.IntegryApplicationEnum;
|
||||
import it.integry.ems.user.dto.UserDTO;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
@@ -31,7 +31,7 @@ public class RequestDataDTO {
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Autowired
|
||||
private JSONObjectMapper jsonObjectMapper;
|
||||
private ResponseJSONObjectMapper jsonObjectMapper;
|
||||
|
||||
private String requestURI;
|
||||
private String requestClientIP;
|
||||
@@ -89,9 +89,9 @@ public class RequestDataDTO {
|
||||
}
|
||||
|
||||
if (shouldIncludeNulls()) {
|
||||
jsonObjectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
} else {
|
||||
jsonObjectMapper.setSerializationInclusion(JsonInclude.Include.USE_DEFAULTS);
|
||||
} else {
|
||||
jsonObjectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
package it.integry.ems.json;
|
||||
|
||||
import com.fasterxml.jackson.core.Version;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import it.integry.ems.adapter.*;
|
||||
import it.integry.ems.response.EsitoType;
|
||||
import it.integry.ems.schedule.new_cron_job.controller.AutomatedOperationController;
|
||||
import it.integry.ems.schedule.new_cron_job.dto.operations.base_classes.BaseAutomatedOperationDTO;
|
||||
import it.integry.ems_model.base.ComposedEntityBase;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.resolver.EntitySubTypeHolder;
|
||||
import org.reflections.Reflections;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
public class CommonObjectMapper extends ObjectMapper {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void setupModules(SimpleModule module) {
|
||||
registerModule(module);
|
||||
|
||||
SimpleModule moduleSubType = new SimpleModule("test", Version.unknownVersion());
|
||||
Reflections reflections = new Reflections("it.integry");
|
||||
Set<Class<? extends EntityBase>> clssList = reflections.getSubTypesOf(EntityBase.class);
|
||||
final Set<Class<? extends ComposedEntityBase>> subTypesOfComposed = reflections.getSubTypesOf(ComposedEntityBase.class);
|
||||
clssList.addAll(subTypesOfComposed);
|
||||
for (Class<? extends EntityBase> clazz : clssList) {
|
||||
try {
|
||||
Field f = clazz.getDeclaredField("ENTITY");
|
||||
f.setAccessible(true);
|
||||
String keyType = (String) f.get(null);
|
||||
EntitySubTypeHolder.getMapType().put(keyType, clazz);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
moduleSubType.addAbstractTypeMapping(EntityBase.class, clazz);
|
||||
registerSubtypes(clazz);
|
||||
}
|
||||
registerModule(moduleSubType);
|
||||
}
|
||||
|
||||
protected SimpleModule setupAdapters() {
|
||||
SimpleModule module = new SimpleModule();
|
||||
|
||||
module.addSerializer(Date.class, new JsonDateAdapterSerializer());
|
||||
module.addDeserializer(Date.class, new JsonDateAdapterDeserializer());
|
||||
|
||||
module.addSerializer(LocalDate.class, new JsonLocalDateAdapterSerializer());
|
||||
module.addDeserializer(LocalDate.class, new JsonLocalDateAdapterDeserializer());
|
||||
|
||||
module.addSerializer(LocalDateTime.class, new JsonLocalDateTimeAdapterSerializer());
|
||||
module.addDeserializer(LocalDateTime.class, new JsonLocalDateTimeAdapterDeserializer());
|
||||
|
||||
module.addSerializer(EsitoType.class, new EsitoSerialize());
|
||||
module.addDeserializer(EsitoType.class, new EsitoDeserialize());
|
||||
|
||||
module.addDeserializer(BigDecimal.class, new BigDecimalDeserialize());
|
||||
module.addDeserializer(Integer.class, new IntegerDeserializer());
|
||||
|
||||
module.addDeserializer(String.class, new StringUnicodeDeserialize());
|
||||
|
||||
module.addDeserializer(Boolean.class, new BooleanDeserializer());
|
||||
|
||||
|
||||
module.addDeserializer(BaseAutomatedOperationDTO.class, new AutomatedOperationController.AutomatedOperationsDeserializer());
|
||||
return module;
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package it.integry.ems.json;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
|
||||
import com.fasterxml.jackson.databind.ser.FilterProvider;
|
||||
import com.fasterxml.jackson.databind.ser.PropertyFilter;
|
||||
import com.fasterxml.jackson.databind.ser.PropertyWriter;
|
||||
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
|
||||
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
|
||||
|
||||
public class JSONObjectMapper extends CommonObjectMapper {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public JSONObjectMapper() {
|
||||
SimpleModule module = setupAdapters();
|
||||
|
||||
PropertyFilter theFilter = new SimpleBeanPropertyFilter() {
|
||||
@Override
|
||||
public void serializeAsField(Object pojo, JsonGenerator jgen, SerializerProvider provider,
|
||||
PropertyWriter writer) throws Exception {
|
||||
if (include(writer)) {
|
||||
try {
|
||||
writer.serializeAsField(pojo, jgen, provider);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
} else if (!jgen.canOmitFields()) { // since 2.3
|
||||
writer.serializeAsOmittedField(pojo, jgen, provider);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean include(BeanPropertyWriter writer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean include(PropertyWriter writer) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
FilterProvider filters = new SimpleFilterProvider().addFilter("jsonEntityFilter", theFilter);
|
||||
|
||||
setFilterProvider(filters);
|
||||
|
||||
// setSerializationInclusion(Include.NON_NULL);
|
||||
|
||||
// escape dei caratteri non standard
|
||||
configure(JsonGenerator.Feature.ESCAPE_NON_ASCII, true);
|
||||
|
||||
configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
|
||||
setupModules(module);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package it.integry.ems.json;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
|
||||
import com.fasterxml.jackson.databind.ser.FilterProvider;
|
||||
import com.fasterxml.jackson.databind.ser.PropertyFilter;
|
||||
import com.fasterxml.jackson.databind.ser.PropertyWriter;
|
||||
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
|
||||
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
|
||||
import it.integry.ems_model.annotation.EntityChild;
|
||||
import it.integry.ems_model.annotation.PK;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public class OrdikidsResponseJSONObjectMapper extends CommonObjectMapper {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public OrdikidsResponseJSONObjectMapper() {
|
||||
SimpleModule module = setupAdapters();
|
||||
|
||||
PropertyFilter theFilter = new SimpleBeanPropertyFilter() {
|
||||
@Override
|
||||
public void serializeAsField(Object pojo, JsonGenerator jgen, SerializerProvider provider,
|
||||
PropertyWriter writer) throws Exception {
|
||||
if (include(writer)) {
|
||||
try {
|
||||
if ("operation".equals(writer.getName())) {
|
||||
writer.serializeAsField(pojo, jgen, provider);
|
||||
return;
|
||||
} else {
|
||||
Field f = pojo.getClass().getDeclaredField(writer.getName());
|
||||
if (f != null) {
|
||||
PK pk = f.getAnnotation(PK.class);
|
||||
SqlField sqlField = f.getAnnotation(SqlField.class);
|
||||
EntityChild child = f.getAnnotation(EntityChild.class);
|
||||
if (pk != null || child != null || (sqlField != null && sqlField.isReturned()))
|
||||
writer.serializeAsField(pojo, jgen, provider);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
} else if (!jgen.canOmitFields()) { // since 2.3
|
||||
writer.serializeAsOmittedField(pojo, jgen, provider);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean include(BeanPropertyWriter writer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean include(PropertyWriter writer) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
FilterProvider filters = new SimpleFilterProvider().addFilter("jsonEntityFilter", theFilter);
|
||||
|
||||
setFilterProvider(filters);
|
||||
|
||||
// escape dei caratteri non standard
|
||||
configure(JsonGenerator.Feature.ESCAPE_NON_ASCII, true);
|
||||
|
||||
configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
|
||||
setupModules(module);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package it.integry.ems.json;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
|
||||
@@ -11,21 +12,62 @@ import com.fasterxml.jackson.databind.ser.PropertyFilter;
|
||||
import com.fasterxml.jackson.databind.ser.PropertyWriter;
|
||||
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
|
||||
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
|
||||
import it.integry.ems.adapter.*;
|
||||
import it.integry.ems.response.EsitoType;
|
||||
import it.integry.ems.schedule.new_cron_job.controller.AutomatedOperationController;
|
||||
import it.integry.ems.schedule.new_cron_job.dto.operations.base_classes.BaseAutomatedOperationDTO;
|
||||
import it.integry.ems_model.annotation.EntityChild;
|
||||
import it.integry.ems_model.annotation.PK;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
import it.integry.ems_model.annotation.Table;
|
||||
import it.integry.ems_model.base.ComposedEntityBase;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.resolver.EntitySubTypeHolder;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import org.reflections.Reflections;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ResponseJSONObjectMapper extends CommonObjectMapper {
|
||||
import static org.reflections.scanners.Scanners.SubTypes;
|
||||
|
||||
public class ResponseJSONObjectMapper extends ObjectMapper {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public SimpleModule addDefaultAdapters(SimpleModule module) {
|
||||
module.addSerializer(Date.class, new JsonDateAdapterSerializer());
|
||||
module.addDeserializer(Date.class, new JsonDateAdapterDeserializer());
|
||||
|
||||
module.addSerializer(LocalDate.class, new JsonLocalDateAdapterSerializer());
|
||||
module.addDeserializer(LocalDate.class, new JsonLocalDateAdapterDeserializer());
|
||||
|
||||
module.addSerializer(LocalDateTime.class, new JsonLocalDateTimeAdapterSerializer());
|
||||
module.addDeserializer(LocalDateTime.class, new JsonLocalDateTimeAdapterDeserializer());
|
||||
|
||||
module.addSerializer(EsitoType.class, new EsitoSerialize());
|
||||
module.addDeserializer(EsitoType.class, new EsitoDeserialize());
|
||||
|
||||
module.addDeserializer(BigDecimal.class, new BigDecimalDeserialize());
|
||||
module.addDeserializer(Integer.class, new IntegerDeserializer());
|
||||
|
||||
module.addDeserializer(String.class, new StringUnicodeDeserialize());
|
||||
|
||||
module.addDeserializer(Boolean.class, new BooleanDeserializer());
|
||||
|
||||
|
||||
module.addDeserializer(BaseAutomatedOperationDTO.class, new AutomatedOperationController.AutomatedOperationsDeserializer());
|
||||
return module;
|
||||
}
|
||||
|
||||
|
||||
public ResponseJSONObjectMapper() {
|
||||
SimpleModule module = setupAdapters();
|
||||
|
||||
PropertyFilter theFilter = new SimpleBeanPropertyFilter() {
|
||||
@Override
|
||||
@@ -60,7 +102,7 @@ public class ResponseJSONObjectMapper extends CommonObjectMapper {
|
||||
if (onlyPkMaster && child != null)
|
||||
return;
|
||||
|
||||
if (pk != null || child != null || (sqlField != null && sqlField.isReturned())) {
|
||||
if (pk != null || child != null || (sqlField != null && sqlField.isReturned()) || !onlyPkMaster) {
|
||||
|
||||
writer.serializeAsField(pojo, jgen, provider);
|
||||
}
|
||||
@@ -92,14 +134,41 @@ public class ResponseJSONObjectMapper extends CommonObjectMapper {
|
||||
|
||||
setFilterProvider(filters);
|
||||
|
||||
setSerializationInclusion(Include.NON_NULL);
|
||||
|
||||
// escape dei caratteri non standard
|
||||
configure(JsonGenerator.Feature.ESCAPE_NON_ASCII, true);
|
||||
SimpleModule simpleModule = new SimpleModule();
|
||||
simpleModule = addDefaultAdapters(simpleModule);
|
||||
|
||||
setupEntityModules(simpleModule);
|
||||
registerModule(simpleModule);
|
||||
|
||||
configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
configure(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES, false);
|
||||
configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false);
|
||||
configure(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES, false);
|
||||
// configure(JsonGenerator.Feature.ESCAPE_NON_ASCII, true); // escape dei caratteri non standard
|
||||
|
||||
setupModules(module);
|
||||
setSerializationInclusion(Include.NON_NULL);
|
||||
}
|
||||
|
||||
public void setupEntityModules(SimpleModule module) {
|
||||
|
||||
Reflections reflections = new Reflections("it.integry");
|
||||
final List<AbstractMap.SimpleEntry<String, Class<? extends EntityBase>>> classList = reflections.get(SubTypes.of(EntityBase.class, ComposedEntityBase.class).asClass())
|
||||
.stream()
|
||||
.filter(x -> x.isAnnotationPresent(Table.class))
|
||||
.map(x ->
|
||||
new AbstractMap.SimpleEntry<String, Class<? extends EntityBase>>(
|
||||
x.getAnnotation(Table.class).value(), (Class<? extends EntityBase>) x))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
for (AbstractMap.SimpleEntry<String, Class<? extends EntityBase>> classData : classList) {
|
||||
EntitySubTypeHolder.getMapType().put(classData.getKey(), classData.getValue());
|
||||
|
||||
module.addAbstractTypeMapping(EntityBase.class, classData.getValue());
|
||||
}
|
||||
|
||||
registerSubtypes(classList.stream().map(AbstractMap.SimpleEntry::getValue).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ package it.integry.ems.license;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import it.integry.annotations.PostContextConstruct;
|
||||
import it.integry.ems.datasource.DataSource;
|
||||
import it.integry.ems.json.JSONObjectMapper;
|
||||
import it.integry.ems.json.ResponseJSONObjectMapper;
|
||||
import it.integry.ems.looper.service.LooperService;
|
||||
import it.integry.ems.response.EsitoType;
|
||||
import it.integry.ems.response.ServiceRestResponse;
|
||||
@@ -37,7 +37,7 @@ public class LicenseComponent {
|
||||
private LooperService looperService;
|
||||
|
||||
@Autowired
|
||||
private JSONObjectMapper jsonObjectMapper;
|
||||
private ResponseJSONObjectMapper jsonObjectMapper;
|
||||
|
||||
private final HashMap<String, LicenseStatusDTO> cachedLicenseStatus = new HashMap<>();
|
||||
|
||||
|
||||
@@ -12,12 +12,13 @@ import it.integry.ems.menu.dto.StbTipoAziendaDTO;
|
||||
import it.integry.ems.settings.SettingsController;
|
||||
import it.integry.ems.sync.MultiDBTransaction.AdvancedDataSource;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityDebug;
|
||||
import it.integry.ems.utility.UtilityDirs;
|
||||
import it.integry.ems_model.entity.*;
|
||||
import it.integry.ems_model.entity.Azienda;
|
||||
import it.integry.ems_model.entity.StbMenu;
|
||||
import it.integry.ems_model.entity.StbMenuOpz;
|
||||
import it.integry.ems_model.entity.StbTipoAzienda;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityLocalDate;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -26,8 +27,6 @@ import org.springframework.stereotype.Service;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.sql.Connection;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.List;
|
||||
|
||||
import static it.integry.ems_model.utility.UtilityDB.executeStatement;
|
||||
@@ -95,7 +94,7 @@ public class MenuConfigurationService {
|
||||
final Azienda azienda = Azienda.getDefaultAzienda(connection);
|
||||
int lastMenuUpd = Integer.parseInt(azienda.getLastUpgDbMenu().replace("QM", ""));
|
||||
|
||||
if (menuConfig.getVersion() <= lastMenuUpd)
|
||||
if (lastMenuUpd >= menuConfig.getVersion())
|
||||
return;
|
||||
|
||||
executeStatement(connection, "DELETE FROM stb_menu",
|
||||
@@ -189,7 +188,7 @@ public class MenuConfigurationService {
|
||||
" AND abil.flag_Abil <> 'N') Opz2Abil\n" +
|
||||
" LEFT OUTER JOIN stb_Abil ON stb_Abil.cod_opz = Opz2Abil.cod_parent AND stb_abil.user_name = Opz2Abil.user_name\n" +
|
||||
"WHERE stb_abil.cod_opz IS NULL",
|
||||
"UPDATE azienda SET last_upg_db_menu = " + UtilityDB.valueToString("QM" + menuConfig.getVersion()));
|
||||
"UPDATE azienda SET last_upg_db_menu = " + UtilityDB.valueToString(menuConfig.getVersion()));
|
||||
|
||||
|
||||
connection.commit();
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
package it.integry.ems.metrics.filter;
|
||||
|
||||
import it.integry.ems.metrics.service.MetricService;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@Component
|
||||
public class MetricFilter implements Filter {
|
||||
|
||||
@Autowired
|
||||
private MetricService metricService;
|
||||
|
||||
@Override
|
||||
public void init(final FilterConfig config) throws ServletException {
|
||||
if (metricService == null) {
|
||||
metricService = (MetricService) WebApplicationContextUtils.
|
||||
getRequiredWebApplicationContext(config.getServletContext()).getBean("metricService");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws java.io.IOException, ServletException {
|
||||
final HttpServletRequest httpRequest = ((HttpServletRequest) request);
|
||||
if (!UtilityString.isNullOrEmpty(httpRequest.getServletPath())) {
|
||||
final String req = httpRequest.getServletPath().substring(1);
|
||||
long startTime = System.nanoTime();
|
||||
|
||||
chain.doFilter(request, response);
|
||||
|
||||
double stopTime = System.nanoTime();
|
||||
double execTime = (stopTime - startTime) / 1000000000;
|
||||
// final int status = ((HttpServletResponse) response).getStatus();
|
||||
|
||||
metricService.updateCountTimeForService(req, execTime);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
package it.integry.ems.metrics.service;
|
||||
|
||||
import it.integry.ems.json.JSONObjectMapper;
|
||||
import org.joda.time.LocalDateTime;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.StringWriter;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@Service
|
||||
public class MetricService {
|
||||
|
||||
private static int DAY_HOUR = 24;
|
||||
|
||||
private final ConcurrentMap<String, Integer> barchartCountService;
|
||||
private final ConcurrentMap<String, List<Double>> barchartTimeExecService;
|
||||
|
||||
private final int[] dayHalfHourLoad = new int[DAY_HOUR * 2];
|
||||
|
||||
@Autowired
|
||||
private JSONObjectMapper jsonObjectMapper;
|
||||
|
||||
private Integer totCount = 0;
|
||||
private AtomicInteger totCountHalfHour = new AtomicInteger(0);
|
||||
private AtomicInteger idxArray;
|
||||
|
||||
private SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
|
||||
|
||||
public MetricService() {
|
||||
barchartCountService = new ConcurrentHashMap<>();
|
||||
barchartTimeExecService = new ConcurrentHashMap<>();
|
||||
}
|
||||
|
||||
public void updateCountTimeForService(String serviceName, Double timeExec) {
|
||||
|
||||
if(!serviceName.startsWith("metric") &&
|
||||
!serviceName.startsWith("js") &&
|
||||
!serviceName.startsWith("font") &&
|
||||
!serviceName.startsWith("assets") &&
|
||||
!serviceName.startsWith("css") &&
|
||||
!serviceName.startsWith("index.html") &&
|
||||
!serviceName.endsWith("favicon.ico") &&
|
||||
!serviceName.endsWith("/status") &&
|
||||
!serviceName.contains("system/ok") &&
|
||||
!serviceName.contains("logs")){
|
||||
|
||||
String[] hourMin = sdf.format(new Date()).split(":");
|
||||
idxArray = new AtomicInteger(Integer.parseInt(hourMin[0]));
|
||||
|
||||
int incr = 0;
|
||||
if (Integer.parseInt(hourMin[1]) > 29) {
|
||||
incr = 1;
|
||||
totCountHalfHour.getAndSet(0);
|
||||
}
|
||||
|
||||
totCountHalfHour.getAndIncrement();
|
||||
|
||||
dayHalfHourLoad[idxArray.get() * 2 + incr] = totCountHalfHour.get();
|
||||
|
||||
totCount++;
|
||||
|
||||
Integer count = barchartCountService.get(serviceName);
|
||||
|
||||
if (count == null)
|
||||
count = 0;
|
||||
|
||||
count++;
|
||||
barchartCountService.put(serviceName, count);
|
||||
|
||||
List<Double> list = barchartTimeExecService.get(serviceName);
|
||||
|
||||
if (list == null)
|
||||
list = new ArrayList<>();
|
||||
list.add(timeExec);
|
||||
barchartTimeExecService.put(serviceName, list);
|
||||
}
|
||||
}
|
||||
|
||||
public String getJsonCountMetric() throws Exception {
|
||||
StringWriter sw = new StringWriter();
|
||||
jsonObjectMapper.writeValue(sw, barchartCountService);
|
||||
|
||||
return sw.toString();
|
||||
}
|
||||
|
||||
public void resetMetric() {
|
||||
totCount = 0;
|
||||
barchartCountService.clear();
|
||||
barchartTimeExecService.clear();
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,8 @@ import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.reflections.scanners.Scanners.SubTypes;
|
||||
|
||||
@Component
|
||||
public class MigrationComponent {
|
||||
|
||||
@@ -60,11 +62,12 @@ public class MigrationComponent {
|
||||
public void init() {
|
||||
Reflections reflections = new Reflections("it.integry.ems.migration.model");
|
||||
|
||||
allMigrationsList = new ArrayList<>(Stream.of(reflections.getSubTypesOf(MigrationModelInterface.class))
|
||||
.map(x -> x)
|
||||
allMigrationsList = reflections.get(SubTypes.of(MigrationModelInterface.class).asClass())
|
||||
.stream()
|
||||
.map(x -> (Class<? extends MigrationModelInterface>) x)
|
||||
.filter(x -> !Modifier.isAbstract(x.getModifiers()))
|
||||
.sortBy(Class::getSimpleName)
|
||||
.toList());
|
||||
.sorted(Comparator.comparing(Class::getSimpleName))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (UtilityDebug.isDebugExecution())
|
||||
return;
|
||||
@@ -161,7 +164,12 @@ public class MigrationComponent {
|
||||
.setSkipped(false);
|
||||
stbMigrationStatus.setOperation(OperationType.INSERT);
|
||||
} else {
|
||||
stbMigrationStatus.setCompleted(true);
|
||||
stbMigrationStatus
|
||||
.setCompleted(true);
|
||||
if (UtilityDebug.isDebugExecution())
|
||||
stbMigrationStatus
|
||||
.setErrorMessage(EmsRestConstants.NULL);
|
||||
|
||||
stbMigrationStatus.setOperation(OperationType.UPDATE);
|
||||
}
|
||||
|
||||
@@ -263,7 +271,7 @@ public class MigrationComponent {
|
||||
"La migrazione " + migrationCode + " non è andata a buon fine sul DB " + advancedDataSource.getProfileName() + ". Controllare il log per ulteriori dettagli.",
|
||||
e, new Date());
|
||||
} catch (Exception ex) {
|
||||
logger.error("MigrationService - Mail", e);
|
||||
logger.error("MigrationService - Mail", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ import it.integry.ems.sync.MultiDBTransaction.AdvancedDataSource;
|
||||
import it.integry.ems.utility.UtilityDebug;
|
||||
import it.integry.ems_model.entity.Azienda;
|
||||
import it.integry.ems_model.entity.StbGestSetup;
|
||||
import it.integry.ems_model.entity.StbGestSetupQuery;
|
||||
import it.integry.ems_model.entity.StbGestSync;
|
||||
import it.integry.ems_model.exception.DataConverterNotFoundException;
|
||||
import it.integry.ems_model.rulescompleting.DroolsDataCompleting;
|
||||
import it.integry.ems_model.types.ApplicationName;
|
||||
@@ -17,6 +19,7 @@ import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.Query;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import it.integry.ems_model.utility.dto.IndexTableDTO;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
@@ -64,13 +67,11 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
}
|
||||
|
||||
protected void executeStatement(Connection connection, String... sqls) throws SQLException {
|
||||
Statement statement = connection.createStatement();
|
||||
|
||||
for (String sql : sqls) {
|
||||
statement.execute(sql);
|
||||
try (Statement statement = connection.createStatement()) {
|
||||
for (String sql : sqls) {
|
||||
statement.execute(sql);
|
||||
}
|
||||
}
|
||||
|
||||
statement.close();
|
||||
}
|
||||
|
||||
protected long executeInsertStatement(String sql) throws SQLException {
|
||||
@@ -100,6 +101,10 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
alterObject(SqlObjectTypeEnum.FUNCTION, objectName, createFunctionSql);
|
||||
}
|
||||
|
||||
protected void dropFunction(String objectName) throws SQLException, IOException {
|
||||
dropObject(SqlObjectTypeEnum.FUNCTION, objectName);
|
||||
}
|
||||
|
||||
protected void createOrUpdateView(String objectName, String createViewSql) throws SQLException, IOException {
|
||||
alterObject(SqlObjectTypeEnum.VIEW, objectName, createViewSql);
|
||||
}
|
||||
@@ -118,6 +123,15 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
sql);
|
||||
}
|
||||
|
||||
private void dropObject(SqlObjectTypeEnum sqlObject, String objectName) throws SQLException, IOException {
|
||||
executeStatement("IF EXISTS (SELECT * FROM SYSOBJECTS WHERE id = object_id('" + objectName + "'))\r\n" +
|
||||
"\tDROP " + sqlObject.toString() + " " + objectName);
|
||||
}
|
||||
|
||||
protected void createIndex(IndexTableDTO indexTableDTO) throws Exception {
|
||||
UtilityDB.createIndex(advancedDataSource.getConnection(), indexTableDTO );
|
||||
}
|
||||
|
||||
|
||||
protected boolean existsColumn(String tableName, String columnName) throws SQLException, IOException {
|
||||
String schema = null;
|
||||
@@ -153,9 +167,10 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
" AND OBJECT_NAME(id) = %s\n" +
|
||||
" AND cdefault <> 0", columnName, tableName));
|
||||
if (!existDefault)
|
||||
executeStatement(Query.format("ALTER TABLE dbo." + tableName + " ADD DEFAULT (%s) FOR "+ columnName, defaultValue));
|
||||
executeStatement(Query.format("ALTER TABLE dbo." + tableName + " ADD DEFAULT (%s) FOR " + columnName, defaultValue));
|
||||
}
|
||||
|
||||
|
||||
protected boolean existsTable(String tableName) throws SQLException, IOException {
|
||||
String schema = null;
|
||||
if (tableName.contains(".")) {
|
||||
@@ -177,13 +192,20 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
executeStatement(dropSql);
|
||||
}
|
||||
|
||||
protected void createSetupQuery(String codQuery, String name, String query) throws SQLException, IOException {
|
||||
if (UtilityString.isNullOrEmpty(codQuery)) {
|
||||
executeStatement(Query.format("EXEC sp_insertQuerySetup %s", query));
|
||||
return;
|
||||
}
|
||||
String sql = Query.format("SELECT cast(count(*) as bit) FROM stb_gest_setup_query WHERE cod_query = %s", codQuery);
|
||||
boolean existQuery = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(advancedDataSource.getConnection(), sql);
|
||||
|
||||
protected void createSetupQuery(String codQuery, String name, String query, boolean override) throws SQLException, IOException {
|
||||
if(override)
|
||||
executeStatement(Query.format("DELETE FROM stb_gest_setup_query WHERE cod_query = %s", codQuery));
|
||||
|
||||
executeStatement(Query.format("INSERT INTO stb_gest_setup_query (cod_query, query_default, description)"+
|
||||
" VALUES (%s, %s, %s);", codQuery, query, name));
|
||||
if (existQuery)
|
||||
executeStatement(Query.format("UPDATE stb_gest_setup_query SET query_default = %S, description = %S WHERE cod_query = %s ",
|
||||
query, name, codQuery));
|
||||
else
|
||||
executeStatement(Query.format("INSERT INTO stb_gest_setup_query (cod_query, query_default, description)" +
|
||||
" VALUES (%s, %s, %s);", codQuery, query, name));
|
||||
}
|
||||
|
||||
protected boolean existsSetup(String gestName, String section, String keySection) throws SQLException, IOException {
|
||||
@@ -195,6 +217,13 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(advancedDataSource.getConnection(), sql);
|
||||
}
|
||||
|
||||
protected boolean existsSetupQuery(String codQuery) throws SQLException, IOException {
|
||||
String sql = Query.format("SELECT CAST(COUNT(*) AS BIT) AS exist FROM " + StbGestSetupQuery.ENTITY +
|
||||
" WHERE cod_query = %s", codQuery);
|
||||
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(advancedDataSource.getConnection(), sql);
|
||||
}
|
||||
|
||||
protected void createSetup(String gestName, String section, String keySection, String value, String description, String codQuery) throws Exception {
|
||||
if (existsSetup(gestName, section, keySection))
|
||||
return;
|
||||
@@ -254,12 +283,27 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
ps.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
protected void createSetup(String gestName, String section, String keySection, String value, String description, boolean flagSync,
|
||||
String codQuery, boolean flagUserView, boolean flagSetupDepo, boolean flagSetupUserWeb,
|
||||
boolean flagTipoJson, boolean flagTipoColore, String tipoSetup, boolean flagMultiValue ) throws Exception {
|
||||
if (existsSetup(gestName, section, keySection))
|
||||
boolean flagTipoJson, boolean flagTipoColore, String tipoSetup, boolean flagMultiValue) throws Exception {
|
||||
createSetup(gestName, section, keySection, value, description, flagSync, codQuery, flagUserView, flagSetupDepo,
|
||||
flagSetupUserWeb, flagTipoJson, flagTipoColore, tipoSetup, flagMultiValue, null);
|
||||
}
|
||||
|
||||
protected void createSetup(String gestName, String section, String keySection, String value, String description, boolean flagSync,
|
||||
String codQuery, boolean flagUserView, boolean flagSetupDepo, boolean flagSetupUserWeb,
|
||||
boolean flagTipoJson, boolean flagTipoColore, String tipoSetup, boolean flagMultiValue,
|
||||
String query) throws Exception {
|
||||
|
||||
if (!UtilityDebug.isDebugExecution() && existsSetup(gestName, section, keySection))
|
||||
return;
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(query) && UtilityString.isNullOrEmpty(codQuery)) {
|
||||
codQuery = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(advancedDataSource.getConnection(),
|
||||
Query.format("SELECT cod_query FROM stb_gest_setup_query WHERE query_default = %s", query));
|
||||
}
|
||||
|
||||
String insertSql = "INSERT INTO " + StbGestSetup.ENTITY +
|
||||
" (gest_name, section, key_section, value, description, flag_sync, query_default,\n" +
|
||||
"flag_user_view, flag_setup_depo, flag_setup_user_web,\n" +
|
||||
@@ -271,13 +315,13 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
ps.setString(3, keySection);
|
||||
ps.setString(4, value);
|
||||
ps.setString(5, description);
|
||||
ps.setString(6, (flagSync?"S":"N"));
|
||||
ps.setString(6, (flagSync ? "S" : "N"));
|
||||
ps.setString(7, codQuery);
|
||||
ps.setString(8, (flagUserView?"S":"N"));
|
||||
ps.setString(9, (flagSetupDepo?"S":"N"));
|
||||
ps.setString(10, (flagSetupUserWeb?"S":"N"));
|
||||
ps.setString(11, (flagTipoJson?"S":"N"));
|
||||
ps.setString(12, (flagTipoColore?"S":"N"));
|
||||
ps.setString(8, (flagUserView ? "S" : "N"));
|
||||
ps.setString(9, (flagSetupDepo ? "S" : "N"));
|
||||
ps.setString(10, (flagSetupUserWeb ? "S" : "N"));
|
||||
ps.setString(11, (flagTipoJson ? "S" : "N"));
|
||||
ps.setString(12, (flagTipoColore ? "S" : "N"));
|
||||
ps.setString(13, tipoSetup);
|
||||
ps.setBoolean(14, flagMultiValue);
|
||||
|
||||
@@ -296,17 +340,60 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
}
|
||||
|
||||
protected void updateSetupValue(String gestName, String section, String keySection, String newValue) throws Exception {
|
||||
this.updateSetupValue(gestName, section, keySection, newValue, null, null, null,
|
||||
null, null, null, null, null, null, null);
|
||||
}
|
||||
|
||||
protected void updateSetupValue(String gestName, String section, String keySection, String newValue, String description, Boolean flagSync,
|
||||
String codQuery, Boolean flagUserView, Boolean flagSetupDepo, Boolean flagSetupUserWeb,
|
||||
Boolean flagTipoJson, Boolean flagTipoColore, String tipoSetup, Boolean flagMultiValue) throws Exception {
|
||||
this.updateSetupValue(gestName, section, keySection, newValue, description, flagSync, codQuery, flagUserView, flagSetupDepo,
|
||||
flagSetupUserWeb, flagTipoJson, flagTipoColore, tipoSetup, flagMultiValue, null);
|
||||
}
|
||||
|
||||
protected void updateSetupValue(String gestName, String section, String keySection, String newValue, String description, Boolean flagSync,
|
||||
String codQuery, Boolean flagUserView, Boolean flagSetupDepo, Boolean flagSetupUserWeb,
|
||||
Boolean flagTipoJson, Boolean flagTipoColore, String tipoSetup, Boolean flagMultiValue,
|
||||
String query) throws Exception {
|
||||
if (!UtilityString.isNullOrEmpty(query) && UtilityString.isNullOrEmpty(codQuery)) {
|
||||
codQuery = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(advancedDataSource.getConnection(),
|
||||
Query.format("SELECT cod_query FROM stb_gest_setup_query WHERE query_default = %s", query));
|
||||
}
|
||||
|
||||
StbGestSetup stbGestSetup = new StbGestSetup()
|
||||
.setGestName(gestName)
|
||||
.setSection(section)
|
||||
.setKeySection(keySection)
|
||||
.setValue(newValue);
|
||||
.setValue(newValue)
|
||||
.setDescription(description)
|
||||
.setCodQuery(codQuery)
|
||||
.setTipoSetup(tipoSetup);
|
||||
|
||||
if (flagSync != null)
|
||||
stbGestSetup.setFlagSync(flagSync ? "S" : "N");
|
||||
|
||||
if (flagUserView != null)
|
||||
stbGestSetup.setFlagUserView(flagUserView ? "S" : "N");
|
||||
|
||||
if (flagSetupDepo != null)
|
||||
stbGestSetup.setFlagSetupDepo(flagSetupDepo ? "S" : "N");
|
||||
|
||||
if (flagSetupUserWeb != null)
|
||||
stbGestSetup.setFlagSetupUserWeb(flagSetupUserWeb ? "S" : "N");
|
||||
|
||||
if (flagTipoJson != null)
|
||||
stbGestSetup.setFlagTipoJson(flagTipoJson ? "S" : "N");
|
||||
|
||||
if (flagTipoColore != null)
|
||||
stbGestSetup.setFlagTipoColore(flagTipoColore ? "S" : "N");
|
||||
|
||||
if (flagMultiValue != null)
|
||||
stbGestSetup.setFlagMultiValue(flagMultiValue);
|
||||
|
||||
stbGestSetup.setOperation(OperationType.UPDATE);
|
||||
stbGestSetup.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
}
|
||||
|
||||
|
||||
protected void addAutomatedOperation(BaseScheduledOperationDTO operation) {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
@@ -364,4 +451,32 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
return currentAzienda.getApplicationNameEnum() == ApplicationName.TEXTILES;
|
||||
}
|
||||
|
||||
protected boolean isDMS() throws SQLException, IOException, DataConverterNotFoundException, InstantiationException, IllegalAccessException {
|
||||
Azienda currentAzienda = Azienda.getDefaultAzienda(advancedDataSource.getConnection());
|
||||
return currentAzienda.getApplicationNameEnum() == ApplicationName.DMS;
|
||||
}
|
||||
|
||||
protected void enableSaveToRest(String gestName) throws Exception {
|
||||
boolean existRow =
|
||||
UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(advancedDataSource.getConnection(),
|
||||
Query.format("SELECT cast(count(*) as bit) FROM stb_gest_sync WHERE gest_name = %s", gestName));
|
||||
|
||||
StbGestSync gestSync =
|
||||
new StbGestSync()
|
||||
.setGestName(gestName)
|
||||
.setSyncronize("R");
|
||||
if (existRow) {
|
||||
gestSync.setOperation(OperationType.UPDATE);
|
||||
} else{
|
||||
String entityName =
|
||||
UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(advancedDataSource.getConnection(),
|
||||
Query.format("SELECT entity_name FROM stb_menu_opz WHERE gest_name = %s", gestName));
|
||||
gestSync.setEntityName(entityName);
|
||||
gestSync.setOperation(OperationType.INSERT);
|
||||
}
|
||||
|
||||
|
||||
gestSync.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ public enum IntegryCustomer {
|
||||
IntegryCustomerDB.Didonna_Diba,
|
||||
IntegryCustomerDB.Didonna_MediimpexLiq,
|
||||
IntegryCustomerDB.Didonna_DibaLiq),
|
||||
|
||||
DMS(IntegryCustomerDB.Siciliani_DMS),
|
||||
DolceBonta(IntegryCustomerDB.DolceBonta_DolceBo,
|
||||
IntegryCustomerDB.DolceBonta_Emanuela),
|
||||
Dulciar(IntegryCustomerDB.Dulciar_Dulciar,
|
||||
@@ -66,6 +68,7 @@ public enum IntegryCustomer {
|
||||
Igood(IntegryCustomerDB.Igood_Igood,
|
||||
IntegryCustomerDB.Igood_ShopService),
|
||||
Ime(IntegryCustomerDB.Ime_ImeTe),
|
||||
Integry(IntegryCustomerDB.Integry_Studioml),
|
||||
Ivr(IntegryCustomerDB.Ivr_Vetta, IntegryCustomerDB.Ivr_Varci),
|
||||
Lamonarca(IntegryCustomerDB.Lamonarca_Lamonarca),
|
||||
Levanplast(IntegryCustomerDB.Levanplast_Levanplast,
|
||||
|
||||
@@ -52,6 +52,7 @@ public enum IntegryCustomerDB {
|
||||
Didonna_MediimpexLiq("mediimpexliq"),
|
||||
Didonna_DibaLiq("dibaliq"),
|
||||
|
||||
Siciliani_DMS("DMS"),
|
||||
|
||||
DolceBonta_DolceBo("dolce_bo"),
|
||||
DolceBonta_Emanuela("emanuela"),
|
||||
@@ -96,6 +97,9 @@ public enum IntegryCustomerDB {
|
||||
Ime_ImeTe("ime_te"),
|
||||
|
||||
|
||||
Integry_Studioml("studioml"),
|
||||
|
||||
|
||||
Ivr_Vetta("vetta"),
|
||||
Ivr_Varci("varci"),
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ public class Migration_20240314133221 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetupQuery("TIPI_DEPO", "Tipi deposito", "SELECT cod_tipo_depo FROM mtb_depo_tipi", true);
|
||||
createSetupQuery("TIPI_DEPO", "Tipi deposito", "SELECT cod_tipo_depo FROM mtb_depo_tipi");
|
||||
|
||||
createSetup("PVM", "PIAN_ACC_ROSSG", "TIPI_DEPO_LAV", null,
|
||||
"Identifica i tipi di deposito dove è possibile far arrivare la materia prima per la produzione.",
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240408145448 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetupQuery("A_C",null,"SELECT 'A|Anagrafica' UNION ALL SELECT 'C|Consumi'");
|
||||
createSetupQuery("ACTIVITY_TYPE","Tipo attività","select activity_type_id from stb_activity_type where flag_tipologia = 'A' and flag_attiva = 'S'");
|
||||
createSetupQuery("ATTACH_LIBERI","Allegati liberi","SELECT stb_files_attached.id_attach, stb_files_attached.file_name, stb_files_attached.user_name, stb_files_attached.description, stb_files_attached.datetime_attach, stb_files_attached.file_size FROM stb_files_attached LEFT OUTER JOIN mrl_partita_mag_attached ON stb_files_attached.id_attach = mrl_partita_mag_attached.id_attach LEFT OUTER JOIN drl_ord_attached ON stb_files_attached.id_attach = drl_ord_attached.id_attach LEFT OUTER JOIN drl_doc_attached ON stb_files_attached.id_attach = drl_doc_attached.id_attach WHERE stb_files_attached.data_doc IS NULL AND stb_files_attached.num_doc IS NULL AND parent_id_attach IS NULL AND mrl_partita_mag_attached.id_attach IS NULL AND mrl_partita_mag_attached.id_attach IS NULL AND mrl_partita_mag_attached.id_attach IS NULL AND flag_lock = 'N' AND file_size > 0 ORDER BY stb_files_attached.file_name");
|
||||
createSetupQuery("COD_ALIQ","Aliquota","SELECT cod_aliq FROM gtb_aliq ORDER BY 1");
|
||||
createSetupQuery("COD_ANAG_CLIE","Cod. cliente","SELECT gtb_anag.cod_anag FROM gtb_anag INNER JOIN vtb_clie ON gtb_anag.cod_anag = vtb_clie.cod_anag AND vtb_clie.flag_stato = 'A' ORDER BY 1");
|
||||
createSetupQuery("COD_ANAG_FORN","Cod. fornitore","SELECT gtb_anag.cod_anag FROM gtb_anag INNER JOIN atb_forn ON gtb_anag.cod_anag = atb_forn.cod_anag AND atb_forn.flag_stato = 'A' ORDER BY 1");
|
||||
createSetupQuery("COD_ATIP","Tipo fornitore","SELECT cod_atip FROM atb_tipi ORDER BY 1");
|
||||
createSetupQuery("COD_CCAU","Causale contabile","SELECT cod_ccau FROM ctb_caus ORDER BY 1");
|
||||
createSetupQuery("COD_DTIP","Tipo Doc.","SELECT cod_dtip FROM dtb_tipi order by 1");
|
||||
createSetupQuery("COD_DTIP_A","Tipo Doc. Acq.","select cod_dtip from dtb_tipi where gestione = 'A' order by 1");
|
||||
createSetupQuery("COD_DTIP_L","Tipo Doc. Lav.","select cod_dtip from dtb_tipi where gestione = 'L' order by 1");
|
||||
createSetupQuery("COD_DTIP_L_CAR",null,"SELECT cod_dtip FROM dtb_tipi WHERE gestione = 'L' AND ( segno_qta_car > 0 OR segno_qta_scar < 0 )");
|
||||
createSetupQuery("COD_DTIP_L_SCAR",null,"SELECT cod_dtip FROM dtb_tipi WHERE gestione = 'L' AND ( segno_qta_car < 0 or segno_qta_scar > 0 )");
|
||||
createSetupQuery("COD_DTIP_V","Selezione tipo documento di vendita","select cod_dtip from dtb_tipi where gestione = 'V' and tipo_emissione = 'DIRETTA' order by 1");
|
||||
createSetupQuery("COD_JCOM","Commessa","SELECT cod_jcom FROM jtb_comt ORDER BY 1");
|
||||
createSetupQuery("COD_JFAS","Cod. fase","SELECT cod_jfas FROM jtb_fasi WHERE flag_attivo = 'S' ORDER BY 1");
|
||||
createSetupQuery("COD_JFLAV",null,"select cod_jflav from jtb_flav");
|
||||
createSetupQuery("COD_MDEP","Tutti i depositi","SELECT cod_mdep FROM mtb_depo ORDER BY 1");
|
||||
createSetupQuery("COD_MGRP","Gruppi merceologici","select cod_mgrp from mtb_grup");
|
||||
createSetupQuery("COD_PAGA","Tipo pagamento","SELECT cod_paga FROM gtb_paga WHERE flag_attivo = 'S' ORDER BY 1");
|
||||
createSetupQuery("COD_SPES","Cod. spesa","SELECT cod_spes FROM gtb_spes ORDER BY 1");
|
||||
createSetupQuery("COD_VAGE",null,"select cod_vage + '|'+ cod_vage + ' - ' + rag_soc from vtb_agen where data_fine_rap is null order by rag_soc");
|
||||
createSetupQuery("COD_VLIS",null,"SELECT cod_vlis FROM vtb_list WHERE flag_attivo = 'S'");
|
||||
createSetupQuery("COD_VVET",null,"select cod_vvet + '|'+rag_soc from vtb_vett");
|
||||
createSetupQuery("EQUI_PREZZO_VEN",null,"SELECT 'N|NON EQUIVALENTE NEL PREZZO' UNION ALL SELECT 'B|EQUIVALENTE NEL PREZZO BASE' UNION ALL SELECT 'V|EQUIVALENTE NEL PREZZO DI VENDITA' UNION ALL SELECT 'R|EQUIVALENTE NEL RICARICO' UNION ALL SELECT 'P|EQUIVALENTE NEL RICARICO E PREZZO DI VENDITA' UNION ALL SELECT 'T|EQUIVALENTE NEL PREZZO BASE, RICARICO E PREZZO DI VENDITA'");
|
||||
createSetupQuery("FLAG_3_STATI","flag con tre stati","SELECT 0 UNION ALL SELECT 1 UNION ALL SELECT 2");
|
||||
createSetupQuery("GRIGLIA_AGENTI",null,"SELECT DISTINCT cod_vage FROM vtb_agen_group");
|
||||
createSetupQuery("GRUPPI_UTENTI_W",null,"SELECT key_group, UPPER(user_group) FROM wtb_user_groups ORDER BY key_group");
|
||||
createSetupQuery("I_P",null,"SELECT 'I|INSERISCI' UNION ALL SELECT 'P|STAMPA'");
|
||||
createSetupQuery("LOAD_BOLLE_DESC",null,"select 'D|DATI DESTINATARIO' UNION ALL select 'O|ORDINE INTERNO + ORDINE CLIENTE'");
|
||||
createSetupQuery("MEZZO",null,"select mezzo from gtb_mezzo");
|
||||
createSetupQuery("PORTO",null,"select porto from gtb_porto");
|
||||
createSetupQuery("PRINTER_NAME","Nome stampante","SELECT name FROM stb_printers order by 1");
|
||||
createSetupQuery("PROCESSO",null,"select activity_type_id FROM stb_activity_type WHERE flag_attiva = 'S' AND flag_tipologia = 'P'");
|
||||
createSetupQuery("REPORT_NAME","Nome report","SELECT report_name FROM wtb_jrept ORDER BY 1");
|
||||
createSetupQuery("SI_NO","Flag S/N","SELECT 'S' UNION ALL SELECT 'N'");
|
||||
createSetupQuery("SIGNUP_MODE",null,"select 'MAILONLY', 'MAILONLY' UNION ALL SELECT 'CODANAG_PARTIVA', 'CODANAG_PARTIVA' UNION ALL SELECT 'REGISTRAZIONE_CLIENTI', 'REGISTRAZIONE_CLIENTI'");
|
||||
createSetupQuery("STATO_COMMESSA","Stato commessa","SELECT stato_commessa FROM jtb_com_stato WHERE flag_attivo = 'S' ORDER BY 1");
|
||||
createSetupQuery("STORED_PROCEDUR",null,"SELECT name FROM SYSOBJECTS WHERE XTYPE = 'p' AND category = 0 order BY name");
|
||||
createSetupQuery("TIPI_DEPO","Tipi deposito","SELECT cod_tipo_depo FROM mtb_depo_tipi");
|
||||
createSetupQuery("TIPO_CALC_TRASP",null,"SELECT 'PESO' UNION ALL SELECT 'COLLI'");
|
||||
createSetupQuery("TRUE_FALSE",null,"SELECT 'true' union all select 'false'");
|
||||
createSetupQuery("UNITA_MISURA",null,"select unt_mis from mtb_unt_mis where flag_attivo = 'S'");
|
||||
createSetupQuery("VAL_SCARICHI",null,"SELECT 'C|Costo ultimo' UNION ALL SELECT 'V|Valore vendita'");
|
||||
createSetupQuery("VAR_CAMPI_LIBER",null,"SELECT 'P|POSIZIONE ARTICOLO' UNION ALL SELECT 'M|MEDIA SETTIMANALE VENDITE'");
|
||||
createSetupQuery("YES_NO","","SELECT 'Yes' UNION SELECT 'No'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +1,21 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.entity_logger.db_schema_manager.component.SQLServerDBSchemaManager;
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240408151802 extends BaseMigration implements MigrationModelInterface {
|
||||
import java.util.List;
|
||||
|
||||
public class Migration_20240408151803 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.Tosca,
|
||||
if (isCustomer(
|
||||
IntegryCustomer.Tosca,
|
||||
IntegryCustomer.Biolevante,
|
||||
IntegryCustomer.Cosmapack,
|
||||
IntegryCustomer.Dulciar,
|
||||
@@ -23,11 +27,16 @@ public class Migration_20240408151802 extends BaseMigration implements Migration
|
||||
IntegryCustomer.ResinaColor,
|
||||
IntegryCustomer.Ivr,
|
||||
IntegryCustomer.Sardinya,
|
||||
IntegryCustomer.Didonna))
|
||||
{
|
||||
IntegryCustomer.Didonna,
|
||||
IntegryCustomer.Smetar)) {
|
||||
updateSetupValue("DATI_AZIENDA", "SETUP", "DELIMITED_IDENTIFIER", "1");
|
||||
updateSetupValue("DATI_AZIENDA", "SETUP", "FLAG_ANSI_PADDING", "S");
|
||||
updateSetupValue("DATI_AZIENDA", "SETUP", "FLAG_CONCAT_NULL_YIELDS_NULL", "S");
|
||||
|
||||
SQLServerDBSchemaManager schemaManager = new SQLServerDBSchemaManager(this.advancedDataSource.getConnection());
|
||||
final List<String> queries = schemaManager.generateAlterTableToDisableAnsiPadding();
|
||||
|
||||
//executeStatement(queries.toArray(new String[0]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240409102838 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("ALTER TABLE ctb_beni ALTER COLUMN descrizione varchar(1024)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240409131537 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
createOrUpdateView("cvw_saldiAnagAnno", "CREATE view cvw_saldiAnagAnno as \n" +
|
||||
"select cod_anag, cod_ccon, anno_comp, sum(saldo_iniz) as saldo_iniz, sum(dare) as dare, sum(avere) as avere from (\n" +
|
||||
"SELECT ctb_movr.cod_anag,\n" +
|
||||
" ctb_movr.cod_ccon,\n" +
|
||||
" ctb_movt.anno_comp,\n" +
|
||||
" 0 AS saldo_iniz,\n" +
|
||||
" SUM(imp_dare) AS dare,\n" +
|
||||
" SUM(imp_avere) AS avere\n" +
|
||||
"FROM ctb_anag,\n" +
|
||||
" ctb_caus,\n" +
|
||||
" ctb_movr,\n" +
|
||||
" ctb_movt\n" +
|
||||
"WHERE (ctb_caus.cod_ccau = ctb_movr.cod_ccau)\n" +
|
||||
" AND (ctb_anag.cod_anag = ctb_movr.cod_anag)\n" +
|
||||
" AND (ctb_anag.cod_ccon = ctb_movr.cod_ccon)\n" +
|
||||
" AND (ctb_movt.num_cmov = ctb_movr.num_cmov)\n" +
|
||||
" AND ((ctb_caus.flag_ap_ch <> 'A' AND ctb_caus.flag_ap_ch <> 'F'))\n" +
|
||||
"GROUP BY ctb_movr.cod_anag, ctb_movr.cod_ccon, ctb_movt.anno_comp\n" +
|
||||
"UNION\n" +
|
||||
"SELECT ctb_movr.cod_anag,\n" +
|
||||
" ctb_movr.cod_ccon,\n" +
|
||||
" ctb_movt.anno_comp,\n" +
|
||||
" SUM(imp_dare - imp_avere) AS saldo_iniz,\n" +
|
||||
" 0 AS dare,\n" +
|
||||
" 0 AS avere\n" +
|
||||
"FROM ctb_anag,\n" +
|
||||
" ctb_caus,\n" +
|
||||
" ctb_movr,\n" +
|
||||
" ctb_movt\n" +
|
||||
"WHERE (ctb_caus.cod_ccau = ctb_movr.cod_ccau)\n" +
|
||||
" AND (ctb_anag.cod_anag = ctb_movr.cod_anag)\n" +
|
||||
" AND (ctb_anag.cod_ccon = ctb_movr.cod_ccon)\n" +
|
||||
" AND (ctb_movt.num_cmov = ctb_movr.num_cmov)\n" +
|
||||
" AND ((ctb_caus.flag_ap_ch = 'A'))\n" +
|
||||
"GROUP BY ctb_movr.cod_anag, ctb_movr.cod_ccon, ctb_movt.anno_comp\n" +
|
||||
") t \n" +
|
||||
"group by cod_anag, cod_ccon, anno_comp");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user