133 Commits

Author SHA1 Message Date
945391fb89 Merge pull request 'develop' (#275) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 53s
Reviewed-on: #275
2026-07-28 13:30:27 +00:00
87306e6c42 Merge pull request 'develop' (#273) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 52s
Reviewed-on: #273
2026-07-27 16:57:36 +00:00
121ac58f51 Merge pull request 'develop' (#271) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 55s
Reviewed-on: #271
2026-07-27 16:19:28 +00:00
9e652e2acc Merge pull request 'develop' (#269) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 54s
Reviewed-on: #269
2026-07-24 16:03:26 +00:00
dd8891a3fb Merge pull request 'develop' (#267) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 55s
Reviewed-on: #267
2026-07-24 15:07:58 +00:00
f7bb899497 Merge pull request 'develop' (#265) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 53s
Reviewed-on: #265
2026-07-24 14:18:41 +00:00
0bd56a6e44 Merge pull request 'develop' (#263) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 52s
Reviewed-on: #263
2026-07-24 13:36:52 +00:00
3a057aa155 Merge pull request 'develop' (#261) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 54s
Reviewed-on: #261
2026-07-24 13:09:06 +00:00
39d673270f Merge pull request 'develop' (#259) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 56s
Reviewed-on: #259
2026-07-23 10:46:54 +00:00
65050cf981 Merge pull request 'develop' (#257) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 54s
Reviewed-on: #257
2026-07-23 09:42:21 +00:00
27981d656e Merge pull request 'develop' (#255) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 58s
Reviewed-on: #255
2026-07-20 19:34:29 +00:00
98641cd52f Merge pull request 'develop' (#253) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 51s
Reviewed-on: #253
2026-07-17 14:13:07 +00:00
3c2bd72aeb Merge pull request 'develop' (#251) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 54s
Reviewed-on: #251
2026-07-10 15:40:56 +00:00
c16a64b1cc Merge pull request 'develop' (#249) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 55s
Reviewed-on: #249
2026-07-09 21:44:09 +00:00
ceb806db2d Merge pull request 'develop' (#247) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 51s
Reviewed-on: #247
2026-07-09 16:47:37 +00:00
02cd322eed Merge pull request 'develop' (#245) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 52s
Reviewed-on: #245
2026-07-08 15:44:19 +00:00
95828a304d Merge pull request 'develop' (#243) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 51s
Reviewed-on: #243
2026-07-04 13:34:01 +00:00
3edef3963e Merge pull request 'develop' (#241) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 56s
Reviewed-on: #241
2026-07-04 10:39:32 +00:00
cde3847b5f Merge pull request 'develop' (#239) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 58s
Reviewed-on: #239
2026-07-03 19:00:09 +00:00
919e3938eb Merge pull request 'develop' (#237) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 54s
Reviewed-on: #237
2026-07-03 15:04:43 +00:00
5cdd27a2f9 Merge pull request 'develop' (#235) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 52s
Reviewed-on: #235
2026-07-03 14:39:47 +00:00
8cba64f520 Merge pull request 'develop' (#233) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 55s
Reviewed-on: #233
2026-07-02 15:14:46 +00:00
5c4248a5ae Merge pull request 'develop' (#231) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 55s
Reviewed-on: #231
2026-07-01 19:30:02 +00:00
6a2aadd6dd Merge pull request 'develop' (#229) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 55s
Reviewed-on: #229
2026-07-01 19:17:09 +00:00
272182d605 Merge pull request 'develop' (#227) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 1m1s
Reviewed-on: #227
2026-06-19 19:01:46 +00:00
a404b9b678 Merge pull request 'develop' (#225) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 1m1s
Reviewed-on: #225
2026-06-19 18:40:12 +00:00
ce0bf6cdf9 Merge pull request 'develop' (#223) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 1m2s
Reviewed-on: #223
2026-06-18 10:58:23 +00:00
6c9c0d1920 Merge pull request 'develop' (#221) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 57s
Reviewed-on: #221
2026-06-17 23:48:39 +00:00
6ac42d08fb Merge pull request 'develop' (#219) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 1m0s
Reviewed-on: #219
2026-06-12 13:33:54 +00:00
816bff63bd Merge pull request 'develop' (#217) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 1m0s
Reviewed-on: #217
2026-06-05 11:41:33 +00:00
07dc4630db Merge pull request 'develop' (#215) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 50s
Reviewed-on: #215
2026-06-01 17:38:45 +00:00
752f01cfc4 Merge pull request 'develop' (#213) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 52s
Reviewed-on: #213
2026-06-01 17:23:31 +00:00
7911903bd8 Merge pull request 'develop' (#211) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 50s
Reviewed-on: #211
2026-05-15 12:10:42 +00:00
953deff41c Merge pull request 'develop' (#209) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 59s
Reviewed-on: #209
2026-04-30 16:09:27 +00:00
aa8a24f81e Merge pull request 'develop' (#207) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 50s
Reviewed-on: #207
2026-04-30 10:33:18 +00:00
ad28588b0a Merge pull request 'develop' (#205) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 52s
Reviewed-on: #205
2026-04-24 15:47:23 +00:00
1775c19c0a Merge pull request 'develop' (#203) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 58s
Reviewed-on: #203
2026-04-24 13:55:41 +00:00
dda6262b23 Merge pull request 'develop' (#201) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 57s
Reviewed-on: #201
2026-04-10 14:09:19 +00:00
5094b1a945 Merge pull request 'develop' (#199) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 49s
Reviewed-on: #199
2026-04-01 20:04:39 +00:00
0bedbf0764 Merge pull request 'develop' (#197) from develop into main
Some checks failed
CD - Deploy on main / deploy (push) Has been cancelled
Reviewed-on: #197
2026-03-24 21:18:04 +00:00
e333b82e96 Merge pull request 'develop' (#195) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 49s
Reviewed-on: #195
2026-03-23 19:56:07 +00:00
a192520b30 Merge pull request 'develop' (#193) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 52s
Reviewed-on: #193
2026-03-22 18:44:13 +00:00
4cd6e7cbae Merge pull request 'develop' (#191) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 49s
Reviewed-on: #191
2026-03-21 20:28:21 +00:00
6c0fa1ca27 Merge pull request 'develop' (#189) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 55s
Reviewed-on: #189
2026-03-21 15:00:15 +00:00
1e4e8f9ff6 Merge pull request 'develop' (#187) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
Reviewed-on: #187
2026-03-21 14:17:09 +00:00
d4d4a7be44 Merge pull request 'develop' (#185) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 52s
Reviewed-on: #185
2026-03-21 10:14:49 +00:00
5ea1c93d2b Merge pull request 'develop' (#183) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
Reviewed-on: #183
2026-03-20 13:40:42 +00:00
e325b12546 Merge pull request 'develop' (#180) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 49s
Reviewed-on: #180
2026-03-19 18:47:05 +00:00
47bcda41fd Merge pull request 'develop' (#178) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 53s
Reviewed-on: #178
2026-03-19 18:00:57 +00:00
3438da3880 Merge pull request 'develop' (#176) from develop into main
Some checks failed
CD - Deploy on main / deploy (push) Failing after 31s
Reviewed-on: #176
2026-03-19 16:16:29 +00:00
ebb91f8318 Merge pull request 'develop' (#174) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 49s
Reviewed-on: #174
2026-03-19 10:25:54 +00:00
767756acfc Merge pull request 'develop' (#172) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 2m58s
Reviewed-on: #172
2026-03-18 17:24:33 +00:00
84ede82428 Merge pull request 'develop' (#170) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 1m49s
Reviewed-on: #170
2026-03-16 13:30:32 +00:00
5beddc7c1b Merge pull request 'develop' (#168) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 1m49s
Reviewed-on: #168
2026-03-14 15:11:20 +00:00
a6f7f3d465 Merge pull request 'develop' (#166) from develop into main
Some checks failed
CD - Deploy on main / deploy (push) Successful in 48s
CI - Build & Test (develop) / build-and-test (pull_request) Has been cancelled
Reviewed-on: #166
2026-03-12 20:02:24 +00:00
43b060371a Merge pull request 'develop' (#164) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 47s
CI - Build & Test (develop) / build-and-test (pull_request) Successful in 29s
Reviewed-on: #164
2026-03-12 19:35:02 +00:00
71f0aa6cd0 Merge pull request 'develop' (#162) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
CI - Build & Test (develop) / build-and-test (pull_request) Successful in 27s
Reviewed-on: #162
2026-03-12 11:28:15 +00:00
87f8ad7a61 Merge pull request 'develop' (#159) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 49s
CI - Build & Test (develop) / build-and-test (pull_request) Successful in 29s
Reviewed-on: #159
2026-03-12 11:23:32 +00:00
6a29a3f43c Merge pull request 'develop' (#157) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 50s
Reviewed-on: #157
2026-03-12 00:03:43 +00:00
3e871a31e6 Merge pull request 'develop' (#155) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 49s
Reviewed-on: #155
2026-03-11 00:11:17 +00:00
9c62c99305 Merge pull request 'develop' (#153) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 50s
Reviewed-on: #153
2026-03-10 21:38:50 +00:00
8fb0088010 Merge pull request 'develop' (#151) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
Reviewed-on: #151
2026-03-09 20:14:21 +00:00
1e810f0ddb Merge pull request 'develop' (#149) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
Reviewed-on: #149
2026-03-09 20:00:49 +00:00
a54adcdcb8 Merge pull request 'develop' (#147) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 50s
Reviewed-on: #147
2026-03-09 19:32:55 +00:00
6b63ae2f52 Merge pull request 'develop' (#145) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 53s
Reviewed-on: #145
2026-03-09 18:53:16 +00:00
6851270bd5 Merge pull request 'develop' (#143) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
Reviewed-on: #143
2026-03-08 13:55:11 +00:00
739cc89872 Merge pull request 'develop' (#139) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
Reviewed-on: #139
2026-03-06 19:09:52 +00:00
dffd6a54a3 Merge pull request 'develop' (#137) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 56s
Reviewed-on: #137
2026-03-01 17:35:07 +00:00
267c09c064 Merge pull request 'develop' (#134) from develop into main
Some checks failed
CD - Deploy on main / deploy (push) Failing after 30s
Reviewed-on: #134
2026-03-01 01:41:31 +00:00
be4524ed67 Merge pull request 'develop' (#132) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 50s
Reviewed-on: #132
2026-02-22 23:18:39 +00:00
06ea9474f1 Merge pull request 'develop' (#130) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 50s
Reviewed-on: #130
2026-02-22 13:56:30 +00:00
c0267fca5e Merge pull request 'develop' (#128) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 55s
Reviewed-on: #128
2026-02-21 12:42:57 +00:00
55b97936ab Merge pull request 'develop' (#126) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 51s
Reviewed-on: #126
2026-02-20 19:34:40 +00:00
adcd51e32b Merge pull request 'develop' (#124) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 51s
Reviewed-on: #124
2026-02-20 18:54:49 +00:00
666519df84 Merge pull request 'develop' (#122) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 51s
Reviewed-on: #122
2026-02-19 20:40:30 +00:00
beb41af562 Merge pull request 'develop' (#120) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 51s
Reviewed-on: #120
2026-02-19 19:08:34 +00:00
57dfdaf64f Merge pull request 'develop' (#118) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 50s
Reviewed-on: #118
2026-02-19 18:33:57 +00:00
f7e3c118e2 Merge pull request 'develop' (#116) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 51s
Reviewed-on: #116
2026-02-19 12:01:26 +00:00
2b4adc0db2 Merge pull request 'develop' (#114) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 50s
Reviewed-on: #114
2026-02-18 23:06:18 +00:00
a0baf985d4 Merge pull request 'develop' (#112) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 53s
Reviewed-on: #112
2026-02-18 20:43:22 +00:00
85e9a41fe2 Merge pull request 'develop' (#110) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 1m1s
Reviewed-on: #110
2026-02-18 14:02:25 +00:00
3102dbc053 Merge pull request 'develop' (#108) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
Reviewed-on: #108
2026-02-16 22:05:19 +00:00
a21be6aef3 Merge pull request 'develop' (#106) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
Reviewed-on: #106
2026-02-16 20:58:29 +00:00
4d708ff4ca Merge pull request 'develop' (#104) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 49s
Reviewed-on: #104
2026-02-16 00:15:47 +00:00
ea1f92c7e2 Merge pull request 'develop' (#102) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
Reviewed-on: #102
2026-02-14 14:09:03 +00:00
9e5e8551f0 Merge pull request 'develop' (#100) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 47s
Reviewed-on: #100
2026-02-13 17:56:04 +00:00
b8b28a673b Merge pull request 'develop' (#98) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 46s
Reviewed-on: #98
2026-02-12 21:33:39 +00:00
70c8c26367 Merge pull request 'develop' (#96) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 46s
Reviewed-on: #96
2026-02-12 02:16:05 +00:00
e1459d85ea Merge pull request 'develop' (#94) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 50s
Reviewed-on: #94
2026-02-11 21:15:46 +00:00
f927db064a Merge pull request 'develop' (#92) from develop into main
Some checks failed
CD - Deploy on main / deploy (push) Has been cancelled
Reviewed-on: #92
2026-02-11 21:13:33 +00:00
0589883f8e Merge pull request 'develop' (#90) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 46s
Reviewed-on: #90
2026-02-10 00:11:18 +00:00
d73e64dbac Merge pull request 'develop' (#88) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
Reviewed-on: #88
2026-02-09 23:27:26 +00:00
cf7c3aaeb2 Merge pull request 'develop' (#86) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 51s
Reviewed-on: #86
2026-02-08 22:24:03 +00:00
cd4fcb7aa0 Merge pull request 'develop' (#84) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 47s
Reviewed-on: #84
2026-02-04 01:34:27 +00:00
1e0cfead5b Merge pull request 'develop' (#82) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
Reviewed-on: #82
2026-02-03 19:34:06 +00:00
0837d0ce08 Merge pull request 'develop' (#80) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 49s
Reviewed-on: #80
2026-02-03 15:09:35 +00:00
b58316bb88 Merge pull request 'develop' (#78) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 49s
Reviewed-on: #78
2026-02-02 23:04:11 +00:00
209d1cd777 Merge pull request 'develop' (#76) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
Reviewed-on: #76
2026-02-01 22:50:41 +00:00
1eb3aeeda0 Merge pull request 'develop' (#74) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 48s
Reviewed-on: #74
2026-01-27 08:59:25 +00:00
b3c288628c Merge pull request 'develop' (#71) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 56s
Reviewed-on: #71
2026-01-13 20:34:13 +00:00
d45e01ac85 Merge pull request 'develop' (#69) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 46s
Reviewed-on: #69
2025-12-20 19:04:38 +00:00
9bb0cc5c75 Merge pull request 'develop' (#67) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 47s
Reviewed-on: #67
2025-12-20 18:56:24 +00:00
3a68fd2ce4 Merge pull request 'develop' (#65) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 44s
Reviewed-on: #65
2025-12-20 17:07:04 +00:00
fa7421c35b Merge pull request 'develop' (#63) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 35s
Reviewed-on: #63
2025-12-20 15:04:55 +00:00
5cb9497163 Merge pull request 'develop' (#61) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 34s
Reviewed-on: #61
2025-12-20 14:50:28 +00:00
15cac660bc Merge pull request 'develop' (#59) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 34s
Reviewed-on: #59
2025-12-20 14:34:41 +00:00
0feec2982f Merge pull request 'develop' (#57) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 35s
Reviewed-on: #57
2025-12-20 14:14:47 +00:00
b5ab0772a0 Merge pull request 'develop' (#55) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 35s
Reviewed-on: #55
2025-12-20 13:11:40 +00:00
f293f65650 Merge pull request 'develop' (#53) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 35s
Reviewed-on: #53
2025-12-20 12:58:25 +00:00
cfd1104c28 Merge pull request 'develop' (#51) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 39s
Reviewed-on: #51
2025-12-20 12:42:50 +00:00
7d64390bae Merge pull request 'develop' (#49) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 34s
Reviewed-on: #49
2025-12-20 12:22:29 +00:00
4876d8ab14 Merge pull request 'develop' (#47) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 39s
Reviewed-on: #47
2025-12-20 12:11:18 +00:00
2bfb298054 Merge pull request 'develop' (#45) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 36s
Reviewed-on: #45
2025-12-20 12:01:44 +00:00
54ef33d1ab Merge pull request 'develop' (#43) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 33s
Reviewed-on: #43
2025-12-20 11:44:36 +00:00
3fd779854f Merge pull request 'develop' (#41) from develop into main
Some checks failed
CD - Deploy on main / deploy (push) Failing after 27s
Reviewed-on: #41
2025-12-20 11:40:18 +00:00
de2928414b Merge pull request 'develop' (#39) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 39s
Reviewed-on: #39
2025-12-20 10:49:00 +00:00
9d6d278d78 Merge pull request 'develop' (#37) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 34s
Reviewed-on: #37
2025-12-20 10:02:57 +00:00
c8b0457195 Merge pull request 'develop' (#35) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 35s
Reviewed-on: #35
2025-12-19 19:18:44 +00:00
9cc74a9a38 Merge pull request 'develop' (#31) from develop into main
Some checks failed
CD - Deploy on main / deploy (push) Failing after 33s
Reviewed-on: #31
2025-12-18 15:47:46 +00:00
8e6168d4ee Merge pull request 'develop' (#29) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Has been skipped
Reviewed-on: #29
2025-12-18 15:46:31 +00:00
c1a8ce86a6 Merge pull request 'develop' (#27) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Has been skipped
Reviewed-on: #27
2025-12-18 10:36:59 +00:00
14feb49dcd Merge pull request 'develop' (#25) from develop into main
Some checks failed
CD - Deploy on main / deploy (push) Failing after 33s
Reviewed-on: #25
2025-12-17 17:14:31 +00:00
39de1c48c0 Merge pull request 'develop' (#23) from develop into main
Some checks failed
CD - Deploy on main / deploy (push) Failing after 34s
Reviewed-on: #23
2025-12-17 16:59:31 +00:00
f9e2b32118 Merge pull request 'develop' (#21) from develop into main
Some checks failed
CD - Deploy on main / deploy (push) Failing after 33s
Reviewed-on: #21
2025-12-17 16:49:53 +00:00
3ebb1cf165 Merge pull request 'develop' (#19) from develop into main
Some checks failed
CD - Deploy on main / deploy (push) Failing after 33s
Reviewed-on: #19
2025-12-17 16:42:39 +00:00
c84176b8d3 Merge pull request 'develop' (#17) from develop into main
Some checks failed
CD - Deploy on main / deploy (push) Failing after 33s
Reviewed-on: #17
2025-12-17 16:27:26 +00:00
61f4dd513f Merge pull request 'develop' (#15) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 38s
Reviewed-on: #15
2025-12-17 14:16:12 +00:00
5e9f437497 Merge pull request 'develop' (#13) from develop into main
Reviewed-on: #13
2025-12-16 18:23:59 +00:00
69af57f876 Merge pull request 'develop' (#11) from develop into main
Reviewed-on: #11
2025-12-16 18:08:36 +00:00
56f78e77f3 Merge pull request 'develop' (#9) from develop into main
Reviewed-on: #9
2025-12-05 19:24:21 +00:00
0c7dc082fd Merge pull request 'develop' (#7) from develop into main
Reviewed-on: #7
2025-12-05 19:21:28 +00:00
3f5d7e980c Merge pull request 'develop' (#5) from develop into main
Reviewed-on: #5
2025-12-05 19:11:10 +00:00
87be4e4483 Merge pull request 'develop' (#3) from develop into main
Reviewed-on: #3
2025-12-05 19:07:16 +00:00
88 changed files with 513 additions and 3546 deletions

View File

@@ -5,7 +5,6 @@ import io.gmss.fiscad.entities.decoupage.Quartier;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.decoupage.QuartierService; import io.gmss.fiscad.interfaces.decoupage.QuartierService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.QuartierPaylaodWeb;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@@ -39,11 +38,11 @@ public class QuartierController {
@PostMapping("/create") @PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_QUARTIER')") @PreAuthorize("hasAuthority('CREATE_QUARTIER')")
public ResponseEntity<?> createQuartier(@RequestBody QuartierPaylaodWeb quartierPaylaodWeb) { public ResponseEntity<?> createQuartier(@RequestBody @Valid @Validated Quartier quartier) {
try { try {
quartierPaylaodWeb = quartierService.createQuartier(quartierPaylaodWeb); quartier = quartierService.createQuartier(quartier);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, quartierPaylaodWeb, "Quartier créé avec succès."), new ApiResponse<>(true, quartier, "Quartier créé avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -64,10 +63,10 @@ public class QuartierController {
@PutMapping("/update/{id}") @PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_QUARTIER')") @PreAuthorize("hasAuthority('UPDATE_QUARTIER')")
public ResponseEntity<?> updateQuartier(@PathVariable Long id, @RequestBody QuartierPaylaodWeb quartierPaylaodWeb) { public ResponseEntity<?> updateQuartier(@PathVariable Long id, @RequestBody Quartier quartier) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, quartierService.updateQuartier(id, quartierPaylaodWeb), "Quartier mis à jour avec succès."), new ApiResponse<>(true, quartierService.updateQuartier(id, quartier), "Quartier mis à jour avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {

View File

@@ -283,29 +283,8 @@ public class SecteurDecoupageController {
} }
} }
@GetMapping("/arbre/enquete/user-id/profil-id/{userId}/{profilId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceEnqueteByUserId(@PathVariable Long userId, @PathVariable Long profilId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurDecoupageService.getStatEnqueteDecoupageByUserIdByProfilId(userId, profilId), "SecteurDecoupage trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
e.printStackTrace();
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/arbre/enquete-valide/user-id/{userId}") @GetMapping("/arbre/enquete-valide/user-id/{userId}")
@@ -383,30 +362,6 @@ public class SecteurDecoupageController {
} }
} }
@GetMapping("/arbre/enquete-batiment/user-id/profil-id/{userId}/{profilId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceEnqueteBatimentEncoursByUserIdByProfilId(@PathVariable Long userId,@PathVariable Long profilId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurDecoupageService.getStatEnqueteBatimentDecoupageByUserIdByProfilId(userId, profilId), "SecteurDecoupage trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
e.printStackTrace();
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/arbre/enquete-batiment-valide/user-id/{userId}") @GetMapping("/arbre/enquete-batiment-valide/user-id/{userId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')") @PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
@@ -483,31 +438,6 @@ public class SecteurDecoupageController {
} }
@GetMapping("/arbre/enquete-unitlog/user-id/profil-id/{userId}/{profilId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceEnqueteUniteLogByUserIdByProfilId(@PathVariable Long userId, @PathVariable Long profilId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurDecoupageService.getStatEnqueteUniteLogementDecoupageByUserIdByProfilId(userId, profilId), "SecteurDecoupage trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
e.printStackTrace();
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/arbre/enquete-unitlog-valide/user-id/{userId}") @GetMapping("/arbre/enquete-unitlog-valide/user-id/{userId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')") @PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceEnqueteUniteLogValideByUserId(@PathVariable Long userId) { public ResponseEntity<?> getArborescenceEnqueteUniteLogValideByUserId(@PathVariable Long userId) {

View File

@@ -101,7 +101,7 @@ public class EnqueteController {
} }
@PutMapping("/validation") @PutMapping("/validation")
@PreAuthorize("hasAuthority('VALIDE_ENQUETE')") @PreAuthorize("hasAuthority('UPDATE_ENQUETE') And hasAuthority('VALIDATE_ENQUETE') ")
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
@@ -124,32 +124,8 @@ public class EnqueteController {
} }
} }
@PutMapping("/controle")
@PreAuthorize("hasAuthority('CONTROLE_ENQUETE')")
public ResponseEntity<?> controlerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteService.controlerEnquete(enqueteTraitementPayLoad), "Validation effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/rejet") @PutMapping("/rejet")
@PreAuthorize("hasAuthority('REJETE_ENQUETE')") @PreAuthorize("hasAuthority('UPDATE_ENQUETE')")
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try { try {
@@ -174,7 +150,7 @@ public class EnqueteController {
} }
@PutMapping("/validation-lot") @PutMapping("/validation-lot")
@PreAuthorize("hasAuthority('VALIDE_ENQUETE')") @PreAuthorize("hasAuthority('UPDATE_ENQUETE')")
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) { public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
@@ -197,31 +173,8 @@ public class EnqueteController {
} }
} }
@PutMapping("/controle-lot")
@PreAuthorize("hasAuthority('CONTROLE_ENQUETE')")
public ResponseEntity<?> controlerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteService.controlerEnquete(enqueteTraitementPayLoads), "Validation effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/rejet-lot") @PutMapping("/rejet-lot")
@PreAuthorize("hasAuthority('REJETE_ENQUETE')") @PreAuthorize("hasAuthority('UPDATE_ENQUETE')")
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) { public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
@@ -583,38 +536,6 @@ public class EnqueteController {
} }
@GetMapping("/all-paged/by-quartier-id/by-profil-id/{quartierId}/{profilId}")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getAllEnqueteEncoursByQuartierPaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId,@PathVariable Long profilId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
if(currentUser==null)
return new ResponseEntity<>(
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
HttpStatus.OK
);
Long userId = currentUser.getUser().getId();
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteService.getEnqueteListByQuartierByProfilByStatutPageableToDto(userId,quartierId, profilId, pageable), "Liste des enquetes en cours chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}") @GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_ENQUETE')") @PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getAllEnqueteClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) { public ResponseEntity<?> getAllEnqueteClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {

View File

@@ -5,7 +5,6 @@ import io.gmss.fiscad.entities.infocad.parametre.ModeAcquisition;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.infocad.parametre.ModeAcquisitionService; import io.gmss.fiscad.interfaces.infocad.parametre.ModeAcquisitionService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.ModeAcquisitionPayloadWeb;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@@ -40,11 +39,11 @@ public class ModeAcquisitionController {
@PostMapping("/create") @PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_MODEACQUISITION')") @PreAuthorize("hasAuthority('CREATE_MODEACQUISITION')")
public ResponseEntity<?> createModeAcquisition(@RequestBody @Valid @Validated ModeAcquisitionPayloadWeb modeAcquisitionPayloadWeb) { public ResponseEntity<?> createModeAcquisition(@RequestBody @Valid @Validated ModeAcquisition modeAcquisition) {
try { try {
modeAcquisitionPayloadWeb = modeAcquisitionService.createModeAcquisition(modeAcquisitionPayloadWeb); modeAcquisition = modeAcquisitionService.createModeAcquisition(modeAcquisition);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, modeAcquisitionPayloadWeb, "Mode acquisition créé avec succès."), new ApiResponse<>(true, modeAcquisition, "Mode acquisition créé avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -65,10 +64,10 @@ public class ModeAcquisitionController {
@PutMapping("/update/{id}") @PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_MODEACQUISITION')") @PreAuthorize("hasAuthority('UPDATE_MODEACQUISITION')")
public ResponseEntity<?> updateModeAcquisition(@PathVariable Long id, @RequestBody ModeAcquisitionPayloadWeb modeAcquisitionPayloadWeb) { public ResponseEntity<?> updateModeAcquisition(@PathVariable Long id, @RequestBody ModeAcquisition modeAcquisition) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, modeAcquisitionService.updateModeAcquisition(id, modeAcquisitionPayloadWeb), "Mode d'acquisition mis à jour avec succès."), new ApiResponse<>(true, modeAcquisitionService.updateModeAcquisition(id, modeAcquisition), "Mode d'acquisition mis à jour avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {

View File

@@ -237,29 +237,4 @@ public class StructureController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK); return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
} }
} }
@GetMapping("/by-avoir-fonction/{avoirFonctionId}")
@PreAuthorize("hasAuthority('READ_STRUCTURE')")
public ResponseEntity<?> getAllStructureListByAvoirFonction(@PathVariable Long avoirFonctionId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, structureService.getListStructureAvoirFonctionId(avoirFonctionId), "Liste des structures chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
} }

View File

@@ -6,9 +6,7 @@ import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
import io.gmss.fiscad.enums.StatusAvis; import io.gmss.fiscad.enums.StatusAvis;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.rfu.metier.DonneesImpositionTfuService; import io.gmss.fiscad.interfaces.rfu.metier.DonneesImpositionTfuService;
import io.gmss.fiscad.interfaces.rfu.metier.ImpositionsTfuService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb;
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb; import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository;
import io.gmss.fiscad.security.CurrentUser; import io.gmss.fiscad.security.CurrentUser;
@@ -30,7 +28,6 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.HttpClientErrorException;
import java.util.List;
import java.util.Optional; import java.util.Optional;
@@ -98,109 +95,6 @@ public class DonneesImpositionTfuController {
} }
} }
@PostMapping("/maj-non-homologable")
@PreAuthorize("hasAuthority('HOMOLOGUE_AVIS')")
public ResponseEntity<?> majNonHomologableDonneesImpositionTfu(@RequestBody List<DonneesImpositionPaylaodWeb> donneesImpositionTfuWebs) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.setDonneesFiscalesNonHomologable(donneesImpositionTfuWebs), "DonneesImpositionTfu mise à jour avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PostMapping("/maj-homologable")
@PreAuthorize("hasAuthority('HOMOLOGUE_AVIS')")
public ResponseEntity<?> majHomologableDonneesImpositionTfu(@RequestBody List<DonneesImpositionPaylaodWeb> donneesImpositionTfuWebs) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.setDonneesFiscalesHomologable(donneesImpositionTfuWebs), "DonneesImpositionTfu mise à jour avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/donnees-non-homologable/{idImpositionTfu}")
@PreAuthorize("hasAuthority('HOMOLOGUE_AVIS') or hasAuthority('READ_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> getNonHomologableDonneesImpositionTfu(@PathVariable Long idImpositionTfu,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesNonHomologable(idImpositionTfu,pageable), "Donnees Imposition Tfu récupérées avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/donnees-homologable/{idImpositionTfu}")
@PreAuthorize("hasAuthority('HOMOLOGUE_AVIS') or hasAuthority('READ_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> getHomologableDonneesImpositionTfu(@PathVariable Long idImpositionTfu,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesHomologable(idImpositionTfu,pageable), "Donnees Imposition Tfu récupérées avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@DeleteMapping("/delete/{id}") @DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_DONNEESIMPOSITIONTFU')") @PreAuthorize("hasAuthority('DELETE_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> deleteDonneesImpositionTfu(@PathVariable Long id) { public ResponseEntity<?> deleteDonneesImpositionTfu(@PathVariable Long id) {
@@ -226,6 +120,54 @@ public class DonneesImpositionTfuController {
} }
} }
// @GetMapping("/all")
// public ResponseEntity<?> getAllDonneesImpositionTfuList() {
// try {
// return new ResponseEntity<>(
// new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(), "Liste des impositions chargée avec succès."),
// HttpStatus.OK
// );
// } catch (HttpClientErrorException.MethodNotAllowed e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
// } catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
// FileStorageException e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
// } catch (NullPointerException e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
// } catch (Exception e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
// }
// }
// @GetMapping("/all-paged")
// public ResponseEntity<?> getAllDonneesImpositionTfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
// try {
// Pageable pageable = PageRequest.of(pageNo, pageSize);
// return new ResponseEntity<>(
// new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(pageable), "Liste des impositions chargée avec succès."),
// HttpStatus.OK
// );
// } catch (HttpClientErrorException.MethodNotAllowed e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
// } catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
// FileStorageException e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
// } catch (NullPointerException e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
// } catch (Exception e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
// }
// }
@GetMapping("/all-page/by-imposition-id/{impositionId}") @GetMapping("/all-page/by-imposition-id/{impositionId}")
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')") @PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) { public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
@@ -409,7 +351,7 @@ public class DonneesImpositionTfuController {
@PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')") @PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> genererDonneesFiscaleBatieUneParcelle(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb,@PathVariable Long parcelleId) { public ResponseEntity<?> genererDonneesFiscaleBatieUneParcelle(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb,@PathVariable Long parcelleId) {
try { try {
Optional<ImpositionsTfuPaylaodWeb> optionalImpositionsTfu =impositionsTfuRepository.findByIdToDto(impositionsTfuPaylaodWeb.getId()); Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
if(optionalImpositionsTfu.isEmpty()){ if(optionalImpositionsTfu.isEmpty()){
return new ResponseEntity<>( return new ResponseEntity<>(
@@ -417,6 +359,14 @@ public class DonneesImpositionTfuController {
HttpStatus.OK HttpStatus.OK
); );
} }
// if(!optionalImpositionsTfu.get().getStatusAvis().equals(StatusAvis.TFU_FNB_GENERE)){
// return new ResponseEntity<>(
// new ApiResponse<>(false, null, "l'état actuel : "+optionalImpositionsTfu.get().getStatusAvis()+" ne permet pas cette opération."),
// HttpStatus.OK
// );
// }
if(userPrincipal==null){ if(userPrincipal==null){
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(false, null, "Vous n'êtes pas autorisé à accéder à cette ressource"), new ApiResponse<>(false, null, "Vous n'êtes pas autorisé à accéder à cette ressource"),
@@ -425,7 +375,6 @@ public class DonneesImpositionTfuController {
} }
impositionsTfuPaylaodWeb=donneesImpositionTfuService.genererDonneesFiscalesParcelleBatieUneParcelle(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId(),parcelleId); impositionsTfuPaylaodWeb=donneesImpositionTfuService.genererDonneesFiscalesParcelleBatieUneParcelle(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId(),parcelleId);
System.out.println("OK apres sorti bati une parcelle");
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true,impositionsTfuPaylaodWeb, "Données d'imposition des fonciers batis Générées avec succès."), new ApiResponse<>(true,impositionsTfuPaylaodWeb, "Données d'imposition des fonciers batis Générées avec succès."),
HttpStatus.OK HttpStatus.OK
@@ -464,7 +413,7 @@ public class DonneesImpositionTfuController {
); );
} }
if(!optionalImpositionsTfu.get().getStatusAvis().equals(StatusAvis.CLOTURE)){ if(!optionalImpositionsTfu.get().getStatusAvis().equals(StatusAvis.GENERATION_AUTORISE)){
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(false, null, "l'état actuel : "+optionalImpositionsTfu.get().getStatusAvis()+" ne permet pas cette opération."), new ApiResponse<>(false, null, "l'état actuel : "+optionalImpositionsTfu.get().getStatusAvis()+" ne permet pas cette opération."),
HttpStatus.OK HttpStatus.OK
@@ -509,7 +458,7 @@ public class DonneesImpositionTfuController {
@PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')") @PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> genererDonneesImpositionNonBatiesUneParcelle(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, @PathVariable Long parcelleId) { public ResponseEntity<?> genererDonneesImpositionNonBatiesUneParcelle(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, @PathVariable Long parcelleId) {
try { try {
Optional<ImpositionsTfuPaylaodWeb> optionalImpositionsTfu = impositionsTfuRepository.findByIdToDto(impositionsTfuPaylaodWeb.getId()); Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
if(optionalImpositionsTfu.isEmpty()){ if(optionalImpositionsTfu.isEmpty()){
return new ResponseEntity<>( return new ResponseEntity<>(
@@ -518,13 +467,19 @@ public class DonneesImpositionTfuController {
); );
} }
// if(!optionalImpositionsTfu.get().getStatusAvis().equals(StatusAvis.GENERATION_AUTORISE)){
// return new ResponseEntity<>(
// new ApiResponse<>(false, null, "l'état actuel : "+optionalImpositionsTfu.get().getStatusAvis()+" ne permet pas cette opération."),
// HttpStatus.OK
// );
// }
if(userPrincipal==null){ if(userPrincipal==null){
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(false, null, "Vous n'êtes pas autorisé à accéder à cette ressource"), new ApiResponse<>(false, null, "Vous n'êtes pas autorisé à accéder à cette ressource"),
HttpStatus.OK HttpStatus.OK
); );
} }
impositionsTfuPaylaodWeb=donneesImpositionTfuService.genererDonneesFiscalesParcelleNonBatieUneParcelle(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId(),parcelleId); impositionsTfuPaylaodWeb=donneesImpositionTfuService.genererDonneesFiscalesParcelleNonBatieUneParcelle(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId(),parcelleId);
return new ResponseEntity<>( return new ResponseEntity<>(

View File

@@ -272,38 +272,6 @@ public class EnqueteBatimentController {
} }
} }
@GetMapping("/all-paged/by-quartier-id/by-profil-id/{quartierId}/{profilId}")
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
public ResponseEntity<?> getAllEnqueteBatimentByQuartierByProfilPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @PathVariable Long profilId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
if(currentUser==null)
return new ResponseEntity<>(
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
HttpStatus.OK
);
Long userId = currentUser.getUser().getId();
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteBatimentService.getEnqueteBatimentListByQuartierByProfilPageableToDto(userId,quartierId, profilId, pageable), "Liste des enquetes en cours chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}") @GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')") @PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
public ResponseEntity<?> getAllEnqueteBatimentClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) { public ResponseEntity<?> getAllEnqueteBatimentClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
@@ -337,7 +305,7 @@ public class EnqueteBatimentController {
@PutMapping("/validation") @PutMapping("/validation")
@PreAuthorize("hasAuthority('VALIDE_ENQUETE')") @PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
@@ -360,32 +328,8 @@ public class EnqueteBatimentController {
} }
} }
@PutMapping("/controle")
@PreAuthorize("hasAuthority('CONTROLE_ENQUETE')")
public ResponseEntity<?> controlerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteBatimentService.controlerEnquete(enqueteTraitementPayLoad), "Validation effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/rejet") @PutMapping("/rejet")
@PreAuthorize("hasAuthority('REJETE_ENQUETE')") @PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try { try {
@@ -410,7 +354,7 @@ public class EnqueteBatimentController {
} }
@PutMapping("/validation-lot") @PutMapping("/validation-lot")
@PreAuthorize("hasAuthority('VALIDE_ENQUETE')") @PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) { public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
@@ -433,33 +377,8 @@ public class EnqueteBatimentController {
} }
} }
@PutMapping("/controle-lot")
@PreAuthorize("hasAuthority('CONTROLE_ENQUETE')")
public ResponseEntity<?> controlerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteBatimentService.controlerEnquete(enqueteTraitementPayLoads), "Validation effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/rejet-lot") @PutMapping("/rejet-lot")
@PreAuthorize("hasAuthority('REJETE_ENQUETE')") @PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) { public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(

View File

@@ -272,38 +272,6 @@ public class EnqueteUniteLogementController {
} }
@GetMapping("/all-paged/by-quartier-id/by-profil-id/{quartierId}/{profilId}")
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> getAllEnqueteUniteLogementByQuartierByProfilPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @PathVariable Long profilId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
if(currentUser==null)
return new ResponseEntity<>(
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
HttpStatus.OK
);
Long userId = currentUser.getUser().getId();
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.getEnqueteUniteLogementListByQuartierByProfilPageableToDto(userId,quartierId, profilId, pageable), "Liste des enquetes en cours chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}") @GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')") @PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> getAllEnqueteUniteLogementClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) { public ResponseEntity<?> getAllEnqueteUniteLogementClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
@@ -337,7 +305,7 @@ public class EnqueteUniteLogementController {
@PutMapping("/validation") @PutMapping("/validation")
@PreAuthorize("hasAuthority('VALIDE_ENQUETE')") @PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
@@ -360,32 +328,8 @@ public class EnqueteUniteLogementController {
} }
} }
@PutMapping("/controle")
@PreAuthorize("hasAuthority('CONTROLE_ENQUETE')")
public ResponseEntity<?> controleEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.controlerEnquete(enqueteTraitementPayLoad), "Validation effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/rejet") @PutMapping("/rejet")
@PreAuthorize("hasAuthority('REJETE_ENQUETE')") @PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try { try {
@@ -410,7 +354,7 @@ public class EnqueteUniteLogementController {
} }
@PutMapping("/validation-lot") @PutMapping("/validation-lot")
@PreAuthorize("hasAuthority('VALIDE_ENQUETE')") @PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) { public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
@@ -433,32 +377,8 @@ public class EnqueteUniteLogementController {
} }
} }
@PutMapping("/controle-lot")
@PreAuthorize("hasAuthority('CONTROLE_ENQUETE')")
public ResponseEntity<?> controleEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.controlerEnquete(enqueteTraitementPayLoads), "Validation effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/rejet-lot") @PutMapping("/rejet-lot")
@PreAuthorize("hasAuthority('REJETE_ENQUETE')") @PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) { public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(

View File

@@ -1,17 +1,14 @@
package io.gmss.fiscad.controllers.rfu.metier; package io.gmss.fiscad.controllers.rfu.metier;
import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu; import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
import io.gmss.fiscad.entities.user.User; import io.gmss.fiscad.entities.user.User;
import io.gmss.fiscad.enums.StatusAvis; import io.gmss.fiscad.enums.StatusAvis;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.infocad.metier.EnqueteService; import io.gmss.fiscad.interfaces.infocad.metier.EnqueteService;
import io.gmss.fiscad.interfaces.infocad.parametre.StructureService;
import io.gmss.fiscad.interfaces.rfu.metier.ImpositionsTfuService; import io.gmss.fiscad.interfaces.rfu.metier.ImpositionsTfuService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb; import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
import io.gmss.fiscad.paylaods.request.crudweb.StructurePaylaodWeb;
import io.gmss.fiscad.security.CurrentUser; import io.gmss.fiscad.security.CurrentUser;
import io.gmss.fiscad.security.UserPrincipal; import io.gmss.fiscad.security.UserPrincipal;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
@@ -32,8 +29,6 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.HttpClientErrorException;
import java.util.Optional;
@RestController @RestController
@AllArgsConstructor @AllArgsConstructor
@@ -44,8 +39,6 @@ import java.util.Optional;
public class ImpositionsTfuController { public class ImpositionsTfuController {
private final ImpositionsTfuService impositionsTfuService; private final ImpositionsTfuService impositionsTfuService;
private final StructureService structureService;
private final EnqueteService enqueteService; private final EnqueteService enqueteService;
private static final Logger logger = LoggerFactory.getLogger(ImpositionsTfuController.class); private static final Logger logger = LoggerFactory.getLogger(ImpositionsTfuController.class);
@@ -61,22 +54,11 @@ public class ImpositionsTfuController {
HttpStatus.OK HttpStatus.OK
); );
} }
User user=currentUser.getUser();
if(impositionsTfuPaylaodWeb.getStructureId()==null){
return new ResponseEntity<>(
new ApiResponse<>(false, null, "Veuillez préciser la strucuture."),
HttpStatus.OK
);
}
User user = currentUser.getUser();
StructurePaylaodWeb st = structureService.getStructureById(impositionsTfuPaylaodWeb.getStructureId()).orElseGet(null);
if(user.getStructure().getId()!=impositionsTfuPaylaodWeb.getStructureId()){ if(user.getStructure().getId()!=impositionsTfuPaylaodWeb.getStructureId()){
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(false, null, "Vous n'etes pas autorisé à accéder à cette ressource. Votre centre : "+ user.getStructure().getNom() +" le centre de liquidation : "+ st.getNom()), new ApiResponse<>(false, null, "Vous n'etes pas autorisé à accéder à cette ressource."),
HttpStatus.OK HttpStatus.OK
); );
} }
@@ -195,30 +177,6 @@ public class ImpositionsTfuController {
} }
} }
@PutMapping("/homologuer")
@PreAuthorize("hasAuthority('HOMOLOGUE_AVIS')")
public ResponseEntity<?> HomologueImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, impositionsTfuService.homologuerImpositionsTfu(impositionsTfuPaylaodWeb), "Unite de logement mise à jour avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/rejeter") @PutMapping("/rejeter")
@PreAuthorize("hasAuthority('UPDATE_IMPOSITIONSTFU')") @PreAuthorize("hasAuthority('UPDATE_IMPOSITIONSTFU')")
public ResponseEntity<?> annulerImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) { public ResponseEntity<?> annulerImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
@@ -349,30 +307,4 @@ public class ImpositionsTfuController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK); return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
} }
} }
@GetMapping("/all-generer/by-structure-id/{structureId}")
@PreAuthorize("hasAuthority('READ_IMPOSITIONSTFU')")
public ResponseEntity<?> getImpositionsTfuGenererByStructureId(@PathVariable Long structureId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, impositionsTfuService.getImpositionsTfuByStructureIdByStatut(structureId, StatusAvis.GENERE), "liste imposition TFU chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
} }

View File

@@ -1,236 +0,0 @@
package io.gmss.fiscad.controllers.rfu.metier;
import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.rfu.metier.ParticiperService;
import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.ParticiperPayloadWeb;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.HttpClientErrorException;
@RestController
@RequestMapping(value = "api/participer", produces = MediaType.APPLICATION_JSON_VALUE)
@SecurityRequirement(name = "bearer")
@Tag(name = "Participer")
@CrossOrigin(origins = "*")
public class ParticiperController {
private final ParticiperService participerService;
private static final Logger logger = LoggerFactory.getLogger(ParticiperController.class);
public ParticiperController(ParticiperService participerService) {
this.participerService = participerService;
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_PARTICIPER')")
public ResponseEntity<?> createParticiper(@RequestBody @Valid @Validated ParticiperPayloadWeb participerPaylaodWeb) {
try {
participerPaylaodWeb = participerService.createParticiper(participerPaylaodWeb);
return new ResponseEntity<>(
new ApiResponse<>(true, participerPaylaodWeb, "Participer créé avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_PARTICIPER')")
public ResponseEntity<?> updateParticiper(@PathVariable Long id, @RequestBody ParticiperPayloadWeb participerPaylaodWeb) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, participerService.updateParticiper(id,participerPaylaodWeb), "Participer mise à jour avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_PARTICIPER')")
public ResponseEntity<?> deleteParticiper(@PathVariable Long id) {
try {
participerService.deleteParticiper(id);
return new ResponseEntity<>(
new ApiResponse<>(true, "Participer supprimée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_PARTICIPER')")
public ResponseEntity<?> getAllParticiperList() {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, participerService.getParticiperList(), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_PARTICIPER')")
public ResponseEntity<?> getAllParticiperPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, participerService.getParticiperList(pageable), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all/by-equipe-id/{equipeId}")
@PreAuthorize("hasAuthority('READ_PARTICIPER')")
public ResponseEntity<?> getAllParticiperByParcelleList(@PathVariable Long equipeId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, participerService.getParticiperListByEquipe(equipeId), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-paged/by-equipe-id/{equipeId}")
@PreAuthorize("hasAuthority('READ_PARTICIPER')")
public ResponseEntity<?> getAllParticiperByParcellePaged(@PathVariable Long equipeId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, participerService.getParticiperListByEquipePageable(equipeId,pageable), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_PARTICIPER')")
public ResponseEntity<?> getParticiperById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, participerService.getParticiperById(id), "Participer trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
}

View File

@@ -5,7 +5,6 @@ import io.gmss.fiscad.enums.TypeCampagne;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.rfu.parametre.CampagneService; import io.gmss.fiscad.interfaces.rfu.parametre.CampagneService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.CampagnePayloadWeb;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@@ -38,11 +37,11 @@ public class CampagneController {
@PostMapping("/create") @PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_CAMPAGNE')") @PreAuthorize("hasAuthority('CREATE_CAMPAGNE')")
public ResponseEntity<?> createCampagne(@RequestBody @Valid @Validated CampagnePayloadWeb campagnePayloadWeb) { public ResponseEntity<?> createCampagne(@RequestBody @Valid @Validated Campagne campagne) {
try { try {
campagnePayloadWeb = campagneService.createCampagne(campagnePayloadWeb); campagne = campagneService.createCampagne(campagne);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, campagnePayloadWeb, "Campagne créé avec succès."), new ApiResponse<>(true, campagne, "Campagne créé avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -63,10 +62,10 @@ public class CampagneController {
@PutMapping("/update/{id}") @PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_CAMPAGNE')") @PreAuthorize("hasAuthority('UPDATE_CAMPAGNE')")
public ResponseEntity<?> updateCampagne(@PathVariable Long id, @RequestBody CampagnePayloadWeb campagnePayloadWeb) { public ResponseEntity<?> updateCampagne(@PathVariable Long id, @RequestBody Campagne campagne) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, campagneService.updateCampagne(id, campagnePayloadWeb), "Campagne mis à jour avec succès."), new ApiResponse<>(true, campagneService.updateCampagne(id, campagne), "Campagne mis à jour avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -208,111 +207,5 @@ public class CampagneController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK); return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
} }
} }
@GetMapping("/by-exercice-id/{exerciceId}")
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
public ResponseEntity<?> getCampagneByExercice(@PathVariable Long exerciceId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, campagneService.getCampagneByExerciceId(exerciceId), "Liste des campagne par type chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/page/by-exercice-id/{exerciceId}")
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
public ResponseEntity<?> getCampagneByExercice(@PathVariable Long exerciceId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, campagneService.getCampagneByExerciceId(exerciceId,pageable), "Liste des campagne par type chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/by-structure-id/{structureId}")
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
public ResponseEntity<?> getCampagneByStructure(@PathVariable Long structureId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, campagneService.getCampagneByStructureId(structureId), "Liste des campagne par type chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/page/by-structure-id/{structureId}")
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
public ResponseEntity<?> getCampagneByStructure(@PathVariable Long structureId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, campagneService.getCampagneByStructureId(structureId,pageable), "Liste des campagne par type chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
} }

View File

@@ -5,7 +5,6 @@ import io.gmss.fiscad.entities.rfu.parametre.Caracteristique;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.rfu.parametre.CaracteristiqueService; import io.gmss.fiscad.interfaces.rfu.parametre.CaracteristiqueService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.CaracteristiquePayloadWeb;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@@ -37,11 +36,11 @@ public class CaracteristiqueController {
@PostMapping("/create") @PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_CARACTERISTIQUE')") @PreAuthorize("hasAuthority('CREATE_CARACTERISTIQUE')")
public ResponseEntity<?> createCaracteristique(@RequestBody @Valid @Validated CaracteristiquePayloadWeb caracteristiquePayloadWeb) { public ResponseEntity<?> createCaracteristique(@RequestBody @Valid @Validated Caracteristique caracteristique) {
try { try {
caracteristiquePayloadWeb = caracteristiqueService.createCaracteristique(caracteristiquePayloadWeb); caracteristique = caracteristiqueService.createCaracteristique(caracteristique);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, caracteristiquePayloadWeb, "Caracteristique créé avec succès."), new ApiResponse<>(true, caracteristique, "Caracteristique créé avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -62,10 +61,10 @@ public class CaracteristiqueController {
@PutMapping("/update/{id}") @PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_CARACTERISTIQUE')") @PreAuthorize("hasAuthority('UPDATE_CARACTERISTIQUE')")
public ResponseEntity<?> updateCaracteristique(@PathVariable Long id, @RequestBody CaracteristiquePayloadWeb caracteristiquePayloadWeb) { public ResponseEntity<?> updateCaracteristique(@PathVariable Long id, @RequestBody Caracteristique caracteristique) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, caracteristiqueService.updateCaracteristique(id, caracteristiquePayloadWeb), "Caracteristique mise à jour avec succès."), new ApiResponse<>(true, caracteristiqueService.updateCaracteristique(id, caracteristique), "Caracteristique mise à jour avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -140,7 +139,7 @@ public class CaracteristiqueController {
Pageable pageable = PageRequest.of(pageNo, pageSize); Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, caracteristiqueService.getCaracteristiqueListPage(pageable), "Liste des caractéristiques chargée avec succès."), new ApiResponse<>(true, caracteristiqueService.getCaracteristiqueList(pageable), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {

View File

@@ -4,7 +4,6 @@ import io.gmss.fiscad.entities.rfu.parametre.Equipe;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.rfu.parametre.EquipeService; import io.gmss.fiscad.interfaces.rfu.parametre.EquipeService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.EquipePayloadWeb;
import io.gmss.fiscad.paylaods.request.synchronisation.EquipePayload; import io.gmss.fiscad.paylaods.request.synchronisation.EquipePayload;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@@ -37,12 +36,12 @@ public class EquipeController {
@PostMapping("/create") @PostMapping("/create")
// @PreAuthorize("hasAuthority('CREATE_EQUIPE')") @PreAuthorize("hasAuthority('CREATE_EQUIPE')")
public ResponseEntity<?> createEquipe(@RequestBody @Valid @Validated EquipePayloadWeb equipePayloadWeb) { public ResponseEntity<?> createEquipe(@RequestBody @Valid @Validated EquipePayload equipePayload) {
try { try {
equipePayloadWeb = equipeService.create(equipePayloadWeb); Equipe equipe = equipeService.createEquipe(equipePayload);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, equipePayloadWeb, "Equipe créé avec succès."), new ApiResponse<>(true, equipe, "Equipe créé avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -56,18 +55,17 @@ public class EquipeController {
logger.error(e.getLocalizedMessage()); logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK); return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
logger.error(e.getLocalizedMessage()); logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK); return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
} }
} }
@PutMapping("/update/{id}") @PutMapping("/update/{id}")
// @PreAuthorize("hasAuthority('UPDATE_EQUIPE')") @PreAuthorize("hasAuthority('UPDATE_EQUIPE')")
public ResponseEntity<?> updateEquipe(@PathVariable Long id, @RequestBody EquipePayloadWeb equipePayloadWeb) { public ResponseEntity<?> updateEquipe(@PathVariable Long id, @RequestBody EquipePayload equipePayload) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, equipeService.update(id, equipePayloadWeb), "Equipe mis à jour avec succès."), new ApiResponse<>(true, equipeService.updateEquipe(id, equipePayload), "Equipe mis à jour avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -90,7 +88,7 @@ public class EquipeController {
@PreAuthorize("hasAuthority('DELETE_EQUIPE')") @PreAuthorize("hasAuthority('DELETE_EQUIPE')")
public ResponseEntity<?> deleteEquiper(@PathVariable Long id) { public ResponseEntity<?> deleteEquiper(@PathVariable Long id) {
try { try {
equipeService.delete(id); equipeService.deleteEquipe(id);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, "Equipe supprimée avec succès."), new ApiResponse<>(true, "Equipe supprimée avec succès."),
HttpStatus.OK HttpStatus.OK
@@ -106,18 +104,17 @@ public class EquipeController {
logger.error(e.getLocalizedMessage()); logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK); return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) { } catch (Exception e) {
logger.error(e.getLocalizedMessage()); logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK); return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
} }
} }
@GetMapping("/all") @GetMapping("/all")
//@PreAuthorize("hasAuthority('READ_EQUIPE')") @PreAuthorize("hasAuthority('READ_EQUIPE')")
public ResponseEntity<?> getAllEquipeList() { public ResponseEntity<?> getAllEquipeList() {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, equipeService.findAll(), "Liste des equipes chargée avec succès."), new ApiResponse<>(true, equipeService.getEquipeList(), "Liste des equipes chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -143,7 +140,7 @@ public class EquipeController {
Pageable pageable = PageRequest.of(pageNo, pageSize); Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, equipeService.findAll(pageable), "Liste des equipes chargée avec succès."), new ApiResponse<>(true, equipeService.getEquipeList(pageable), "Liste des equipes chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -167,81 +164,7 @@ public class EquipeController {
public ResponseEntity<?> getEquipeById(@PathVariable Long id) { public ResponseEntity<?> getEquipeById(@PathVariable Long id) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, equipeService.findById(id), "Equipe trouvée avec succès."), new ApiResponse<>(true, equipeService.getEquipeById(id), "Equipe trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/by-compagne-id/{campagneId}")
@PreAuthorize("hasAuthority('READ_EQUIPE')")
public ResponseEntity<?> getEquipeByCompagneId(@PathVariable Long campagneId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, equipeService.findByCampagneId(campagneId), "Equipe trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/by-secteur-id/{secteurId}")
@PreAuthorize("hasAuthority('READ_EQUIPE')")
public ResponseEntity<?> getEquipeBySecteurId(@PathVariable Long secteurId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, equipeService.findBySecteurId(secteurId), "Equipe trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_EQUIPE')")
public ResponseEntity<?> getEquipeByQuartierId(@PathVariable Long quartierId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, equipeService.findByQuartierId(quartierId), "Equipe trouvée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {

View File

@@ -38,8 +38,6 @@ public class ExerciceController {
@PreAuthorize("hasAuthority('CREATE_EXERCICE')") @PreAuthorize("hasAuthority('CREATE_EXERCICE')")
public ResponseEntity<?> createExercice(@RequestBody @Valid @Validated Exercice exercice) { public ResponseEntity<?> createExercice(@RequestBody @Valid @Validated Exercice exercice) {
try { try {
exercice = exerciceService.createExercice(exercice); exercice = exerciceService.createExercice(exercice);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, exercice, "Exercice créé avec succès."), new ApiResponse<>(true, exercice, "Exercice créé avec succès."),

View File

@@ -215,44 +215,6 @@ public class StatistiqueController {
} }
@Operation(
summary = "Statistique des enquetes en cours par object ",
description = "Donnes le nombre d'enquetes en coures par objet"
)
@GetMapping(path = "/nombre-enquete/par-objet/profil-id/{profilId}")
public ResponseEntity<?> getStatistiquesEnqueteParObjetParProfilId(@CurrentUser UserPrincipal currentUser,@PathVariable Long profilId) {
try {
if(currentUser==null)
return new ResponseEntity<>(
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
HttpStatus.OK
);
Long userId = currentUser.getUser().getId();
return new ResponseEntity<>(
new ApiResponse<>(true, statistiquesService.getStatNombreEnqueteParObjetUserConnectProfil(userId,profilId), "Statistique des personne par type."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@Operation( @Operation(
summary = "Statistique des enquetes en cours par object ", summary = "Statistique des enquetes en cours par object ",
description = "Donnes le nombre d'enquetes en coures par objet" description = "Donnes le nombre d'enquetes en coures par objet"

View File

@@ -70,34 +70,34 @@ public class UserController {
} }
} }
// @PostMapping("/change-password")
// @PreAuthorize("hasAuthority('UPDATE_USER')")
// public ResponseEntity<?> changeUserPassword(@RequestBody Login login) {
// try {
// userService.updatePassword(login.getUsername(), login.getPassword());
// return new ResponseEntity<>(
// new ApiResponse<>(true, "Votre mot de passe à été modifiée avec succès."),
// HttpStatus.OK
// );
// } catch (HttpClientErrorException.MethodNotAllowed e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
// } catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
// FileStorageException e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
// } catch (NullPointerException e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
// } catch (Exception e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
// }
// }
@PostMapping("/change-password") @PostMapping("/change-password")
//@PreAuthorize("hasAuthority('CHANGE_MY_PASSWORD')") @PreAuthorize("hasAuthority('UPDATE_USER')")
public ResponseEntity<?> changeUserPassword(@RequestBody Login login) {
try {
userService.updatePassword(login.getUsername(), login.getPassword());
return new ResponseEntity<>(
new ApiResponse<>(true, "Votre mot de passe à été modifiée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PostMapping("/change-my-password")
@PreAuthorize("hasAuthority('UPDATE_USER')")
public ResponseEntity<?> changeMyPassword(@CurrentUser UserPrincipal currentUser, @RequestBody Login login) { public ResponseEntity<?> changeMyPassword(@CurrentUser UserPrincipal currentUser, @RequestBody Login login) {
try { try {
User user = currentUser.getUser() ; User user = currentUser.getUser() ;
@@ -389,33 +389,6 @@ public class UserController {
} }
@GetMapping("/all-by-fonction/{fonctionId}")
@PreAuthorize("hasAuthority('READ_USER')")
public ResponseEntity<?> getAllByFonction(@PathVariable Long fonctionId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, userService.getUsersByFonctionId(fonctionId), "Liste des utilisateurs chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/page/all-by-structure/{structureId}") @GetMapping("/page/all-by-structure/{structureId}")
@PreAuthorize("hasAuthority('READ_USER')") @PreAuthorize("hasAuthority('READ_USER')")
public ResponseEntity<?> getAllByStructurePaged(@PathVariable Long structureId, @RequestParam int pageNo, @RequestParam int pageSize) { public ResponseEntity<?> getAllByStructurePaged(@PathVariable Long structureId, @RequestParam int pageNo, @RequestParam int pageSize) {

View File

@@ -27,7 +27,6 @@ import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.hibernate.annotations.Formula;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
@@ -184,14 +183,6 @@ public class Enquete extends BaseEntity implements Serializable {
private Integer nbreIndivisiaire; private Integer nbreIndivisiaire;
private String autreAdresse; private String autreAdresse;
private Float superficie ; private Float superficie ;
@Formula("""
(
SELECT COUNT(DISTINCT (bat.id))
FROM enquete e
join batiment bat on bat.parcelle_id =e.parcelle_id
WHERE bat.parcelle_id = parcelle_id
)
""")
private Integer nbreBatiment; private Integer nbreBatiment;
private Integer nbrePiscine; private Integer nbrePiscine;
private Long montantMensuelleLocation; private Long montantMensuelleLocation;

View File

@@ -94,8 +94,6 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
private Long nombrePiscine; private Long nombrePiscine;
private Long nombreUlog; private Long nombreUlog;
private Long nombreBat; private Long nombreBat;
//@Column(nullable = true, columnDefinition = "boolean default true")
private Boolean homologable ;
@JsonFormat(pattern = "dd-MM-yyyy") @JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class) @JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateEnquete; private LocalDate dateEnquete;

View File

@@ -8,13 +8,15 @@ import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.decoupage.Commune; import io.gmss.fiscad.entities.decoupage.Commune;
import io.gmss.fiscad.entities.infocad.parametre.Structure; import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.entities.rfu.parametre.Exercice; import io.gmss.fiscad.entities.rfu.parametre.Exercice;
import io.gmss.fiscad.entities.rfu.parametre.Participer;
import io.gmss.fiscad.enums.StatusAvis; import io.gmss.fiscad.enums.StatusAvis;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.hibernate.annotations.Formula; import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
@@ -52,51 +54,19 @@ public class ImpositionsTfu extends BaseEntity implements Serializable {
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private StatusAvis statusAvis; private StatusAvis statusAvis;
@Formula("""
(
SELECT COUNT(DISTINCT (d.annee, d.code_commune, d.personne_id))
FROM donnees_imposition_tfu d
WHERE d.impositions_tfu_id = id
)
""")
private Integer nombreAvis; private Integer nombreAvis;
@Formula("""
(
SELECT COUNT(DISTINCT (d.annee, d.code_commune, d.personne_id))
FROM donnees_imposition_tfu d
WHERE d.impositions_tfu_id = id
and (d.nature_impot='FNB' or d.nature_impot='FB')
)
""")
private Integer nombreAvisFnb; private Integer nombreAvisFnb;
@Formula("""
(
SELECT COUNT(DISTINCT (d.annee, d.code_commune, d.personne_id))
FROM donnees_imposition_tfu d
WHERE d.impositions_tfu_id = id
and d.nature_impot='FB'
and d.batiment_id is not null
)
""")
private Integer nombreAvisBatiment; private Integer nombreAvisBatiment;
@Formula("""
(
SELECT COUNT(DISTINCT (d.annee, d.code_commune, d.personne_id))
FROM donnees_imposition_tfu d
WHERE d.impositions_tfu_id = id
and d.nature_impot='FB'
and d.unite_logement_id is not null
)
""")
private Integer nombreAvisUniteLog; private Integer nombreAvisUniteLog;
@Column(columnDefinition = "TEXT") @Column(columnDefinition = "TEXT")
private String motif; private String motif;
// @JsonIgnore @JsonIgnore
// @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
// @JoinColumn(name = "impositions_tfu_id") @JoinColumn(name = "impositions_tfu_id")
// private List<DonneesImpositionTfu> donneesImpositionTfus; private List<DonneesImpositionTfu> donneesImpositionTfus;
} }

View File

@@ -6,7 +6,6 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer; import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.BaseEntity; import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.infocad.metier.Enquete; import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.enums.TypeCampagne; import io.gmss.fiscad.enums.TypeCampagne;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@@ -40,12 +39,12 @@ public class Campagne extends BaseEntity implements Serializable {
private LocalDate dateFin; private LocalDate dateFin;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private TypeCampagne typeCampagne; private TypeCampagne typeCampagne;
@ManyToOne // @JsonIgnore
private Exercice exercice ; // @OneToMany(mappedBy = "campagne")
// private List<Equipe> equipes;
@ManyToOne // @JsonIgnore
private Structure structure ; // @OneToMany(mappedBy = "campagne")
// private List<Enquete> enquetes;
} }

View File

@@ -1,13 +1,10 @@
package io.gmss.fiscad.entities.rfu.parametre; package io.gmss.fiscad.entities.rfu.parametre;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.BaseEntity; import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.decoupage.Quartier;
import io.gmss.fiscad.entities.decoupage.Secteur; import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.infocad.parametre.Bloc; import io.gmss.fiscad.entities.infocad.parametre.Bloc;
import io.gmss.fiscad.entities.rfu.metier.Participer;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
@@ -16,7 +13,6 @@ import lombok.NoArgsConstructor;
import org.hibernate.annotations.Where; import org.hibernate.annotations.Where;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate;
import java.util.List; import java.util.List;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@@ -36,10 +32,6 @@ public class Equipe extends BaseEntity implements Serializable {
private Bloc bloc; private Bloc bloc;
@ManyToOne @ManyToOne
private Secteur secteur; private Secteur secteur;
@ManyToOne
private Quartier quartier;
@ManyToOne @ManyToOne
private Campagne campagne; private Campagne campagne;
@@ -47,14 +39,6 @@ public class Equipe extends BaseEntity implements Serializable {
@JoinColumn(name = "equipe_id") @JoinColumn(name = "equipe_id")
private List<Participer> participers; private List<Participer> participers;
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateDebut;
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateFin;
// @JsonIgnore // @JsonIgnore
// @OneToMany(mappedBy = "equipe") // @OneToMany(mappedBy = "equipe")
// private List<Enquete> enquetes; // private List<Enquete> enquetes;

View File

@@ -21,11 +21,6 @@ import java.time.LocalDate;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Where(clause = " deleted = false") @Where(clause = " deleted = false")
@Table(
uniqueConstraints = {
@UniqueConstraint(name = "uk_exercice_annee", columnNames = "annee")
}
)
public class Exercice extends BaseEntity implements Serializable { public class Exercice extends BaseEntity implements Serializable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)

View File

@@ -1,11 +1,10 @@
package io.gmss.fiscad.entities.rfu.metier; package io.gmss.fiscad.entities.rfu.parametre;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer; import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.BaseEntity; import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.rfu.parametre.Equipe;
import io.gmss.fiscad.entities.user.User; import io.gmss.fiscad.entities.user.User;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@@ -22,15 +21,7 @@ import java.time.LocalDate;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
//@Where(clause = " deleted = false") @Where(clause = " deleted = false")
@Table(
uniqueConstraints = {
@UniqueConstraint(
name = "uk_participer_equipe_user",
columnNames = {"equipe_id", "user_id"}
)
}
)
public class Participer extends BaseEntity implements Serializable { public class Participer extends BaseEntity implements Serializable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)

View File

@@ -1,9 +1,15 @@
package io.gmss.fiscad.entities.user; package io.gmss.fiscad.entities.user;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.BaseEntity; import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.infocad.parametre.Structure; import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.entities.rfu.metier.Participer; import io.gmss.fiscad.entities.rfu.parametre.Participer;
import io.gmss.fiscad.enums.UserRole;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@@ -13,6 +19,7 @@ import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where; import org.hibernate.annotations.Where;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;

View File

@@ -4,10 +4,11 @@ public enum StatusAvis {
EN_COURS, EN_COURS,
CLOTURE, CLOTURE,
// GENERATION_AUTORISE, GENERATION_AUTORISE,
REJETE, REJETE,
TFU_FNB_GENERE, TFU_FNB_GENERE,
GENERE, GENERE,
HOMOLOGUE APPROVAL
} }

View File

@@ -3,13 +3,8 @@ package io.gmss.fiscad.enums;
public enum StatutEnquete { public enum StatutEnquete {
EN_COURS, EN_COURS,
FINALISE, FINALISE,
REJETE, REJETE,
CONTROLE,
VALIDE, VALIDE,
ECHEC, ECHEC,
CLOTURE CLOTURE
} }

View File

@@ -2,10 +2,7 @@ package io.gmss.fiscad.enums;
public enum UserRole { public enum UserRole {
VALIDE_ENQUETE, VALIDE_ENQUETE,
REJETE_ENQUETE, APPROVAL_AVIS,
CONTROLE_ENQUETE,
HOMOLOGUE_AVIS,
//CHANGE_MY_PASSWORD,
CREATE_ARRONDISSEMENT, CREATE_ARRONDISSEMENT,
READ_ARRONDISSEMENT, READ_ARRONDISSEMENT,
UPDATE_ARRONDISSEMENT, UPDATE_ARRONDISSEMENT,

View File

@@ -7,10 +7,7 @@ import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.decoupage.ArrondissementService; import io.gmss.fiscad.interfaces.decoupage.ArrondissementService;
import io.gmss.fiscad.interfaces.decoupage.QuartierService; import io.gmss.fiscad.interfaces.decoupage.QuartierService;
import io.gmss.fiscad.paylaods.request.crudweb.QuartierPaylaodWeb; import io.gmss.fiscad.paylaods.request.crudweb.QuartierPaylaodWeb;
import io.gmss.fiscad.persistence.repositories.decoupage.ArrondissementRepository;
import io.gmss.fiscad.persistence.repositories.decoupage.QuartierRepository; import io.gmss.fiscad.persistence.repositories.decoupage.QuartierRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -19,59 +16,33 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
@Service @Service
@AllArgsConstructor
public class QuartierServiceImpl implements QuartierService { public class QuartierServiceImpl implements QuartierService {
private final QuartierRepository quartierRepository; private final QuartierRepository quartierRepository;
private final ArrondissementRepository arrondissementRepository;
private final ArrondissementService arrondissementService; private final ArrondissementService arrondissementService;
private final EntityFromPayLoadService entityFromPayLoadService;
public QuartierServiceImpl(QuartierRepository quartierRepository, ArrondissementService arrondissementService) {
this.quartierRepository = quartierRepository;
this.arrondissementService = arrondissementService;
@Override
public QuartierPaylaodWeb createQuartier(QuartierPaylaodWeb quartierPaylaodWeb) throws BadRequestException {
if (quartierPaylaodWeb.getId() != null) {
throw new BadRequestException("Impossible de créer un nouveau quartier ayant un id non null.");
}
if (quartierPaylaodWeb.getArrondissementId() == null) {
throw new BadRequestException("Impossible de créer un nouveau quartier : Veuillez préciser l'arrondissement");
}
if (!arrondissementRepository.existsById(quartierPaylaodWeb.getArrondissementId())) {
throw new BadRequestException("Impossible de créer un nouveau quartier : l'arrondissement n'existe pas");
}
Quartier quartier = entityFromPayLoadService.getQuartierFromPayLoadWeb(quartierPaylaodWeb);
quartier = quartierRepository.save(quartier);
Optional<QuartierPaylaodWeb> optionalQuartierPaylaodWeb = quartierRepository.findQuartierToDtoById(quartier.getId());
return optionalQuartierPaylaodWeb.orElse(null);
} }
@Override @Override
public QuartierPaylaodWeb updateQuartier(Long id, QuartierPaylaodWeb quartierPaylaodWeb) throws NotFoundException { public Quartier createQuartier(Quartier quartier) throws BadRequestException {
if (quartierPaylaodWeb.getId() == null) { if (quartier.getId() != null) {
throw new BadRequestException("Impossible de créer un nouveau quartier ayant un id non null.");
}
return quartierRepository.save(quartier);
}
@Override
public Quartier updateQuartier(Long id, Quartier quartier) throws NotFoundException {
if (quartier.getId() == null) {
throw new BadRequestException("Impossible de mettre à jour un nouveau quartier ayant un id null."); throw new BadRequestException("Impossible de mettre à jour un nouveau quartier ayant un id null.");
} }
if (!quartierRepository.existsById(quartierPaylaodWeb.getId())) { if (!quartierRepository.existsById(quartier.getId())) {
throw new NotFoundException("Impossible de trouver le quartier spécifié dans notre base de données."); throw new NotFoundException("Impossible de trouver le quartier spécifié dans notre base de données.");
} }
return quartierRepository.save(quartier);
if (quartierPaylaodWeb.getArrondissementId() == null) {
throw new BadRequestException("Impossible de créer un nouveau quartier : Veuillez préciser l'arrondissement");
}
Quartier quartier = entityFromPayLoadService.getQuartierFromPayLoadWeb(quartierPaylaodWeb);
quartier = quartierRepository.save(quartier);
Optional<QuartierPaylaodWeb> optionalQuartierPaylaodWeb = quartierRepository.findQuartierToDtoById(quartier.getId());
return optionalQuartierPaylaodWeb.orElse(null);
} }
@Override @Override

View File

@@ -2,9 +2,7 @@ package io.gmss.fiscad.implementations.decoupage;
import io.gmss.fiscad.entities.decoupage.Secteur; import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.entities.decoupage.SecteurDecoupage; import io.gmss.fiscad.entities.decoupage.SecteurDecoupage;
import io.gmss.fiscad.entities.user.Profile;
import io.gmss.fiscad.enums.StatutEnquete; import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.enums.UserProfile;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.decoupage.SecteurDecoupageService; import io.gmss.fiscad.interfaces.decoupage.SecteurDecoupageService;
@@ -17,7 +15,6 @@ import io.gmss.fiscad.persistence.repositories.infocad.metier.ParcelleRepository
import io.gmss.fiscad.persistence.repositories.interface_sigibe.EdeclarationProprieteRepository; import io.gmss.fiscad.persistence.repositories.interface_sigibe.EdeclarationProprieteRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository;
import io.gmss.fiscad.persistence.repositories.user.ProfileRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService; import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@@ -37,7 +34,6 @@ public class SecteurDecoupageServiceImpl implements SecteurDecoupageService {
private final EdeclarationProprieteRepository edeclarationProprieteRepository; private final EdeclarationProprieteRepository edeclarationProprieteRepository;
private final EnqueteBatimentRepository enqueteBatimentRepository; private final EnqueteBatimentRepository enqueteBatimentRepository;
private final EnqueteUniteLogementRepository enqueteUniteLogementRepository; private final EnqueteUniteLogementRepository enqueteUniteLogementRepository;
private final ProfileRepository profileRepository;
private final EntityFromPayLoadService entityFromPayLoadService; private final EntityFromPayLoadService entityFromPayLoadService;
@@ -135,20 +131,6 @@ public class SecteurDecoupageServiceImpl implements SecteurDecoupageService {
return enqueteRepository.findStatsEnqueteBySecteurs(secteurIds,statutEnquete); return enqueteRepository.findStatsEnqueteBySecteurs(secteurIds,statutEnquete);
} }
@Override
public List<ParcelleStatsProjectionUnSecteur> getStatEnqueteDecoupageByUserIdByProfilId(Long userId, Long profilId) {
Optional<Profile> optionalProfile= profileRepository.findProfileById(profilId);
List<ParcelleStatsProjectionUnSecteur> parcelleStatsProjectionUnSecteurs= new ArrayList<>();
if(optionalProfile.isPresent()){
if (optionalProfile.get().getNom().equals(UserProfile.GESSECTCHEF)){
parcelleStatsProjectionUnSecteurs= getStatEnqueteDecoupageByUserId(userId,StatutEnquete.EN_COURS.toString());
}else if(optionalProfile.get().getNom().equals(UserProfile.GESCHEF) || optionalProfile.get().getNom().equals(UserProfile.GESCENTRE)){
parcelleStatsProjectionUnSecteurs= getStatEnqueteDecoupageByUserId(userId,StatutEnquete.CONTROLE.toString());
}
}
return parcelleStatsProjectionUnSecteurs;
}
@Override @Override
public List<ParcelleStatsProjectionUnSecteur> getStatEnqueteBatimentDecoupageByUserId(Long userId, String statutEnquete) { public List<ParcelleStatsProjectionUnSecteur> getStatEnqueteBatimentDecoupageByUserId(Long userId, String statutEnquete) {
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId); List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
@@ -160,22 +142,6 @@ public class SecteurDecoupageServiceImpl implements SecteurDecoupageService {
return enqueteBatimentRepository.findStatsEnqueteBatimentBySecteurs(secteurIds,statutEnquete); return enqueteBatimentRepository.findStatsEnqueteBatimentBySecteurs(secteurIds,statutEnquete);
} }
@Override
public List<ParcelleStatsProjectionUnSecteur> getStatEnqueteBatimentDecoupageByUserIdByProfilId(Long userId, Long profilId) {
Optional<Profile> optionalProfile= profileRepository.findProfileById(profilId);
List<ParcelleStatsProjectionUnSecteur> parcelleStatsProjectionUnSecteurs= new ArrayList<>();
if(optionalProfile.isPresent()){
if (optionalProfile.get().getNom().equals(UserProfile.GESSECTCHEF)){
parcelleStatsProjectionUnSecteurs= getStatEnqueteBatimentDecoupageByUserId(userId,StatutEnquete.EN_COURS.toString());
}else if(optionalProfile.get().getNom().equals(UserProfile.GESCHEF) || optionalProfile.get().getNom().equals(UserProfile.GESCENTRE)){
parcelleStatsProjectionUnSecteurs= getStatEnqueteBatimentDecoupageByUserId(userId,StatutEnquete.CONTROLE.toString());
}
}
return parcelleStatsProjectionUnSecteurs;
}
@Override @Override
public List<ParcelleStatsProjectionUnSecteur> getStatEnqueteUniteLogementDecoupageByUserId(Long userId, String statutEnquete) { public List<ParcelleStatsProjectionUnSecteur> getStatEnqueteUniteLogementDecoupageByUserId(Long userId, String statutEnquete) {
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId); List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
@@ -185,21 +151,6 @@ public class SecteurDecoupageServiceImpl implements SecteurDecoupageService {
return enqueteUniteLogementRepository.findStatsEnqueteBatimentBySecteurs(secteurIds,statutEnquete); return enqueteUniteLogementRepository.findStatsEnqueteBatimentBySecteurs(secteurIds,statutEnquete);
} }
@Override
public List<ParcelleStatsProjectionUnSecteur> getStatEnqueteUniteLogementDecoupageByUserIdByProfilId(Long userId, Long profilId) {
Optional<Profile> optionalProfile= profileRepository.findProfileById(profilId);
List<ParcelleStatsProjectionUnSecteur> parcelleStatsProjectionUnSecteurs= new ArrayList<>();
if(optionalProfile.isPresent()){
if (optionalProfile.get().getNom().equals(UserProfile.GESSECTCHEF)){
parcelleStatsProjectionUnSecteurs= getStatEnqueteUniteLogementDecoupageByUserId(userId,StatutEnquete.EN_COURS.toString());
}else if(optionalProfile.get().getNom().equals(UserProfile.GESCHEF) || optionalProfile.get().getNom().equals(UserProfile.GESCENTRE)){
parcelleStatsProjectionUnSecteurs= getStatEnqueteUniteLogementDecoupageByUserId(userId,StatutEnquete.CONTROLE.toString());
}
}
return parcelleStatsProjectionUnSecteurs;
}
@Override @Override
public List<ParcelleStatsProjectionUnSecteur> getStatDeclarationProprieteByUserId(Long userId, String statutDeclcarationPropriete) { public List<ParcelleStatsProjectionUnSecteur> getStatDeclarationProprieteByUserId(Long userId, String statutDeclcarationPropriete) {
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId); List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);

View File

@@ -10,11 +10,9 @@ import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment;
import io.gmss.fiscad.entities.rfu.metier.EnqueteUniteLogement; import io.gmss.fiscad.entities.rfu.metier.EnqueteUniteLogement;
import io.gmss.fiscad.entities.rfu.parametre.Equipe; import io.gmss.fiscad.entities.rfu.parametre.Equipe;
import io.gmss.fiscad.entities.rfu.parametre.ZoneRfu; import io.gmss.fiscad.entities.rfu.parametre.ZoneRfu;
import io.gmss.fiscad.entities.user.Profile;
import io.gmss.fiscad.entities.user.User; import io.gmss.fiscad.entities.user.User;
import io.gmss.fiscad.enums.StatutEdeclarationPropriete; import io.gmss.fiscad.enums.StatutEdeclarationPropriete;
import io.gmss.fiscad.enums.StatutEnquete; import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.enums.UserProfile;
import io.gmss.fiscad.exceptions.ApplicationException; import io.gmss.fiscad.exceptions.ApplicationException;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
@@ -48,7 +46,6 @@ import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentReposit
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.EquipeRepository; import io.gmss.fiscad.persistence.repositories.rfu.parametre.EquipeRepository;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.ZoneRfuRepository; import io.gmss.fiscad.persistence.repositories.rfu.parametre.ZoneRfuRepository;
import io.gmss.fiscad.persistence.repositories.user.ProfileRepository;
import io.gmss.fiscad.persistence.repositories.user.UserRepository; import io.gmss.fiscad.persistence.repositories.user.UserRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService; import io.gmss.fiscad.service.EntityFromPayLoadService;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
@@ -59,7 +56,6 @@ import jakarta.ws.rs.NotAcceptableException;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.modelmapper.ModelMapper; import org.modelmapper.ModelMapper;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
@@ -95,7 +91,6 @@ public class EnqueteServiceImpl implements EnqueteService {
private final SecteurService secteurService ; private final SecteurService secteurService ;
private final EdeclarationProprieteService edeclarationProprieteService ; private final EdeclarationProprieteService edeclarationProprieteService ;
private final QuartierRepository quartierRepository ; private final QuartierRepository quartierRepository ;
private final ProfileRepository profileRepository ;
; ;
@PersistenceContext @PersistenceContext
@@ -424,35 +419,6 @@ public class EnqueteServiceImpl implements EnqueteService {
return enqueteRepository.findEnqueteToDto(enquete.getId()).orElse(null); return enqueteRepository.findEnqueteToDto(enquete.getId()).orElse(null);
} }
@Override
public EnquetePayLoadWeb controlerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
if (enqueteTraitementPayLoad == null) {
throw new BadRequestException("Impossible de valider une enquête ayant un id null.");
}
Optional<Enquete> optionalEnquete = enqueteRepository.findById(enqueteTraitementPayLoad.getIdBackend());
if (!optionalEnquete.isPresent()) {
throw new NotFoundException("Impossible de trouver l'enquête que vous désirez valider.");
}
if(optionalEnquete.get().getStatutEnquete()==StatutEnquete.CLOTURE ||
optionalEnquete.get().getStatutEnquete()==StatutEnquete.REJETE||
optionalEnquete.get().getStatutEnquete()==StatutEnquete.VALIDE ){
throw new NotAcceptableException("Impossible de valider : Le statut actuel "+optionalEnquete.get().getStatutEnquete()+" ne le permet pas.");
}
System.out.println("ICIC");
Enquete enquete = optionalEnquete.get();
enquete.setDateValidation(LocalDate.now());
enquete.setStatutEnquete(StatutEnquete.CONTROLE);
enquete.setSynchronise(true);
enquete= enqueteRepository.save(enquete);
if(enquete.getEdeclarationPropriete()!=null) {
edeclarationProprieteService.updateEdeclarationProprieteStatut(enquete.getEdeclarationPropriete().getId(), StatutEdeclarationPropriete.TRAITE);
}
return enqueteRepository.findEnqueteToDto(enquete.getId()).orElse(null);
}
@Override @Override
public EnquetePayLoadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public EnquetePayLoadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
if (enqueteTraitementPayLoad.getIdBackend() == null) { if (enqueteTraitementPayLoad.getIdBackend() == null) {
@@ -488,21 +454,6 @@ public class EnqueteServiceImpl implements EnqueteService {
return enquetePayLoadWebs; return enquetePayLoadWebs;
} }
@Override
public List<EnquetePayLoadWeb> controlerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
List<EnquetePayLoadWeb> enquetePayLoadWebs = new ArrayList<>();
try {
for (EnqueteTraitementPayLoad enqueteTraitementPayLoad : enqueteTraitementPayLoads) {
enquetePayLoadWebs.add(controlerEnquete(enqueteTraitementPayLoad));
}
} catch (Exception e) {
enquetePayLoadWebs.add(null);
}
return enquetePayLoadWebs;
}
@Override @Override
public List<EnquetePayLoadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) { public List<EnquetePayLoadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
List<EnquetePayLoadWeb> enquetePayLoadWebs = new ArrayList<>(); List<EnquetePayLoadWeb> enquetePayLoadWebs = new ArrayList<>();
@@ -684,27 +635,6 @@ public class EnqueteServiceImpl implements EnqueteService {
return enqueteRepository.findAllEnqueteByQuartierByStatutToDtoPageable(quartierId,secteurIds,statutEnquete,pageable); return enqueteRepository.findAllEnqueteByQuartierByStatutToDtoPageable(quartierId,secteurIds,statutEnquete,pageable);
} }
@Override
public Page<EnquetePayLoadWeb> getEnqueteListByQuartierByProfilByStatutPageableToDto(Long userId, Long quartierId, Long profilId, Pageable pageable) {
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
List<Long> secteurIds = secteurs.stream()
.map(Secteur::getId)
.toList();
Page<EnquetePayLoadWeb> enquetePayLoadWebs = Page.empty(pageable);
Optional<Profile> optionalProfile= profileRepository.findProfileById(profilId);
if(optionalProfile.isPresent()){
if (optionalProfile.get().getNom().equals(UserProfile.GESSECTCHEF)){
enquetePayLoadWebs=enqueteRepository.findAllEnqueteByQuartierByStatutToDtoPageable(quartierId,secteurIds,StatutEnquete.EN_COURS,pageable);
}else if(optionalProfile.get().getNom().equals(UserProfile.GESCHEF) || optionalProfile.get().getNom().equals(UserProfile.GESCENTRE)){
enquetePayLoadWebs=enqueteRepository.findAllEnqueteByQuartierByStatutToDtoPageable(quartierId,secteurIds,StatutEnquete.CONTROLE,pageable);
}
}
return enquetePayLoadWebs;
}
@Override @Override
@Transactional @Transactional
public int cloturerEnqueteParcelleBatimentUniteLogementByStructureIdAndExerciceId(Long structureId,Long exerciceId) { public int cloturerEnqueteParcelleBatimentUniteLogementByStructureIdAndExerciceId(Long structureId,Long exerciceId) {

View File

@@ -267,6 +267,7 @@ public class PersonneServiceImpl implements PersonneService {
} }
if(request.getNpi()!=null && !request.getNpi().equals("")){ if(request.getNpi()!=null && !request.getNpi().equals("")){
List<PersonnePayLoadWeb> personnePayLoadWebs = personneRepository.findAllPersonneByNpiToDto(request.getNpi()); List<PersonnePayLoadWeb> personnePayLoadWebs = personneRepository.findAllPersonneByNpiToDto(request.getNpi());
if(!personnePayLoadWebs.isEmpty()) if(!personnePayLoadWebs.isEmpty())
return personnePayLoadWebs; return personnePayLoadWebs;
@@ -276,14 +277,13 @@ public class PersonneServiceImpl implements PersonneService {
result = recherchePersonneLocal(request); result = recherchePersonneLocal(request);
if (result != null && ! result.isEmpty()) { if (result != null && !result.isEmpty()) {
return result; return result;
} }
// Conversion date en String format yyyy-MM-dd // Conversion date en String format yyyy-MM-dd
String dateNaissance = Optional.ofNullable(request.getDateNaissance()) String dateNaissance = Optional.ofNullable(request.getDateNaissance())
.map(d -> d.format(DateTimeFormatter.ISO_LOCAL_DATE)) .map(d -> d.format(DateTimeFormatter.ISO_LOCAL_DATE))
.orElse(null); .orElse(null);
// Construction du body IFU // Construction du body IFU
IfuEnLigneRechercheBody ifuRequest = new IfuEnLigneRechercheBody(); IfuEnLigneRechercheBody ifuRequest = new IfuEnLigneRechercheBody();
ifuRequest.setNom(request.getNom()); ifuRequest.setNom(request.getNom());

View File

@@ -1,14 +1,10 @@
package io.gmss.fiscad.implementations.infocad.parametre; package io.gmss.fiscad.implementations.infocad.parametre;
import io.gmss.fiscad.entities.infocad.parametre.ModeAcquisition; import io.gmss.fiscad.entities.infocad.parametre.ModeAcquisition;
import io.gmss.fiscad.entities.rfu.parametre.Caracteristique;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.infocad.parametre.ModeAcquisitionService; import io.gmss.fiscad.interfaces.infocad.parametre.ModeAcquisitionService;
import io.gmss.fiscad.paylaods.request.crudweb.ModeAcquisitionPayloadWeb;
import io.gmss.fiscad.persistence.repositories.infocad.parametre.ModeAcquisitionRepository; import io.gmss.fiscad.persistence.repositories.infocad.parametre.ModeAcquisitionRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -20,35 +16,28 @@ import java.util.Optional;
public class ModeAcquisitionServiceImpl implements ModeAcquisitionService { public class ModeAcquisitionServiceImpl implements ModeAcquisitionService {
private final ModeAcquisitionRepository modeAcquisitionRepository; private final ModeAcquisitionRepository modeAcquisitionRepository;
private final EntityFromPayLoadService entityFromPayLoadService;
public ModeAcquisitionServiceImpl(ModeAcquisitionRepository modeAcquisitionRepository, EntityFromPayLoadService entityFromPayLoadService) { public ModeAcquisitionServiceImpl(ModeAcquisitionRepository modeAcquisitionRepository) {
this.modeAcquisitionRepository = modeAcquisitionRepository; this.modeAcquisitionRepository = modeAcquisitionRepository;
this.entityFromPayLoadService = entityFromPayLoadService;
} }
@Override @Override
public ModeAcquisitionPayloadWeb createModeAcquisition(ModeAcquisitionPayloadWeb modeAcquisitionPayloadWeb) throws BadRequestException { public ModeAcquisition createModeAcquisition(ModeAcquisition modeAcquisition) throws BadRequestException {
if (modeAcquisitionPayloadWeb.getId() != null) { if (modeAcquisition.getId() != null) {
throw new BadRequestException("Impossible de créer un nouveau mode d'acquisition ayant un id non null."); throw new BadRequestException("Impossible de créer un nouveau mode d'acquisition ayant un id non null.");
} }
ModeAcquisition modeAcquisition = entityFromPayLoadService.getModeAcquisitionFromPayLoadWeb(modeAcquisitionPayloadWeb); return modeAcquisitionRepository.save(modeAcquisition);
modeAcquisition = modeAcquisitionRepository.save(modeAcquisition);
return modeAcquisitionRepository.findPayloadById(modeAcquisition.getId()).orElse(null);
} }
@Override @Override
public ModeAcquisitionPayloadWeb updateModeAcquisition(Long id, ModeAcquisitionPayloadWeb modeAcquisitionPayloadWeb) throws NotFoundException { public ModeAcquisition updateModeAcquisition(Long id, ModeAcquisition modeAcquisition) throws NotFoundException {
if (modeAcquisitionPayloadWeb.getId() == null) { if (modeAcquisition.getId() == null) {
throw new BadRequestException("Impossible de mettre à jour un nouveau mode d'acquisition ayant un id null."); throw new BadRequestException("Impossible de mettre à jour un nouveau mode d'acquisition ayant un id null.");
} }
if (!modeAcquisitionRepository.existsById(modeAcquisitionPayloadWeb.getId())) { if (!modeAcquisitionRepository.existsById(modeAcquisition.getId())) {
throw new NotFoundException("Impossible de trouver le mode d'acquisition spécifié dans notre base de données."); throw new NotFoundException("Impossible de trouver le mode d'acquisition spécifié dans notre base de données.");
} }
ModeAcquisition modeAcquisition = entityFromPayLoadService.getModeAcquisitionFromPayLoadWeb(modeAcquisitionPayloadWeb); return modeAcquisitionRepository.save(modeAcquisition);
modeAcquisition = modeAcquisitionRepository.save(modeAcquisition);
return modeAcquisitionRepository.findPayloadById(modeAcquisition.getId()).orElse(null);
} }
@Override @Override
@@ -62,19 +51,19 @@ public class ModeAcquisitionServiceImpl implements ModeAcquisitionService {
} }
@Override @Override
public Page<ModeAcquisitionPayloadWeb> getModeAcquisitionList(Pageable pageable) { public Page<ModeAcquisition> getModeAcquisitionList(Pageable pageable) {
return modeAcquisitionRepository.findAllPayload(pageable); return modeAcquisitionRepository.findAll(pageable);
} }
@Override @Override
public List<ModeAcquisitionPayloadWeb> getModeAcquisitionList() { public List<ModeAcquisition> getModeAcquisitionList() {
return modeAcquisitionRepository.findAllPayload(); return modeAcquisitionRepository.findAll();
} }
@Override @Override
public Optional<ModeAcquisitionPayloadWeb> getModeAcquisitionById(Long id) { public Optional<ModeAcquisition> getModeAcquisitionById(Long id) {
if (modeAcquisitionRepository.existsById(id)) { if (modeAcquisitionRepository.existsById(id)) {
return modeAcquisitionRepository.findPayloadById(id); return modeAcquisitionRepository.findById(id);
} else { } else {
throw new NotFoundException("Impossible de trouver le mode d'acquisition spécifié dans la base de données."); throw new NotFoundException("Impossible de trouver le mode d'acquisition spécifié dans la base de données.");
} }

View File

@@ -102,7 +102,7 @@ public class StructureServiceImpl implements StructureService {
avoirFonctions.stream() avoirFonctions.stream()
.filter(af -> af.getDateFin() == null || af.getDateFin().isAfter(LocalDate.now())) .filter(af -> af.getDateFin() == null || af.getDateFin().isAfter(LocalDate.now()))
.forEach(avoirFonction -> { .forEach(avoirFonction -> {
if(avoirFonction.getFonction().getStructure()!=null && avoirFonction.getFonction().getDepartement()==null){ if(avoirFonction.getFonction().getStructure()!=null){
structures.addAll(List.of(avoirFonction.getFonction().getStructure())); structures.addAll(List.of(avoirFonction.getFonction().getStructure()));
}else if (avoirFonction.getFonction().getDepartement()!=null){ }else if (avoirFonction.getFonction().getDepartement()!=null){
structures.addAll(structureRepository.findDistinctByCommune_Departement_Id(avoirFonction.getFonction().getDepartement().getId())); structures.addAll(structureRepository.findDistinctByCommune_Departement_Id(avoirFonction.getFonction().getDepartement().getId()));
@@ -111,33 +111,6 @@ public class StructureServiceImpl implements StructureService {
return structures; return structures;
} }
@Override
public List<StructurePaylaodWeb> getListStructureAvoirFonctionId(Long avoirFonctionId) {
Optional<AvoirFonction> optionalAvoirFonction= avoirFonctionRepository.findById(avoirFonctionId);
List<AvoirFonction> avoirFonctions= new ArrayList<>() ;
if(optionalAvoirFonction.isPresent()){
avoirFonctions.add(optionalAvoirFonction.get());
}
List<Structure> structures = new ArrayList<>();
avoirFonctions.stream()
.filter(af -> af.getDateFin() == null || af.getDateFin().isAfter(LocalDate.now()))
.forEach(avoirFonction -> {
if(avoirFonction.getFonction().getStructure()!=null && avoirFonction.getFonction().getDepartement()==null){
structures.addAll(List.of(avoirFonction.getFonction().getStructure()));
}else if (avoirFonction.getFonction().getDepartement()!=null){
structures.addAll(structureRepository.findDistinctByCommune_Departement_Id(avoirFonction.getFonction().getDepartement().getId()));
}
});
List<StructurePaylaodWeb> structurePaylaodWebs=new ArrayList<>();
structures.forEach(structure -> {
structurePaylaodWebs.add(structureRepository.findStructureToDtoById(structure.getId()).orElse(null));
});
return structurePaylaodWebs;
}
// public List<Long> getStructureIdListForUser(Long userId) { // public List<Long> getStructureIdListForUser(Long userId) {

View File

@@ -38,30 +38,30 @@ public class CommuneCentreAssignationServiceImpl implements CommuneCentreAssigna
public CommuneCentreAssignationPaylaodWeb createCommuneCentreAssignation(User user, CommuneCentreAssignationPaylaodWeb communeCentreAssignationPaylaodWeb) throws BadRequestException { public CommuneCentreAssignationPaylaodWeb createCommuneCentreAssignation(User user, CommuneCentreAssignationPaylaodWeb communeCentreAssignationPaylaodWeb) throws BadRequestException {
if (user.getStructure() == null) { if (user.getStructure() == null) {
throw new BadRequestException("Impossible de finaliser l'assignation: Votre centre doit être précisé."); throw new BadRequestException("Impossible de créer l'assignation: Votre centre doit être précisé.");
} }
if (user.getStructure().getCommune() == null) { if (user.getStructure().getCommune() == null) {
throw new BadRequestException("Impossible de finaliser l'assignation : votre commune doit être précisée."); throw new BadRequestException("Impossible de créer un nouveau communeCentreAssignation: votre commune doit être précisée.");
} }
if (communeCentreAssignationPaylaodWeb.getPersonneId() == null) { if (communeCentreAssignationPaylaodWeb.getPersonneId() == null) {
throw new BadRequestException("Impossible de finaliser l'assignation : Le contribuable doit être précisée."); throw new BadRequestException("Impossible de créer un nouveau communeCentreAssignation: Le contribuable doit être précisée.");
}else { }else {
if(!personneRepository.existsById(communeCentreAssignationPaylaodWeb.getPersonneId())) if(!personneRepository.existsById(communeCentreAssignationPaylaodWeb.getPersonneId()))
throw new BadRequestException("Impossible de finaliser l'assignation : Le contribuable doit être précisée."); throw new BadRequestException("Impossible de créer un nouveau communeCentreAssignation: Le contribuable doit être précisée.");
} }
if (communeCentreAssignationPaylaodWeb.getParcelleContactId() == null) { if (communeCentreAssignationPaylaodWeb.getParcelleContactId() == null) {
throw new BadRequestException("Impossible de finaliser l'assignation : La parcelle de contact doit être précisée."); throw new BadRequestException("Impossible de créer une nouvelle assignation de centre : La parcelle de contact doit être précisée.");
}else { }else {
if(!parcelleRepository.existsById(communeCentreAssignationPaylaodWeb.getParcelleContactId())) if(!parcelleRepository.existsById(communeCentreAssignationPaylaodWeb.getParcelleContactId()))
throw new BadRequestException("Impossible de finaliser l'assignation : La parcelle précisée n'existe pas."); throw new BadRequestException("Impossible de créer une nouvelle assignation de centre: La parcelle précisée n'existe pas.");
} }
Optional<CommuneCentreAssignationPaylaodWeb> communeCentreAssignationPaylaodWebOptional=communeCentreAssignationRepository.findbyCommuneAndPersonne(user.getStructure().getCommune().getId(),communeCentreAssignationPaylaodWeb.getPersonneId()); Optional<CommuneCentreAssignationPaylaodWeb> communeCentreAssignationPaylaodWebOptional=communeCentreAssignationRepository.findbyCommuneAndPersonne(user.getStructure().getCommune().getId(),communeCentreAssignationPaylaodWeb.getPersonneId());
if(communeCentreAssignationPaylaodWeb.getId()==null && communeCentreAssignationPaylaodWebOptional.isPresent()){ if(communeCentreAssignationPaylaodWeb.getId()==null && communeCentreAssignationPaylaodWebOptional.isPresent()){
throw new NotAcceptableException("Impossible de finaliser l'assignation : Le contribuable est déjà assigné au centre : "+communeCentreAssignationPaylaodWebOptional.get().getStructureNom()); throw new NotAcceptableException("Impossible de créer une nouvelle assignation de centre: Le contribuable est déjà assigné au centre : "+communeCentreAssignationPaylaodWebOptional.get().getStructureNom());
} }

View File

@@ -2,16 +2,16 @@ package io.gmss.fiscad.implementations.rfu.metier;
import io.gmss.fiscad.entities.decoupage.Arrondissement; import io.gmss.fiscad.entities.decoupage.Arrondissement;
import io.gmss.fiscad.entities.infocad.metier.Parcelle; import io.gmss.fiscad.entities.infocad.metier.Parcelle;
import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.entities.rfu.metier.DonneesImpositionTfu; import io.gmss.fiscad.entities.rfu.metier.DonneesImpositionTfu;
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu; import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuNonBati; import io.gmss.fiscad.entities.rfu.parametre.BaremRfuNonBati;
import io.gmss.fiscad.enums.StatusAvis; import io.gmss.fiscad.enums.StatusAvis;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.infocad.parametre.StructureService;
import io.gmss.fiscad.interfaces.rfu.metier.DonneesImpositionTfuService; import io.gmss.fiscad.interfaces.rfu.metier.DonneesImpositionTfuService;
import io.gmss.fiscad.paylaods.request.crudweb.*; import io.gmss.fiscad.paylaods.request.crudweb.ArrondissementPaylaodWeb;
import io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb;
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
import io.gmss.fiscad.paylaods.response.DonneesImpositionTfuResponse; import io.gmss.fiscad.paylaods.response.DonneesImpositionTfuResponse;
import io.gmss.fiscad.persistence.repositories.decoupage.ArrondissementRepository; import io.gmss.fiscad.persistence.repositories.decoupage.ArrondissementRepository;
import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository; import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository;
@@ -45,7 +45,6 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
private final ArrondissementRepository arrondissementRepository; private final ArrondissementRepository arrondissementRepository;
private final BaremRfuRepository baremRfuRepository; private final BaremRfuRepository baremRfuRepository;
private final EntityFromPayLoadService entityFromPayLoadService; private final EntityFromPayLoadService entityFromPayLoadService;
private final StructureService structureService;
@@ -107,7 +106,7 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb); ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
impositionsTfu.setStatusAvis(StatusAvis.TFU_FNB_GENERE); impositionsTfu.setStatusAvis(StatusAvis.TFU_FNB_GENERE);
//impositionsTfu.setNombreAvisFnb(nb); impositionsTfu.setNombreAvisFnb(nb);
impositionsTfuRepository.save(impositionsTfu); impositionsTfuRepository.save(impositionsTfu);
@@ -117,38 +116,23 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
@Override @Override
@Transactional @Transactional
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleNonBatieUneParcelle(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId,Long parcelleId) { public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleNonBatieUneParcelle(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId,Long parcelleId) {
boolean existsBareme = baremRfuNonBatiRepository.existsBaremForParcelleNonBati(parcelleId); boolean existsBareme = baremRfuNonBatiRepository.existsBaremForParcelleNonBati(parcelleId);
Optional<Parcelle> optionalParcelle= parcelleRepository.findById(parcelleId);
Optional<ParcellePayLoadWeb> optionalParcelle= parcelleRepository.findParcelleToDtoById(parcelleId);
String nomQuartier=""; String nomQuartier="";
String nomArrondissement=""; String nomArrondissement="";
String nomCommune=""; String nomCommune="";
if(optionalParcelle.isPresent()){ if(optionalParcelle.isPresent()){
nomQuartier= optionalParcelle.get().getQuartierNom(); nomQuartier= optionalParcelle.get().getQuartier().getNom();
nomArrondissement= optionalParcelle.get().getQuartier().getArrondissement().getNom();
nomCommune= optionalParcelle.get().getQuartier().getArrondissement().getCommune().getNom();
} }
if(!existsBareme){ if(!existsBareme){
throw new BadRequestException("Impossible de continuer la liquidation : Il n'existe pas de barème configuré pour la zone de cette parcelle : "+nomQuartier); throw new BadRequestException("Impossible de continuer la liquidation : Il n'existe pas de barème configuré pour la zone de cette parcelle : "+nomCommune+" : "+nomArrondissement+" : "+nomQuartier);
} }
Integer nb= donneesImpositionTfuRepository.genererDonneesTfuNonBatie(impositionsTfuPaylaodWeb.getId(),userId,parcelleId);
List<Structure> structures = structureService.getListStructureUserId(userId);
boolean existe = structures.stream()
.anyMatch(s -> s.getId().equals(impositionsTfuPaylaodWeb.getStructureId()));
if (!existe) {
throw new BadRequestException("Impossible de continuer la liquidation : La parcelle ne se trouve pas dans votre territoire ");
}
Integer nb= donneesImpositionTfuRepository.genererDonneesTfuNonBatie(impositionsTfuPaylaodWeb.getId(), userId, parcelleId);
System.out.println(nb);
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb); ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
impositionsTfu.setStatusAvis(StatusAvis.TFU_FNB_GENERE); impositionsTfu.setStatusAvis(StatusAvis.TFU_FNB_GENERE);
impositionsTfu.setNombreAvisFnb(nb);
impositionsTfuRepository.save(impositionsTfu); impositionsTfuRepository.save(impositionsTfu);
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null); return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
} }
@@ -174,9 +158,9 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb); ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
impositionsTfu.setStatusAvis(StatusAvis.GENERE); impositionsTfu.setStatusAvis(StatusAvis.GENERE);
//impositionsTfu.setNombreAvis(nbb+nbulo+ (impositionsTfu.getNombreAvisFnb()==null?0:impositionsTfu.getNombreAvisFnb())); impositionsTfu.setNombreAvis(nbb+nbulo+ (impositionsTfu.getNombreAvisFnb()==null?0:impositionsTfu.getNombreAvisFnb()));
//impositionsTfu.setNombreAvisBatiment(nbb); impositionsTfu.setNombreAvisBatiment(nbb);
//impositionsTfu.setNombreAvisUniteLog(nbulo); impositionsTfu.setNombreAvisUniteLog(nbulo);
impositionsTfuRepository.save(impositionsTfu); impositionsTfuRepository.save(impositionsTfu);
@@ -189,21 +173,23 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleBatieUneParcelle(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId, Long parcelleId) { public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleBatieUneParcelle(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId, Long parcelleId) {
Optional<ImpositionsTfuPaylaodWeb> imp=impositionsTfuRepository.findByIdToDto(impositionsTfuPaylaodWeb.getId()); Optional<ImpositionsTfuPaylaodWeb> imp=impositionsTfuRepository.findByIdToDto(impositionsTfuPaylaodWeb.getId());
if(imp.isPresent()){ if(imp.isPresent()){
boolean dejaLiquide = donneesImpositionTfuRepository.existsByImpositionAnneeAndParcelle(Long.valueOf(imp.get().getExerciceAnnee()),parcelleId); boolean dejaLiquide = donneesImpositionTfuRepository.existsByImpositionAnneeAndParcelle(Long.valueOf(imp.get().getExerciceAnnee()),parcelleId);
if(dejaLiquide){ if(dejaLiquide){
return imp.orElse(null); return imp.orElse(null);
} }
} }
boolean existsBareme = baremRfuRepository.existsBaremForParcelle(parcelleId);
Optional<ParcellePayLoadWeb> optionalParcelle= parcelleRepository.findParcelleToDtoById(parcelleId); boolean existsBareme = baremRfuRepository.existsBaremForParcelle(parcelleId);
Optional<Parcelle> optionalParcelle= parcelleRepository.findById(parcelleId);
String nomQuartier=""; String nomQuartier="";
String nomArrondissement=""; String nomArrondissement="";
String nomCommune=""; String nomCommune="";
if(optionalParcelle.isPresent()){ if(optionalParcelle.isPresent()){
nomQuartier= optionalParcelle.get().getQuartierNom(); nomQuartier= optionalParcelle.get().getQuartier().getNom();
nomArrondissement= optionalParcelle.get().getQuartier().getArrondissement().getNom();
nomCommune= optionalParcelle.get().getQuartier().getArrondissement().getCommune().getNom();
} }
if(!existsBareme){ if(!existsBareme){
throw new BadRequestException("Impossible de continuer la liquidation : Il n'existe pas de barème configuré pour la zone de cette parcelle : "+nomCommune+" : "+nomArrondissement+" : "+nomQuartier); throw new BadRequestException("Impossible de continuer la liquidation : Il n'existe pas de barème configuré pour la zone de cette parcelle : "+nomCommune+" : "+nomArrondissement+" : "+nomQuartier);
@@ -223,17 +209,20 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
Integer nbMajAcompteRirf= donneesImpositionTfuRepository.majDonneesAcompteRirfUneParcelle(impositionsTfuPaylaodWeb.getId(),parcelleId); Integer nbMajAcompteRirf= donneesImpositionTfuRepository.majDonneesAcompteRirfUneParcelle(impositionsTfuPaylaodWeb.getId(),parcelleId);
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb); ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
impositionsTfu.setStatusAvis(StatusAvis.GENERE); impositionsTfu.setStatusAvis(StatusAvis.GENERE);
impositionsTfu.setNombreAvis(impositionsTfu.getNombreAvis()+1);
impositionsTfu.setNombreAvisBatiment(impositionsTfu.getNombreAvisFnb()+1);
impositionsTfu.setNombreAvisUniteLog(impositionsTfu.getNombreAvisUniteLog()+1);
impositionsTfuRepository.save(impositionsTfu); impositionsTfuRepository.save(impositionsTfu);
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null); return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
} }
@Override @Override
public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImposition(Long impositionsId) { public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImposition(Long impositionsId) {
return donneesImpositionTfuRepository.findAllByImpositionTfuId(impositionsId); return donneesImpositionTfuRepository.findAllByImpositionTfuId(impositionsId);
@@ -303,58 +292,4 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByPersonneId(Long personneId) { public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByPersonneId(Long personneId) {
return donneesImpositionTfuRepository.findAllByPersonneId(personneId); return donneesImpositionTfuRepository.findAllByPersonneId(personneId);
} }
@Override
public Integer setDonneesFiscalesNonHomologable(List<DonneesImpositionPaylaodWeb> donneesImpositionPaylaodWebs) {
int nb=0;
if(donneesImpositionPaylaodWebs!=null){
for(DonneesImpositionPaylaodWeb donneesImpositionPaylaodWeb:donneesImpositionPaylaodWebs){
Optional<DonneesImpositionTfu> optionalDonneesImpositionTfu = donneesImpositionTfuRepository.findById(donneesImpositionPaylaodWeb.getId());
if(optionalDonneesImpositionTfu.isPresent()){
DonneesImpositionTfu donneesImpositionTfu=optionalDonneesImpositionTfu.get();
donneesImpositionTfu.setHomologable(false);
donneesImpositionTfuRepository.save(donneesImpositionTfu);
nb++ ;
}
}
}
return nb ;
}
@Override
public Integer setDonneesFiscalesHomologable(List<DonneesImpositionPaylaodWeb> donneesImpositionPaylaodWebs) {
int nb=0;
if(donneesImpositionPaylaodWebs!=null){
for(DonneesImpositionPaylaodWeb donneesImpositionPaylaodWeb:donneesImpositionPaylaodWebs){
Optional<DonneesImpositionTfu> optionalDonneesImpositionTfu = donneesImpositionTfuRepository.findById(donneesImpositionPaylaodWeb.getId());
if(optionalDonneesImpositionTfu.isPresent()){
DonneesImpositionTfu donneesImpositionTfu=optionalDonneesImpositionTfu.get();
donneesImpositionTfu.setHomologable(null);
donneesImpositionTfuRepository.save(donneesImpositionTfu);
nb++ ;
}
}
}
return nb ;
}
@Override
public Integer homologuer(Long impositionTfuId) {
return donneesImpositionTfuRepository.homologuerDonneesImposition(impositionTfuId);
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesNonHomologable(Long impositionTfuId,Pageable pageable) {
return donneesImpositionTfuRepository.findAllByImpositionTfuIdNonHomologablePageable(impositionTfuId,pageable);
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesHomologable(Long impositionTfuId,Pageable pageable) {
return donneesImpositionTfuRepository.findAllByImpositionTfuIdHomologablePageable(impositionTfuId,pageable);
}
} }

View File

@@ -7,10 +7,8 @@ import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.rfu.metier.Batiment; import io.gmss.fiscad.entities.rfu.metier.Batiment;
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment; import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment; import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment;
import io.gmss.fiscad.entities.user.Profile;
import io.gmss.fiscad.enums.StatutEdeclarationPropriete; import io.gmss.fiscad.enums.StatutEdeclarationPropriete;
import io.gmss.fiscad.enums.StatutEnquete; import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.enums.UserProfile;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.decoupage.SecteurService; import io.gmss.fiscad.interfaces.decoupage.SecteurService;
@@ -29,7 +27,6 @@ import io.gmss.fiscad.persistence.repositories.infocad.parametre.PersonneReposit
import io.gmss.fiscad.persistence.repositories.interface_sigibe.EdeclarationProprieteRepository; import io.gmss.fiscad.persistence.repositories.interface_sigibe.EdeclarationProprieteRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.BatimentRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.BatimentRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository;
import io.gmss.fiscad.persistence.repositories.user.ProfileRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService; import io.gmss.fiscad.service.EntityFromPayLoadService;
import jakarta.transaction.Transactional; import jakarta.transaction.Transactional;
import jakarta.ws.rs.NotAcceptableException; import jakarta.ws.rs.NotAcceptableException;
@@ -51,7 +48,6 @@ public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
private final BatimentRepository batimentRepository; private final BatimentRepository batimentRepository;
private final BatimentService batimentService; private final BatimentService batimentService;
private final SecteurService secteurService; private final SecteurService secteurService;
private final ProfileRepository profileRepository;
@@ -191,28 +187,6 @@ public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
} }
@Override
public Page<EnqueteBatimentPayloadWeb> getEnqueteBatimentListByQuartierByProfilPageableToDto(Long userId, Long quartierId, Long profilId, Pageable pageable) {
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
List<Long> secteurIds = secteurs.stream()
.map(Secteur::getId)
.toList();
Page<EnqueteBatimentPayloadWeb> enqueteBatimentPayloadWebs = Page.empty(pageable);
Optional<Profile> optionalProfile= profileRepository.findProfileById(profilId);
if(optionalProfile.isPresent()){
if (optionalProfile.get().getNom().equals(UserProfile.GESSECTCHEF)){
enqueteBatimentPayloadWebs=enqueteBatimentRepository.findAllEnqueteBatimentByQuartierByStatutToDtoPageable(quartierId,secteurIds,StatutEnquete.EN_COURS,pageable);
}else if(optionalProfile.get().getNom().equals(UserProfile.GESCHEF) || optionalProfile.get().getNom().equals(UserProfile.GESCENTRE)){
enqueteBatimentPayloadWebs=enqueteBatimentRepository.findAllEnqueteBatimentByQuartierByStatutToDtoPageable(quartierId,secteurIds,StatutEnquete.CONTROLE,pageable);
}
}
return enqueteBatimentPayloadWebs;
}
@Override @Override
public EnqueteBatimentPayloadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public EnqueteBatimentPayloadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
if (enqueteTraitementPayLoad == null || enqueteTraitementPayLoad.getIdBackend()==null) { if (enqueteTraitementPayLoad == null || enqueteTraitementPayLoad.getIdBackend()==null) {
@@ -239,30 +213,6 @@ public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
return enqueteBatimentRepository.findEnqueteBatimentByIdToDto(enqueteBatiment.getId()).orElse(null); return enqueteBatimentRepository.findEnqueteBatimentByIdToDto(enqueteBatiment.getId()).orElse(null);
} }
@Override
public EnqueteBatimentPayloadWeb controlerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
if (enqueteTraitementPayLoad == null || enqueteTraitementPayLoad.getIdBackend()==null) {
throw new BadRequestException("Impossible de valider une enquête ayant un id null.");
}
Optional<EnqueteBatiment> optionalEnqueteBatiment = enqueteBatimentRepository.findById(enqueteTraitementPayLoad.getIdBackend());
if (!optionalEnqueteBatiment.isPresent()) {
throw new NotFoundException("Impossible de trouver l'enquête que vous désirez valider.");
}
if(optionalEnqueteBatiment.get().getStatutEnquete()==StatutEnquete.CLOTURE ||
optionalEnqueteBatiment.get().getStatutEnquete()==StatutEnquete.REJETE ||
optionalEnqueteBatiment.get().getStatutEnquete()==StatutEnquete.CONTROLE ){
throw new NotAcceptableException("Impossible de valider : Le statut actuel "+optionalEnqueteBatiment.get().getStatutEnquete()+" ne le permet pas.");
}
EnqueteBatiment enqueteBatiment = optionalEnqueteBatiment.get();
enqueteBatiment.setDateValidation(LocalDate.now());
enqueteBatiment.setStatutEnquete(StatutEnquete.CONTROLE);
enqueteBatiment= enqueteBatimentRepository.save(enqueteBatiment);
return enqueteBatimentRepository.findEnqueteBatimentByIdToDto(enqueteBatiment.getId()).orElse(null);
}
@Override @Override
public EnqueteBatimentPayloadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public EnqueteBatimentPayloadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
if (enqueteTraitementPayLoad == null || enqueteTraitementPayLoad.getIdBackend()==null) { if (enqueteTraitementPayLoad == null || enqueteTraitementPayLoad.getIdBackend()==null) {
@@ -297,19 +247,6 @@ public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
return enqueteBatimentPayloadWebs; return enqueteBatimentPayloadWebs;
} }
@Override
public List<EnqueteBatimentPayloadWeb> controlerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
List<EnqueteBatimentPayloadWeb> enqueteBatimentPayloadWebs = new ArrayList<>();
try {
for (EnqueteTraitementPayLoad enqueteTraitementPayLoad : enqueteTraitementPayLoads) {
enqueteBatimentPayloadWebs.add(controlerEnquete(enqueteTraitementPayLoad));
}
} catch (Exception e) {
enqueteBatimentPayloadWebs.add(null);
}
return enqueteBatimentPayloadWebs;
}
@Override @Override
public List<EnqueteBatimentPayloadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) { public List<EnqueteBatimentPayloadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
List<EnqueteBatimentPayloadWeb> enqueteBatimentPayloadWebs = new ArrayList<>(); List<EnqueteBatimentPayloadWeb> enqueteBatimentPayloadWebs = new ArrayList<>();

View File

@@ -5,10 +5,8 @@ import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.infocad.metier.Upload; import io.gmss.fiscad.entities.infocad.metier.Upload;
import io.gmss.fiscad.entities.infocad.parametre.Personne; import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.rfu.metier.*; import io.gmss.fiscad.entities.rfu.metier.*;
import io.gmss.fiscad.entities.user.Profile;
import io.gmss.fiscad.enums.StatutEdeclarationPropriete; import io.gmss.fiscad.enums.StatutEdeclarationPropriete;
import io.gmss.fiscad.enums.StatutEnquete; import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.enums.UserProfile;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.decoupage.SecteurService; import io.gmss.fiscad.interfaces.decoupage.SecteurService;
@@ -25,7 +23,6 @@ import io.gmss.fiscad.persistence.repositories.infocad.metier.UploadRepository;
import io.gmss.fiscad.persistence.repositories.infocad.parametre.PersonneRepository; import io.gmss.fiscad.persistence.repositories.infocad.parametre.PersonneRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.UniteLogementRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.UniteLogementRepository;
import io.gmss.fiscad.persistence.repositories.user.ProfileRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService; import io.gmss.fiscad.service.EntityFromPayLoadService;
import jakarta.transaction.Transactional; import jakarta.transaction.Transactional;
import jakarta.ws.rs.NotAcceptableException; import jakarta.ws.rs.NotAcceptableException;
@@ -48,7 +45,6 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
private final UniteLogementService uniteLogementService ; private final UniteLogementService uniteLogementService ;
private final SecteurService secteurService ; private final SecteurService secteurService ;
private final EdeclarationProprieteService edeclarationProprieteService ; private final EdeclarationProprieteService edeclarationProprieteService ;
private final ProfileRepository profileRepository ;
@@ -191,25 +187,6 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
return enqueteUniteLogementRepository.findAllEnqueteUniteLogementByQuartierByStatutToDtoPageable(quartierId,secteurIds,statutEnquete,pageable); return enqueteUniteLogementRepository.findAllEnqueteUniteLogementByQuartierByStatutToDtoPageable(quartierId,secteurIds,statutEnquete,pageable);
} }
@Override
public Page<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementListByQuartierByProfilPageableToDto(Long userId, Long quartierId, Long profilId, Pageable pageable) {
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
List<Long> secteurIds = secteurs.stream()
.map(Secteur::getId)
.toList();
Page<EnqueteUniteLogementPayloadWeb> uniteLogementPayloadWebs = Page.empty(pageable);
Optional<Profile> optionalProfile= profileRepository.findProfileById(profilId);
if(optionalProfile.isPresent()){
if (optionalProfile.get().getNom().equals(UserProfile.GESSECTCHEF)){
uniteLogementPayloadWebs=enqueteUniteLogementRepository.findAllEnqueteUniteLogementByQuartierByStatutToDtoPageable(quartierId,secteurIds,StatutEnquete.EN_COURS,pageable);
}else if(optionalProfile.get().getNom().equals(UserProfile.GESCHEF) || optionalProfile.get().getNom().equals(UserProfile.GESCENTRE)){
uniteLogementPayloadWebs=enqueteUniteLogementRepository.findAllEnqueteUniteLogementByQuartierByStatutToDtoPageable(quartierId,secteurIds,StatutEnquete.CONTROLE,pageable);
}
}
return uniteLogementPayloadWebs;
}
@Override @Override
public EnqueteUniteLogementPayloadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public EnqueteUniteLogementPayloadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
@@ -237,29 +214,6 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
return enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(enqueteUniteLogement.getId()).orElse(null); return enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(enqueteUniteLogement.getId()).orElse(null);
} }
@Override
public EnqueteUniteLogementPayloadWeb controlerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
if (enqueteTraitementPayLoad == null || enqueteTraitementPayLoad.getIdBackend()==null) {
throw new BadRequestException("Impossible de valider une enquête ayant un id null.");
}
Optional<EnqueteUniteLogement> optionalEnqueteUniteLogement = enqueteUniteLogementRepository.findById(enqueteTraitementPayLoad.getIdBackend());
if (!optionalEnqueteUniteLogement.isPresent()) {
throw new NotFoundException("Impossible de trouver l'enquête que vous désirez valider.");
}
if(optionalEnqueteUniteLogement.get().getStatutEnquete()==StatutEnquete.CLOTURE ||
optionalEnqueteUniteLogement.get().getStatutEnquete()==StatutEnquete.REJETE ||
optionalEnqueteUniteLogement.get().getStatutEnquete()==StatutEnquete.CONTROLE ){
throw new NotAcceptableException("Impossible de valider : Le statut actuel "+optionalEnqueteUniteLogement.get().getStatutEnquete()+" ne le permet pas.");
}
EnqueteUniteLogement enqueteUniteLogement = optionalEnqueteUniteLogement.get();
enqueteUniteLogement.setDateValidation(LocalDate.now());
enqueteUniteLogement.setStatutEnquete(StatutEnquete.CONTROLE);
enqueteUniteLogement= enqueteUniteLogementRepository.save(enqueteUniteLogement);
return enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(enqueteUniteLogement.getId()).orElse(null);
}
@Override @Override
public EnqueteUniteLogementPayloadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public EnqueteUniteLogementPayloadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
if (enqueteTraitementPayLoad == null || enqueteTraitementPayLoad.getIdBackend()==null) { if (enqueteTraitementPayLoad == null || enqueteTraitementPayLoad.getIdBackend()==null) {
@@ -294,20 +248,6 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
return enqueteUniteLogementPayloadWebs; return enqueteUniteLogementPayloadWebs;
} }
@Override
public List<EnqueteUniteLogementPayloadWeb> controlerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
List<EnqueteUniteLogementPayloadWeb> enqueteUniteLogementPayloadWebs = new ArrayList<>();
try {
for (EnqueteTraitementPayLoad enqueteTraitementPayLoad : enqueteTraitementPayLoads) {
enqueteUniteLogementPayloadWebs.add(controlerEnquete(enqueteTraitementPayLoad));
}
} catch (Exception e) {
enqueteUniteLogementPayloadWebs.add(null);
}
return enqueteUniteLogementPayloadWebs;
}
@Override @Override
public List<EnqueteUniteLogementPayloadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) { public List<EnqueteUniteLogementPayloadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
List<EnqueteUniteLogementPayloadWeb> enqueteUniteLogementPayloadWebs = new ArrayList<>(); List<EnqueteUniteLogementPayloadWeb> enqueteUniteLogementPayloadWebs = new ArrayList<>();

View File

@@ -7,7 +7,6 @@ import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.infocad.metier.EnqueteService; import io.gmss.fiscad.interfaces.infocad.metier.EnqueteService;
import io.gmss.fiscad.interfaces.infocad.parametre.StructureService; import io.gmss.fiscad.interfaces.infocad.parametre.StructureService;
import io.gmss.fiscad.interfaces.rfu.metier.DonneesImpositionTfuService;
import io.gmss.fiscad.interfaces.rfu.metier.ImpositionsTfuService; import io.gmss.fiscad.interfaces.rfu.metier.ImpositionsTfuService;
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb; import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository;
@@ -29,7 +28,6 @@ public class ImpositionsTfuServiceImpl implements ImpositionsTfuService {
private final ImpositionsTfuRepository impositionsTfuRepository; private final ImpositionsTfuRepository impositionsTfuRepository;
private final StructureService structureService; private final StructureService structureService;
private final DonneesImpositionTfuService donneesImpositionTfuService;
private final EntityFromPayLoadService entityFromPayLoadService; private final EntityFromPayLoadService entityFromPayLoadService;
private final EnqueteService enqueteService; private final EnqueteService enqueteService;
@@ -54,8 +52,7 @@ public class ImpositionsTfuServiceImpl implements ImpositionsTfuService {
List<StatusAvis> statusAvis= new ArrayList<>(); List<StatusAvis> statusAvis= new ArrayList<>();
statusAvis.add(StatusAvis.EN_COURS); statusAvis.add(StatusAvis.EN_COURS);
statusAvis.add(StatusAvis.CLOTURE); statusAvis.add(StatusAvis.CLOTURE);
statusAvis.add(StatusAvis.GENERE); statusAvis.add(StatusAvis.GENERATION_AUTORISE);
statusAvis.add(StatusAvis.HOMOLOGUE);
Optional<ImpositionsTfu> optionalImpositionsTfu= impositionsTfuRepository.findDistinctByStructure_IdAndExercice_IdAndStatusAvisIn(impositionsTfuPaylaodWeb.getStructureId(),impositionsTfuPaylaodWeb.getExerciceId(),statusAvis); Optional<ImpositionsTfu> optionalImpositionsTfu= impositionsTfuRepository.findDistinctByStructure_IdAndExercice_IdAndStatusAvisIn(impositionsTfuPaylaodWeb.getStructureId(),impositionsTfuPaylaodWeb.getExerciceId(),statusAvis);
@@ -116,28 +113,6 @@ public class ImpositionsTfuServiceImpl implements ImpositionsTfuService {
@Override @Override
public ImpositionsTfuPaylaodWeb autoriserGenerationImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException { public ImpositionsTfuPaylaodWeb autoriserGenerationImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException {
// if (impositionsTfuPaylaodWeb.getId() == null) {
// throw new BadRequestException("Impossible de valider une imposition ayant un id null.");
// }
// if (!impositionsTfuRepository.existsById(impositionsTfuPaylaodWeb.getId())) {
// throw new NotFoundException("Impossible de trouver l'imposition spécifiée dans notre base de données.");
// }
//
// ImpositionsTfu impositionsTfu= entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
//
// if(!impositionsTfu.getStatusAvis().equals(StatusAvis.CLOTURE)){
// throw new NotFoundException("L'état actuel : "+impositionsTfu.getStatusAvis()+ " ne permet pas de passer à l'état Autorisé");
// }
// impositionsTfu.setDateGeneration(LocalDate.now());
// impositionsTfu.setStatusAvis(StatusAvis.GENERATION_AUTORISE);
// impositionsTfu =impositionsTfuRepository.save(impositionsTfu);
// return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
return null;
}
@Transactional
@Override
public ImpositionsTfuPaylaodWeb homologuerImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException {
if (impositionsTfuPaylaodWeb.getId() == null) { if (impositionsTfuPaylaodWeb.getId() == null) {
throw new BadRequestException("Impossible de valider une imposition ayant un id null."); throw new BadRequestException("Impossible de valider une imposition ayant un id null.");
} }
@@ -147,13 +122,12 @@ public class ImpositionsTfuServiceImpl implements ImpositionsTfuService {
ImpositionsTfu impositionsTfu= entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb); ImpositionsTfu impositionsTfu= entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
if(!impositionsTfu.getStatusAvis().equals(StatusAvis.GENERE)){ if(!impositionsTfu.getStatusAvis().equals(StatusAvis.CLOTURE)){
throw new NotFoundException("L'état actuel : "+impositionsTfu.getStatusAvis()+ " ne permet pas de passer à l'état Autorisé"); throw new NotFoundException("L'état actuel : "+impositionsTfu.getStatusAvis()+ " ne permet pas de passer à l'état Autorisé");
} }
impositionsTfu.setDateGeneration(LocalDate.now()); impositionsTfu.setDateGeneration(LocalDate.now());
impositionsTfu.setStatusAvis(StatusAvis.HOMOLOGUE); impositionsTfu.setStatusAvis(StatusAvis.GENERATION_AUTORISE);
impositionsTfu =impositionsTfuRepository.save(impositionsTfu); impositionsTfu =impositionsTfuRepository.save(impositionsTfu);
donneesImpositionTfuService.homologuer(impositionsTfu.getId());
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null); return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
} }
@@ -211,9 +185,4 @@ public class ImpositionsTfuServiceImpl implements ImpositionsTfuService {
System.out.println(structureIds.get(0)); System.out.println(structureIds.get(0));
return impositionsTfuRepository.findByStructureIdsToDto(structureIds); return impositionsTfuRepository.findByStructureIdsToDto(structureIds);
} }
@Override
public List<ImpositionsTfuPaylaodWeb> getImpositionsTfuByStructureIdByStatut(Long structureId, StatusAvis statusAvis) {
return impositionsTfuRepository.findByStructureIdByStatutToDto(structureId,statusAvis);
}
} }

View File

@@ -1,136 +0,0 @@
package io.gmss.fiscad.implementations.rfu.metier;
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
import io.gmss.fiscad.entities.rfu.metier.Participer;
import io.gmss.fiscad.exceptions.ApplicationException;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.rfu.metier.ParticiperService;
import io.gmss.fiscad.paylaods.request.crudweb.ParticiperPayloadWeb;
import io.gmss.fiscad.persistence.repositories.infocad.metier.ParcelleRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.ParticiperRepository;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.EquipeRepository;
import io.gmss.fiscad.persistence.repositories.user.UserRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@AllArgsConstructor
@Service
public class ParticiperServiceImpl implements ParticiperService {
private final ParticiperRepository participerRepository;
private final EquipeRepository equipeRepository;
private final UserRepository userRepository;
private final EntityFromPayLoadService entityFromPayLoadService;
@Override
public ParticiperPayloadWeb createParticiper(ParticiperPayloadWeb participerPaylaodWeb) throws BadRequestException {
if (participerPaylaodWeb.getId() != null) {
throw new BadRequestException("Impossible de créer un nouveau participer ayant un id non null.");
}
if (participerPaylaodWeb.getEquipeId() == null) {
throw new BadRequestException("Impossible de créer un nouveau participer: L'équipe doit être précisée.");
}else {
if(!equipeRepository.existsById(participerPaylaodWeb.getEquipeId()))
throw new BadRequestException("Impossible de créer la participation: L'équipe doit être précisée.");
}
if (participerPaylaodWeb.getUserId() == null) {
throw new BadRequestException("Impossible de créer la participation : Le participant doit être précisé.");
}else {
if(!userRepository.existsById(participerPaylaodWeb.getUserId()))
throw new BadRequestException("Impossible de créer un nouveau participer: Le participant doit être précisé.");
}
if (participerRepository.existsByEquipeIdAndUserId(
participerPaylaodWeb.getEquipeId(),
participerPaylaodWeb.getUserId())) {
throw new ApplicationException("Cet utilisateur participe déjà à cette équipe.");
}
Participer participer= entityFromPayLoadService.getParticiperFromPayLoadWeb(participerPaylaodWeb);
participer= participerRepository.save(participer);
return participerRepository.findPayloadById(participer.getId()).orElse(null);
}
@Override
public ParticiperPayloadWeb updateParticiper(Long id,ParticiperPayloadWeb participerPaylaodWeb) throws NotFoundException {
if (participerPaylaodWeb.getId() == null) {
throw new BadRequestException("Participation non spécifiée");
}
if (!participerRepository.existsById(participerPaylaodWeb.getId())) {
throw new NotFoundException("Impossible de trouver la participation.");
}
if (participerPaylaodWeb.getEquipeId() == null) {
throw new BadRequestException("Impossible de créer un nouveau participer: L'équipe doit être précisée.");
}else {
if(!equipeRepository.existsById(participerPaylaodWeb.getEquipeId()))
throw new BadRequestException("Impossible de créer un nouveau participer: L'équipe doit être précisée.");
}
if (participerPaylaodWeb.getUserId() == null) {
throw new BadRequestException("Impossible de créer un nouveau participer: Le participant doit être précisé.");
}else {
if(!userRepository.existsById(participerPaylaodWeb.getUserId()))
throw new BadRequestException("Impossible de créer un nouveau participer: Le participant doit être précisé.");
}
Participer participer= entityFromPayLoadService.getParticiperFromPayLoadWeb(participerPaylaodWeb);
participer= participerRepository.save(participer);
return participerRepository.findPayloadById(participer.getId()).orElse(null);
}
@Override
public void deleteParticiper(Long id) throws NotFoundException {
Optional<Participer> participerOptional = participerRepository.findById(id);
if (participerOptional.isPresent()) {
participerRepository.deleteById(participerOptional.get().getId());
} else {
throw new NotFoundException("Impossible de trouver le participer spécifié dans notre base de données.");
}
}
@Override
public Page<ParticiperPayloadWeb> getParticiperList(Pageable pageable) {
return participerRepository.findAllPayload(pageable);
}
@Override
public List<ParticiperPayloadWeb> getParticiperList() {
return participerRepository.findAllPayload();
}
@Override
public Page<ParticiperPayloadWeb> getParticiperListByEquipePageable(Long equipeId, Pageable pageable) {
return participerRepository.findAllPayloadByEquipeId(equipeId,pageable);
}
@Override
public List<ParticiperPayloadWeb> getParticiperListByEquipe(Long equipeId) {
return participerRepository.findAllPayloadByEquipeId(equipeId);
}
@Override
public Optional<ParticiperPayloadWeb> getParticiperById(Long id) {
if (participerRepository.existsById(id)) {
return participerRepository.findPayloadById(id);
} else {
throw new NotFoundException("Impossible de trouver la participation spécifiée dans la base de données.");
}
}
}

View File

@@ -1,16 +1,11 @@
package io.gmss.fiscad.implementations.rfu.parametre; package io.gmss.fiscad.implementations.rfu.parametre;
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
import io.gmss.fiscad.entities.rfu.metier.Batiment;
import io.gmss.fiscad.entities.rfu.parametre.Campagne; import io.gmss.fiscad.entities.rfu.parametre.Campagne;
import io.gmss.fiscad.enums.TypeCampagne; import io.gmss.fiscad.enums.TypeCampagne;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.rfu.parametre.CampagneService; import io.gmss.fiscad.interfaces.rfu.parametre.CampagneService;
import io.gmss.fiscad.paylaods.request.crudweb.CampagnePayloadWeb;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.CampagneRepository; import io.gmss.fiscad.persistence.repositories.rfu.parametre.CampagneRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -19,36 +14,29 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
@Service @Service
@AllArgsConstructor
public class CampagneServiceImpl implements CampagneService { public class CampagneServiceImpl implements CampagneService {
private final CampagneRepository campagneRepository; private final CampagneRepository campagneRepository;
private final EntityFromPayLoadService entityFromPayLoadService;
public CampagneServiceImpl(CampagneRepository campagneRepository) {
this.campagneRepository = campagneRepository;
}
@Override @Override
public CampagnePayloadWeb createCampagne(CampagnePayloadWeb campagnePayloadWeb) throws BadRequestException { public Campagne createCampagne(Campagne campagne) throws BadRequestException {
if (campagnePayloadWeb.getId() != null) { if (campagne.getId() != null) {
throw new BadRequestException("Impossible de créer une nouvelle campgne ayant un id non null."); throw new BadRequestException("Impossible de créer une nouvelle campgne ayant un id non null.");
} }
return campagneRepository.save(campagne);
Campagne campagne= entityFromPayLoadService.getCampagneFromPayLoadWeb(campagnePayloadWeb);
campagne= campagneRepository.save(campagne);
return campagneRepository.findPayloadById(campagne.getId()).orElse(null);
} }
@Override @Override
public CampagnePayloadWeb updateCampagne(Long id, CampagnePayloadWeb campagnePayloadWeb) throws NotFoundException { public Campagne updateCampagne(Long id, Campagne campagne) throws NotFoundException {
if (campagnePayloadWeb.getId() == null) { if (campagne.getId() == null) {
throw new BadRequestException("Impossible de mettre à jour une nouvelle campagne ayant un id null."); throw new BadRequestException("Impossible de mettre à jour une nouvelle campagne ayant un id null.");
} }
if (!campagneRepository.existsById(campagnePayloadWeb.getId())) { if (!campagneRepository.existsById(campagne.getId())) {
throw new NotFoundException("Impossible de trouver la campagne spécifiée dans notre base de données."); throw new NotFoundException("Impossible de trouver la campagne spécifiée dans notre base de données.");
} }
Campagne campagne= entityFromPayLoadService.getCampagneFromPayLoadWeb(campagnePayloadWeb); return campagneRepository.save(campagne);
campagne= campagneRepository.save(campagne);
return campagneRepository.findPayloadById(campagne.getId()).orElse(null);
} }
@Override @Override
@@ -61,13 +49,13 @@ public class CampagneServiceImpl implements CampagneService {
} }
} }
@Override @Override
public Page<CampagnePayloadWeb> getCampagneList(Pageable pageable) { public Page<Campagne> getCampagneList(Pageable pageable) {
return campagneRepository.findAllPayload(pageable); return campagneRepository.findAll(pageable);
} }
@Override @Override
public List<CampagnePayloadWeb> getCampagneList() { public List<Campagne> getCampagneList() {
return campagneRepository.findAllPayload(); return campagneRepository.findAll();
} }
@Override @Override
@@ -76,28 +64,8 @@ public class CampagneServiceImpl implements CampagneService {
} }
@Override @Override
public Optional<CampagnePayloadWeb> getCampagneById(Long id) { public Optional<Campagne> getCampagneById(Long id) {
return campagneRepository.findPayloadById(id); return campagneRepository.findById(id);
}
@Override
public List<CampagnePayloadWeb> getCampagneByExerciceId(Long exerciceId) {
return campagneRepository.findAllPayloadByExerciceId(exerciceId);
}
@Override
public Page<CampagnePayloadWeb> getCampagneByExerciceId(Long exerciceId, Pageable pageable) {
return campagneRepository.findAllPayloadByExerciceId(exerciceId,pageable);
}
@Override
public List<CampagnePayloadWeb> getCampagneByStructureId(Long structureId) {
return campagneRepository.findAllPayloadByStructureId(structureId);
}
@Override
public Page<CampagnePayloadWeb> getCampagneByStructureId(Long structureId, Pageable pageable) {
return campagneRepository.findAllPayloadByStructureId(structureId,pageable);
} }
} }

View File

@@ -1,13 +1,10 @@
package io.gmss.fiscad.implementations.rfu.parametre; package io.gmss.fiscad.implementations.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
import io.gmss.fiscad.entities.rfu.parametre.Caracteristique; import io.gmss.fiscad.entities.rfu.parametre.Caracteristique;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.rfu.parametre.CaracteristiqueService; import io.gmss.fiscad.interfaces.rfu.parametre.CaracteristiqueService;
import io.gmss.fiscad.paylaods.request.crudweb.CaracteristiquePayloadWeb;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.CaracteristiqueRepository; import io.gmss.fiscad.persistence.repositories.rfu.parametre.CaracteristiqueRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -19,36 +16,28 @@ import java.util.Optional;
public class CaracteristiqueServiceImpl implements CaracteristiqueService { public class CaracteristiqueServiceImpl implements CaracteristiqueService {
private final CaracteristiqueRepository caracteristiqueRepository; private final CaracteristiqueRepository caracteristiqueRepository;
private final EntityFromPayLoadService entityFromPayLoadService;
public CaracteristiqueServiceImpl(CaracteristiqueRepository caracteristiqueRepository, EntityFromPayLoadService entityFromPayLoadService) { public CaracteristiqueServiceImpl(CaracteristiqueRepository caracteristiqueRepository) {
this.caracteristiqueRepository = caracteristiqueRepository; this.caracteristiqueRepository = caracteristiqueRepository;
this.entityFromPayLoadService = entityFromPayLoadService;
} }
@Override @Override
public CaracteristiquePayloadWeb createCaracteristique(CaracteristiquePayloadWeb caracteristiquePayloadWeb) throws BadRequestException { public Caracteristique createCaracteristique(Caracteristique caracteristique) throws BadRequestException {
if (caracteristiquePayloadWeb.getId() != null) { if (caracteristique.getId() != null) {
throw new BadRequestException("Impossible de créer une nouvelle caracteristique ayant un id non null."); throw new BadRequestException("Impossible de créer une nouvelle caracteristique ayant un id non null.");
} }
Caracteristique caracteristique = entityFromPayLoadService.getCaracteristiqueFromPayLoadWeb(caracteristiquePayloadWeb); return caracteristiqueRepository.save(caracteristique);
caracteristique = caracteristiqueRepository.save(caracteristique);
return caracteristiqueRepository.findPayloadById(caracteristique.getId()).orElse(null);
} }
@Override @Override
public CaracteristiquePayloadWeb updateCaracteristique(Long id, CaracteristiquePayloadWeb caracteristiquePayloadWeb) throws NotFoundException { public Caracteristique updateCaracteristique(Long id, Caracteristique caracteristique) throws NotFoundException {
if (caracteristiquePayloadWeb.getId() == null) { if (caracteristique.getId() == null) {
throw new BadRequestException("Impossible de mettre à jour une nouvelle caracteristique ayant un id null."); throw new BadRequestException("Impossible de mettre à jour une nouvelle caracteristique ayant un id null.");
} }
if (!caracteristiqueRepository.existsById(caracteristiquePayloadWeb.getId())) { if (!caracteristiqueRepository.existsById(caracteristique.getId())) {
throw new NotFoundException("Impossible de trouver la caractéristique spécifiée dans notre base de données."); throw new NotFoundException("Impossible de trouver la caractéristique spécifiée dans notre base de données.");
} }
Caracteristique caracteristique = entityFromPayLoadService.getCaracteristiqueFromPayLoadWeb(caracteristiquePayloadWeb); return caracteristiqueRepository.save(caracteristique);
caracteristique = caracteristiqueRepository.save(caracteristique);
return caracteristiqueRepository.findPayloadById(caracteristique.getId()).orElse(null);
} }
@Override @Override
@@ -62,20 +51,20 @@ public class CaracteristiqueServiceImpl implements CaracteristiqueService {
} }
@Override @Override
public List<CaracteristiquePayloadWeb> getCaracteristiqueList() { public Page<Caracteristique> getCaracteristiqueList(Pageable pageable) {
return caracteristiqueRepository.findAllPayload(); return caracteristiqueRepository.findAll(pageable);
} }
@Override @Override
public Page<CaracteristiquePayloadWeb> getCaracteristiqueListPage(Pageable pageable) { public List<Caracteristique> getCaracteristiqueList() {
return caracteristiqueRepository.findAllPayload(pageable); return caracteristiqueRepository.findAll();
} }
@Override @Override
public Optional<CaracteristiquePayloadWeb> getCaracteristiqueById(Long id) { public Optional<Caracteristique> getCaracteristiqueById(Long id) {
if (caracteristiqueRepository.existsById(id)) { if (caracteristiqueRepository.existsById(id)) {
return caracteristiqueRepository.findPayloadById(id); return caracteristiqueRepository.findById(id);
} else { } else {
throw new NotFoundException("Impossible de trouver la caractéristique spécifiée dans la base de données."); throw new NotFoundException("Impossible de trouver la caractéristique spécifiée dans la base de données.");
} }

View File

@@ -1,131 +1,121 @@
package io.gmss.fiscad.implementations.rfu.parametre; package io.gmss.fiscad.implementations.rfu.parametre;
import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.entities.infocad.parametre.Bloc;
import io.gmss.fiscad.entities.rfu.parametre.Campagne;
import io.gmss.fiscad.entities.rfu.parametre.Equipe; import io.gmss.fiscad.entities.rfu.parametre.Equipe;
import io.gmss.fiscad.entities.rfu.parametre.Participer;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.rfu.parametre.EquipeService; import io.gmss.fiscad.interfaces.rfu.parametre.EquipeService;
import io.gmss.fiscad.paylaods.request.crudweb.EquipePayloadWeb; import io.gmss.fiscad.paylaods.request.synchronisation.EquipePayload;
import io.gmss.fiscad.paylaods.request.synchronisation.ParticiperPayload;
import io.gmss.fiscad.persistence.repositories.decoupage.SecteurRepository;
import io.gmss.fiscad.persistence.repositories.infocad.parametre.BlocRepository;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.CampagneRepository;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.EquipeRepository; import io.gmss.fiscad.persistence.repositories.rfu.parametre.EquipeRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService; import io.gmss.fiscad.persistence.repositories.user.UserRepository;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@AllArgsConstructor
@Service @Service
public class EquipeServiceImpl implements EquipeService { public class EquipeServiceImpl implements EquipeService {
private final EntityFromPayLoadService entityFromPayLoadService; private final EquipeRepository equipeRepository;
private final EquipeRepository equipeRepository; private final UserRepository userRepository;
private final BlocRepository blocRepository;
private final SecteurRepository secteurRepository;
private final CampagneRepository campagneRepository;
public EquipeServiceImpl(EquipeRepository equipeRepository, UserRepository userRepository, BlocRepository blocRepository, SecteurRepository secteurRepository, CampagneRepository campagneRepository) {
this.equipeRepository = equipeRepository;
this.userRepository = userRepository;
this.blocRepository = blocRepository;
this.secteurRepository = secteurRepository;
this.campagneRepository = campagneRepository;
}
@Override @Override
public EquipePayloadWeb create(EquipePayloadWeb equipePayloadWeb) { public Equipe createEquipe(EquipePayload equipePayload) throws BadRequestException {
if (equipePayloadWeb.getId() != null) { if (equipePayload.getId() != null) {
throw new BadRequestException("Impossible de créer une nouvelle caracteristique ayant un id non null."); throw new BadRequestException("Impossible de créer une nouvelle equipe ayant un id non null.");
} }
Equipe equipe = entityFromPayLoadService.getEquipeFromPayLoadWeb(equipePayloadWeb); Equipe equipe = getEquipeFromPayload(equipePayload);
equipe = equipeRepository.save(equipe); return equipeRepository.save(equipe);
return equipeRepository.findPayloadById(equipe.getId()).orElse(null); }
private Equipe getEquipeFromPayload(EquipePayload equipePayload) {
Equipe equipe = new Equipe();
Optional<Bloc> optionalBloc = blocRepository.findById(equipePayload.getBlocId());
equipe.setBloc(optionalBloc.orElse(null));
equipe.setId(equipePayload.getId());
equipe.setCode(equipePayload.getCode());
equipe.setNom(equipePayload.getNom());
Optional<Secteur> optionalSecteur = secteurRepository.findById(equipePayload.getSecteurId());
equipe.setSecteur(optionalSecteur.orElse(null));
Optional<Campagne> optionalCampagne = campagneRepository.findById(equipePayload.getCampagneId());
equipe.setCampagne(optionalCampagne.orElse(null));
List<Participer> participerList = new ArrayList<>();
for (ParticiperPayload pp : equipePayload.getParticiperPayloads()) {
Participer part = new Participer();
part.setId(pp.getId());
if (pp.getEquipeId() != null && equipeRepository.existsById(equipe.getId())) {
part.setEquipe(equipeRepository.findById(equipe.getId()).orElse(null));
}
if (pp.getUserId() != null && userRepository.existsById(pp.getUserId())) {
part.setUser(userRepository.findById(pp.getUserId()).orElse(null));
}
part.setDateDebut(pp.getDateDebut());
part.setDateFin(pp.getDateFin());
participerList.add(part);
}
equipe.setParticipers(participerList);
return equipe;
} }
@Override @Override
public EquipePayloadWeb update(Long id, EquipePayloadWeb equipePayloadWeb) { public Equipe updateEquipe(Long id, EquipePayload equipePayload) throws NotFoundException {
if (equipePayloadWeb.getId() == null) { if (equipePayload.getId() == null) {
throw new BadRequestException("Impossible de faire la mise à jour: Equipe non fournie"); throw new BadRequestException("Impossible de mettre à jour une nouvelle equipe ayant un id null.");
} }
Optional<Equipe> optionalEquipe=Optional.empty(); if (!equipeRepository.existsById(equipePayload.getId())) {
if(!equipeRepository.existsById(equipePayloadWeb.getId())){ throw new NotFoundException("Impossible de trouver la equipe spécifiée dans notre base de données.");
throw new BadRequestException("Impossible de faire la mise à jour: Equipe non fournie");
} }
Equipe equipe = getEquipeFromPayload(equipePayload);
Equipe equipe = entityFromPayLoadService.getEquipeFromPayLoadWeb(equipePayloadWeb); return equipeRepository.save(equipe);
equipe = equipeRepository.save(equipe);
return equipeRepository.findPayloadById(equipe.getId()).orElse(null);
} }
@Override @Override
public void delete(Long id) { public void deleteEquipe(Long id) throws NotFoundException {
Optional<Equipe> optionalEquipe = equipeRepository.findById(id); Optional<Equipe> equipeOptional = equipeRepository.findById(id);
if (optionalEquipe.isPresent()) { if (equipeOptional.isPresent()) {
equipeRepository.deleteById(optionalEquipe.get().getId()); equipeRepository.deleteById(equipeOptional.get().getId());
} else { } else {
throw new NotFoundException("Impossible de trouver lquipe spécifiée."); throw new NotFoundException("Impossible de trouver la equipe spécifiée dans notre base de données.");
} }
} }
@Override @Override
public EquipePayloadWeb findById(Long id) { public Page<Equipe> getEquipeList(Pageable pageable) {
if (equipeRepository.existsById(id)) { return equipeRepository.findAll(pageable);
return equipeRepository.findPayloadById(id).orElse(null);
} else {
throw new NotFoundException("Impossible de trouver la caractéristique spécifiée dans la base de données.");
}
} }
@Override @Override
public List<EquipePayloadWeb> findAll() { public List<Equipe> getEquipeList() {
return equipeRepository.findAllPayload(); return equipeRepository.findAll();
} }
@Override
public Page<EquipePayloadWeb> findAll(Pageable pageable) {
return equipeRepository.findAllPayload(pageable);
}
@Override @Override
public List<EquipePayloadWeb> findByCampagneId(Long campagneId) { public Optional<Equipe> getEquipeById(Long id) {
return equipeRepository.findAllPayloadByCampagneId(campagneId); return equipeRepository.findById(id);
}
@Override
public Page<EquipePayloadWeb> findByCampagneId(Long campagneId, Pageable pageable) {
return equipeRepository.findAllPayloadByCampagneId(campagneId,pageable);
}
@Override
public List<EquipePayloadWeb> findBySecteurId(Long secteurId) {
return equipeRepository.findAllPayloadBySecteurId(secteurId);
}
@Override
public Page<EquipePayloadWeb> findBySecteurId(Long secteurId, Pageable pageable) {
return null;
}
@Override
public List<EquipePayloadWeb> findByQuartierId(Long quartierId) {
return equipeRepository.findAllPayloadByQuartierId(quartierId);
}
@Override
public Page<EquipePayloadWeb> findByQuartierId(Long quartierId, Pageable pageable) {
return null;
}
@Override
public List<EquipePayloadWeb> findByBlocId(Long blocId) {
return null;
}
@Override
public Page<EquipePayloadWeb> findByBlocId(Long blocId, Pageable pageable) {
return null;
}
@Override
public boolean existsById(Long id) {
return false;
}
@Override
public boolean existsByCode(String code) {
return false;
}
@Override
public Optional<Equipe> findEntityById(Long id) {
return Optional.empty();
} }
} }

View File

@@ -1,7 +1,6 @@
package io.gmss.fiscad.implementations.rfu.parametre; package io.gmss.fiscad.implementations.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.Exercice; import io.gmss.fiscad.entities.rfu.parametre.Exercice;
import io.gmss.fiscad.exceptions.ApplicationException;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.rfu.parametre.ExerciceService; import io.gmss.fiscad.interfaces.rfu.parametre.ExerciceService;
@@ -23,14 +22,8 @@ public class ExerciceServiceImpl implements ExerciceService {
@Override @Override
public Exercice createExercice(Exercice exercice) throws BadRequestException { public Exercice createExercice(Exercice exercice) throws BadRequestException {
if (exercice.getId() == null) { if (exercice.getId() != null) {
if (exerciceRepository.existsByAnnee(exercice.getAnnee())) { throw new BadRequestException("Impossible de créer une nouvelle campgne ayant un id non null.");
throw new ApplicationException("Un exercice existe déjà pour l'année " + exercice.getAnnee() + ".");
}
} else {
if (exerciceRepository.existsByAnneeAndIdNot(exercice.getAnnee(), exercice.getId())) {
throw new ApplicationException("Un exercice existe déjà pour l'année " + exercice.getAnnee() + ".");
}
} }
return exerciceRepository.save(exercice); return exerciceRepository.save(exercice);
} }

View File

@@ -1,10 +1,8 @@
package io.gmss.fiscad.implementations.statistiques; package io.gmss.fiscad.implementations.statistiques;
import io.gmss.fiscad.entities.decoupage.Secteur; import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.entities.user.Profile;
import io.gmss.fiscad.entities.user.User; import io.gmss.fiscad.entities.user.User;
import io.gmss.fiscad.enums.StatutEnquete; import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.enums.UserProfile;
import io.gmss.fiscad.interfaces.decoupage.SecteurService; import io.gmss.fiscad.interfaces.decoupage.SecteurService;
import io.gmss.fiscad.interfaces.statistique.StatistiquesService; import io.gmss.fiscad.interfaces.statistique.StatistiquesService;
import io.gmss.fiscad.interfaces.user.UserService; import io.gmss.fiscad.interfaces.user.UserService;
@@ -17,7 +15,6 @@ import io.gmss.fiscad.persistence.repositories.rfu.metier.BatimentRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.UniteLogementRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.UniteLogementRepository;
import io.gmss.fiscad.persistence.repositories.user.ProfileRepository;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -27,7 +24,6 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional;
@Service @Service
public class StatistiquesServiceImpl implements StatistiquesService { public class StatistiquesServiceImpl implements StatistiquesService {
@@ -41,9 +37,8 @@ public class StatistiquesServiceImpl implements StatistiquesService {
private final SecteurService secteurService; private final SecteurService secteurService;
private final EnqueteBatimentRepository enqueteBatimentRepository; private final EnqueteBatimentRepository enqueteBatimentRepository;
private final EnqueteUniteLogementRepository enqueteUniteLogementRepository; private final EnqueteUniteLogementRepository enqueteUniteLogementRepository;
private final ProfileRepository profileRepository;
public StatistiquesServiceImpl(UserService userService, EnqueteRepository enqueteRepository, ParcelleRepository parcelleRepository, BatimentRepository batimentRepository, UniteLogementRepository uniteLogementRepository, PersonneRepository personneRepository, SecteurService secteurService, EnqueteBatimentRepository enqueteBatimentRepository, EnqueteUniteLogementRepository enqueteUniteLogementRepository, ProfileRepository profileRepository) { public StatistiquesServiceImpl(UserService userService, EnqueteRepository enqueteRepository, ParcelleRepository parcelleRepository, BatimentRepository batimentRepository, UniteLogementRepository uniteLogementRepository, PersonneRepository personneRepository, SecteurService secteurService, EnqueteBatimentRepository enqueteBatimentRepository, EnqueteUniteLogementRepository enqueteUniteLogementRepository) {
this.userService = userService; this.userService = userService;
this.enqueteRepository = enqueteRepository; this.enqueteRepository = enqueteRepository;
this.parcelleRepository = parcelleRepository; this.parcelleRepository = parcelleRepository;
@@ -53,7 +48,6 @@ public class StatistiquesServiceImpl implements StatistiquesService {
this.secteurService = secteurService; this.secteurService = secteurService;
this.enqueteBatimentRepository = enqueteBatimentRepository; this.enqueteBatimentRepository = enqueteBatimentRepository;
this.enqueteUniteLogementRepository = enqueteUniteLogementRepository; this.enqueteUniteLogementRepository = enqueteUniteLogementRepository;
this.profileRepository = profileRepository;
} }
@@ -135,28 +129,4 @@ public class StatistiquesServiceImpl implements StatistiquesService {
return nombreEnquetesParObjet; return nombreEnquetesParObjet;
} }
@Override
public NombreEnquetesParObjet getStatNombreEnqueteParObjetUserConnectProfil(Long userId, Long profilId) {
NombreEnquetesParObjet nombreEnquetesParObjet= new NombreEnquetesParObjet();
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
List<Long> secteurIds = secteurs.stream()
.map(Secteur::getId)
.toList();
Optional<Profile> optionalProfile= profileRepository.findProfileById(profilId);
if(optionalProfile.isPresent()){
if (optionalProfile.get().getNom().equals(UserProfile.GESSECTCHEF)){
nombreEnquetesParObjet.setNombreEnqueteUniteLogement(enqueteUniteLogementRepository.getNombreEnqueteUniteLogementByUserConnecte(secteurIds,StatutEnquete.EN_COURS.toString()));
nombreEnquetesParObjet.setNombreEnqueteParcelle(enqueteRepository.getNombreEnqueteByUserConnecte(secteurIds,StatutEnquete.EN_COURS.toString()));
nombreEnquetesParObjet.setNombreEnqueteBatiment(enqueteBatimentRepository.getNombreEnqueteBatimentByUserConnecte(secteurIds,StatutEnquete.EN_COURS.toString()));
}else if(optionalProfile.get().getNom().equals(UserProfile.GESCHEF) || optionalProfile.get().getNom().equals(UserProfile.GESCENTRE)){
nombreEnquetesParObjet.setNombreEnqueteUniteLogement(enqueteUniteLogementRepository.getNombreEnqueteUniteLogementByUserConnecte(secteurIds,StatutEnquete.CONTROLE.toString()));
nombreEnquetesParObjet.setNombreEnqueteParcelle(enqueteRepository.getNombreEnqueteByUserConnecte(secteurIds,StatutEnquete.CONTROLE.toString()));
nombreEnquetesParObjet.setNombreEnqueteBatiment(enqueteBatimentRepository.getNombreEnqueteBatimentByUserConnecte(secteurIds,StatutEnquete.CONTROLE.toString()));
}
}
return nombreEnquetesParObjet;
}
} }

View File

@@ -137,10 +137,9 @@ public class UserServiceImpl implements UserService {
public UserPaylaodWeb updateUser(Long id, UserPaylaodWeb userPaylaodWeb) { public UserPaylaodWeb updateUser(Long id, UserPaylaodWeb userPaylaodWeb) {
if ((userRepository.findByUsername(userPaylaodWeb.getLogin()).isEmpty()) if ((userRepository.findByUsername(userPaylaodWeb.getLogin()).isEmpty())
&& (userRepository.findByEmail(userPaylaodWeb.getEmail()).isEmpty())) { || (userRepository.findByEmail(userPaylaodWeb.getEmail()).isEmpty())) {
throw new BadRequestException("Cet utilisateur n'existe pas."); throw new BadRequestException("Cet utilisateur n'existe pas.");
} }
if (userPaylaodWeb.getId() == null) { if (userPaylaodWeb.getId() == null) {
throw new BadRequestException("Cet utilisateur n'existe déjà."); throw new BadRequestException("Cet utilisateur n'existe déjà.");
} }
@@ -379,11 +378,6 @@ public class UserServiceImpl implements UserService {
return !isTokenExpired(tokenDate); return !isTokenExpired(tokenDate);
} }
@Override
public List<UserPaylaodWeb> getUsersByFonctionId(Long fonctionId) {
return userRepository.findAllUserByFonctionToDto(fonctionId);
}
/** /**
* Calcule la date d'expiration du token en ajoutant 24h à sa date de génération. * Calcule la date d'expiration du token en ajoutant 24h à sa date de génération.
@@ -408,7 +402,9 @@ public class UserServiceImpl implements UserService {
if (dateToken == null) { if (dateToken == null) {
return true; return true;
} }
LocalDateTime dateExpiration = calculerDateExpiration(dateToken); LocalDateTime dateExpiration = calculerDateExpiration(dateToken);
return LocalDateTime.now().isAfter(dateExpiration); return LocalDateTime.now().isAfter(dateExpiration);
} }

View File

@@ -12,9 +12,9 @@ import java.util.Optional;
public interface QuartierService { public interface QuartierService {
QuartierPaylaodWeb createQuartier(QuartierPaylaodWeb quartierPaylaodWeb) throws BadRequestException; Quartier createQuartier(Quartier quartier) throws BadRequestException;
QuartierPaylaodWeb updateQuartier(Long id, QuartierPaylaodWeb quartierPaylaodWeb) throws NotFoundException; Quartier updateQuartier(Long id, Quartier quartier) throws NotFoundException;
void deleteQuartier(Long id) throws NotFoundException; void deleteQuartier(Long id) throws NotFoundException;

View File

@@ -34,11 +34,8 @@ public interface SecteurDecoupageService {
List<ParcelleStatsProjectionUnSecteur> getStatParcelleDecoupageUnSecteur(Long secteurId) ; List<ParcelleStatsProjectionUnSecteur> getStatParcelleDecoupageUnSecteur(Long secteurId) ;
List<ParcelleStatsProjectionUnSecteur> getStatParcelleDecoupageByUserId(Long userId) ; List<ParcelleStatsProjectionUnSecteur> getStatParcelleDecoupageByUserId(Long userId) ;
List<ParcelleStatsProjectionUnSecteur> getStatEnqueteDecoupageByUserId(Long userId, String statutEnquete) ; List<ParcelleStatsProjectionUnSecteur> getStatEnqueteDecoupageByUserId(Long userId, String statutEnquete) ;
List<ParcelleStatsProjectionUnSecteur> getStatEnqueteDecoupageByUserIdByProfilId(Long userId, Long profilId) ;
List<ParcelleStatsProjectionUnSecteur> getStatEnqueteBatimentDecoupageByUserId(Long userId, String statutEnquete) ; List<ParcelleStatsProjectionUnSecteur> getStatEnqueteBatimentDecoupageByUserId(Long userId, String statutEnquete) ;
List<ParcelleStatsProjectionUnSecteur> getStatEnqueteBatimentDecoupageByUserIdByProfilId(Long userId, Long profilId) ;
List<ParcelleStatsProjectionUnSecteur> getStatEnqueteUniteLogementDecoupageByUserId(Long userId, String statutEnquete) ; List<ParcelleStatsProjectionUnSecteur> getStatEnqueteUniteLogementDecoupageByUserId(Long userId, String statutEnquete) ;
List<ParcelleStatsProjectionUnSecteur> getStatEnqueteUniteLogementDecoupageByUserIdByProfilId(Long userId, Long profilId ) ;
List<ParcelleStatsProjectionUnSecteur> getStatDeclarationProprieteByUserId(Long userId, String statutDeclcarationPropriete) ; List<ParcelleStatsProjectionUnSecteur> getStatDeclarationProprieteByUserId(Long userId, String statutDeclcarationPropriete) ;

View File

@@ -41,12 +41,10 @@ public interface EnqueteService {
Optional<EnquetePayLoadWeb> getEnqueteById(Long id); Optional<EnquetePayLoadWeb> getEnqueteById(Long id);
EnquetePayLoadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad); EnquetePayLoadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
EnquetePayLoadWeb controlerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
EnquetePayLoadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad); EnquetePayLoadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
List<EnquetePayLoadWeb> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads); List<EnquetePayLoadWeb> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
List<EnquetePayLoadWeb> controlerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
List<EnquetePayLoadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads); List<EnquetePayLoadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
@@ -67,6 +65,5 @@ public interface EnqueteService {
Page<EnquetePayLoadWeb> getEnqueteListByQuartierByStatutPageableToDto(Long userId, Long quartierId, StatutEnquete statutEnquete, Pageable pageable); Page<EnquetePayLoadWeb> getEnqueteListByQuartierByStatutPageableToDto(Long userId, Long quartierId, StatutEnquete statutEnquete, Pageable pageable);
Page<EnquetePayLoadWeb> getEnqueteListByQuartierByProfilByStatutPageableToDto(Long userId, Long quartierId, Long profilId,Pageable pageable);
} }

View File

@@ -3,7 +3,6 @@ package io.gmss.fiscad.interfaces.infocad.parametre;
import io.gmss.fiscad.entities.infocad.parametre.ModeAcquisition; import io.gmss.fiscad.entities.infocad.parametre.ModeAcquisition;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.ModeAcquisitionPayloadWeb;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -12,15 +11,15 @@ import java.util.Optional;
public interface ModeAcquisitionService { public interface ModeAcquisitionService {
ModeAcquisitionPayloadWeb createModeAcquisition(ModeAcquisitionPayloadWeb modeAcquisitionPayloadWeb) throws BadRequestException; ModeAcquisition createModeAcquisition(ModeAcquisition modeAcquisition) throws BadRequestException;
ModeAcquisitionPayloadWeb updateModeAcquisition(Long id, ModeAcquisitionPayloadWeb modeAcquisitionPayloadWeb) throws NotFoundException; ModeAcquisition updateModeAcquisition(Long id, ModeAcquisition modeAcquisition) throws NotFoundException;
void deleteModeAcquisition(Long id) throws NotFoundException; void deleteModeAcquisition(Long id) throws NotFoundException;
Page<ModeAcquisitionPayloadWeb> getModeAcquisitionList(Pageable pageable); Page<ModeAcquisition> getModeAcquisitionList(Pageable pageable);
List<ModeAcquisitionPayloadWeb> getModeAcquisitionList(); List<ModeAcquisition> getModeAcquisitionList();
Optional<ModeAcquisitionPayloadWeb> getModeAcquisitionById(Long id); Optional<ModeAcquisition> getModeAcquisitionById(Long id);
} }

View File

@@ -36,6 +36,5 @@ public interface StructureService {
public List<Structure> getListStructureUserId(Long userId) ; public List<Structure> getListStructureUserId(Long userId) ;
public List<StructurePaylaodWeb> getListStructureAvoirFonctionId(Long avoirFonctionId) ;
} }

View File

@@ -52,10 +52,5 @@ public interface DonneesImpositionTfuService {
//List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByParcelleIdAndExercice(Long parcelleId, Long exerciceId); //List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByParcelleIdAndExercice(Long parcelleId, Long exerciceId);
Integer setDonneesFiscalesNonHomologable(List<DonneesImpositionPaylaodWeb> donneesImpositionPaylaodWebs);
Integer setDonneesFiscalesHomologable(List<DonneesImpositionPaylaodWeb> donneesImpositionPaylaodWebs);
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesNonHomologable(Long impositionTfuId,Pageable pageable);
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesHomologable(Long impositionTfuId,Pageable pageable);
public Integer homologuer(Long impositionTfuId);
} }

View File

@@ -31,15 +31,12 @@ public interface EnqueteBatimentService {
List<EnqueteBatimentPayloadWeb> getEnqueteBatimentByBatimentList(Long batimentId); List<EnqueteBatimentPayloadWeb> getEnqueteBatimentByBatimentList(Long batimentId);
Page<EnqueteBatimentPayloadWeb> getEnqueteBatimentListByQuartierByStatutPageableToDto(Long userId, Long quartierId, StatutEnquete statutEnquete, Pageable pageable); Page<EnqueteBatimentPayloadWeb> getEnqueteBatimentListByQuartierByStatutPageableToDto(Long userId, Long quartierId, StatutEnquete statutEnquete, Pageable pageable);
Page<EnqueteBatimentPayloadWeb> getEnqueteBatimentListByQuartierByProfilPageableToDto(Long userId, Long quartierId, Long profilId, Pageable pageable);
EnqueteBatimentPayloadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad); EnqueteBatimentPayloadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
EnqueteBatimentPayloadWeb controlerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
EnqueteBatimentPayloadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad); EnqueteBatimentPayloadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
List<EnqueteBatimentPayloadWeb> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads); List<EnqueteBatimentPayloadWeb> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
List<EnqueteBatimentPayloadWeb> controlerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
List<EnqueteBatimentPayloadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads); List<EnqueteBatimentPayloadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);

View File

@@ -32,15 +32,12 @@ public interface EnqueteUniteLogementService {
Optional<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementById(Long enqueteUniteLogement); Optional<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementById(Long enqueteUniteLogement);
Page<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementListByQuartierByStatutPageableToDto(Long userId, Long quartierId, StatutEnquete statutEnquete, Pageable pageable); Page<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementListByQuartierByStatutPageableToDto(Long userId, Long quartierId, StatutEnquete statutEnquete, Pageable pageable);
Page<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementListByQuartierByProfilPageableToDto(Long userId, Long quartierId, Long profilId, Pageable pageable);
EnqueteUniteLogementPayloadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad); EnqueteUniteLogementPayloadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
EnqueteUniteLogementPayloadWeb controlerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
EnqueteUniteLogementPayloadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad); EnqueteUniteLogementPayloadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
List<EnqueteUniteLogementPayloadWeb> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads); List<EnqueteUniteLogementPayloadWeb> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
List<EnqueteUniteLogementPayloadWeb> controlerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
List<EnqueteUniteLogementPayloadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads); List<EnqueteUniteLogementPayloadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
} }

View File

@@ -1,7 +1,6 @@
package io.gmss.fiscad.interfaces.rfu.metier; package io.gmss.fiscad.interfaces.rfu.metier;
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu; import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
import io.gmss.fiscad.enums.StatusAvis;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb; import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
@@ -17,7 +16,6 @@ public interface ImpositionsTfuService {
ImpositionsTfuPaylaodWeb rejeterImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException; ImpositionsTfuPaylaodWeb rejeterImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException;
ImpositionsTfuPaylaodWeb cloturerImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException; ImpositionsTfuPaylaodWeb cloturerImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException;
ImpositionsTfuPaylaodWeb autoriserGenerationImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException; ImpositionsTfuPaylaodWeb autoriserGenerationImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException;
ImpositionsTfuPaylaodWeb homologuerImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException;
ImpositionsTfuPaylaodWeb updateImpositionsTfu(Long id, ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws NotFoundException; ImpositionsTfuPaylaodWeb updateImpositionsTfu(Long id, ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws NotFoundException;
@@ -29,5 +27,4 @@ public interface ImpositionsTfuService {
Optional<ImpositionsTfuPaylaodWeb> getImpositionsTfuById(Long id); Optional<ImpositionsTfuPaylaodWeb> getImpositionsTfuById(Long id);
List<ImpositionsTfuPaylaodWeb> getImpositionsTfuByUserIdIds(Long userId); List<ImpositionsTfuPaylaodWeb> getImpositionsTfuByUserIdIds(Long userId);
List<ImpositionsTfuPaylaodWeb> getImpositionsTfuByStructureIdByStatut(Long structureId, StatusAvis statusAvis);
} }

View File

@@ -1,30 +0,0 @@
package io.gmss.fiscad.interfaces.rfu.metier;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.ParticiperPayloadWeb;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Optional;
public interface ParticiperService {
ParticiperPayloadWeb createParticiper(ParticiperPayloadWeb participerPayloadWeb) throws BadRequestException;
ParticiperPayloadWeb updateParticiper(Long id,ParticiperPayloadWeb participerPayloadWeb) throws NotFoundException;
void deleteParticiper(Long id) throws NotFoundException;
Page<ParticiperPayloadWeb> getParticiperList(Pageable pageable);
List<ParticiperPayloadWeb> getParticiperList();
Page<ParticiperPayloadWeb> getParticiperListByEquipePageable(Long equipeId, Pageable pageable);
List<ParticiperPayloadWeb> getParticiperListByEquipe(Long equipeId);
Optional<ParticiperPayloadWeb> getParticiperById(Long id);
}

View File

@@ -4,7 +4,6 @@ import io.gmss.fiscad.entities.rfu.parametre.Campagne;
import io.gmss.fiscad.enums.TypeCampagne; import io.gmss.fiscad.enums.TypeCampagne;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.CampagnePayloadWeb;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -13,23 +12,18 @@ import java.util.Optional;
public interface CampagneService { public interface CampagneService {
CampagnePayloadWeb createCampagne(CampagnePayloadWeb campagnePayloadWeb) throws BadRequestException; Campagne createCampagne(Campagne campagne) throws BadRequestException;
CampagnePayloadWeb updateCampagne(Long id, CampagnePayloadWeb campagnePayloadWeb) throws NotFoundException; Campagne updateCampagne(Long id, Campagne campagne) throws NotFoundException;
void deleteCampagne(Long id) throws NotFoundException; void deleteCampagne(Long id) throws NotFoundException;
Page<CampagnePayloadWeb> getCampagneList(Pageable pageable); Page<Campagne> getCampagneList(Pageable pageable);
List<CampagnePayloadWeb> getCampagneList(); List<Campagne> getCampagneList();
List<Campagne> getCampagnesByType(TypeCampagne typeCampagne); List<Campagne> getCampagnesByType(TypeCampagne typeCampagne);
Optional<CampagnePayloadWeb> getCampagneById(Long id); Optional<Campagne> getCampagneById(Long id);
List<CampagnePayloadWeb> getCampagneByExerciceId(Long exerciceId);
Page<CampagnePayloadWeb> getCampagneByExerciceId(Long exerciceId,Pageable pageable);
List<CampagnePayloadWeb> getCampagneByStructureId(Long structureId);
Page<CampagnePayloadWeb> getCampagneByStructureId(Long structureId, Pageable pageable);
} }

View File

@@ -3,7 +3,6 @@ package io.gmss.fiscad.interfaces.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.Caracteristique; import io.gmss.fiscad.entities.rfu.parametre.Caracteristique;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.CaracteristiquePayloadWeb;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -12,16 +11,15 @@ import java.util.Optional;
public interface CaracteristiqueService { public interface CaracteristiqueService {
CaracteristiquePayloadWeb createCaracteristique(CaracteristiquePayloadWeb caracteristiquePayloadWeb) throws BadRequestException; Caracteristique createCaracteristique(Caracteristique caracteristique) throws BadRequestException;
CaracteristiquePayloadWeb updateCaracteristique(Long id, CaracteristiquePayloadWeb caracteristiquePayloadWeb) throws NotFoundException; Caracteristique updateCaracteristique(Long id, Caracteristique caracteristique) throws NotFoundException;
void deleteCaracteristique(Long id) throws NotFoundException; void deleteCaracteristique(Long id) throws NotFoundException;
Page<CaracteristiquePayloadWeb> getCaracteristiqueListPage(Pageable pageable); Page<Caracteristique> getCaracteristiqueList(Pageable pageable);
List<CaracteristiquePayloadWeb> getCaracteristiqueList();
//List<CaracteristiquePayloadWeb> getCaracteristiqueListByTypeImmeuble(Long typeImmeubleId); List<Caracteristique> getCaracteristiqueList();
Optional<CaracteristiquePayloadWeb> getCaracteristiqueById(Long id); Optional<Caracteristique> getCaracteristiqueById(Long id);
} }

View File

@@ -3,7 +3,6 @@ package io.gmss.fiscad.interfaces.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.Equipe; import io.gmss.fiscad.entities.rfu.parametre.Equipe;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.EquipePayloadWeb;
import io.gmss.fiscad.paylaods.request.synchronisation.EquipePayload; import io.gmss.fiscad.paylaods.request.synchronisation.EquipePayload;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -13,42 +12,16 @@ import java.util.Optional;
public interface EquipeService { public interface EquipeService {
// CRUD Equipe createEquipe(EquipePayload equipePayload) throws BadRequestException;
EquipePayloadWeb create(EquipePayloadWeb payload);
EquipePayloadWeb update(Long id, EquipePayloadWeb payload); Equipe updateEquipe(Long id, EquipePayload equipePayload) throws NotFoundException;
void delete(Long id); void deleteEquipe(Long id) throws NotFoundException;
// Recherche Page<Equipe> getEquipeList(Pageable pageable);
EquipePayloadWeb findById(Long id);
List<EquipePayloadWeb> findAll(); List<Equipe> getEquipeList();
Page<EquipePayloadWeb> findAll(Pageable pageable); Optional<Equipe> getEquipeById(Long id);
// Filtres
List<EquipePayloadWeb> findByCampagneId(Long campagneId);
Page<EquipePayloadWeb> findByCampagneId(Long campagneId, Pageable pageable);
List<EquipePayloadWeb> findBySecteurId(Long secteurId);
Page<EquipePayloadWeb> findBySecteurId(Long secteurId, Pageable pageable);
List<EquipePayloadWeb> findByQuartierId(Long quartierId);
Page<EquipePayloadWeb> findByQuartierId(Long quartierId, Pageable pageable);
List<EquipePayloadWeb> findByBlocId(Long blocId);
Page<EquipePayloadWeb> findByBlocId(Long blocId, Pageable pageable);
// Vérifications
boolean existsById(Long id);
boolean existsByCode(String code);
Optional<Equipe> findEntityById(Long id);
} }

View File

@@ -12,5 +12,4 @@ public interface StatistiquesService {
StatNombreTotalObjet getStatNombreTotalObjet(String codeDecoupageAdmin); StatNombreTotalObjet getStatNombreTotalObjet(String codeDecoupageAdmin);
List<StatistiqueTypeNombreResponse> getStatNombrePersonneParCategorie(); List<StatistiqueTypeNombreResponse> getStatNombrePersonneParCategorie();
NombreEnquetesParObjet getStatNombreEnqueteParObjetUserConnect(Long userId, String statutEnquete); NombreEnquetesParObjet getStatNombreEnqueteParObjetUserConnect(Long userId, String statutEnquete);
NombreEnquetesParObjet getStatNombreEnqueteParObjetUserConnectProfil(Long userId, Long profilId);
} }

View File

@@ -66,6 +66,4 @@ public interface UserService {
Boolean validationTokenResetPassword(String token); Boolean validationTokenResetPassword(String token);
List<UserPaylaodWeb> getUsersByFonctionId(Long fonctionId);
} }

View File

@@ -1,49 +0,0 @@
package io.gmss.fiscad.paylaods.request.crudweb;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
import io.gmss.fiscad.enums.TypeCampagne;
import jakarta.persistence.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
@NoArgsConstructor
@Data
public class CampagnePayloadWeb {
private Long id;
private String refAdministrative;
private String nom;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateDebut;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateFin;
@Enumerated(EnumType.STRING)
private TypeCampagne typeCampagne;
private Long exerciceId ;
private Integer exerciceAnnee ;
private Long structureId ;
private String structureCode ;
private String structureNom ;
public CampagnePayloadWeb(Long id, String refAdministrative, String nom, LocalDate dateDebut, LocalDate dateFin, TypeCampagne typeCampagne, Long exerciceId, Integer exerciceAnnee, Long structureId, String structureCode, String structureNom) {
this.id = id;
this.refAdministrative = refAdministrative;
this.nom = nom;
this.dateDebut = dateDebut;
this.dateFin = dateFin;
this.typeCampagne = typeCampagne;
this.exerciceId = exerciceId;
this.exerciceAnnee = exerciceAnnee;
this.structureId = structureId;
this.structureCode = structureCode;
this.structureNom = structureNom;
}
}

View File

@@ -1,41 +0,0 @@
package io.gmss.fiscad.paylaods.request.crudweb;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.gmss.fiscad.entities.decoupage.Arrondissement;
import io.gmss.fiscad.entities.infocad.metier.Tpe;
import io.gmss.fiscad.entities.rfu.parametre.CategorieBatiment;
import io.gmss.fiscad.entities.rfu.parametre.TypeCaracteristique;
import io.gmss.fiscad.enums.TypeImmeuble;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.FetchType;
import jakarta.persistence.ManyToOne;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
@NoArgsConstructor
@Data
public class CaracteristiquePayloadWeb {
private Long id;
private String code;
private String libelle;
private boolean actif;
@Enumerated(EnumType.STRING)
private TypeImmeuble typeImmeuble;
private Long typeCaracteristiqueId;
private String typeCaracteristiqueCode;
private String typeCaracteristiqueLibelle;
public CaracteristiquePayloadWeb(Long id, String code, String libelle, boolean actif, TypeImmeuble typeImmeuble, Long typeCaracteristiqueId, String typeCaracteristiqueCode, String typeCaracteristiqueLibelle) {
this.id = id;
this.code = code;
this.libelle = libelle;
this.actif = actif;
this.typeImmeuble = typeImmeuble;
this.typeCaracteristiqueId = typeCaracteristiqueId;
this.typeCaracteristiqueCode = typeCaracteristiqueCode;
this.typeCaracteristiqueLibelle = typeCaracteristiqueLibelle;
}
}

View File

@@ -76,7 +76,6 @@ public class DonneesImpositionPaylaodWeb {
private Long valeurLocativeAdmMetreCarre; private Long valeurLocativeAdmMetreCarre;
private Long valeurAdminParcelleNbMetreCarre; private Long valeurAdminParcelleNbMetreCarre;
private Float montantTaxe; private Float montantTaxe;
private Boolean homologable ;
public DonneesImpositionPaylaodWeb(Long id, public DonneesImpositionPaylaodWeb(Long id,
Long annee, Long annee,
@@ -136,8 +135,7 @@ public class DonneesImpositionPaylaodWeb {
Long valeurParcelle, Long valeurParcelle,
Long valeurLocativeAdmMetreCarre, Long valeurLocativeAdmMetreCarre,
Long valeurAdministrativeParcelleNonBatiAuMetreCarre, Long valeurAdministrativeParcelleNonBatiAuMetreCarre,
Float montantTaxe, Float montantTaxe
Boolean homologable
) { ) {
this.id = id; this.id = id;
this.annee = annee; this.annee = annee;
@@ -199,6 +197,5 @@ public class DonneesImpositionPaylaodWeb {
this.valeurLocativeAdmMetreCarre = valeurLocativeAdmMetreCarre; this.valeurLocativeAdmMetreCarre = valeurLocativeAdmMetreCarre;
this.valeurAdminParcelleNbMetreCarre = valeurAdministrativeParcelleNonBatiAuMetreCarre; this.valeurAdminParcelleNbMetreCarre = valeurAdministrativeParcelleNonBatiAuMetreCarre;
this.montantTaxe = montantTaxe; this.montantTaxe = montantTaxe;
this.homologable = homologable == null || homologable;
} }
} }

View File

@@ -36,7 +36,6 @@ public class EnquetePayLoadWeb {
private Long zoneRfuId; private Long zoneRfuId;
private String zoneRfuNom; private String zoneRfuNom;
private Long personneId; private Long personneId;
private String personneIfu;
private String personneNom; private String personneNom;
private String personnePrenom; private String personnePrenom;
private String personneRaisonSociale; private String personneRaisonSociale;

View File

@@ -1,58 +0,0 @@
package io.gmss.fiscad.paylaods.request.crudweb;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
@NoArgsConstructor
@Data
public class EquipePayloadWeb {
private Long id;
private String code;
private String nom;
private Long blocId;
private String blocCode;
private Long secteurId;
private String secteurCode;
private String secteurNom;
private Long campagneId;
private String campagneNom;
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateDebut;
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateFin;
private Long quartierId;
private String quartierCode;
private String quartierNom;
public EquipePayloadWeb(Long id, String code, String nom, Long blocId, String blocCode, Long secteurId, String secteurCode, String secteurNom, Long campagneId, String campagneNom, LocalDate dateDebut, LocalDate dateFin, Long quartierId, String quartierCode, String quartierNom) {
this.id = id;
this.code = code;
this.nom = nom;
this.blocId = blocId;
this.blocCode = blocCode;
this.secteurId = secteurId;
this.secteurCode = secteurCode;
this.secteurNom = secteurNom;
this.campagneId = campagneId;
this.campagneNom = campagneNom;
this.dateDebut = dateDebut;
this.dateFin = dateFin;
this.quartierId = quartierId;
this.quartierCode = quartierCode;
this.quartierNom = quartierNom;
}
}

View File

@@ -11,7 +11,6 @@ import io.gmss.fiscad.enums.StatusAvis;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.hibernate.annotations.Formula;
import java.time.LocalDate; import java.time.LocalDate;

View File

@@ -1,21 +0,0 @@
package io.gmss.fiscad.paylaods.request.crudweb;
import io.gmss.fiscad.entities.infocad.metier.Piece;
import io.gmss.fiscad.entities.infocad.parametre.TypePersonne;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Set;
@NoArgsConstructor
@Data
public class ModeAcquisitionPayloadWeb {
private Long id;
private String libelle;
public ModeAcquisitionPayloadWeb(Long id, String libelle) {
this.id = id;
this.libelle = libelle;
}
}

View File

@@ -1,50 +0,0 @@
package io.gmss.fiscad.paylaods.request.crudweb;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.rfu.parametre.Equipe;
import io.gmss.fiscad.entities.user.User;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.ManyToOne;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
@NoArgsConstructor
@Data
public class ParticiperPayloadWeb {
private Long id;
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateDebut;
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateFin;
private Long equipeId;
private String equipeCode;
private String equipeNom;
private Long userId;
private String userNom;
private String userPrenom;
public ParticiperPayloadWeb(Long id, LocalDate dateDebut, LocalDate dateFin, Long equipeId, String equipeCode, String equipeNom, Long userId, String userNom, String userPrenom) {
this.id = id;
this.dateDebut = dateDebut;
this.dateFin = dateFin;
this.equipeId = equipeId;
this.equipeCode = equipeCode;
this.equipeNom = equipeNom;
this.userId = userId;
this.userNom = userNom;
this.userPrenom = userPrenom;
}
}

View File

@@ -20,5 +20,4 @@ public class ProfilePaylaodWeb {
private UserProfile nom ; private UserProfile nom ;
private String description; private String description;
private Set<Role> roles; private Set<Role> roles;
} }

View File

@@ -24,7 +24,7 @@ public class UserPaylaodWeb {
private Long structureId; private Long structureId;
private String structureCode; private String structureCode;
private String structureNom; private String structureNom;
private Boolean active; private Boolean actif;
private Boolean resetPassword; private Boolean resetPassword;
public UserPaylaodWeb(Long id, public UserPaylaodWeb(Long id,
@@ -36,7 +36,7 @@ public class UserPaylaodWeb {
Long structureId, Long structureId,
String structureCode, String structureCode,
String structureNom, String structureNom,
Boolean active, Boolean actif,
Boolean resetPassword) { Boolean resetPassword) {
this.id = id; this.id = id;
this.nom = nom; this.nom = nom;
@@ -47,7 +47,7 @@ public class UserPaylaodWeb {
this.structureId = structureId; this.structureId = structureId;
this.structureCode = structureCode; this.structureCode = structureCode;
this.structureNom = structureNom; this.structureNom = structureNom;
this.active = active; this.actif = actif;
this.resetPassword = resetPassword; this.resetPassword = resetPassword;
} }
} }

View File

@@ -73,12 +73,12 @@ public class ParcelleRepositoryCustomImpl implements ParcelleRepositoryCustom {
r.numero as rueNumero, r.numero as rueNumero,
r.nom as rueNom, r.nom as rueNom,
pers.id as proprietaireId, pers.id as personneId,
pers.ifu as proprietaireIfu, pers.ifu as ifu,
pers.npi as proprietaireNpi, pers.npi as npi,
pers.nom as proprietaireNom, pers.nom as nom,
pers.prenom as proprietairePrenom, pers.prenom as prenom,
pers.raison_sociale as proprietaireRaisonSociale, pers.raison_sociale as raisonSociale,
de.id as enqueteCouranteId de.id as enqueteCouranteId

View File

@@ -1,3 +1,75 @@
----------------
/*
create or replace view e_avis_view as
WITH first_parcelle_imposition AS (
SELECT DISTINCT ON (personne_id)
personne_id,
parcelle_id
FROM donnees_imposition_tfu
ORDER BY personne_id, annee,parcelle_id
),
cca_unique AS (
SELECT DISTINCT ON (cc.commune_id, cc.personne_id)
cc.structure_id,
cc.personne_id,
cc.commune_id,
COALESCE(qu.code, qu_imp.code) AS r_quartier_contact,
COALESCE(parc.q, parc_imp.q) AS q_contact,
COALESCE(parc.i, parc_imp.i) AS i_contact,
COALESCE(parc.p, parc_imp.p) AS p_contact
FROM commune_centre_assignation cc
LEFT JOIN parcelle parc
ON parc.id = cc.parcelle_id
LEFT JOIN quartier qu
ON qu.id = parc.quartier_id
LEFT JOIN first_parcelle_imposition dpi
ON dpi.personne_id = cc.personne_id
LEFT JOIN parcelle parc_imp
ON parc_imp.id = dpi.parcelle_id
LEFT JOIN quartier qu_imp
ON qu_imp.id = parc_imp.quartier_id
ORDER BY cc.commune_id, cc.personne_id, cc.structure_id
)
SELECT distinct
null as id_avis,
concat(c.code,'-',dimp.ifu,'-',exo.annee) as r_avis,
exo.annee as exercice,
c.code as r_commune,
st.code as r_centre_impot,
dimp.personne_id as id_contribuable_foncier,
dimp.ifu as ifu,
dimp.npi as npi,
dimp.ifu as nc,
dimp.raison_sociale as raison_sociale,
dimp.nom_prop as nom ,
dimp.prenom_prop as prenom,
imp.date_generation as date_liquidation,
current_date as date_information,
cca.r_quartier_contact,
cca.q_contact,
cca.i_contact,
cca.p_contact
FROM impositions_tfu imp
INNER JOIN donnees_imposition_tfu dimp
ON dimp.impositions_tfu_id = imp.id
LEFT JOIN exercice exo
ON exo.id = imp.exercice_id
LEFT JOIN commune c
ON c.id = imp.commune_id
LEFT JOIN cca_unique cca
ON cca.personne_id = dimp.personne_id
AND cca.commune_id = imp.commune_id
LEFT JOIN structure st
ON st.id = cca.structure_id
order by c.code,st.code,r_quartier_contact,i_contact,p_contact; */
create or replace view e_avis_view as create or replace view e_avis_view as
WITH first_parcelle_imposition AS ( WITH first_parcelle_imposition AS (
SELECT DISTINCT ON (personne_id) SELECT DISTINCT ON (personne_id)
@@ -121,10 +193,6 @@ FROM impositions_tfu imp
order by exo.annee,dimp.parcelle_id,dimp.nature_impot, dimp.montant_taxe-coalesce(dimp.acompte,0)-coalesce(dimp.retenu_irf,0) desc ; order by exo.annee,dimp.parcelle_id,dimp.nature_impot, dimp.montant_taxe-coalesce(dimp.acompte,0)-coalesce(dimp.retenu_irf,0) desc ;
select * from e_avis_view
select *
from impositions_tfu;
--------------------------------------------------- ---------------------------------------------------

View File

@@ -63,15 +63,6 @@ $$;
call integrer_eavis(); call integrer_eavis();
call integrer_eavis_detail(); select * from eavis
select * delete from eavis;
from e_avis_view ;
select * from eavis;
select * from eavis_detail;
select *
from donnees_imposition_tfu;

View File

@@ -25,11 +25,8 @@ BEGIN
montant_valeur_locative = v.montant_valeur_locative, montant_valeur_locative = v.montant_valeur_locative,
taux = v.taux, taux = v.taux,
montant_du = v.montant_du, montant_du = v.montant_du,
booleen_parcelle_contact = case v.booleen_parcelle_contact booleen_parcelle_contact = v.booleen_parcelle_contact,
when true then 'OUI' penalite = v.penalite
when false then 'NON' end,
penalite = v.penalite,
r_avis = v.r_avis
WHEN NOT MATCHED THEN WHEN NOT MATCHED THEN
INSERT INSERT
@@ -50,8 +47,7 @@ BEGIN
taux, taux,
montant_du, montant_du,
booleen_parcelle_contact, booleen_parcelle_contact,
penalite, penalite
r_avis
) )
VALUES VALUES
( (
@@ -70,11 +66,8 @@ BEGIN
v.montant_valeur_locative, v.montant_valeur_locative,
v.taux, v.taux,
v.montant_du, v.montant_du,
case v.booleen_parcelle_contact v.booleen_parcelle_contact,
when true then 'OUI' v.penalite
when false then 'NON' end,
v.penalite,
v.r_avis
); );
END; END;
$$; $$;

View File

@@ -147,11 +147,3 @@ select * from arrondissement
select left(code,4) as code_commune_fiscad, code as code_quartier_fiscad,nom as nom_quartier_fiscad select left(code,4) as code_commune_fiscad, code as code_quartier_fiscad,nom as nom_quartier_fiscad
from quartier; from quartier;
create function get_dblink_connection_sigibe() returns text
language sql
as
$$
SELECT 'host=193.181.208.4 port=5433 dbname=sigibe_test user=sigibe_test_user password=sigibe_test_pwd';
$$;

View File

@@ -1,16 +1,11 @@
package io.gmss.fiscad.persistence.repositories.infocad.parametre; package io.gmss.fiscad.persistence.repositories.infocad.parametre;
import io.gmss.fiscad.entities.infocad.parametre.ModeAcquisition; import io.gmss.fiscad.entities.infocad.parametre.ModeAcquisition;
import io.gmss.fiscad.paylaods.request.crudweb.ModeAcquisitionPayloadWeb;
import io.gmss.fiscad.paylaods.response.synchronisation.ModesAcquisitionTypePersonneSyncResponse; import io.gmss.fiscad.paylaods.response.synchronisation.ModesAcquisitionTypePersonneSyncResponse;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List; import java.util.List;
import java.util.Optional;
public interface ModeAcquisitionRepository extends JpaRepository<ModeAcquisition, Long> { public interface ModeAcquisitionRepository extends JpaRepository<ModeAcquisition, Long> {
@Query(value = "select ma.id, ma.libelle,mat.type_personne_id as typePersonneId " + @Query(value = "select ma.id, ma.libelle,mat.type_personne_id as typePersonneId " +
@@ -18,34 +13,4 @@ public interface ModeAcquisitionRepository extends JpaRepository<ModeAcquisition
" inner join mode_acquisition_type_personne mat on mat.mode_acquisition_id=ma.id " + " inner join mode_acquisition_type_personne mat on mat.mode_acquisition_id=ma.id " +
" where ma.deleted is false ", nativeQuery = true) " where ma.deleted is false ", nativeQuery = true)
List<ModesAcquisitionTypePersonneSyncResponse> getModeAcquisitionTypePersonne(); List<ModesAcquisitionTypePersonneSyncResponse> getModeAcquisitionTypePersonne();
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ModeAcquisitionPayloadWeb(
m.id,
m.libelle
)
FROM ModeAcquisition m
WHERE m.id = :id
""")
Optional<ModeAcquisitionPayloadWeb> findPayloadById(@Param("id") Long id);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ModeAcquisitionPayloadWeb(
m.id,
m.libelle
)
FROM ModeAcquisition m
ORDER BY m.libelle
""")
List<ModeAcquisitionPayloadWeb> findAllPayload();
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ModeAcquisitionPayloadWeb(
m.id,
m.libelle
)
FROM ModeAcquisition m
""")
Page<ModeAcquisitionPayloadWeb> findAllPayload(Pageable pageable);
} }

View File

@@ -4,11 +4,9 @@ import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.rfu.metier.DonneesImpositionTfu; import io.gmss.fiscad.entities.rfu.metier.DonneesImpositionTfu;
import io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb; import io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb;
import io.gmss.fiscad.paylaods.response.DonneesImpositionTfuResponse; import io.gmss.fiscad.paylaods.response.DonneesImpositionTfuResponse;
import jakarta.transaction.Transactional;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
@@ -79,7 +77,7 @@ public interface DonneesImpositionTfuRepository extends JpaRepository<DonneesImp
e.nbre_batiment as nombreBat, e.nbre_batiment as nombreBat,
e.nbre_piscine as nombrePiscine, e.nbre_piscine as nombrePiscine,
e.id as enquete_id, e.id as enquete_id,
-- e.zone_rfu_id as zoneRfuId, e.zone_rfu_id as zoneRfuId,
ul.surface as superficieAuSolUlog, ul.surface as superficieAuSolUlog,
ba.nom as categorieBat, ba.nom as categorieBat,
ba.libelle as standingBat, ba.libelle as standingBat,
@@ -189,8 +187,7 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.valeurParcelle, d.valeurParcelle,
d.valeurLocativeAdmMetreCarre, d.valeurLocativeAdmMetreCarre,
d.valeurAdminParcelleNbMetreCarre, d.valeurAdminParcelleNbMetreCarre,
d.montantTaxe, d.montantTaxe
d.homologable
) )
FROM DonneesImpositionTfu d FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu JOIN d.impositionsTfu itfu
@@ -268,8 +265,7 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.valeurParcelle, d.valeurParcelle,
d.valeurLocativeAdmMetreCarre, d.valeurLocativeAdmMetreCarre,
d.valeurAdminParcelleNbMetreCarre, d.valeurAdminParcelleNbMetreCarre,
d.montantTaxe, d.montantTaxe
d.homologable
) )
FROM DonneesImpositionTfu d FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu JOIN d.impositionsTfu itfu
@@ -345,8 +341,7 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.valeurParcelle, d.valeurParcelle,
d.valeurLocativeAdmMetreCarre, d.valeurLocativeAdmMetreCarre,
d.valeurAdminParcelleNbMetreCarre, d.valeurAdminParcelleNbMetreCarre,
d.montantTaxe, d.montantTaxe
d.homologable
) )
FROM DonneesImpositionTfu d FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu JOIN d.impositionsTfu itfu
@@ -423,8 +418,7 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.valeurParcelle, d.valeurParcelle,
d.valeurLocativeAdmMetreCarre, d.valeurLocativeAdmMetreCarre,
d.valeurAdminParcelleNbMetreCarre, d.valeurAdminParcelleNbMetreCarre,
d.montantTaxe, d.montantTaxe
d.homologable
) )
FROM DonneesImpositionTfu d FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu JOIN d.impositionsTfu itfu
@@ -502,8 +496,7 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.valeurParcelle, d.valeurParcelle,
d.valeurLocativeAdmMetreCarre, d.valeurLocativeAdmMetreCarre,
d.valeurAdminParcelleNbMetreCarre, d.valeurAdminParcelleNbMetreCarre,
d.montantTaxe, d.montantTaxe
d.homologable
) )
FROM DonneesImpositionTfu d FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu JOIN d.impositionsTfu itfu
@@ -518,176 +511,6 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
Pageable pageable Pageable pageable
); );
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.id,
d.annee,
d.codeDepartement,
d.nomDepartement,
d.codeCommune,
d.nomCommune,
d.codeArrondissement,
d.nomArrondissement,
d.codeQuartierVillage,
d.nomQuartierVillage,
d.q,
d.ilot,
d.parcelle,
d.nup,
d.titreFoncier,
d.numBatiment,
d.numUniteLogement,
d.ifu,
d.npi,
d.telProp,
d.emailProp,
d.nomProp,
d.prenomProp,
d.raisonSociale,
d.adresseProp,
d.telSc,
d.emailSc,
d.nomSc,
d.prenomSc,
d.adresseSc,
d.longitude,
d.latitude,
d.superficieParc,
d.superficieAuSolBat,
d.superficieAuSolUlog,
d.batie,
d.exonere,
d.batimentExonere,
d.uniteLogementExonere,
d.valeurLocativeAdm,
d.montantLoyerAnnuel,
d.tfuMetreCarre,
d.tfuMinimum,
d.standingBat,
d.categorieBat,
d.nombrePiscine,
d.nombreUlog,
d.nombreBat,
d.dateEnquete,
s.id,
z.id,
d.valeurAdminParcelleNb,
d.natureImpot,
s.code,
z.nom,
d.valeurBatiment,
d.valeurParcelle,
d.valeurLocativeAdmMetreCarre,
d.valeurAdminParcelleNbMetreCarre,
d.montantTaxe,
d.homologable
)
FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu
LEFT join d.structure s
LEFT join d.zoneRfu z
WHERE itfu.id = :impositionTfuId
and d.homologable is false
order by d.nomProp,d.nomProp asc
""")
Page<DonneesImpositionPaylaodWeb> findAllByImpositionTfuIdNonHomologablePageable(
Long impositionTfuId,
Pageable pageable
);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.id,
d.annee,
d.codeDepartement,
d.nomDepartement,
d.codeCommune,
d.nomCommune,
d.codeArrondissement,
d.nomArrondissement,
d.codeQuartierVillage,
d.nomQuartierVillage,
d.q,
d.ilot,
d.parcelle,
d.nup,
d.titreFoncier,
d.numBatiment,
d.numUniteLogement,
d.ifu,
d.npi,
d.telProp,
d.emailProp,
d.nomProp,
d.prenomProp,
d.raisonSociale,
d.adresseProp,
d.telSc,
d.emailSc,
d.nomSc,
d.prenomSc,
d.adresseSc,
d.longitude,
d.latitude,
d.superficieParc,
d.superficieAuSolBat,
d.superficieAuSolUlog,
d.batie,
d.exonere,
d.batimentExonere,
d.uniteLogementExonere,
d.valeurLocativeAdm,
d.montantLoyerAnnuel,
d.tfuMetreCarre,
d.tfuMinimum,
d.standingBat,
d.categorieBat,
d.nombrePiscine,
d.nombreUlog,
d.nombreBat,
d.dateEnquete,
s.id,
z.id,
d.valeurAdminParcelleNb,
d.natureImpot,
s.code,
z.nom,
d.valeurBatiment,
d.valeurParcelle,
d.valeurLocativeAdmMetreCarre,
d.valeurAdminParcelleNbMetreCarre,
d.montantTaxe,
d.homologable
)
FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu
LEFT join d.structure s
LEFT join d.zoneRfu z
WHERE itfu.id = :impositionTfuId
and d.homologable is null
order by d.nomProp,d.nomProp asc
""")
Page<DonneesImpositionPaylaodWeb> findAllByImpositionTfuIdHomologablePageable(
Long impositionTfuId,
Pageable pageable
);
@Modifying
@Transactional
@Query("""
UPDATE DonneesImpositionTfu d
SET d.homologable = true
WHERE d.impositionsTfu.id = :impositionsTfuId
AND d.homologable IS NULL
""")
int homologuerDonneesImposition(
@Param("impositionsTfuId") Long impositionsTfuId
);
@Query(value = "SELECT generer_donnees_imposition_tfu_batie(:impositionId, :userId)", nativeQuery = true) @Query(value = "SELECT generer_donnees_imposition_tfu_batie(:impositionId, :userId)", nativeQuery = true)
Integer genererDonneesTfuBatie( Integer genererDonneesTfuBatie(
@Param("impositionId") Long impositionId, @Param("impositionId") Long impositionId,
@@ -872,8 +695,7 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.valeurParcelle, d.valeurParcelle,
d.valeurLocativeAdmMetreCarre, d.valeurLocativeAdmMetreCarre,
d.valeurAdminParcelleNbMetreCarre, d.valeurAdminParcelleNbMetreCarre,
d.montantTaxe, d.montantTaxe
d.homologable
) )
FROM DonneesImpositionTfu d FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu JOIN d.impositionsTfu itfu
@@ -961,8 +783,7 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.valeurParcelle, d.valeurParcelle,
d.valeurLocativeAdmMetreCarre, d.valeurLocativeAdmMetreCarre,
d.valeurAdminParcelleNbMetreCarre, d.valeurAdminParcelleNbMetreCarre,
d.montantTaxe, d.montantTaxe
d.homologable
) )
FROM DonneesImpositionTfu d FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu JOIN d.impositionsTfu itfu
@@ -1044,8 +865,7 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.valeurParcelle, d.valeurParcelle,
d.valeurLocativeAdmMetreCarre, d.valeurLocativeAdmMetreCarre,
d.valeurAdminParcelleNbMetreCarre, d.valeurAdminParcelleNbMetreCarre,
d.montantTaxe, d.montantTaxe
d.homologable
) )
FROM DonneesImpositionTfu d FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu JOIN d.impositionsTfu itfu

View File

@@ -194,36 +194,4 @@ public interface ImpositionsTfuRepository extends JpaRepository<ImpositionsTfu,
WHERE d.id= :departementId WHERE d.id= :departementId
""") """)
List<ImpositionsTfuPaylaodWeb> findByDepartementIdToDto(@Param("departementId") Long departementId); List<ImpositionsTfuPaylaodWeb> findByDepartementIdToDto(@Param("departementId") Long departementId);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb(
i.id,
i.dateGeneration,
i.dateCloture,
i.referencePieceAdmin,
i.datePieceAdmin,
i.statusAvis,
i.nombreAvis,
i.motif,
e.id,
e.annee,
c.id,
c.code,
c.nom,
s.id,
s.nom,
i.nombreAvisFnb,
i.nombreAvisBatiment,
i.nombreAvisUniteLog
)
FROM ImpositionsTfu i
LEFT JOIN i.exercice e
LEFT JOIN i.commune c
LEFT JOIN i.structure s
WHERE s.id = :structureId
AND i.statusAvis = :statutAvis
""")
List<ImpositionsTfuPaylaodWeb> findByStructureIdByStatutToDto(@Param("structureId") Long structureId, @Param("statutAvis") StatusAvis statutAvis);
} }

View File

@@ -1,175 +0,0 @@
package io.gmss.fiscad.persistence.repositories.rfu.metier;
import io.gmss.fiscad.entities.rfu.metier.Participer;
import io.gmss.fiscad.paylaods.request.crudweb.ParticiperPayloadWeb;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;
import java.util.Optional;
public interface ParticiperRepository extends JpaRepository<Participer, Long> {
boolean existsByEquipeIdAndUserId(Long equipeId, Long userId);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ParticiperPayloadWeb(
p.id,
p.dateDebut,
p.dateFin,
e.id,
e.code,
e.nom,
u.id,
u.nom,
u.prenom
)
FROM Participer p
LEFT JOIN p.equipe e
LEFT JOIN p.user u
WHERE p.id = :id
""")
Optional<ParticiperPayloadWeb> findPayloadById(@Param("id") Long id);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ParticiperPayloadWeb(
p.id,
p.dateDebut,
p.dateFin,
e.id,
e.code,
e.nom,
u.id,
u.nom,
u.prenom
)
FROM Participer p
LEFT JOIN p.equipe e
LEFT JOIN p.user u
ORDER BY e.nom, u.nom, u.prenom
""")
List<ParticiperPayloadWeb> findAllPayload();
@Query(value = """
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ParticiperPayloadWeb(
p.id,
p.dateDebut,
p.dateFin,
e.id,
e.code,
e.nom,
u.id,
u.nom,
u.prenom
)
FROM Participer p
LEFT JOIN p.equipe e
LEFT JOIN p.user u
""",
countQuery = """
SELECT COUNT(p)
FROM Participer p
""")
Page<ParticiperPayloadWeb> findAllPayload(Pageable pageable);
@Query(value = """
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ParticiperPayloadWeb(
p.id,
p.dateDebut,
p.dateFin,
e.id,
e.code,
e.nom,
u.id,
u.nom,
u.prenom
)
FROM Participer p
LEFT JOIN p.equipe e
LEFT JOIN p.user u
WHERE e.id = :equipeId
""",
countQuery = """
SELECT COUNT(p)
FROM Participer p
WHERE p.equipe.id = :equipeId
""")
Page<ParticiperPayloadWeb> findAllPayloadByEquipeId(
@Param("equipeId") Long equipeId,
Pageable pageable);
@Query(value = """
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ParticiperPayloadWeb(
p.id,
p.dateDebut,
p.dateFin,
e.id,
e.code,
e.nom,
u.id,
u.nom,
u.prenom
)
FROM Participer p
LEFT JOIN p.equipe e
LEFT JOIN p.user u
WHERE u.id = :userId
""",
countQuery = """
SELECT COUNT(p)
FROM Participer p
WHERE p.user.id = :userId
""")
Page<ParticiperPayloadWeb> findAllPayloadByUserId(
@Param("userId") Long userId,
Pageable pageable);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ParticiperPayloadWeb(
p.id,
p.dateDebut,
p.dateFin,
e.id,
e.code,
e.nom,
u.id,
u.nom,
u.prenom
)
FROM Participer p
LEFT JOIN p.equipe e
LEFT JOIN p.user u
WHERE e.id = :equipeId
ORDER BY u.nom, u.prenom
""")
List<ParticiperPayloadWeb> findAllPayloadByEquipeId(@Param("equipeId") Long equipeId);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ParticiperPayloadWeb(
p.id,
p.dateDebut,
p.dateFin,
e.id,
e.code,
e.nom,
u.id,
u.nom,
u.prenom
)
FROM Participer p
LEFT JOIN p.equipe e
LEFT JOIN p.user u
WHERE u.id = :userId
ORDER BY e.nom
""")
List<ParticiperPayloadWeb> findAllPayloadByUserId(@Param("userId") Long userId);
}

View File

@@ -2,186 +2,11 @@ package io.gmss.fiscad.persistence.repositories.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.Campagne; import io.gmss.fiscad.entities.rfu.parametre.Campagne;
import io.gmss.fiscad.enums.TypeCampagne; import io.gmss.fiscad.enums.TypeCampagne;
import io.gmss.fiscad.paylaods.request.crudweb.CampagnePayloadWeb;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List; import java.util.List;
import java.util.Optional;
public interface CampagneRepository extends JpaRepository<Campagne, Long> { public interface CampagneRepository extends JpaRepository<Campagne, Long> {
List<Campagne> findAllByTypeCampagne(TypeCampagne typeCampagne); List<Campagne> findAllByTypeCampagne(TypeCampagne typeCampagne);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.CampagnePayloadWeb(
c.id,
c.refAdministrative,
c.nom,
c.dateDebut,
c.dateFin,
c.typeCampagne,
e.id,
e.annee,
s.id,
s.code,
s.nom
)
FROM Campagne c
LEFT JOIN c.exercice e
LEFT JOIN c.structure s
WHERE c.id = :id
""")
Optional<CampagnePayloadWeb> findPayloadById(@Param("id") Long id);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.CampagnePayloadWeb(
c.id,
c.refAdministrative,
c.nom,
c.dateDebut,
c.dateFin,
c.typeCampagne,
e.id,
e.annee,
s.id,
s.code,
s.nom
)
FROM Campagne c
LEFT JOIN c.exercice e
LEFT JOIN c.structure s
ORDER BY c.dateDebut DESC
""")
List<CampagnePayloadWeb> findAllPayload();
@Query(value = """
SELECT new io.gmss.fiscad.paylaods.request.crudweb.CampagnePayloadWeb(
c.id,
c.refAdministrative,
c.nom,
c.dateDebut,
c.dateFin,
c.typeCampagne,
e.id,
e.annee,
s.id,
s.code,
s.nom
)
FROM Campagne c
LEFT JOIN c.exercice e
LEFT JOIN c.structure s
""",
countQuery = """
SELECT COUNT(c)
FROM Campagne c
""")
Page<CampagnePayloadWeb> findAllPayload(Pageable pageable);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.CampagnePayloadWeb(
c.id,
c.refAdministrative,
c.nom,
c.dateDebut,
c.dateFin,
c.typeCampagne,
e.id,
e.annee,
s.id,
s.code,
s.nom
)
FROM Campagne c
LEFT JOIN c.exercice e
LEFT JOIN c.structure s
WHERE e.id = :exerciceId
ORDER BY c.dateDebut DESC
""")
List<CampagnePayloadWeb> findAllPayloadByExerciceId(@Param("exerciceId") Long exerciceId);
@Query(value = """
SELECT new io.gmss.fiscad.paylaods.request.crudweb.CampagnePayloadWeb(
c.id,
c.refAdministrative,
c.nom,
c.dateDebut,
c.dateFin,
c.typeCampagne,
e.id,
e.annee,
s.id,
s.code,
s.nom
)
FROM Campagne c
LEFT JOIN c.exercice e
LEFT JOIN c.structure s
WHERE e.id = :exerciceId
""",
countQuery = """
SELECT COUNT(c)
FROM Campagne c
WHERE c.exercice.id = :exerciceId
""")
Page<CampagnePayloadWeb> findAllPayloadByExerciceId(
@Param("exerciceId") Long exerciceId,
Pageable pageable);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.CampagnePayloadWeb(
c.id,
c.refAdministrative,
c.nom,
c.dateDebut,
c.dateFin,
c.typeCampagne,
e.id,
e.annee,
s.id,
s.code,
s.nom
)
FROM Campagne c
LEFT JOIN c.exercice e
LEFT JOIN c.structure s
WHERE s.id = :structureId
ORDER BY c.dateDebut DESC
""")
List<CampagnePayloadWeb> findAllPayloadByStructureId(@Param("structureId") Long structureId);
@Query(value = """
SELECT new io.gmss.fiscad.paylaods.request.crudweb.CampagnePayloadWeb(
c.id,
c.refAdministrative,
c.nom,
c.dateDebut,
c.dateFin,
c.typeCampagne,
e.id,
e.annee,
s.id,
s.code,
s.nom
)
FROM Campagne c
LEFT JOIN c.exercice e
LEFT JOIN c.structure s
WHERE s.id = :structureId
""",
countQuery = """
SELECT COUNT(c)
FROM Campagne c
WHERE c.structure.id = :structureId
""")
Page<CampagnePayloadWeb> findAllPayloadByStructureId(
@Param("exerciceId") Long structureId,
Pageable pageable);
} }

View File

@@ -1,91 +1,13 @@
package io.gmss.fiscad.persistence.repositories.rfu.parametre; package io.gmss.fiscad.persistence.repositories.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.Caracteristique; import io.gmss.fiscad.entities.rfu.parametre.Caracteristique;
import io.gmss.fiscad.enums.TypeImmeuble;
import io.gmss.fiscad.paylaods.request.crudweb.CaracteristiquePayloadWeb;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List; import java.util.List;
import java.util.Optional;
public interface CaracteristiqueRepository extends JpaRepository<Caracteristique, Long> { public interface CaracteristiqueRepository extends JpaRepository<Caracteristique, Long> {
List<Caracteristique> findAllByActifIsTrue(); List<Caracteristique> findAllByActifIsTrue();
//Optional<Caracteristique> findFirstByExternalKeyAndTerminal_Id(Long externalKey, Long TerminalId); //Optional<Caracteristique> findFirstByExternalKeyAndTerminal_Id(Long externalKey, Long TerminalId);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.CaracteristiquePayloadWeb(
c.id,
c.code,
c.libelle,
c.actif,
c.typeImmeuble,
tc.id,
tc.code,
tc.libelle
)
FROM Caracteristique c
LEFT JOIN c.typeCaracteristique tc
WHERE c.id = :id
""")
Optional<CaracteristiquePayloadWeb> findPayloadById(@Param("id") Long id);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.CaracteristiquePayloadWeb(
c.id,
c.code,
c.libelle,
c.actif,
c.typeImmeuble,
tc.id,
tc.code,
tc.libelle
)
FROM Caracteristique c
LEFT JOIN c.typeCaracteristique tc
WHERE c.typeImmeuble = :typeImmeuble
ORDER BY tc.libelle, c.libelle
""")
List<CaracteristiquePayloadWeb> findByTypeImmeuble(
@Param("typeImmeuble") TypeImmeuble typeImmeuble
);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.CaracteristiquePayloadWeb(
c.id,
c.code,
c.libelle,
c.actif,
c.typeImmeuble,
tc.id,
tc.code,
tc.libelle
)
FROM Caracteristique c
LEFT JOIN c.typeCaracteristique tc
ORDER BY tc.libelle, c.libelle
""")
List<CaracteristiquePayloadWeb> findAllPayload();
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.CaracteristiquePayloadWeb(
c.id,
c.code,
c.libelle,
c.actif,
c.typeImmeuble,
tc.id,
tc.code,
tc.libelle
)
FROM Caracteristique c
LEFT JOIN c.typeCaracteristique tc
""")
Page<CaracteristiquePayloadWeb> findAllPayload(Pageable pageable);
} }

View File

@@ -1,292 +1,9 @@
package io.gmss.fiscad.persistence.repositories.rfu.parametre; package io.gmss.fiscad.persistence.repositories.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.Equipe; import io.gmss.fiscad.entities.rfu.parametre.Equipe;
import io.gmss.fiscad.paylaods.request.crudweb.EquipePayloadWeb;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;
import java.util.Optional;
public interface EquipeRepository extends JpaRepository<Equipe, Long> { public interface EquipeRepository extends JpaRepository<Equipe, Long> {
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EquipePayloadWeb(
e.id,
e.code,
e.nom,
b.id,
b.cote,
s.id,
s.code,
s.nom,
c.id,
c.nom,
e.dateDebut,
e.dateFin,
q.id,
q.code,
q.nom
)
FROM Equipe e
LEFT JOIN e.bloc b
LEFT JOIN e.secteur s
LEFT JOIN e.campagne c
LEFT JOIN e.quartier q
WHERE e.id = :id
""")
Optional<EquipePayloadWeb> findPayloadById(@Param("id") Long id);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EquipePayloadWeb(
e.id,
e.code,
e.nom,
b.id,
b.cote,
s.id,
s.code,
s.nom,
c.id,
c.nom,
e.dateDebut,
e.dateFin,
q.id,
q.code,
q.nom
)
FROM Equipe e
LEFT JOIN e.bloc b
LEFT JOIN e.secteur s
LEFT JOIN e.campagne c
LEFT JOIN e.quartier q
ORDER BY e.nom
""")
List<EquipePayloadWeb> findAllPayload();
@Query(value = """
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EquipePayloadWeb(
e.id,
e.code,
e.nom,
b.id,
b.cote,
s.id,
s.code,
s.nom,
c.id,
c.nom,
e.dateDebut,
e.dateFin,
q.id,
q.code,
q.nom
)
FROM Equipe e
LEFT JOIN e.bloc b
LEFT JOIN e.secteur s
LEFT JOIN e.campagne c
LEFT JOIN e.quartier q
""",
countQuery = """
SELECT COUNT(e)
FROM Equipe e
""")
Page<EquipePayloadWeb> findAllPayload(Pageable pageable);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EquipePayloadWeb(
e.id,
e.code,
e.nom,
b.id,
b.cote,
s.id,
s.code,
s.nom,
c.id,
c.nom,
e.dateDebut,
e.dateFin,
q.id,
q.code,
q.nom
)
FROM Equipe e
LEFT JOIN e.bloc b
LEFT JOIN e.secteur s
LEFT JOIN e.campagne c
LEFT JOIN e.quartier q
WHERE c.id = :campagneId
ORDER BY e.nom
""")
List<EquipePayloadWeb> findAllPayloadByCampagneId(@Param("campagneId") Long campagneId);
@Query(value ="""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EquipePayloadWeb(
e.id,
e.code,
e.nom,
b.id,
b.cote,
s.id,
s.code,
s.nom,
c.id,
c.nom,
e.dateDebut,
e.dateFin,
q.id,
q.code,
q.nom
)
FROM Equipe e
LEFT JOIN e.bloc b
LEFT JOIN e.secteur s
LEFT JOIN e.campagne c
LEFT JOIN e.quartier q
WHERE c.id = :campagneId
ORDER BY e.nom
""",
countQuery = """
SELECT COUNT(e)
FROM Equipe e
where e.campagne.id= :campagneId
""")
Page<EquipePayloadWeb> findAllPayloadByCampagneId(@Param("campagneId") Long campagneId,Pageable pageable);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EquipePayloadWeb(
e.id,
e.code,
e.nom,
b.id,
b.cote,
s.id,
s.code,
s.nom,
c.id,
c.nom,
e.dateDebut,
e.dateFin,
q.id,
q.code,
q.nom
)
FROM Equipe e
LEFT JOIN e.bloc b
LEFT JOIN e.secteur s
LEFT JOIN e.campagne c
LEFT JOIN e.quartier q
WHERE s.id = :secteurId
ORDER BY e.nom
""")
List<EquipePayloadWeb> findAllPayloadBySecteurId(@Param("secteurId") Long secteurId);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EquipePayloadWeb(
e.id,
e.code,
e.nom,
b.id,
b.cote,
s.id,
s.code,
s.nom,
c.id,
c.nom,
e.dateDebut,
e.dateFin,
q.id,
q.code,
q.nom
)
FROM Equipe e
LEFT JOIN e.bloc b
LEFT JOIN e.secteur s
LEFT JOIN e.campagne c
LEFT JOIN e.quartier q
WHERE e.quartier.id = :quartierId
ORDER BY e.nom
""")
List<EquipePayloadWeb> findAllPayloadByQuartierId(@Param("quartierId") Long quartierId);
@Query(value = """
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EquipePayloadWeb(
e.id,
e.code,
e.nom,
b.id,
b.cote,
s.id,
s.code,
s.nom,
c.id,
c.nom,
e.dateDebut,
e.dateFin,
q.id,
q.code,
q.nom
)
FROM Equipe e
LEFT JOIN e.bloc b
LEFT JOIN e.secteur s
LEFT JOIN e.campagne c
LEFT JOIN e.quartier q
WHERE e.quartier.id = :quartierId
""",
countQuery = """
SELECT COUNT(e)
FROM Equipe e
WHERE e.quartier.id = :quartierId
""")
Page<EquipePayloadWeb> findAllPayloadByQuartierId(
@Param("quartierId") Long quartierId,
Pageable pageable);
@Query(value = """
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EquipePayloadWeb(
e.id,
e.code,
e.nom,
b.id,
b.cote,
s.id,
s.code,
s.nom,
c.id,
c.nom,
e.dateDebut,
e.dateFin,
q.id,
q.code,
q.nom
)
FROM Equipe e
LEFT JOIN e.bloc b
LEFT JOIN e.secteur s
LEFT JOIN e.campagne c
LEFT JOIN e.quartier q
WHERE e.secteur.id = :secteurId
""",
countQuery = """
SELECT COUNT(e)
FROM Equipe e
WHERE e.secteur.id = :secteurId
""")
Page<EquipePayloadWeb> findAllPayloadBySecteurId(
@Param("secteurId") Long secteurId,
Pageable pageable);
} }

View File

@@ -10,8 +10,5 @@ import java.util.Optional;
public interface ExerciceRepository extends JpaRepository<Exercice, Long> { public interface ExerciceRepository extends JpaRepository<Exercice, Long> {
Optional<Exercice> findFirstByAnnee(int annee); Optional<Exercice> findFirstByAnnee(int annee);
boolean existsByAnnee(Integer annee);
boolean existsByAnneeAndIdNot(Integer annee, Long id);
} }

View File

@@ -88,26 +88,25 @@ public interface AvoirFonctionRepository extends JpaRepository<AvoirFonction, Lo
Page<AvoirFonctionPaylaodWeb> findAllAvoirFonctionToDtoPageable(Pageable pageable); Page<AvoirFonctionPaylaodWeb> findAllAvoirFonctionToDtoPageable(Pageable pageable);
@Query(""" @Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.AvoirFonctionPaylaodWeb( SELECT new io.gmss.fiscad.paylaods.request.crudweb.AvoirFonctionPaylaodWeb(
af.id, af.id,
af.dateDebut, af.dateDebut,
af.dateFin, af.dateFin,
f.id, f.id,
f.code, f.code,
f.nom, f.nom,
u.id, u.id,
u.username, u.username,
u.nom, u.nom,
u.prenom, u.prenom,
u.email, u.email,
af.titre af.titre
) )
FROM AvoirFonction af FROM AvoirFonction af
LEFT JOIN af.user u LEFT JOIN af.user u
LEFT JOIN af.fonction f LEFT JOIN af.fonction f
WHERE u.id = :userId WHERE u.id = :userId
AND (af.dateFin IS NULL OR af.dateFin >= CURRENT_DATE) """)
""")
List<AvoirFonctionPaylaodWeb> findAllAvoirFonctionByUserToDto(@Param("userId") Long userId); List<AvoirFonctionPaylaodWeb> findAllAvoirFonctionByUserToDto(@Param("userId") Long userId);

View File

@@ -3,9 +3,7 @@ package io.gmss.fiscad.persistence.repositories.user;
import io.gmss.fiscad.entities.user.Role; import io.gmss.fiscad.entities.user.Role;
import io.gmss.fiscad.enums.UserRole; import io.gmss.fiscad.enums.UserRole;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
import java.util.Optional; import java.util.Optional;
public interface RoleRepository extends JpaRepository<Role, Long> { public interface RoleRepository extends JpaRepository<Role, Long> {
@@ -16,5 +14,4 @@ public interface RoleRepository extends JpaRepository<Role, Long> {
boolean existsByNom(UserRole userRole); boolean existsByNom(UserRole userRole);
Role getRolesByNom(UserRole userRole); Role getRolesByNom(UserRole userRole);
} }

View File

@@ -159,26 +159,4 @@ public interface UserRepository extends JpaRepository<User, Long> {
WHERE st.id = :structureId WHERE st.id = :structureId
""") """)
Page<UserPaylaodWeb> findAllUserByStructureToDtoPageable(@Param("structureId") Long structureId, Pageable pageable); Page<UserPaylaodWeb> findAllUserByStructureToDtoPageable(@Param("structureId") Long structureId, Pageable pageable);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.UserPaylaodWeb(
u.id,
u.nom,
u.prenom,
u.tel,
u.username,
u.email,
st.id,
st.code,
st.nom,
u.active,
u.resetPassword
)
FROM AvoirFonction af
JOIN af.user u
LEFT JOIN u.structure st
WHERE af.fonction.id = :fonctionId
""")
List<UserPaylaodWeb> findAllUserByFonctionToDto(@Param("fonctionId") Long fonctionId);
} }

View File

@@ -20,7 +20,10 @@ import io.gmss.fiscad.persistence.repositories.frontend.ModuleRepository;
import io.gmss.fiscad.persistence.repositories.infocad.metier.*; import io.gmss.fiscad.persistence.repositories.infocad.metier.*;
import io.gmss.fiscad.persistence.repositories.infocad.parametre.*; import io.gmss.fiscad.persistence.repositories.infocad.parametre.*;
import io.gmss.fiscad.persistence.repositories.rfu.metier.*; import io.gmss.fiscad.persistence.repositories.rfu.metier.*;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.*; import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuNonBatiRepository;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuRepository;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.CaracteristiqueRepository;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.ExerciceRepository;
import io.gmss.fiscad.persistence.repositories.user.AvoirFonctionRepository; import io.gmss.fiscad.persistence.repositories.user.AvoirFonctionRepository;
import io.gmss.fiscad.persistence.repositories.user.ProfileModuleFonctionnaliteRepository; import io.gmss.fiscad.persistence.repositories.user.ProfileModuleFonctionnaliteRepository;
import io.gmss.fiscad.persistence.repositories.user.ProfileRepository; import io.gmss.fiscad.persistence.repositories.user.ProfileRepository;
@@ -38,9 +41,6 @@ public class EntityFromPayLoadService {
private final TypePieceRepository typePieceRepository; private final TypePieceRepository typePieceRepository;
private final PieceRepository pieceRepository; private final PieceRepository pieceRepository;
private final CaracteristiqueRepository caracteristiqueRepository; private final CaracteristiqueRepository caracteristiqueRepository;
private final EquipeRepository equipeRepository;
private final BlocRepository blocRepository;
private final CampagneRepository campagneRepository;
private final ModeAcquisitionRepository modeAcquisitionRepository; private final ModeAcquisitionRepository modeAcquisitionRepository;
private final PersonneRepository personneRepository; private final PersonneRepository personneRepository;
private final SourceDroitRepository sourceDroitRepository; private final SourceDroitRepository sourceDroitRepository;
@@ -81,9 +81,7 @@ public class EntityFromPayLoadService {
private final CommuneCentreAssignationRepository communeCentreAssignationRepository ; private final CommuneCentreAssignationRepository communeCentreAssignationRepository ;
private final ModuleRepository moduleRepository ; private final ModuleRepository moduleRepository ;
private final FonctionnaliteRepository fonctionnaliteRepository ; private final FonctionnaliteRepository fonctionnaliteRepository ;
private final ParticiperRepository participerRepository ;
private final ProfileModuleFonctionnaliteRepository profileModuleFonctionnaliteRepository ; private final ProfileModuleFonctionnaliteRepository profileModuleFonctionnaliteRepository ;
private final TypeCaracteristiqueRepository typeCaracteristiqueRepository ;
public CaracteristiqueParcelle getCaracteristiqueParcelleFromPayLoadWeb(CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb){ public CaracteristiqueParcelle getCaracteristiqueParcelleFromPayLoadWeb(CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb){
@@ -106,94 +104,6 @@ public class EntityFromPayLoadService {
return caracteristiqueParcelle; return caracteristiqueParcelle;
} }
public Quartier getQuartierFromPayLoadWeb(QuartierPaylaodWeb quartierPaylaodWeb){
Quartier quartier=new Quartier();
if(quartierPaylaodWeb.getId()!=null)
quartier = quartierRepository.findById(quartierPaylaodWeb.getId()).orElse(new Quartier());
Optional<Arrondissement> optionalArrondissement=Optional.empty();
if(quartierPaylaodWeb.getArrondissementId()!=null)
optionalArrondissement=arrondissementRepository.findById(quartierPaylaodWeb.getArrondissementId());
quartier.setId(quartierPaylaodWeb.getId());
quartier.setArrondissement(optionalArrondissement.orElse(null));
quartier.setCode(quartierPaylaodWeb.getCode());
quartier.setNom(quartierPaylaodWeb.getNom());
return quartier;
}
public Caracteristique getCaracteristiqueFromPayLoadWeb(CaracteristiquePayloadWeb caracteristiquePayloadWeb){
Caracteristique caracteristique=new Caracteristique();
if(caracteristiquePayloadWeb.getId()!=null)
caracteristique = caracteristiqueRepository.findById(caracteristiquePayloadWeb.getId()).orElse(new Caracteristique());
Optional<TypeCaracteristique> optionalTypeCaracteristique=Optional.empty();
if(caracteristiquePayloadWeb.getTypeCaracteristiqueId()!=null)
optionalTypeCaracteristique=typeCaracteristiqueRepository.findById(caracteristiquePayloadWeb.getTypeCaracteristiqueId());
caracteristique.setId(caracteristiquePayloadWeb.getId());
caracteristique.setTypeCaracteristique(optionalTypeCaracteristique.orElse(null));
caracteristique.setCode(caracteristiquePayloadWeb.getCode());
caracteristique.setLibelle(caracteristiquePayloadWeb.getLibelle());
caracteristique.setActif(caracteristiquePayloadWeb.isActif());
caracteristique.setTypeImmeuble(caracteristiquePayloadWeb.getTypeImmeuble());
return caracteristique;
}
public Equipe getEquipeFromPayLoadWeb(EquipePayloadWeb equipePayloadWeb){
Equipe equipe=new Equipe();
if(equipePayloadWeb.getId()!=null)
equipe = equipeRepository.findById(equipePayloadWeb.getId()).orElse(new Equipe());
Optional<Campagne> optionalCampagne=Optional.empty();
Optional<Secteur> optionalSecteur=Optional.empty();
Optional<Quartier> optionalQuartier=Optional.empty();
Optional<Bloc> optionalBloc=Optional.empty();
if(equipePayloadWeb.getBlocId()!=null)
optionalBloc=blocRepository.findById(equipePayloadWeb.getBlocId());
if(equipePayloadWeb.getCampagneId()!=null)
optionalCampagne=campagneRepository.findById(equipePayloadWeb.getCampagneId());
if(equipePayloadWeb.getSecteurId()!=null)
optionalSecteur=secteurRepository.findById(equipePayloadWeb.getSecteurId());
if(equipePayloadWeb.getQuartierId()!=null)
optionalQuartier=quartierRepository.findById(equipePayloadWeb.getQuartierId());
if(optionalBloc.isPresent())
equipe.setBloc(optionalBloc.get());
if(optionalCampagne.isPresent())
equipe.setCampagne(optionalCampagne.get());
if(optionalSecteur.isPresent())
equipe.setSecteur(optionalSecteur.get());
if(optionalQuartier.isPresent())
equipe.setQuartier(optionalQuartier.get());
equipe.setId(equipePayloadWeb.getId());
equipe.setNom(equipePayloadWeb.getNom());
equipe.setCode(equipePayloadWeb.getCode());
equipe.setDateDebut(equipePayloadWeb.getDateDebut());
equipe.setDateFin(equipePayloadWeb.getDateFin());
return equipe;
}
public ModeAcquisition getModeAcquisitionFromPayLoadWeb(ModeAcquisitionPayloadWeb modeAcquisitionPayloadWeb){
ModeAcquisition modeAcquisition=new ModeAcquisition();
if(modeAcquisitionPayloadWeb.getId()!=null)
modeAcquisition = modeAcquisitionRepository.findById(modeAcquisitionPayloadWeb.getId()).orElse(new ModeAcquisition());
modeAcquisition.setId(modeAcquisitionPayloadWeb.getId());
modeAcquisition.setLibelle(modeAcquisitionPayloadWeb.getLibelle());
return modeAcquisition;
}
public CaracteristiqueBatiment getCaracteristiqueBatimentFromPayLoadWeb(CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb){ public CaracteristiqueBatiment getCaracteristiqueBatimentFromPayLoadWeb(CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb){
CaracteristiqueBatiment caracteristiqueBatiment=new CaracteristiqueBatiment(); CaracteristiqueBatiment caracteristiqueBatiment=new CaracteristiqueBatiment();
@@ -1139,6 +1049,18 @@ public class EntityFromPayLoadService {
communeCentreAssignation.setAdresseContact(communeCentreAssignationPaylaodWeb.getAdresseContact()); communeCentreAssignation.setAdresseContact(communeCentreAssignationPaylaodWeb.getAdresseContact());
// if (communeCentreAssignationPaylaodWeb.getCommuneId() != null) {
// Commune commune = new Commune();
// commune.setId(communeCentreAssignationPaylaodWeb.getCommuneId());
// communeCentreAssignation.setCommune(commune);
// }
// if (communeCentreAssignationPaylaodWeb.getStructureId() != null) {
// Structure structure = new Structure();
// structure.setId(communeCentreAssignationPaylaodWeb.getStructureId());
// communeCentreAssignation.setStructure(structure);
// }
if (communeCentreAssignationPaylaodWeb.getParcelleContactId() != null) { if (communeCentreAssignationPaylaodWeb.getParcelleContactId() != null) {
Parcelle parcelle = new Parcelle(); Parcelle parcelle = new Parcelle();
parcelle.setId(communeCentreAssignationPaylaodWeb.getParcelleContactId()); parcelle.setId(communeCentreAssignationPaylaodWeb.getParcelleContactId());
@@ -1206,56 +1128,4 @@ public class EntityFromPayLoadService {
return profileModuleFonctionnalite ; return profileModuleFonctionnalite ;
} }
public Participer getParticiperFromPayLoadWeb(ParticiperPayloadWeb participerPayloadWeb) {
Participer participer =new Participer();
if(participerPayloadWeb.getId()!=null)
participer = participerRepository.findById(participerPayloadWeb.getId()).orElse(new Participer());
if (participerPayloadWeb.getEquipeId() != null) {
Equipe equipe = new Equipe();
equipe.setId(participerPayloadWeb.getEquipeId());
participer.setEquipe(equipe);
}
if (participerPayloadWeb.getUserId() != null) {
User user = new User();
user.setId(participerPayloadWeb.getUserId());
participer.setUser(user);
}
participer.setId(participerPayloadWeb.getId());
participer.setDateDebut(participerPayloadWeb.getDateDebut());
participer.setDateFin(participerPayloadWeb.getDateFin());
return participer ;
}
public Campagne getCampagneFromPayLoadWeb(CampagnePayloadWeb campagnePayloadWeb) {
Campagne campagne =new Campagne();
if(campagnePayloadWeb.getId()!=null)
campagne = campagneRepository.findById(campagnePayloadWeb.getId()).orElse(new Campagne());
if (campagnePayloadWeb.getExerciceId() != null) {
Exercice exercice = new Exercice();
exercice.setId(campagnePayloadWeb.getExerciceId());
campagne.setExercice(exercice);
}
if (campagnePayloadWeb.getStructureId() != null) {
Structure structure = new Structure();
structure.setId(campagnePayloadWeb.getStructureId());
campagne.setStructure(structure);
}
campagne.setId(campagnePayloadWeb.getId());
campagne.setDateDebut(campagnePayloadWeb.getDateDebut());
campagne.setDateFin(campagnePayloadWeb.getDateFin());
campagne.setTypeCampagne(campagnePayloadWeb.getTypeCampagne());
campagne.setRefAdministrative(campagnePayloadWeb.getRefAdministrative());
campagne.setNom(campagnePayloadWeb.getNom());
return campagne ;
}
} }

View File

@@ -4,7 +4,7 @@ io.gmss.fiscad.profile=test
# LOCAL ENV TEST # LOCAL ENV TEST
#spring.datasource.url=jdbc:postgresql://localhost:5432/fiscad_dgi #spring.datasource.url=jdbc:postgresql://localhost:5432/fiscad_dgi
#spring.datasource.username=infocad_user #spring.datasource.username=infocad_user
#spring.datasource.password=W5fwD({9*q53 @spring.datasource.password=W5fwD({9*q53
spring.datasource.url=jdbc:postgresql://193.181.208.4:5432/fiscad_db spring.datasource.url=jdbc:postgresql://193.181.208.4:5432/fiscad_db