179 Commits

Author SHA1 Message Date
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
9063162c33 Merge pull request 'fusion maj parcelle,batiment,ulo et leur enquete' (#179) from features/fiche_refonte into develop
Reviewed-on: #179
2026-03-19 18:45:31 +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
3f9cdcdad3 Merge pull request 'fusion maj parcelle,batiment,ulo et leur enquete' (#177) from features/fiche_refonte into develop
Reviewed-on: #177
2026-03-19 18:00:14 +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
e58e338123 Merge pull request 'features/fiche_refonte' (#175) from features/fiche_refonte into develop
Reviewed-on: #175
2026-03-19 16:15:42 +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
253332bbd3 Merge pull request 'fusion maj parcelle,batiment,ulo et leur enquete' (#173) from features/fiche_refonte into develop
Reviewed-on: #173
2026-03-19 10:24:32 +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
6dcd549889 Merge pull request 'features/fiche_refonte' (#171) from features/fiche_refonte into develop
Reviewed-on: #171
2026-03-18 17:18:14 +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
0d27aaebac Merge pull request 'fusion maj parcelle,batiment,ulo et leur enquete' (#169) from features/fiche_refonte into develop
Reviewed-on: #169
2026-03-16 13:27:34 +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
afbf525af5 Merge pull request 'Generation tfu batie et non batie avec ressource de liste de données imposition' (#167) from features/crud_entites into develop
Reviewed-on: #167
2026-03-14 14:47:18 +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
8ee2f7c9b0 Merge pull request 'Generation tfu batie et non batie avec ressource de liste de données imposition' (#165) from features/crud_entites into develop
Reviewed-on: #165
2026-03-12 20:01:27 +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
6bdfa3ad1e Merge pull request 'Generation tfu batie et non batie avec ressource de liste de données imposition' (#163) from features/crud_entites into develop
Reviewed-on: #163
2026-03-12 19:34:04 +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
b8ba15c6fb Merge pull request 'Generation tfu batie et non batie' (#161) from features/crud_entites into develop
Reviewed-on: #161
2026-03-12 11:27:12 +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
698b7e7c99 Merge pull request 'Generation tfu batie et non batie' (#158) from features/crud_entites into develop
Reviewed-on: #158
2026-03-12 11:06:47 +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
9e597386f8 Merge pull request 'Generation tfu batie et non batie' (#156) from features/crud_entites into develop
Reviewed-on: #156
2026-03-12 00:03:12 +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
cb2faeea32 Merge pull request 'Generation tfu batie et non batie' (#154) from features/crud_entites into develop
Reviewed-on: #154
2026-03-11 00:10:38 +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
6b3ab8fc43 Merge pull request 'Gestion des barem' (#152) from features/crud_entites into develop
Reviewed-on: #152
2026-03-10 21:37:55 +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
906a74571f Merge pull request 'features/crud_entites' (#150) from features/crud_entites into develop
Reviewed-on: #150
2026-03-09 20:13:24 +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
6494fe235e Merge pull request 'Gestion des barem' (#148) from features/crud_entites into develop
Reviewed-on: #148
2026-03-09 20:00:03 +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
28da361054 Merge pull request 'features/crud_entites' (#146) from features/crud_entites into develop
Reviewed-on: #146
2026-03-09 19:32:08 +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
3993d28d51 Merge pull request 'features/crud_entites' (#144) from features/crud_entites into develop
Reviewed-on: #144
2026-03-09 18:52:33 +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
09d8b21909 Merge pull request 'Gestion des barem' (#142) from features/crud_entites into develop
Reviewed-on: #142
2026-03-08 13:54:26 +00:00
274b47d116 Merge pull request 'Gestion des barem' (#141) from features/crud_entites into develop
Reviewed-on: #141
2026-03-08 13:52:20 +00:00
bdb08b88fd Merge pull request 'Gestion des barem' (#140) from features/crud_entites into develop
Reviewed-on: #140
2026-03-08 13:25:13 +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
b86c685cd0 Merge pull request 'Gestion cloture' (#138) from features/crud_entites into develop
Reviewed-on: #138
2026-03-06 19:08:53 +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
d46a14626e Merge pull request 'Gestion parcelle geom et changement https://gitea.com/actions/checkout@v4 #actions/checkout@v4' (#136) from features/crud_entites into develop
Reviewed-on: #136
2026-03-01 17:33:59 +00:00
920c70c877 Merge pull request 'Gestion parcelle geom' (#135) from features/crud_entites into develop
Reviewed-on: #135
2026-03-01 17:29:34 +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
2ab5b9299c Merge pull request 'Gestion parcelle geom' (#133) from features/crud_entites into develop
Reviewed-on: #133
2026-03-01 01:40:41 +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
bf19ab6e6a Merge pull request 'features/crud_entites' (#131) from features/crud_entites into develop
Reviewed-on: #131
2026-02-22 23:17:33 +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
84451d5a15 Merge pull request 'features/crud_entites' (#129) from features/crud_entites into develop
Reviewed-on: #129
2026-02-22 13:53:35 +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
e687a9a904 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#127) from features/crud_entites into develop
Reviewed-on: #127
2026-02-21 12:42:08 +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
9685c73513 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#125) from features/crud_entites into develop
Reviewed-on: #125
2026-02-20 19:33:57 +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
650470efff Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#123) from features/crud_entites into develop
Reviewed-on: #123
2026-02-20 18:54:07 +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
9f5cc61726 Merge pull request 'features/crud_entites' (#121) from features/crud_entites into develop
Reviewed-on: #121
2026-02-19 20:37:58 +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
41175d93f0 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#119) from features/crud_entites into develop
Reviewed-on: #119
2026-02-19 19:07:35 +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
1ecaecdee3 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#117) from features/crud_entites into develop
Reviewed-on: #117
2026-02-19 18:33:11 +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
122dfcbead Merge pull request 'features/crud_entites' (#115) from features/crud_entites into develop
Reviewed-on: #115
2026-02-19 12:00:31 +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
d168b68d4b Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#113) from features/crud_entites into develop
Reviewed-on: #113
2026-02-18 23:05:41 +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
2af14dd4cd Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#111) from features/crud_entites into develop
Reviewed-on: #111
2026-02-18 20:42:05 +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
76f0d34e79 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#109) from features/crud_entites into develop
Reviewed-on: #109
2026-02-18 14:01: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
666779ecce Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#107) from features/crud_entites into develop
Reviewed-on: #107
2026-02-16 22:04:26 +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
7fcd676fc0 Merge pull request 'features/crud_entites' (#105) from features/crud_entites into develop
Reviewed-on: #105
2026-02-16 20:55:25 +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
fffdef7103 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#103) from features/crud_entites into develop
Reviewed-on: #103
2026-02-16 00:15:01 +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
95c0dacd1e Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#101) from features/crud_entites into develop
Reviewed-on: #101
2026-02-14 14:08:19 +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
7ac6b953d3 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#99) from features/crud_entites into develop
Reviewed-on: #99
2026-02-13 17:54:51 +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
e010100472 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#97) from features/crud_entites into develop
Reviewed-on: #97
2026-02-12 21:31:24 +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
177a9c7b56 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#95) from features/crud_entites into develop
Reviewed-on: #95
2026-02-12 02:15: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
3054930a86 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#93) from features/crud_entites into develop
Reviewed-on: #93
2026-02-11 21:14:57 +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
4397abd041 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#91) from features/crud_entites into develop
Reviewed-on: #91
2026-02-11 21:10:08 +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
a4b403ca20 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#89) from features/crud_entites into develop
Reviewed-on: #89
2026-02-10 00:10:39 +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
ff7b88f9f8 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#87) from features/crud_entites into develop
Reviewed-on: #87
2026-02-09 23:26:42 +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
37fdba1d85 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#85) from features/crud_entites into develop
Reviewed-on: #85
2026-02-08 22:23:08 +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
f50ed9aa5f Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#83) from features/crud_entites into develop
Reviewed-on: #83
2026-02-04 01:33:32 +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
966fd2ca7a Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#81) from features/crud_entites into develop
Reviewed-on: #81
2026-02-03 19:32: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
a10253b2e8 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#79) from features/crud_entites into develop
Reviewed-on: #79
2026-02-03 15:08:48 +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
08b68f9e08 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#77) from features/crud_entites into develop
Reviewed-on: #77
2026-02-02 23:03:26 +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
be487d6a03 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#75) from features/crud_entites into develop
Reviewed-on: #75
2026-02-01 22:49:00 +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
3be64e7f44 Merge pull request 'gestion de profil, secteur, section et arbre decoupage' (#73) from features/crud_entites into develop
Reviewed-on: #73
2026-01-27 08:58:32 +00:00
03a661cdc0 Merge pull request 'gestion de profil, secteur, section et arbre decoupage' (#72) from features/crud_entites into develop
Reviewed-on: #72
2026-01-27 08:37:52 +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
a68ec444cc Merge pull request 'features/crud_entites' (#70) from features/crud_entites into develop
Reviewed-on: #70
2026-01-13 20:33:17 +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
58f517bf31 Merge pull request 'correction creation user par defaut' (#68) from features/crud_entites into develop
Reviewed-on: #68
2025-12-20 19:03:51 +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
7f18f22efb Merge pull request 'correction creation user par defaut' (#66) from features/crud_entites into develop
Reviewed-on: #66
2025-12-20 18:55:42 +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
af3218412f Merge pull request 'correction creation user par defaut' (#64) from features/crud_entites into develop
Reviewed-on: #64
2025-12-20 17:06:19 +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
f35670c72e Merge pull request 'correction creation user par defaut' (#62) from features/crud_entites into develop
Reviewed-on: #62
2025-12-20 15:03:45 +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
a77c0e854d Merge pull request 'correction creation user par defaut' (#60) from features/crud_entites into develop
Reviewed-on: #60
2025-12-20 14:48:47 +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
e75eff4e20 Merge pull request 'correction lecture de secret chargement' (#58) from features/crud_entites into develop
Reviewed-on: #58
2025-12-20 14:33:59 +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
40d078c653 Merge pull request 'correction lecture de secret chargement' (#56) from features/crud_entites into develop
Reviewed-on: #56
2025-12-20 14:14:02 +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
31dd11d017 Merge pull request 'correction lecture de secret chargement' (#54) from features/crud_entites into develop
Reviewed-on: #54
2025-12-20 13:10: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
6dfd12fae8 Merge pull request 'correction lecture de secret chargement' (#52) from features/crud_entites into develop
Reviewed-on: #52
2025-12-20 12:57:46 +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
a4ad0a4556 Merge pull request 'correction lecture de secret chargement' (#50) from features/crud_entites into develop
Reviewed-on: #50
2025-12-20 12:41:09 +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
411a6c0c2d Merge pull request 'correction lecture de secret' (#48) from features/crud_entites into develop
Reviewed-on: #48
2025-12-20 12:21:25 +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
bed73b2b16 Merge pull request 'correction lecture de secret' (#46) from features/crud_entites into develop
Reviewed-on: #46
2025-12-20 12:10:00 +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
5a0814a0ba Merge pull request 'correction lecture de secret' (#44) from features/crud_entites into develop
Reviewed-on: #44
2025-12-20 12:00:12 +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
126254ea94 Merge pull request 'correction lecture de secret' (#42) from features/crud_entites into develop
Reviewed-on: #42
2025-12-20 11:43:55 +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
f9e4681af4 Merge pull request 'correction lecture de secret' (#40) from features/crud_entites into develop
Reviewed-on: #40
2025-12-20 11:39:40 +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
84089d3639 Merge pull request 'correction profil actif' (#38) from features/crud_entites into develop
Reviewed-on: #38
2025-12-20 10:48:01 +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
02b0a937b4 Merge pull request 'correction profil actif' (#36) from features/crud_entites into develop
Reviewed-on: #36
2025-12-20 10:02:19 +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
c0096457fb Merge pull request 'nouvelle verson ci-cd avec gitea runner natif intallé sur hote' (#34) from features/crud_entites into develop
Reviewed-on: #34
2025-12-19 19:14:24 +00:00
b6062ba4d1 Merge pull request 'nouvelle verson ci-cd avec gitea runner natif intallé sur hote' (#33) from features/crud_entites into develop
Reviewed-on: #33
2025-12-19 10:50:02 +00:00
8dc8c974d3 Merge pull request 'correction docker composer avec les secrets' (#32) from features/crud_entites into develop
Reviewed-on: #32
2025-12-19 10:39:57 +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
957416df9e Merge pull request 'correction docker composer avec les secrets' (#30) from features/crud_entites into develop
Reviewed-on: #30
2025-12-18 15:47:21 +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
8d8af75108 Merge pull request 'correction docker composer avec les secrets' (#28) from features/crud_entites into develop
Reviewed-on: #28
2025-12-18 15:46:02 +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
555f13508e Merge pull request 'correction docker composer avec les secrets' (#26) from features/crud_entites into develop
Reviewed-on: #26
2025-12-18 10:36:10 +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
d92a2b2503 Merge pull request 'correction docker composer avec les secrets' (#24) from features/crud_entites into develop
Reviewed-on: #24
2025-12-17 17:13:46 +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
5ccfdb6a3f Merge pull request 'correction docker composer avec les secrets' (#22) from features/crud_entites into develop
Reviewed-on: #22
2025-12-17 16:58:50 +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
87b3bfbe83 Merge pull request 'correction docker composer avec les secrets' (#20) from features/crud_entites into develop
Reviewed-on: #20
2025-12-17 16:49:15 +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
62f25ea726 Merge pull request 'correction docker composer avec les secrets' (#18) from features/crud_entites into develop
Reviewed-on: #18
2025-12-17 16:41:46 +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
6125fcbd0b Merge pull request 'correction docker composer' (#16) from features/crud_entites into develop
Reviewed-on: #16
2025-12-17 16:26:17 +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
211af6103a Merge pull request 'features/crud_entites' (#14) from features/crud_entites into develop
Reviewed-on: #14
2025-12-17 14:12:53 +00:00
5e9f437497 Merge pull request 'develop' (#13) from develop into main
Reviewed-on: #13
2025-12-16 18:23:59 +00:00
d27b622db8 Merge pull request 'Changement en DB du nom de la colonne personne_id en proprietaire_id dans la table enquete' (#12) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 35s
Reviewed-on: #12
2025-12-16 18:22:48 +00:00
69af57f876 Merge pull request 'develop' (#11) from develop into main
Reviewed-on: #11
2025-12-16 18:08:36 +00:00
c80b40082c Merge pull request 'Changement en DB du nom de la colonne personne_id en proprietaire_id dans la table enquete' (#10) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 44s
Reviewed-on: #10
2025-12-16 18:06:52 +00:00
56f78e77f3 Merge pull request 'develop' (#9) from develop into main
Reviewed-on: #9
2025-12-05 19:24:21 +00:00
4a88af6487 Merge pull request 'Changement en DB du nom de la colonne personne_id en proprietaire_id dans la table enquete' (#8) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 34s
Reviewed-on: #8
2025-12-05 19:24:00 +00:00
0c7dc082fd Merge pull request 'develop' (#7) from develop into main
Reviewed-on: #7
2025-12-05 19:21:28 +00:00
966b0af1c2 Merge pull request 'Changement en DB du nom de la colonne personne_id en proprietaire_id dans la table enquete' (#6) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 36s
Reviewed-on: #6
2025-12-05 19:20:57 +00:00
3f5d7e980c Merge pull request 'develop' (#5) from develop into main
Reviewed-on: #5
2025-12-05 19:11:10 +00:00
58aa088ac3 Merge pull request 'ajout de ci-cd' (#4) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 39s
Reviewed-on: #4
2025-12-05 19:10:37 +00:00
87be4e4483 Merge pull request 'develop' (#3) from develop into main
Reviewed-on: #3
2025-12-05 19:07:16 +00:00
033b430051 Merge pull request 'ajout de ci-cd' (#2) from features/crud_entites into develop
Some checks failed
CD - Deploy on main / deploy (pull_request) Failing after 39s
Reviewed-on: #2
2025-12-05 19:06:43 +00:00
b8dbc7f625 Merge pull request 'ajout de ci-cd' (#1) from features/crud_entites into develop
Reviewed-on: #1
2025-12-05 17:53:30 +00:00
190 changed files with 316 additions and 20201 deletions

View File

@@ -45,7 +45,6 @@ public class ArrondissementController {
@io.swagger.v3.oas.annotations.responses.ApiResponse(description = "Unauthorized / Invalid Token", responseCode = "403")}
)
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_ARRONDISSEMENT')")
public ResponseEntity<?> createArrondissement(@RequestBody @Valid @Validated Arrondissement arrondissement) {
try {
arrondissement = arrondissementService.createArrondissement(arrondissement);
@@ -77,7 +76,6 @@ public class ArrondissementController {
@io.swagger.v3.oas.annotations.responses.ApiResponse(description = "Unauthorized / Invalid Token", responseCode = "403")}
)
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_ARRONDISSEMENT')")
public ResponseEntity<?> updateArrondissement(@PathVariable Long id, @RequestBody Arrondissement arrondissement) {
try {
return new ResponseEntity<>(
@@ -101,7 +99,6 @@ public class ArrondissementController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_ARRONDISSEMENT')")
public ResponseEntity<?> deleteArrondissement(@PathVariable Long id) {
try {
arrondissementService.deleteArrondissement(id);
@@ -126,7 +123,6 @@ public class ArrondissementController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_ARRONDISSEMENT')")
public ResponseEntity<?> getAllArrondissementList() {
try {
return new ResponseEntity<>(
@@ -151,7 +147,6 @@ public class ArrondissementController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_ARRONDISSEMENT')")
public ResponseEntity<?> getAllArrondissementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -177,7 +172,6 @@ public class ArrondissementController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_ARRONDISSEMENT')")
public ResponseEntity<?> getArrondissementById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -202,7 +196,6 @@ public class ArrondissementController {
}
@GetMapping("/commune/{communeId}")
@PreAuthorize("hasAuthority('READ_ARRONDISSEMENT')")
public ResponseEntity<?> getArrondissementByCommune(@PathVariable Long communeId) {
try {
return new ResponseEntity<>(
@@ -226,7 +219,6 @@ public class ArrondissementController {
}
@GetMapping("/page/commune/{communeId}")
@PreAuthorize("hasAuthority('READ_ARRONDISSEMENT')")
public ResponseEntity<?> getArrondissementByCommune(@PathVariable Long communeId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);

View File

@@ -38,7 +38,6 @@ public class CommuneController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_COMMUNE')")
public ResponseEntity<?> createCommune(@RequestBody @Valid @Validated Commune commune) {
try {
commune = communeService.createCommune(commune);
@@ -63,7 +62,6 @@ public class CommuneController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_COMMUNE')")
public ResponseEntity<?> updateCommune(@PathVariable Long id, @RequestBody Commune commune) {
try {
return new ResponseEntity<>(
@@ -87,7 +85,6 @@ public class CommuneController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_COMMUNE')")
public ResponseEntity<?> deleteCommuner(@PathVariable Long id) {
try {
communeService.deleteCommune(id);
@@ -112,7 +109,6 @@ public class CommuneController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_COMMUNE')")
public ResponseEntity<?> getAllCommuneList() {
try {
return new ResponseEntity<>(
@@ -137,7 +133,6 @@ public class CommuneController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_COMMUNE')")
public ResponseEntity<?> getAllCommunePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -163,7 +158,6 @@ public class CommuneController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_COMMUNE')")
public ResponseEntity<?> getCommuneById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -187,7 +181,6 @@ public class CommuneController {
}
@GetMapping("/departement/{departementId}")
@PreAuthorize("hasAuthority('READ_COMMUNE')")
public ResponseEntity<?> getCommuneByDepartement(@PathVariable Long departementId) {
try {
@@ -212,7 +205,6 @@ public class CommuneController {
}
@GetMapping("/page/by-departement-id/{departementId}")
@PreAuthorize("hasAuthority('READ_COMMUNE')")
public ResponseEntity<?> getCommuneByDepartementIdPaged(@PathVariable Long departementId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);

View File

@@ -37,7 +37,6 @@ public class DepartementController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_DEPARTEMENT')")
public ResponseEntity<?> createDepartement(@RequestBody @Valid @Validated Departement departement) {
try {
departement = departementService.createDepartement(departement);
@@ -62,7 +61,6 @@ public class DepartementController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_DEPARTEMENT')")
public ResponseEntity<?> updateDepartement(@PathVariable Long id, @RequestBody Departement departement) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class DepartementController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_DEPARTEMENT')")
public ResponseEntity<?> deleteDepartementr(@PathVariable Long id) {
try {
departementService.deleteDepartement(id);
@@ -111,7 +108,6 @@ public class DepartementController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_DEPARTEMENT')")
public ResponseEntity<?> getAllDepartementList() {
try {
return new ResponseEntity<>(
@@ -136,7 +132,6 @@ public class DepartementController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_DEPARTEMENT')")
public ResponseEntity<?> getAllDepartementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -162,7 +157,6 @@ public class DepartementController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_DEPARTEMENT')")
public ResponseEntity<?> getDepartementById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -37,7 +37,6 @@ public class NationaliteController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_NATIONALITE')")
public ResponseEntity<?> createNationalite(@RequestBody @Valid @Validated Nationalite nationalite) {
try {
nationalite = nationaliteService.createNationalite(nationalite);
@@ -62,7 +61,6 @@ public class NationaliteController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_NATIONALITE')")
public ResponseEntity<?> updateNationalite(@PathVariable Long id, @RequestBody Nationalite nationalite) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class NationaliteController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_NATIONALITE')")
public ResponseEntity<?> deleteNationaliter(@PathVariable Long id) {
try {
nationaliteService.deleteNationalite(id);
@@ -111,7 +108,6 @@ public class NationaliteController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_NATIONALITE')")
public ResponseEntity<?> getAllNationaliteList() {
try {
return new ResponseEntity<>(
@@ -135,7 +131,6 @@ public class NationaliteController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_NATIONALITE')")
public ResponseEntity<?> getAllNationalitePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -161,7 +156,6 @@ public class NationaliteController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_NATIONALITE')")
public ResponseEntity<?> getNationaliteById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -37,7 +37,6 @@ public class QuartierController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_QUARTIER')")
public ResponseEntity<?> createQuartier(@RequestBody @Valid @Validated Quartier quartier) {
try {
quartier = quartierService.createQuartier(quartier);
@@ -62,7 +61,6 @@ public class QuartierController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_QUARTIER')")
public ResponseEntity<?> updateQuartier(@PathVariable Long id, @RequestBody Quartier quartier) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class QuartierController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_QUARTIER')")
public ResponseEntity<?> deleteQuartier(@PathVariable Long id) {
try {
quartierService.deleteQuartier(id);
@@ -111,7 +108,6 @@ public class QuartierController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_QUARTIER')")
public ResponseEntity<?> getAllQuartierList() {
try {
return new ResponseEntity<>(
@@ -135,7 +131,6 @@ public class QuartierController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_QUARTIER')")
public ResponseEntity<?> getAllQuartierPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +155,6 @@ public class QuartierController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_QUARTIER')")
public ResponseEntity<?> getQuartierById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -184,7 +178,6 @@ public class QuartierController {
}
@GetMapping("/arrondissement/{arrondissementId}")
@PreAuthorize("hasAuthority('READ_QUARTIER')")
public ResponseEntity<?> getQuartierByArrondissement(@PathVariable Long arrondissementId) {
try {
@@ -209,7 +202,6 @@ public class QuartierController {
}
@GetMapping("/page/arrondissement/{arrondissementId}")
@PreAuthorize("hasAuthority('READ_QUARTIER')")
public ResponseEntity<?> getQuartierByArrondissementPaged(@PathVariable Long arrondissementId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);

View File

@@ -42,7 +42,6 @@ public class SecteurController {
description = "Permet de Créer un secteur"
)
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_SECTEUR')")
public ResponseEntity<?> createSecteur(@RequestBody @Valid @Validated SecteurPaylaodWeb secteurPaylaodWeb) {
try {
secteurPaylaodWeb = secteurService.createSecteur(secteurPaylaodWeb);
@@ -71,7 +70,6 @@ public class SecteurController {
description = "Permet de modifier un secteur"
)
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_SECTEUR')")
public ResponseEntity<?> updateSecteur(@PathVariable Long id, @RequestBody SecteurPaylaodWeb secteurPayloadWeb) {
try {
return new ResponseEntity<>(
@@ -98,7 +96,6 @@ public class SecteurController {
description = "Permet de supprimer un secteur"
)
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_SECTEUR')")
public ResponseEntity<?> deleteSecteurr(@PathVariable Long id) {
try {
secteurService.deleteSecteur(id);
@@ -126,7 +123,6 @@ public class SecteurController {
description = "Permet de récuperer l'ensemble des secteurs"
)
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_SECTEUR')")
public ResponseEntity<?> getAllSecteurList() {
try {
return new ResponseEntity<>(
@@ -154,7 +150,6 @@ public class SecteurController {
description = "Permet de récuperer l'ensemble des secteurs avec pagination"
)
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_SECTEUR')")
public ResponseEntity<?> getAllSecteurPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -183,7 +178,6 @@ public class SecteurController {
description = "Permet de récuperer le secteur ayant l'ID fournie en path"
)
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_SECTEUR')")
public ResponseEntity<?> getSecteurById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -211,7 +205,6 @@ public class SecteurController {
description = "Permet de récuperer l'ensemble des secteurs de la structure dont l'ID est fourni en path"
)
@GetMapping("/by-structure-id/{structureId}")
@PreAuthorize("hasAuthority('READ_SECTEUR')")
public ResponseEntity<?> getSecteurByStructureId(@PathVariable Long structureId) {
try {
return new ResponseEntity<>(
@@ -240,7 +233,6 @@ public class SecteurController {
description = "Permet de récuperer l'ensemble des secteurs de la structure dont l'ID est fourni en path avec pagination"
)
@GetMapping("/page/by-structure-id/{structureId}")
@PreAuthorize("hasAuthority('READ_SECTEUR')")
public ResponseEntity<?> getSecteurByStructureIdPage(@PathVariable Long structureId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -271,7 +263,6 @@ public class SecteurController {
description = "Permet de récuperer l'ensemble des secteurs de la section dont l'ID est fourni en path"
)
@GetMapping("/by-section-id/{sectionId}")
@PreAuthorize("hasAuthority('READ_SECTEUR')")
public ResponseEntity<?> getSecteurBySectionId(@PathVariable Long sectionId) {
try {
return new ResponseEntity<>(
@@ -300,7 +291,6 @@ public class SecteurController {
description = "Permet de récuperer l'ensemble des secteurs de la section dont l'ID est fourni en path avec pagination"
)
@GetMapping("/page/by-section-id/{sectionId}")
@PreAuthorize("hasAuthority('READ_SECTEUR')")
public ResponseEntity<?> getSecteurBySectionIdPage(@PathVariable Long sectionId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -330,7 +320,6 @@ public class SecteurController {
description = "Permet de récuperer l'ensemble des secteurs du departement dont l'ID est fourni en path"
)
@GetMapping("/by-departement-id/{departementId}")
@PreAuthorize("hasAuthority('READ_SECTEUR')")
public ResponseEntity<?> getSecteurByDepartementId(@PathVariable Long departementId) {
try {
return new ResponseEntity<>(

View File

@@ -37,7 +37,6 @@ public class SecteurDecoupageController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> createSecteurDecoupage(@RequestBody @Valid @Validated SecteurDecoupagePaylaodWeb secteurDecoupagePaylaodWeb) {
try {
secteurDecoupagePaylaodWeb = secteurDecoupageService.createSecteurDecoupage(secteurDecoupagePaylaodWeb);
@@ -62,7 +61,6 @@ public class SecteurDecoupageController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> updateSecteurDecoupage(@PathVariable Long id, @RequestBody SecteurDecoupagePaylaodWeb secteurDecoupagePaylaodWeb) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class SecteurDecoupageController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> deleteSecteurDecoupager(@PathVariable Long id) {
try {
secteurDecoupageService.deleteSecteurDecoupage(id);
@@ -111,7 +108,6 @@ public class SecteurDecoupageController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getAllSecteurDecoupageList() {
try {
return new ResponseEntity<>(
@@ -135,7 +131,6 @@ public class SecteurDecoupageController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getAllSecteurDecoupagePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +155,6 @@ public class SecteurDecoupageController {
}
@GetMapping("/by-secteur-id/{secteurId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getAllSecteurDecoupageListBySecteurId(@PathVariable Long secteurId) {
try {
return new ResponseEntity<>(
@@ -184,7 +178,6 @@ public class SecteurDecoupageController {
}
@GetMapping("/page/by-secteur-decoupage-id/{secteurId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getAllSecteurDecoupageListBySecteurIdPaged(@PathVariable Long secteurId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -209,7 +202,6 @@ public class SecteurDecoupageController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getSecteurDecoupageById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -234,7 +226,6 @@ public class SecteurDecoupageController {
@GetMapping("/arbre/user-id/{userId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
@@ -259,7 +250,6 @@ public class SecteurDecoupageController {
@GetMapping("/arbre/enquete-en-cours/user-id/{userId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceEnqueteEncoursByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
@@ -284,7 +274,6 @@ public class SecteurDecoupageController {
@GetMapping("/arbre/enquete-valide/user-id/{userId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceEnqueteValideByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
@@ -309,7 +298,6 @@ public class SecteurDecoupageController {
@GetMapping("/arbre/enquete-cloture/user-id/{userId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceEnqueteClotureByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
@@ -335,7 +323,6 @@ public class SecteurDecoupageController {
@GetMapping("/arbre/enquete-batiment-en-cours/user-id/{userId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceEnqueteBatimentEncoursByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
@@ -360,7 +347,6 @@ public class SecteurDecoupageController {
@GetMapping("/arbre/enquete-batiment-valide/user-id/{userId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceEnqueteBatimentValideByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
@@ -385,7 +371,6 @@ public class SecteurDecoupageController {
@GetMapping("/arbre/enquete-batiment-cloture/user-id/{userId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceEnqueteBatimentClotureByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
@@ -410,7 +395,6 @@ public class SecteurDecoupageController {
@GetMapping("/arbre/enquete-unitlog-en-cours/user-id/{userId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceEnqueteUniteLogEncoursByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
@@ -435,7 +419,6 @@ public class SecteurDecoupageController {
@GetMapping("/arbre/enquete-unitlog-valide/user-id/{userId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceEnqueteUniteLogValideByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
@@ -460,7 +443,6 @@ public class SecteurDecoupageController {
@GetMapping("/arbre/enquete-unitlog-cloture/user-id/{userId}")
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
public ResponseEntity<?> getArborescenceEnqueteUniteLigClotureByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(

View File

@@ -15,7 +15,6 @@ 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;
@@ -40,7 +39,6 @@ public class SectionController {
description = "Permet de Créer un section"
)
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_SECTION')")
public ResponseEntity<?> createSection(@RequestBody @Valid @Validated SectionPaylaodWeb sectionPaylaodWeb) {
try {
sectionPaylaodWeb = sectionService.createSection(sectionPaylaodWeb);
@@ -69,7 +67,6 @@ public class SectionController {
description = "Permet de modifier un section"
)
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_SECTION')")
public ResponseEntity<?> updateSection(@PathVariable Long id, @RequestBody SectionPaylaodWeb sectionPayloadWeb) {
try {
return new ResponseEntity<>(
@@ -96,7 +93,6 @@ public class SectionController {
description = "Permet de supprimer un section"
)
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_SECTION')")
public ResponseEntity<?> deleteSection(@PathVariable Long id) {
try {
sectionService.deleteSection(id);
@@ -124,7 +120,6 @@ public class SectionController {
description = "Permet de récuperer l'ensemble des sections"
)
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_SECTION')")
public ResponseEntity<?> getAllSectionList() {
try {
return new ResponseEntity<>(
@@ -152,7 +147,6 @@ public class SectionController {
description = "Permet de récuperer l'ensemble des sections avec pagination"
)
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_SECTION')")
public ResponseEntity<?> getAllSectionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -181,7 +175,6 @@ public class SectionController {
description = "Permet de récuperer le section ayant l'ID fournie en path"
)
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_SECTION')")
public ResponseEntity<?> getSectionById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -209,7 +202,6 @@ public class SectionController {
description = "Permet de récuperer l'ensemble des sections de la structure dont l'ID est fourni en path"
)
@GetMapping("/by-structure-id/{structureId}")
@PreAuthorize("hasAuthority('READ_SECTION')")
public ResponseEntity<?> getSectionByStructureId(@PathVariable Long structureId) {
try {
return new ResponseEntity<>(
@@ -238,7 +230,6 @@ public class SectionController {
description = "Permet de récuperer l'ensemble des sections de la structure dont l'ID est fourni en path avec pagination"
)
@GetMapping("/page/by-structure-id/{structureId}")
@PreAuthorize("hasAuthority('READ_SECTION')")
public ResponseEntity<?> getSectionByStructureIdPage(@PathVariable Long structureId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);

View File

@@ -1,183 +0,0 @@
package io.gmss.fiscad.controllers.frontend;
import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.frontend.FonctionnaliteService;
import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.FonctionnalitePayloadWeb;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;
@AllArgsConstructor
@RestController
@RequestMapping(value = "api/fonctionnalite", produces = MediaType.APPLICATION_JSON_VALUE)
@SecurityRequirement(name = "bearer")
@Tag(name = "Fonctionnalite")
@CrossOrigin(origins = "*")
public class FonctionnaliteController {
private final FonctionnaliteService fonctionnaliteService;
private static final Logger logger = LoggerFactory.getLogger(FonctionnaliteController.class);
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_FONCTIONNALITE')")
public ResponseEntity<?> createFonctionnalite(@RequestBody @Valid @Validated FonctionnalitePayloadWeb fonctionnalitePayLoadWeb) {
try {
fonctionnalitePayLoadWeb = fonctionnaliteService.createFonctionnalite(fonctionnalitePayLoadWeb);
return new ResponseEntity<>(
new ApiResponse<>(true, fonctionnalitePayLoadWeb, "Fonctionnalite 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_FONCTIONNALITE')")
public ResponseEntity<?> updateFonctionnalite(@PathVariable Long id, @RequestBody FonctionnalitePayloadWeb fonctionnalitePayLoadWeb) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, fonctionnaliteService.updateFonctionnalite(id,fonctionnalitePayLoadWeb), "Fonctionnalite 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_FONCTIONNALITE')")
public ResponseEntity<?> deleteFonctionnalite(@PathVariable Long id) {
try {
fonctionnaliteService.deleteFonctionnalite(id);
return new ResponseEntity<>(
new ApiResponse<>(true, "Fonctionnalite 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_FONCTIONNALITE')")
public ResponseEntity<?> getAllFonctionnaliteList() {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, fonctionnaliteService.getFonctionnaliteListToDto(), "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-profil-id/{profilId}")
@PreAuthorize("hasAuthority('READ_FONCTIONNALITE')")
public ResponseEntity<?> getAllFonctionnaliteByProfilList(@PathVariable Long profilId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, fonctionnaliteService.getAllFonctionnaliteByProfilIdToDto(profilId), "Liste des fonctionnalites 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_FONCTIONNALITE')")
public ResponseEntity<?> getFonctionnaliteById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, fonctionnaliteService.getFonctionnaliteByIdToDto(id), "Fonctionnalite 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

@@ -1,185 +0,0 @@
package io.gmss.fiscad.controllers.frontend;
import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.frontend.ModuleService;
import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.ModulePayloadWeb;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
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;
@AllArgsConstructor
@RestController
@RequestMapping(value = "api/module", produces = MediaType.APPLICATION_JSON_VALUE)
@SecurityRequirement(name = "bearer")
@Tag(name = "Module")
@CrossOrigin(origins = "*")
public class ModuleController {
private final ModuleService moduleService;
private static final Logger logger = LoggerFactory.getLogger(ModuleController.class);
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_MODULE')")
public ResponseEntity<?> createModule(@RequestBody @Valid @Validated ModulePayloadWeb modulePayLoadWeb) {
try {
modulePayLoadWeb = moduleService.createModule(modulePayLoadWeb);
return new ResponseEntity<>(
new ApiResponse<>(true, modulePayLoadWeb, "Module 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_MODULE')")
public ResponseEntity<?> updateModule(@PathVariable Long id, @RequestBody ModulePayloadWeb modulePayLoadWeb) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, moduleService.updateModule(id,modulePayLoadWeb), "Module 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_MODULE')")
public ResponseEntity<?> deleteModule(@PathVariable Long id) {
try {
moduleService.deleteModule(id);
return new ResponseEntity<>(
new ApiResponse<>(true, "Module 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_MODULE')")
public ResponseEntity<?> getAllModuleList() {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, moduleService.getModuleListToDto(), "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-profil-id/{profilId}")
@PreAuthorize("hasAuthority('READ_MODULE')")
public ResponseEntity<?> getAllModuleByProfilList(@PathVariable Long profilId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, moduleService.getAllModuleByProfilIdToDto(profilId), "Liste des modules 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_MODULE')")
public ResponseEntity<?> getModuleById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, moduleService.getModuleByIdToDto(id), "Module 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

@@ -21,7 +21,7 @@ import org.springframework.web.client.HttpClientErrorException;
@SecurityRequirement(name = "bearer")
@Tag(name = "Actuer concerné")
@CrossOrigin(origins = "*")
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public class ActeurConcerneController {
private final ActeurConcerneService acteurConcerneService;
@@ -36,7 +36,6 @@ public class ActeurConcerneController {
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_ACTEURCONCERNE')")
public ResponseEntity<?> getArrondissementById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -59,7 +58,6 @@ public class ActeurConcerneController {
}
}
@GetMapping("/get-details/{id}")
@PreAuthorize("hasAuthority('READ_ACTEURCONCERNE')")
public ResponseEntity<?> getDetails(@PathVariable Long id) {
try{
PersonneCompletDTO personneCompletDTO = personneService.getPersonneComplete(id);

View File

@@ -39,9 +39,8 @@ public class CommentaireController {
this.commentaireService = commentaireService;
}
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_COMMENTAIRE')")
public ResponseEntity<?> createcommentaire(@RequestBody @Valid @Validated Commentaire commentaire) {
try {
commentaire.setDateCommentaire(LocalDateTime.now());
@@ -65,9 +64,8 @@ public class CommentaireController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_COMMENTAIRE')")
public ResponseEntity<?> updatecommentaire(@PathVariable Long id, @RequestBody Commentaire commentaire) {
try {
return new ResponseEntity<>(
@@ -89,9 +87,8 @@ public class CommentaireController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_COMMENTAIRE')")
public ResponseEntity<?> deletecommentaire(@PathVariable Long id) {
try {
commentaireService.deleteCommentaire(id);
@@ -114,9 +111,8 @@ public class CommentaireController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_COMMENTAIRE')")
public ResponseEntity<?> getAllcommentaireList() {
try {
return new ResponseEntity<>(
@@ -138,9 +134,8 @@ public class CommentaireController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_COMMENTAIRE')")
public ResponseEntity<?> getcommentaireById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -162,9 +157,8 @@ public class CommentaireController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@GetMapping("/nup/{nup}")
@PreAuthorize("hasAuthority('READ_COMMENTAIRE')")
public ResponseEntity<?> getcommentaireByNup(@PathVariable String nup) {
try {
return new ResponseEntity<>(
@@ -186,9 +180,8 @@ public class CommentaireController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PostMapping("/enquete")
@PreAuthorize("hasAuthority('READ_COMMENTAIRE')")
public ResponseEntity<?> getcommentaireByEnquete(@RequestBody Commentaire commentaire) {
try {
return new ResponseEntity<>(
@@ -210,9 +203,8 @@ public class CommentaireController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PostMapping("/enquete-and-state")
@PreAuthorize("hasAuthority('READ_COMMENTAIRE')")
//@ApiOperation(value = "Cette ressource permet d'avoir la liste de tous les commentaires d'une enquête avec le statut (lu ou non lu). Les champs a renseigner pour le payload sont idEnquete et lu")
public ResponseEntity<?> getcommentaireByEnqueteAndStatut(@RequestBody Commentaire commentaire) {
try {
@@ -235,9 +227,8 @@ public class CommentaireController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PostMapping("/all-by-params")
@PreAuthorize("hasAuthority('READ_COMMENTAIRE')")
//@ApiOperation(value = "Cette ressource permet d'avoir 4 résultats différents. \n 1 - Liste des commentaires non lus provenant du BatimentPaylaodWeb. \n 2 - Liste des commentaires lus provenant du BatimentPaylaodWeb \n 3 - Liste des commentaires non lus provenant du mobile. \n 4 - Liste des commentaires lus provenant du mobile. \n A savoir : Les variables Origine et lu sont à varier pour avoir le résultat")
public ResponseEntity<?> getcommentaireByParams(@RequestBody CommentaireRequest commentaireRequest) {
try {
@@ -262,7 +253,6 @@ public class CommentaireController {
}
@PostMapping("synchronise/from-mobile")
@PreAuthorize("hasAuthority('CREATE_COMMENTAIRE')")
//@ApiOperation(value = "Cette ressource permet de synchroniser tous les commentaires effectués sur le mobile vers le backend.")
public ResponseEntity<?> synchroniseCommentairesFromMobile(@RequestBody List<Commentaire> commentaires) {
try {
@@ -287,7 +277,6 @@ public class CommentaireController {
}
@PostMapping("synchronise/from-web")
@PreAuthorize("hasAuthority('READ_COMMENTAIRE')")
//@ApiOperation(value = "Cette ressource permet d'avoir 4 résultats différents. \n 1 - Liste des commentaires non synchronisés provenant du BatimentPaylaodWeb. \n 2 - Liste des commentaires synchronisés provenant du BatimentPaylaodWeb \n 3 - Liste des commentaires non synchronisés provenant du mobile. \n 4 - Liste des commentaires synchronisés provenant du mobile. \n A savoir : Les variables Origine et Synchronise sont à varier pour avoir le résultat")
public ResponseEntity<?> synchroniseCommentairesFromWeb(@RequestBody CommentaireRequest commentaireRequest) {
try {
@@ -310,9 +299,8 @@ public class CommentaireController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PostMapping("synchronise/notify-done-from-mobile")
@PreAuthorize("hasAuthority('CREATE_COMMENTAIRE')")
//@ApiOperation(value = "Cette ressource permet matérialiser coté backend les commentaires du WEB déjà synchronisé avec le MOBILE pour que les prochaines extractions ne prennent pas en compte cela. ")
public ResponseEntity<?> notifyDoneSynchronizedFromMobile(@RequestBody List<SyncCommentaireRequest> syncCommentaireRequests) {
try {

View File

@@ -50,7 +50,6 @@ public class EnqueteController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_ENQUETE')")
public ResponseEntity<?> createEnquete(@RequestBody @Valid @Validated EnquetePayLoadWeb enquetePayLoadWeb) {
try {
enquetePayLoadWeb = enqueteService.createEnquete(enquetePayLoadWeb);
@@ -77,7 +76,6 @@ public class EnqueteController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_ENQUETE')")
public ResponseEntity<?> updateEnquete(@PathVariable Long id, @RequestBody EnquetePayLoadWeb enquetePayLoadWeb) {
try {
return new ResponseEntity<>(
@@ -101,7 +99,6 @@ public class EnqueteController {
}
@PutMapping("/validation")
@PreAuthorize("hasAuthority('UPDATE_ENQUETE')")
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try {
return new ResponseEntity<>(
@@ -125,7 +122,6 @@ public class EnqueteController {
}
@PutMapping("/rejet")
@PreAuthorize("hasAuthority('UPDATE_ENQUETE')")
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try {
@@ -150,7 +146,6 @@ public class EnqueteController {
}
@PutMapping("/validation-lot")
@PreAuthorize("hasAuthority('UPDATE_ENQUETE')")
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try {
return new ResponseEntity<>(
@@ -174,7 +169,6 @@ public class EnqueteController {
}
@PutMapping("/rejet-lot")
@PreAuthorize("hasAuthority('UPDATE_ENQUETE')")
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try {
return new ResponseEntity<>(
@@ -198,7 +192,6 @@ public class EnqueteController {
}
@GetMapping("/all/decoupage-admin-for-enquete")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getAllByEnqueteDecoupageAdmin() {
try {
return new ResponseEntity<>(
@@ -226,7 +219,6 @@ public class EnqueteController {
description = "Permet de récuperer les enquêtes déjà réalisées sur une parcelles"
)
@GetMapping("/by-parcelle-id/{parcelleId}")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getAllByParcelle(@PathVariable Long parcelleId) {
try {
return new ResponseEntity<>(
@@ -255,7 +247,6 @@ public class EnqueteController {
description = "Permet de récuperer les enquêtes déjà réalisées sur une parcelles"
)
@GetMapping("/page/by-parcelle-id/{parcelleId}")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getAllByParcellePaged(@PathVariable Long parcelleId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -284,7 +275,6 @@ public class EnqueteController {
@GetMapping("/all/dgi/decoupage-admin-for-enquete")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getAllByEnqueteDecoupageAdminForDgi() {
try {
return new ResponseEntity<>(
@@ -309,7 +299,6 @@ public class EnqueteController {
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_ENQUETE')")
public ResponseEntity<?> deleteStructurer(@PathVariable Long id) {
try {
enqueteService.deleteEnquete(id);
@@ -334,7 +323,6 @@ public class EnqueteController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getAllStructureList() {
try {
return new ResponseEntity<>(
@@ -358,7 +346,6 @@ public class EnqueteController {
}
@GetMapping("/all/com-arrond-bloc")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getAllByCommuneArrondBloc() {
try {
return new ResponseEntity<>(
@@ -382,7 +369,6 @@ public class EnqueteController {
}
@PostMapping("/all/com-arrond-bloc/filtre")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getAllByCommuneArrondBlocFiltre(@RequestBody FiltreEnquetePayLoad filtreEnquetePayLoad) {
try {
return new ResponseEntity<>(
@@ -406,7 +392,6 @@ public class EnqueteController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getAllEnquetePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -431,7 +416,6 @@ public class EnqueteController {
}
@GetMapping("/fiche/id/{id}")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getFicheEnqueteById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -455,7 +439,6 @@ public class EnqueteController {
}
@GetMapping("/fiche/nup-provisoir/{nupProvisoir}")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getFicheEnqueteByNupProvisoir(@PathVariable String nupProvisoir) {
try {
return new ResponseEntity<>(
@@ -479,7 +462,6 @@ public class EnqueteController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getStructureById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -505,7 +487,6 @@ public class EnqueteController {
@GetMapping("/all-paged/en-cours/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getAllEnqueteEncoursByQuartierPaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -537,7 +518,6 @@ public class EnqueteController {
@GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_ENQUETE')")
public ResponseEntity<?> getAllEnqueteClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);

View File

@@ -23,7 +23,6 @@ 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;
@@ -50,7 +49,6 @@ public class ParcelleController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_PARCELLE')")
public ResponseEntity<?> createParcelle(@RequestBody @Valid @Validated ParcellePayLoadWeb parcellePayLoadWeb) {
try {
parcellePayLoadWeb = parcelleService.createParcelle(parcellePayLoadWeb);
@@ -76,7 +74,6 @@ public class ParcelleController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_PARCELLE')")
public ResponseEntity<?> updateEnquete(@PathVariable Long id, @RequestBody ParcellePayLoadWeb parcellePayLoadWeb) {
try {
return new ResponseEntity<>(
@@ -103,7 +100,6 @@ public class ParcelleController {
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_PARCELLE')")
public ResponseEntity<?> deleteStructurer(@PathVariable Long id) {
try {
parcelleService.deleteParcelle(id);
@@ -149,7 +145,6 @@ public class ParcelleController {
// }
// }
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_PARCELLE')")
public ResponseEntity<?> getParcelleById(@CurrentUser UserPrincipal currentUser, @PathVariable Long id) {
try {
if(currentUser==null)
@@ -159,7 +154,7 @@ public class ParcelleController {
);
Long userId = currentUser.getUser().getId();
return new ResponseEntity<>(
new ApiResponse<>(true, parcelleService.getParcelleByIdToDto(userId,id), "parcelle trouvée avec succès."),
new ApiResponse<>(true, parcelleService.getParcelleByIdToDto(userId,id), "enquete trouvé avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -178,7 +173,6 @@ public class ParcelleController {
}
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_PARCELLE')")
public ResponseEntity<?> getAllParcelle(@CurrentUser UserPrincipal currentUser) {
try {
if(currentUser==null)
@@ -208,7 +202,6 @@ public class ParcelleController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_PARCELLE')")
public ResponseEntity<?> getAllParcellePaged(@CurrentUser UserPrincipal currentUser,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -241,7 +234,6 @@ public class ParcelleController {
@PostMapping("/all-paged/multi-criteres")
@PreAuthorize("hasAuthority('READ_PARCELLE')")
public ResponseEntity<?> getAllParcelleFiltrePaged(@CurrentUser UserPrincipal currentUser, @RequestParam int pageNo, @RequestParam int pageSize, @RequestBody FiltreParcelle filtreParcelle) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -274,7 +266,6 @@ public class ParcelleController {
}
@GetMapping("/all/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_PARCELLE')")
public ResponseEntity<?> getAllParcelleByQuartier(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId) {
try {
if(currentUser==null)
@@ -304,7 +295,6 @@ public class ParcelleController {
}
@GetMapping("/all-paged/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_PARCELLE')")
public ResponseEntity<?> getAllParcelleByQuartierPaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -337,7 +327,6 @@ public class ParcelleController {
@GetMapping("/all/by-rue-id/{rueId}")
@PreAuthorize("hasAuthority('READ_PARCELLE')")
public ResponseEntity<?> getAllParcelleByRue(@CurrentUser UserPrincipal currentUser,@PathVariable Long rueId) {
try {
if(currentUser==null)
@@ -367,7 +356,6 @@ public class ParcelleController {
}
@GetMapping("/all-paged/by-rue-id/{rueId}")
@PreAuthorize("hasAuthority('READ_PARCELLE')")
public ResponseEntity<?> getAllParcelleByRuePaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long rueId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -401,7 +389,6 @@ public class ParcelleController {
@PutMapping("/syncrhonise-etat-batie-parcelle")
@PreAuthorize("hasAuthority('READ_PARCELLE')")
public ResponseEntity<?> putSynchroniseEtatBatieParcelle() {
try {
Integer nombreParcelleSync= parcelleService.majParcelleBatieNonbatie();

View File

@@ -31,7 +31,6 @@ public class ParcelleGeomController {
@PostMapping(value = "/create-from-geojsonfile",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@PreAuthorize("hasAuthority('CREATE_PARCELLEGEOM')")
public ResponseEntity<?> createTpe(@RequestPart(required = true) MultipartFile file,@RequestParam String reference,@RequestParam String description) {
try{
int n = parcelleGeomService.createParcelleFromGeoJsonFile(file, reference, description);
@@ -49,7 +48,6 @@ public class ParcelleGeomController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
public ResponseEntity<?> getAllTpeList() {
return new ResponseEntity<>(
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomList(), "Liste des parcelle chargée avec succès."),
@@ -58,7 +56,6 @@ public class ParcelleGeomController {
}
@GetMapping("/by-quartier/{codeQuartier}")
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
public ResponseEntity<?> getParcellesGeomsByQuartier(@PathVariable String codeQuartier) {
return new ResponseEntity<>(
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListUnQuatier(codeQuartier), "Liste des parcelle chargée avec succès."),
@@ -68,7 +65,6 @@ public class ParcelleGeomController {
@GetMapping("/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
public ResponseEntity<?> getParcellesGeomsByQuartierId(@PathVariable Long quartierId) {
return new ResponseEntity<>(
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListByQuatierId(quartierId), "Liste des parcelle chargée avec succès."),
@@ -77,7 +73,6 @@ public class ParcelleGeomController {
}
@GetMapping("/page/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
public ResponseEntity<?> getParcellesGeomsByQuartierIdPaged(@PathVariable Long quartierId,@RequestParam int pageNo, @RequestParam int pageSize) {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
@@ -87,7 +82,6 @@ public class ParcelleGeomController {
}
@GetMapping("/by-arrondissement/{codeArrondissement}")
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
public ResponseEntity<?> getParcellesGeomsByArrondissement(@PathVariable String codeArrondissement) {
return new ResponseEntity<>(
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListUnArrondissement(codeArrondissement), "Liste des parcelle chargée avec succès."),
@@ -97,7 +91,6 @@ public class ParcelleGeomController {
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
public ResponseEntity<?> getAllTpePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
@@ -107,7 +100,6 @@ public class ParcelleGeomController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
public ResponseEntity<?> getParcelleGeomById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -39,7 +39,6 @@ public class PersonneController {
private final PersonneService personneService;
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_PERSONNE')")
public ResponseEntity<?> createPersonne(@RequestBody @Valid @Validated PersonnePayLoadWeb personnePayLoadWeb) {
try {
personnePayLoadWeb = personneService.createPersonne(personnePayLoadWeb);
@@ -65,7 +64,6 @@ public class PersonneController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_PERSONNE')")
public ResponseEntity<?> updatePersonne(@PathVariable Long id, @RequestBody PersonnePayLoadWeb personnePayLoadWeb) {
try {
return new ResponseEntity<>(
@@ -88,7 +86,6 @@ public class PersonneController {
}
}
@GetMapping("/get-details/{id}")
@PreAuthorize("hasAuthority('READ_PERSONNE')")
public ResponseEntity<?> getDetails(@PathVariable Long id) {
try{
PersonneCompletDTO personneCompletDTO = personneService.getPersonneComplete(id);
@@ -105,7 +102,6 @@ public class PersonneController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_PERSONNE')")
public ResponseEntity<?> getPersonneById(@PathVariable Long id) {
try{
Optional<PersonnePayLoadWeb> optionalPersonne= personneService.getPersonneById(id);
@@ -122,7 +118,6 @@ public class PersonneController {
}
@PostMapping("/recherche")
@PreAuthorize("hasAuthority('READ_PERSONNE')")
public ResponseEntity<?> rechercherPersonne(@RequestBody RecherchePersonneResquestBody recherchePersonneResquestBody ) {
try{
// personneService.recherchePersonne(recherchePersonneResquestBody);
@@ -140,7 +135,6 @@ public class PersonneController {
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_PERSONNE')")
public ResponseEntity<?> getAllPersonne() {
try {
@@ -165,7 +159,6 @@ public class PersonneController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_PERSONNE')")
public ResponseEntity<?> getAllPersonnePaged(@CurrentUser UserPrincipal currentUser,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);

View File

@@ -16,7 +16,6 @@ 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;
@@ -36,7 +35,6 @@ public class PieceController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_PIECE')")
public ResponseEntity<?> createPiece(@RequestBody @Valid @Validated PiecePayLoadWeb piecePayLoadWeb) {
try {
piecePayLoadWeb = pieceService.createPiece(piecePayLoadWeb);
@@ -61,7 +59,6 @@ public class PieceController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_PIECE')")
public ResponseEntity<?> updatePiece(@PathVariable Long id, @RequestBody PiecePayLoadWeb piecePayLoadWeb) {
try {
return new ResponseEntity<>(
@@ -85,7 +82,6 @@ public class PieceController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_PIECE')")
public ResponseEntity<?> deletePiece(@PathVariable Long id) {
try {
pieceService.deletePiece(id);
@@ -110,7 +106,6 @@ public class PieceController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_PIECE')")
public ResponseEntity<?> getAllPieceList() {
try {
return new ResponseEntity<>(
@@ -134,7 +129,6 @@ public class PieceController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_PIECE')")
public ResponseEntity<?> getAllPiecePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -159,7 +153,6 @@ public class PieceController {
}
@GetMapping("/all/by-enquete-id/{enqueteId}")
@PreAuthorize("hasAuthority('READ_PIECE')")
public ResponseEntity<?> getAllPieceByEnqueteList(@PathVariable Long enqueteId) {
try {
return new ResponseEntity<>(
@@ -183,7 +176,6 @@ public class PieceController {
}
@GetMapping("/all-paged/by-enquete-id/{enqueteId}")
@PreAuthorize("hasAuthority('READ_PIECE')")
public ResponseEntity<?> getAllPieceByParcellePaged(@PathVariable Long enqueteId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -209,7 +201,6 @@ public class PieceController {
@GetMapping("/by-enquete-batiment-id/{enqueteBatimentId}")
@PreAuthorize("hasAuthority('READ_PIECE')")
public ResponseEntity<?> getAllPieceByEnqueteBatiment(@PathVariable Long enqueteBatimentId) {
try {
return new ResponseEntity<>(
@@ -234,7 +225,6 @@ public class PieceController {
@GetMapping("/by-enquete-unite-logement-id/{enqueteUniteLogementId}")
@PreAuthorize("hasAuthority('READ_PIECE')")
public ResponseEntity<?> getAllPieceByEnqueteUniteLogement(@PathVariable Long enqueteUniteLogementId) {
try {
return new ResponseEntity<>(
@@ -258,7 +248,6 @@ public class PieceController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_PIECE')")
public ResponseEntity<?> getPieceById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
@SecurityRequirement(name = "bearer")
@Tag(name = "Tpe")
@CrossOrigin(origins = "*")
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public class TpeController {
private final TpeService tpeService;
@@ -37,7 +37,6 @@ public class TpeController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_TPE')")
public ResponseEntity<?> createTpe(@RequestBody @Valid @Validated Tpe tpe) {
try {
tpe = tpeService.createTpe(tpe);
@@ -61,7 +60,6 @@ public class TpeController {
}
}
@PostMapping("/re-create")
@PreAuthorize("hasAuthority('CREATE_TPE')")
public ResponseEntity<?> reCreateTpe(@RequestBody @Valid @Validated Tpe tpe) {
try{
tpe = tpeService.majTpe(tpe.getId(),tpe);
@@ -77,7 +75,6 @@ public class TpeController {
}
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_TPE')")
public ResponseEntity<?> majTpe(@PathVariable Long id, @RequestBody Tpe tpe) {
try {
return new ResponseEntity<>(
@@ -102,7 +99,6 @@ public class TpeController {
@PutMapping("/restaure/{id}")
@PreAuthorize("hasAuthority('UPDATE_TPE')")
public ResponseEntity<?> updateTpe(@PathVariable Long id, @RequestBody Tpe tpe) {
try {
return new ResponseEntity<>(
@@ -126,7 +122,6 @@ public class TpeController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_TPE')")
public ResponseEntity<?> deleteTper(@PathVariable Long id) {
try {
tpeService.deleteTpe(id);
@@ -151,7 +146,6 @@ public class TpeController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_TPE')")
public ResponseEntity<?> getAllTpeList() {
try {
return new ResponseEntity<>(
@@ -175,7 +169,6 @@ public class TpeController {
}
@GetMapping("/all-by-model/{model}")
@PreAuthorize("hasAuthority('READ_TPE')")
public ResponseEntity<?> getAllTpeListByModel(@PathVariable String model) {
try {
return new ResponseEntity<>(
@@ -199,7 +192,6 @@ public class TpeController {
}
@GetMapping("/all-by-userId/{userId}")
@PreAuthorize("hasAuthority('READ_TPE')")
public ResponseEntity<?> getAllTpeListByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
@@ -224,7 +216,6 @@ public class TpeController {
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_TPE')")
public ResponseEntity<?> getAllTpePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -249,7 +240,6 @@ public class TpeController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_TPE')")
public ResponseEntity<?> getTpeById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -273,7 +263,6 @@ public class TpeController {
}
@GetMapping("/identifier/{identifier}")
@PreAuthorize("hasAuthority('READ_TPE')")
public ResponseEntity<?> getTpeByIdentifier(@PathVariable String identifier) {
try {
return new ResponseEntity<>(

View File

@@ -76,7 +76,6 @@ public class UploadController {
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_UPLOAD')")
public ResponseEntity<?> all() {
try {
if (uploadRepository.findAll().isEmpty()) {
@@ -96,7 +95,6 @@ public class UploadController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_UPLOAD')")
public ResponseEntity<?> one(@PathVariable Long id) {
try {
@@ -123,7 +121,6 @@ public class UploadController {
* @return
*/
@GetMapping("/downloadfile/{fileName:.+}")
@PreAuthorize("hasAuthority('READ_UPLOAD')")
public ResponseEntity<Resource> downloadFile(@PathVariable String fileName, HttpServletRequest request) {
// Load file as Resource
Resource resource = fileStorageService.loadFileAsResource(fileName);
@@ -151,7 +148,6 @@ public class UploadController {
value = "/save",
consumes = MediaType.MULTIPART_FORM_DATA_VALUE
)
@PreAuthorize("hasAuthority('CREATE_UPLOAD')")
public ResponseEntity<?> saveFilePieceId(
@Parameter(
description = "Fichier à uploader",
@@ -182,7 +178,6 @@ public class UploadController {
@DeleteMapping("/delete/id/{id}")
@PreAuthorize("hasAuthority('DELETE_UPLOAD')")
public ResponseEntity<?> delete(@PathVariable Long id) {
try {
if (id != null || uploadRepository.findById(id).isPresent()) {
@@ -209,7 +204,6 @@ public class UploadController {
consumes = MediaType.MULTIPART_FORM_DATA_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
)
@PreAuthorize("hasAuthority('CREATE_UPLOAD')")
public ResponseEntity<?> submit(@RequestPart("file") MultipartFile file) throws Exception {
if (file == null || file.isEmpty())
return new ResponseEntity<>(new ApiResponse(false,null, "Le fichier envoyé est introuvable ou inexistant."), HttpStatus.BAD_REQUEST);
@@ -250,7 +244,6 @@ public class UploadController {
}
@GetMapping(path = "/by-piece/{pieceId}")
@PreAuthorize("hasAuthority('READ_UPLOAD')")
public ResponseEntity<?> getByPiece(@PathVariable("pieceId") Long pieceId) {
try{
return new ResponseEntity<>(new ApiResponse(true, uploadService.getAllUploadByPiece(pieceId), "Liste des fichier de la piece"), HttpStatus.OK);

View File

@@ -39,7 +39,6 @@ public class BlocController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_BLOC')")
public ResponseEntity<?> createBloc(@RequestBody @Valid @Validated Bloc bloc, @CurrentUser UserPrincipal userPrincipal) {
try {
bloc = blocService.createBloc(bloc);
@@ -64,7 +63,6 @@ public class BlocController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_BLOC')")
public ResponseEntity<?> updateBloc(@PathVariable Long id, @RequestBody Bloc bloc) {
try {
return new ResponseEntity<>(
@@ -88,7 +86,6 @@ public class BlocController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_BLOC')")
public ResponseEntity<?> deleteBlocr(@PathVariable Long id) {
try {
blocService.deleteBloc(id);
@@ -113,7 +110,6 @@ public class BlocController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_BLOC')")
public ResponseEntity<?> getAllBlocList() {
try {
return new ResponseEntity<>(
@@ -138,7 +134,6 @@ public class BlocController {
}
@GetMapping("/list-by-arrondissement")
@PreAuthorize("hasAuthority('READ_BLOC')")
public ResponseEntity<?> getAllBlocListByArrondissement(@RequestParam Long idArrondissement) {
try {
return new ResponseEntity<>(
@@ -164,7 +159,6 @@ public class BlocController {
@GetMapping("/list-by-structure")
@PreAuthorize("hasAuthority('READ_BLOC')")
public ResponseEntity<?> getAllBlocListByStructure(@RequestParam Long idStructure) {
try {
return new ResponseEntity<>(
@@ -189,7 +183,6 @@ public class BlocController {
}
@GetMapping("/list-by-secteur")
@PreAuthorize("hasAuthority('READ_BLOC')")
@Tag(name = "Liste blocs", description = "Liste des blocs d'un secteur")
public ResponseEntity<?> getAllBlocListBySecteur(@RequestParam Long idSecteur) {
try {
@@ -214,7 +207,6 @@ public class BlocController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_BLOC')")
public ResponseEntity<?> getAllBlocPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
@@ -241,7 +233,6 @@ public class BlocController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_BLOC')")
public ResponseEntity<?> getBlocById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -38,7 +38,6 @@ public class ModeAcquisitionController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_MODEACQUISITION')")
public ResponseEntity<?> createModeAcquisition(@RequestBody @Valid @Validated ModeAcquisition modeAcquisition) {
try {
modeAcquisition = modeAcquisitionService.createModeAcquisition(modeAcquisition);
@@ -63,7 +62,6 @@ public class ModeAcquisitionController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_MODEACQUISITION')")
public ResponseEntity<?> updateModeAcquisition(@PathVariable Long id, @RequestBody ModeAcquisition modeAcquisition) {
try {
return new ResponseEntity<>(
@@ -87,7 +85,6 @@ public class ModeAcquisitionController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_MODEACQUISITION')")
public ResponseEntity<?> deleteModeAcquisitionr(@PathVariable Long id) {
try {
modeAcquisitionService.deleteModeAcquisition(id);
@@ -112,7 +109,6 @@ public class ModeAcquisitionController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_MODEACQUISITION')")
public ResponseEntity<?> getAllModeAcquisitionList() {
try {
return new ResponseEntity<>(
@@ -136,7 +132,6 @@ public class ModeAcquisitionController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_MODEACQUISITION')")
public ResponseEntity<?> getAllModeAcquisitionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -161,7 +156,6 @@ public class ModeAcquisitionController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_MODEACQUISITION')")
public ResponseEntity<?> getModeAcquisitionById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -37,7 +37,6 @@ public class NatureDomaineController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_NATUREDOMAINE')")
public ResponseEntity<?> createNatureDomaine(@RequestBody @Valid @Validated NatureDomaine natureDomaine) {
try {
natureDomaine = natureDomaineService.createNatureDomaine(natureDomaine);
@@ -62,7 +61,6 @@ public class NatureDomaineController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_NATUREDOMAINE')")
public ResponseEntity<?> updateNatureDomaine(@PathVariable Long id, @RequestBody NatureDomaine natureDomaine) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class NatureDomaineController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_NATUREDOMAINE')")
public ResponseEntity<?> deleteNatureDomainer(@PathVariable Long id) {
try {
natureDomaineService.deleteNatureDomaine(id);
@@ -111,7 +108,6 @@ public class NatureDomaineController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_NATUREDOMAINE')")
public ResponseEntity<?> getAllNatureDomaineList() {
try {
return new ResponseEntity<>(
@@ -135,7 +131,6 @@ public class NatureDomaineController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_NATUREDOMAINE')")
public ResponseEntity<?> getAllNatureDomainePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +155,6 @@ public class NatureDomaineController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_NATUREDOMAINE')")
public ResponseEntity<?> getNatureDomaineById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -37,7 +37,6 @@ public class PositionRepresentationController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_POSITIONREPRESENTATION')")
public ResponseEntity<?> createPositionRepresentation(@RequestBody @Valid @Validated PositionRepresentation positionRepresentation) {
try {
positionRepresentation = positionRepresentationService.createPositionRepresentation(positionRepresentation);
@@ -62,7 +61,6 @@ public class PositionRepresentationController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_POSITIONREPRESENTATION')")
public ResponseEntity<?> updatePositionRepresentation(@PathVariable Long id, @RequestBody PositionRepresentation positionRepresentation) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class PositionRepresentationController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_POSITIONREPRESENTATION')")
public ResponseEntity<?> deletePositionRepresentation(@PathVariable Long id) {
try {
positionRepresentationService.deletePositionRepresentation(id);
@@ -111,7 +108,6 @@ public class PositionRepresentationController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_POSITIONREPRESENTATION')")
public ResponseEntity<?> getAllPositionRepresentationList() {
try {
return new ResponseEntity<>(
@@ -135,7 +131,6 @@ public class PositionRepresentationController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_POSITIONREPRESENTATION')")
public ResponseEntity<?> getAllPositionRepresentationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -162,7 +157,6 @@ public class PositionRepresentationController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_POSITIONREPRESENTATION')")
public ResponseEntity<?> getPositionRepresentationById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -38,7 +38,6 @@ public class ProfessionController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_PROFESSION')")
public ResponseEntity<?> createProfession(@RequestBody @Valid @Validated Profession profession) {
try {
profession = professionService.createProfession(profession);
@@ -63,7 +62,6 @@ public class ProfessionController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_PROFESSION')")
public ResponseEntity<?> updateProfession(@PathVariable Long id, @RequestBody Profession profession) {
try {
return new ResponseEntity<>(
@@ -87,7 +85,6 @@ public class ProfessionController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_PROFESSION')")
public ResponseEntity<?> deleteProfessionr(@PathVariable Long id) {
try {
professionService.deleteProfession(id);
@@ -112,7 +109,6 @@ public class ProfessionController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_PROFESSION')")
public ResponseEntity<?> getAllProfessionList() {
try {
return new ResponseEntity<>(
@@ -137,7 +133,6 @@ public class ProfessionController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_PROFESSION')")
public ResponseEntity<?> getAllProfessionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -163,7 +158,6 @@ public class ProfessionController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_PROFESSION')")
public ResponseEntity<?> getProfessionById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -37,7 +37,6 @@ public class SituationGeographiqueController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_SITUATIONGEOGRAPHIQUE')")
public ResponseEntity<?> createSituationGeographique(@RequestBody @Valid @Validated SituationGeographique situationGeographique) {
try {
situationGeographique = situationGeographiqueService.createSituationGeographique(situationGeographique);
@@ -62,7 +61,6 @@ public class SituationGeographiqueController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_SITUATIONGEOGRAPHIQUE')")
public ResponseEntity<?> updateSituationGeographique(@PathVariable Long id, @RequestBody SituationGeographique situationGeographique) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class SituationGeographiqueController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_SITUATIONGEOGRAPHIQUE')")
public ResponseEntity<?> deleteSituationGeographiquer(@PathVariable Long id) {
try {
situationGeographiqueService.deleteSituationGeographique(id);
@@ -111,7 +108,6 @@ public class SituationGeographiqueController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_SITUATIONGEOGRAPHIQUE')")
public ResponseEntity<?> getAllSituationGeographiqueList() {
try {
return new ResponseEntity<>(
@@ -135,7 +131,6 @@ public class SituationGeographiqueController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_SITUATIONGEOGRAPHIQUE')")
public ResponseEntity<?> getAllSituationGeographiquePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +155,6 @@ public class SituationGeographiqueController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_SITUATIONGEOGRAPHIQUE')")
public ResponseEntity<?> getSituationGeographiqueById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -37,7 +37,6 @@ public class SituationMatrimonialeController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_SITUATIONMATRIMONIALE')")
public ResponseEntity<?> createSituationMatrimoniale(@RequestBody @Valid @Validated SituationMatrimoniale situationMatrimoniale) {
try {
situationMatrimoniale = situationMatrimonialeService.createSituationMatrimoniale(situationMatrimoniale);
@@ -62,7 +61,6 @@ public class SituationMatrimonialeController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_SITUATIONMATRIMONIALE')")
public ResponseEntity<?> updateSituationMatrimoniale(@PathVariable Long id, @RequestBody SituationMatrimoniale situationMatrimoniale) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class SituationMatrimonialeController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_SITUATIONMATRIMONIALE')")
public ResponseEntity<?> deleteSituationMatrimonialer(@PathVariable Long id) {
try {
situationMatrimonialeService.deleteSituationMatrimoniale(id);
@@ -111,7 +108,6 @@ public class SituationMatrimonialeController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_SITUATIONMATRIMONIALE')")
public ResponseEntity<?> getAllSituationMatrimonialeList() {
try {
return new ResponseEntity<>(
@@ -135,7 +131,6 @@ public class SituationMatrimonialeController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_SITUATIONMATRIMONIALE')")
public ResponseEntity<?> getAllSituationMatrimonialePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +155,6 @@ public class SituationMatrimonialeController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_SITUATIONMATRIMONIALE')")
public ResponseEntity<?> getSituationMatrimonialeById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -37,7 +37,6 @@ public class SourceDroitController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_SOURCEDROIT')")
public ResponseEntity<?> createSourceDroit(@RequestBody @Valid @Validated SourceDroit sourceDroit) {
try {
sourceDroit = sourceDroitService.createSourceDroit(sourceDroit);
@@ -62,7 +61,6 @@ public class SourceDroitController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_SOURCEDROIT')")
public ResponseEntity<?> updateSourceDroit(@PathVariable Long id, @RequestBody SourceDroit sourceDroit) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class SourceDroitController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_SOURCEDROIT')")
public ResponseEntity<?> deleteSourceDroitr(@PathVariable Long id) {
try {
sourceDroitService.deleteSourceDroit(id);
@@ -111,7 +108,6 @@ public class SourceDroitController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_SOURCEDROIT')")
public ResponseEntity<?> getAllSourceDroitList() {
try {
return new ResponseEntity<>(
@@ -135,7 +131,6 @@ public class SourceDroitController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_SOURCEDROIT')")
public ResponseEntity<?> getAllSourceDroitPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +155,6 @@ public class SourceDroitController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_SOURCEDROIT')")
public ResponseEntity<?> getSourceDroitById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -41,7 +41,6 @@ public class StructureController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_STRUCTURE')")
public ResponseEntity<?> createStructure(@RequestBody StructurePaylaodWeb structurePaylaodWeb) {
try {
structurePaylaodWeb = structureService.createStructure(structurePaylaodWeb);
@@ -66,7 +65,6 @@ public class StructureController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_STRUCTURE')")
public ResponseEntity<?> updateStructure(@PathVariable Long id, @RequestBody StructurePaylaodWeb structurePaylaodWeb) {
try {
return new ResponseEntity<>(
@@ -90,7 +88,6 @@ public class StructureController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_STRUCTURE')")
public ResponseEntity<?> deleteStructurer(@PathVariable Long id) {
try {
structureService.deleteStructure(id);
@@ -115,7 +112,6 @@ public class StructureController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_STRUCTURE')")
public ResponseEntity<?> getAllStructureList() {
try {
return new ResponseEntity<>(
@@ -140,7 +136,6 @@ public class StructureController {
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_STRUCTURE')")
public ResponseEntity<?> getAllStructurePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -166,7 +161,6 @@ public class StructureController {
}
@GetMapping("/by-commune/{communeId}")
@PreAuthorize("hasAuthority('READ_STRUCTURE')")
public ResponseEntity<?> getAllStructureListByCommune(@PathVariable Long communeId) {
try {
return new ResponseEntity<>(
@@ -190,7 +184,6 @@ public class StructureController {
}
@GetMapping("/page/by-commune/{communeId}")
@PreAuthorize("hasAuthority('READ_STRUCTURE')")
public ResponseEntity<?> getAllStructureListByCommunePageable(@PathVariable Long communeId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -215,7 +208,6 @@ public class StructureController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_STRUCTURE')")
public ResponseEntity<?> getStructureById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -37,7 +37,6 @@ public class TypeContestationController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_TYPECONTESTATION')")
public ResponseEntity<?> createTypeContestation(@RequestBody @Valid @Validated TypeContestation typeContestation) {
try {
typeContestation = typeContestationService.createTypeContestation(typeContestation);
@@ -62,7 +61,6 @@ public class TypeContestationController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_TYPECONTESTATION')")
public ResponseEntity<?> updateTypeContestation(@PathVariable Long id, @RequestBody TypeContestation typeContestation) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class TypeContestationController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_TYPECONTESTATION')")
public ResponseEntity<?> deleteTypeContestationr(@PathVariable Long id) {
try {
typeContestationService.deleteTypeContestation(id);
@@ -111,7 +108,6 @@ public class TypeContestationController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_TYPECONTESTATION')")
public ResponseEntity<?> getAllTypeContestationList() {
try {
return new ResponseEntity<>(
@@ -135,7 +131,6 @@ public class TypeContestationController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_TYPECONTESTATION')")
public ResponseEntity<?> getAllTypeContestationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +155,6 @@ public class TypeContestationController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_TYPECONTESTATION')")
public ResponseEntity<?> getTypeContestationById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -37,7 +37,6 @@ public class TypeDomaineController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_TYPEDOMAINE')")
public ResponseEntity<?> createTypeDomaine(@RequestBody @Valid @Validated TypeDomaine typeDomaine) {
try {
typeDomaine = typeDomaineService.createTypeDomaine(typeDomaine);
@@ -62,7 +61,6 @@ public class TypeDomaineController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_TYPEDOMAINE')")
public ResponseEntity<?> updateTypeDomaine(@PathVariable Long id, @RequestBody TypeDomaine typeDomaine) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class TypeDomaineController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_TYPEDOMAINE')")
public ResponseEntity<?> deleteTypeDomainer(@PathVariable Long id) {
try {
typeDomaineService.deleteTypeDomaine(id);
@@ -111,7 +108,6 @@ public class TypeDomaineController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_TYPEDOMAINE')")
public ResponseEntity<?> getAllTypeDomaineList() {
try {
return new ResponseEntity<>(
@@ -135,7 +131,6 @@ public class TypeDomaineController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_TYPEDOMAINE')")
public ResponseEntity<?> getAllTypeDomainePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +155,6 @@ public class TypeDomaineController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_TYPEDOMAINE')")
public ResponseEntity<?> getTypeDomaineById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -37,7 +37,6 @@ public class TypePersonneController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_TYPEPERSONNE')")
public ResponseEntity<?> createTypePersonne(@RequestBody @Valid @Validated TypePersonne typePersonne) {
try {
typePersonne = typePersonneService.createTypePersonne(typePersonne);
@@ -62,7 +61,6 @@ public class TypePersonneController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_TYPEPERSONNE')")
public ResponseEntity<?> updateTypePersonne(@PathVariable Long id, @RequestBody TypePersonne typePersonne) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class TypePersonneController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_TYPEPERSONNE')")
public ResponseEntity<?> deleteTypePersonner(@PathVariable Long id) {
try {
typePersonneService.deleteTypePersonne(id);
@@ -111,7 +108,6 @@ public class TypePersonneController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_TYPEPERSONNE')")
public ResponseEntity<?> getAllTypePersonneList() {
try {
return new ResponseEntity<>(
@@ -135,7 +131,6 @@ public class TypePersonneController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_TYPEPERSONNE')")
public ResponseEntity<?> getAllTypePersonnePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +155,6 @@ public class TypePersonneController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_TYPEPERSONNE')")
public ResponseEntity<?> getTypePersonneById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -37,7 +37,6 @@ public class TypePieceController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_TYPEPIECE')")
public ResponseEntity<?> createTypePiece(@RequestBody @Valid @Validated TypePiece typePiece) {
try {
typePiece = typePieceService.createTypePiece(typePiece);
@@ -62,7 +61,6 @@ public class TypePieceController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_TYPEPIECE')")
public ResponseEntity<?> updateTypePiece(@PathVariable Long id, @RequestBody TypePiece typePiece) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class TypePieceController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_TYPEPIECE')")
public ResponseEntity<?> deleteTypePiecer(@PathVariable Long id) {
try {
typePieceService.deleteTypePiece(id);
@@ -111,7 +108,6 @@ public class TypePieceController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_TYPEPIECE')")
public ResponseEntity<?> getAllTypePieceList() {
try {
return new ResponseEntity<>(
@@ -135,7 +131,6 @@ public class TypePieceController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_TYPEPIECE')")
public ResponseEntity<?> getAllTypePiecePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +155,6 @@ public class TypePieceController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_TYPEPIECE')")
public ResponseEntity<?> getTypePieceById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -37,7 +37,6 @@ public class TypeRepresentationController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_TYPEREPRESENTATION')")
public ResponseEntity<?> createTypeRepresentation(@RequestBody @Valid @Validated TypeRepresentation typeRepresentation) {
try {
typeRepresentation = typeRepresentationService.createTypeRepresentation(typeRepresentation);
@@ -62,7 +61,6 @@ public class TypeRepresentationController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_TYPEREPRESENTATION')")
public ResponseEntity<?> updateTypeRepresentation(@PathVariable Long id, @RequestBody TypeRepresentation typeRepresentation) {
try {
return new ResponseEntity<>(
@@ -86,7 +84,6 @@ public class TypeRepresentationController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_TYPEREPRESENTATION')")
public ResponseEntity<?> deleteTypeRepresentationr(@PathVariable Long id) {
try {
typeRepresentationService.deleteTypeRepresentation(id);
@@ -111,7 +108,6 @@ public class TypeRepresentationController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_TYPEREPRESENTATION')")
public ResponseEntity<?> getAllTypeRepresentationList() {
try {
return new ResponseEntity<>(
@@ -135,7 +131,6 @@ public class TypeRepresentationController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_TYPEREPRESENTATION')")
public ResponseEntity<?> getAllTypeRepresentationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +155,6 @@ public class TypeRepresentationController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_TYPEREPRESENTATION')")
public ResponseEntity<?> getTypeRepresentationById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -16,7 +16,6 @@ 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;
@@ -38,7 +37,6 @@ public class BatimentController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_BATIMENT')")
public ResponseEntity<?> createBatiment(@RequestBody @Valid @Validated BatimentPaylaodWeb batimentPaylaodWeb) {
try {
batimentPaylaodWeb = batimentService.createBatiment(batimentPaylaodWeb);
@@ -63,7 +61,6 @@ public class BatimentController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_BATIMENT')")
public ResponseEntity<?> updateBatiment(@PathVariable Long id, @RequestBody BatimentPaylaodWeb batimentPaylaodWeb) {
try {
return new ResponseEntity<>(
@@ -87,7 +84,6 @@ public class BatimentController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_BATIMENT')")
public ResponseEntity<?> deleteBatiment(@PathVariable Long id) {
try {
batimentService.deleteBatiment(id);
@@ -112,7 +108,6 @@ public class BatimentController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_BATIMENT')")
public ResponseEntity<?> getAllBatimentList() {
try {
return new ResponseEntity<>(
@@ -136,7 +131,6 @@ public class BatimentController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_BATIMENT')")
public ResponseEntity<?> getAllBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -161,7 +155,6 @@ public class BatimentController {
}
@GetMapping("/all/by-parcelle-id/{parcelleId}")
@PreAuthorize("hasAuthority('READ_BATIMENT')")
public ResponseEntity<?> getAllBatimentByParcelleList(@PathVariable Long parcelleId) {
try {
return new ResponseEntity<>(
@@ -185,7 +178,6 @@ public class BatimentController {
}
@GetMapping("/all-paged/by-parcelle-id/{parcelleId}")
@PreAuthorize("hasAuthority('READ_BATIMENT')")
public ResponseEntity<?> getAllBatimentByParcellePaged(@PathVariable Long parcelleId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -210,7 +202,6 @@ public class BatimentController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_BATIMENT')")
public ResponseEntity<?> getBatimentById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -232,54 +223,4 @@ public class BatimentController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-paged/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_BATIMENT')")
public ResponseEntity<?> getAllBatimentByQuartierPaged(@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, batimentService.getBatimentListByquartierPageable(quartierId,pageable), "Liste des batiments 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-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_BATIMENT')")
public ResponseEntity<?> getAllBatimentByQuartier(@PathVariable Long quartierId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, batimentService.getBatimentListByquartier(quartierId), "Liste des batiments 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

@@ -2,8 +2,6 @@ package io.gmss.fiscad.controllers.rfu.metier;
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
import io.gmss.fiscad.enums.RoleActeur;
import io.gmss.fiscad.enums.UserRole;
import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueBatimentService;
import io.gmss.fiscad.paylaods.ApiResponse;
@@ -18,7 +16,6 @@ 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;
@@ -39,10 +36,8 @@ public class CaracteristiqueBatimentController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_CARACTERISTIQUEBATIMENT')")
public ResponseEntity<?> createCaracteristiqueBatiment(@RequestBody @Valid @Validated CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb) {
try {
caracteristiqueBatimentPayloadWeb = caracteristiqueBatimentService.createCaracteristiqueBatiment(caracteristiqueBatimentPayloadWeb);
return new ResponseEntity<>(
new ApiResponse<>(true, caracteristiqueBatimentPayloadWeb, "Caracteristique du batiment créé avec succès."),
@@ -56,7 +51,6 @@ public class CaracteristiqueBatimentController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_CARACTERISTIQUEBATIMENT')")
public ResponseEntity<?> updateCaracteristiqueBatiment(@PathVariable Long id, @RequestBody CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb) {
try {
return new ResponseEntity<>(
@@ -80,7 +74,6 @@ public class CaracteristiqueBatimentController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_CARACTERISTIQUEBATIMENT')")
public ResponseEntity<?> deleteCaracteristiqueBatiment(@PathVariable Long id) {
try {
caracteristiqueBatimentService.deleteCaracteristiqueBatiment(id);
@@ -105,7 +98,6 @@ public class CaracteristiqueBatimentController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
public ResponseEntity<?> getAllCaracteristiqueBatimentList() {
try {
return new ResponseEntity<>(
@@ -129,7 +121,6 @@ public class CaracteristiqueBatimentController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
public ResponseEntity<?> getAllCaracteristiqueBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -154,7 +145,6 @@ public class CaracteristiqueBatimentController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
public ResponseEntity<?> getCaracteristiqueBatimentById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -178,7 +168,6 @@ public class CaracteristiqueBatimentController {
}
@GetMapping("/by-enquete-batiment-id/{enqueteBatimentId}")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
public ResponseEntity<?> getCaracteristiqueBatimentByBatimentId(@PathVariable Long enqueteBatimentId) {
try {
return new ResponseEntity<>(
@@ -202,7 +191,6 @@ public class CaracteristiqueBatimentController {
}
@GetMapping("/page/by-enquete-batiment-id/{enqueteBatimentId}")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
public ResponseEntity<?> getCaracteristiqueBatimentByEnqueteBatimentIdPaged(@PathVariable Long enqueteBatimentId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);

View File

@@ -16,7 +16,6 @@ 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;
@@ -37,7 +36,6 @@ public class CaracteristiqueParcelleController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_CARACTERISTIQUEPARCELLE')")
public ResponseEntity<?> createCaracteristiqueParcelle(@RequestBody @Valid @Validated CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb) {
try {
caracteristiqueParcellePayloadWeb = caracteristiqueParcelleService.createCaracteristiqueParcelle(caracteristiqueParcellePayloadWeb);
@@ -62,7 +60,6 @@ public class CaracteristiqueParcelleController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_CARACTERISTIQUEPARCELLE')")
public ResponseEntity<?> updateCaracteristiqueParcelle(@PathVariable Long id, @RequestBody CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb) {
try {
return new ResponseEntity<>(
@@ -86,7 +83,6 @@ public class CaracteristiqueParcelleController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_CARACTERISTIQUEPARCELLE')")
public ResponseEntity<?> deleteCaracteristiqueParcelle(@PathVariable Long id) {
try {
caracteristiqueParcelleService.deleteCaracteristiqueParcelle(id);
@@ -111,7 +107,6 @@ public class CaracteristiqueParcelleController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEPARCELLE')")
public ResponseEntity<?> getAllCaracteristiqueParcelleList() {
try {
return new ResponseEntity<>(
@@ -135,7 +130,6 @@ public class CaracteristiqueParcelleController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEPARCELLE')")
public ResponseEntity<?> getAllCaracteristiqueParcellePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +154,6 @@ public class CaracteristiqueParcelleController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEPARCELLE')")
public ResponseEntity<?> getCaracteristiqueParcelleById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -185,7 +178,6 @@ public class CaracteristiqueParcelleController {
@GetMapping("/by-enquete-id/{enqueteId}")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEPARCELLE')")
public ResponseEntity<?> getAllCaracteristiqueParcelleList(@PathVariable Long enqueteId) {
try {
return new ResponseEntity<>(
@@ -209,7 +201,6 @@ public class CaracteristiqueParcelleController {
}
@GetMapping("/page/by-enquete-id/{enqueteId}")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEPARCELLE')")
public ResponseEntity<?> getAllCaracteristiqueParcellePaged(@PathVariable Long enqueteId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);

View File

@@ -16,7 +16,6 @@ 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;
@@ -37,7 +36,6 @@ public class CaracteristiqueUniteLogementController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_CARACTERISTIQUEUNITELOGEMENT')")
public ResponseEntity<?> createCaracteristiqueUniteLogement(@RequestBody @Valid @Validated CaracteristiqueUniteLogementPayloadWeb caracteristiqueUniteLogementPayloadWeb) {
try {
caracteristiqueUniteLogementPayloadWeb = caracteristiqueUniteLogementService.createCaracteristiqueUniteLogement(caracteristiqueUniteLogementPayloadWeb);
@@ -62,7 +60,6 @@ public class CaracteristiqueUniteLogementController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_CARACTERISTIQUEUNITELOGEMENT')")
public ResponseEntity<?> updateCaracteristiqueUniteLogement(@PathVariable Long id, @RequestBody CaracteristiqueUniteLogementPayloadWeb caracteristiqueUniteLogementPayloadWeb) {
try {
return new ResponseEntity<>(
@@ -86,7 +83,6 @@ public class CaracteristiqueUniteLogementController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_CARACTERISTIQUEUNITELOGEMENT')")
public ResponseEntity<?> deleteCaracteristiqueUniteLogement(@PathVariable Long id) {
try {
caracteristiqueUniteLogementService.deleteCaracteristiqueUniteLogement(id);
@@ -111,7 +107,6 @@ public class CaracteristiqueUniteLogementController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEUNITELOGEMENT')")
public ResponseEntity<?> getAllCaracteristiqueUniteLogementList() {
try {
return new ResponseEntity<>(
@@ -135,7 +130,6 @@ public class CaracteristiqueUniteLogementController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEUNITELOGEMENT')")
public ResponseEntity<?> getAllCaracteristiqueUniteLogementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +154,6 @@ public class CaracteristiqueUniteLogementController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEUNITELOGEMENT')")
public ResponseEntity<?> getCaracteristiqueUniteLogementById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -184,7 +177,6 @@ public class CaracteristiqueUniteLogementController {
}
@GetMapping("/by-enquete-ulo-id/{enqueteUloId}")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEUNITELOGEMENT')")
public ResponseEntity<?> getAllCaracteristiqueUniteLogementListByEul(@PathVariable Long enqueteUloId) {
try {
return new ResponseEntity<>(
@@ -208,7 +200,6 @@ public class CaracteristiqueUniteLogementController {
}
@GetMapping("/page/by-enquete-ulo-id/{enqueteUloId}")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEUNITELOGEMENT')")
public ResponseEntity<?> getAllCaracteristiqueUniteLogementByEulPaged(@PathVariable Long enqueteUloId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);

View File

@@ -1,325 +0,0 @@
package io.gmss.fiscad.controllers.rfu.metier;
import io.gmss.fiscad.entities.user.User;
import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.implementations.infocad.metier.PersonneServiceImpl;
import io.gmss.fiscad.interfaces.rfu.metier.CommuneCentreAssignationService;
import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.CommuneCentreAssignationPaylaodWeb;
import io.gmss.fiscad.security.CurrentUser;
import io.gmss.fiscad.security.UserPrincipal;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
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
@AllArgsConstructor
@RequestMapping(value = "api/commune-centre-assignation", produces = MediaType.APPLICATION_JSON_VALUE)
@SecurityRequirement(name = "bearer")
@Tag(name = "CommuneCentreAssignation")
@CrossOrigin(origins = "*")
public class CommuneCentreAssignationController {
private final CommuneCentreAssignationService communeCentreAssignationService;
private final PersonneServiceImpl personneService;
private static final Logger logger = LoggerFactory.getLogger(CommuneCentreAssignationController.class);
// public CommuneCentreAssignationController(CommuneCentreAssignationService communeCentreAssignationService) {
// this.communeCentreAssignationService = communeCentreAssignationService;
// }
@PostMapping("/assigne-centre")
@PreAuthorize("hasAuthority('CREATE_COMMUNECENTREASSIGNATION')")
public ResponseEntity<?> AssigneCommuneCentre(@CurrentUser UserPrincipal userPrincipal, @RequestBody CommuneCentreAssignationPaylaodWeb communeCentreAssignationPaylaodWeb) {
try {
if(userPrincipal==null){
return new ResponseEntity<>(
new ApiResponse<>(false, null, "vous ne pouvez pas faire cette action."),
HttpStatus.OK
);
}
User user = userPrincipal.getUser();
communeCentreAssignationPaylaodWeb = communeCentreAssignationService.createCommuneCentreAssignation(user,communeCentreAssignationPaylaodWeb);
return new ResponseEntity<>(
new ApiResponse<>(true, communeCentreAssignationPaylaodWeb, "CommuneCentreAssignation 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);
}
}
@PostMapping("/detache-centre")
@PreAuthorize("hasAuthority('UPDATE_COMMUNECENTREASSIGNATION')")
public ResponseEntity<?> detacheCommuneCentre(@CurrentUser UserPrincipal userPrincipal, @RequestBody CommuneCentreAssignationPaylaodWeb communeCentreAssignationPaylaodWeb) {
try {
if(userPrincipal==null){
return new ResponseEntity<>(
new ApiResponse<>(false, null, "vous ne pouvez pas faire cette action."),
HttpStatus.OK
);
}
User user = userPrincipal.getUser();
communeCentreAssignationPaylaodWeb = communeCentreAssignationService.detacherCommuneCentreAssignation(user,communeCentreAssignationPaylaodWeb);
return new ResponseEntity<>(
new ApiResponse<>(true, communeCentreAssignationPaylaodWeb, "CommuneCentreAssignation 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_COMMUNECENTREASSIGNATION')")
public ResponseEntity<?> updateCommuneCentreAssignation(@PathVariable Long id, @RequestBody CommuneCentreAssignationPaylaodWeb communeCentreAssignationPaylaodWeb) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, communeCentreAssignationService.updateCommuneCentreAssignation(id,communeCentreAssignationPaylaodWeb), "CommuneCentreAssignation 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_COMMUNECENTREASSIGNATION')")
public ResponseEntity<?> deleteCommuneCentreAssignation(@PathVariable Long id) {
try {
communeCentreAssignationService.deleteCommuneCentreAssignation(id);
return new ResponseEntity<>(
new ApiResponse<>(true, "CommuneCentreAssignation 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-paged")
@PreAuthorize("hasAuthority('READ_COMMUNECENTREASSIGNATION')")
public ResponseEntity<?> getAllCommuneCentreAssignationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, communeCentreAssignationService.getCommuneCentreAssignationList(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-paged/by-commune-id/{communeId}")
@PreAuthorize("hasAuthority('READ_COMMUNECENTREASSIGNATION')")
public ResponseEntity<?> getAllCommuneCentreAssignationByCommuneList(@PathVariable Long communeId,@RequestParam int pageNo, @RequestParam int pageSize ) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, communeCentreAssignationService.getCommuneCentreAssignationListByCommunePageable(communeId,pageable), "Liste des assignation de centre 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_COMMUNECENTREASSIGNATION')")
public ResponseEntity<?> getCommuneCentreAssignationById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, communeCentreAssignationService.getCommuneCentreAssignationById(id), "CommuneCentreAssignation 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);
}
}
@Operation(summary = "Liste des contribuables ayant un centre d'assignation")
@GetMapping("/all-paged/by-structure-id/{structureId}")
@PreAuthorize("hasAuthority('READ_COMMUNECENTREASSIGNATION')")
public ResponseEntity<?> getAllCommuneCentreAssignationByStrucutrePaged(@PathVariable Long structureId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, communeCentreAssignationService.getCommuneCentreAssignationListByCentrePageable(structureId, pageable), "Liste des communeCentreAssignations 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);
}
}
@Operation(summary = "Liste des contribuables sans centre d'assignation")
@GetMapping("/all-paged/sans-centre-assignation")
@PreAuthorize("hasAuthority('READ_COMMUNECENTREASSIGNATION')")
public ResponseEntity<?> getAllPersonneSansCentreAssignationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, personneService.getPersonneListNonAssigneePage(pageable), "Liste des contribuables sans centre d'assignation 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);
}
}
@Operation(summary = "Vérifier l'assignation d'un contribuable",description = "permet de vérifier si un contribuable a déjà un centre d'assignation dans la commune de l'utilisateur connecté")
@GetMapping("/contribuable/{personneId}")
@PreAuthorize("hasAuthority('READ_COMMUNECENTREASSIGNATION')")
public ResponseEntity<?> getAssignationPersonne(@CurrentUser UserPrincipal currentUser, @PathVariable Long personneId) {
try {
if(currentUser==null){
return new ResponseEntity<>(
new ApiResponse<>(false, null, "vous ne pouvez pas faire cette action."),
HttpStatus.OK
);
}
User user = currentUser.getUser();
return new ResponseEntity<>(
new ApiResponse<>(true, communeCentreAssignationService.getCommuneCentreAssignationByPersonneIdCommune(user,personneId).orElse(null), "Assignation 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

@@ -18,7 +18,6 @@ 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;
@@ -37,8 +36,7 @@ public class DeclarationNcController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_DECLARATIONNC')")
public ResponseEntity<?> createDeclarationNc(@RequestBody DeclarationNcPayloadWeb declarationNcPayloadWeb) {
public ResponseEntity<?> createDeclarationNc(@RequestBody @Valid @Validated DeclarationNcPayloadWeb declarationNcPayloadWeb) {
try {
declarationNcPayloadWeb = declarationNcService.createDeclarationNc(declarationNcPayloadWeb);
return new ResponseEntity<>(
@@ -62,7 +60,6 @@ public class DeclarationNcController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_DECLARATIONNC')")
public ResponseEntity<?> updateEnqueteBatiment(@PathVariable Long id, @RequestBody DeclarationNcPayloadWeb declarationNcPayloadWeb) {
try {
return new ResponseEntity<>(
@@ -86,7 +83,6 @@ public class DeclarationNcController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_DECLARATIONNC')")
public ResponseEntity<?> deleteEnqueteBatiment(@PathVariable Long id) {
try {
declarationNcService.deleteDeclarationNc(id);
@@ -111,7 +107,6 @@ public class DeclarationNcController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_DECLARATIONNC')")
public ResponseEntity<?> getAllEnqueteBatimentList() {
try {
return new ResponseEntity<>(
@@ -135,7 +130,6 @@ public class DeclarationNcController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_DECLARATIONNC')")
public ResponseEntity<?> getAllEnqueteBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -161,7 +155,6 @@ public class DeclarationNcController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_DECLARATIONNC')")
public ResponseEntity<?> getEnqueteBatimentById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -185,7 +178,6 @@ public class DeclarationNcController {
}
@GetMapping("/by-personne-id/{personneId}")
@PreAuthorize("hasAuthority('READ_DECLARATIONNC')")
public ResponseEntity<?> getDeclarationNcByPersonne(@PathVariable Long personneId) {
try {
return new ResponseEntity<>(
@@ -209,7 +201,6 @@ public class DeclarationNcController {
}
@GetMapping("/page/by-personne-id/{personneId}")
@PreAuthorize("hasAuthority('READ_DECLARATIONNC')")
public ResponseEntity<?> getDeclarationNcByPersonnePaged(@PathVariable Long personneId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);

View File

@@ -23,7 +23,6 @@ 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;
@@ -47,7 +46,6 @@ public class DonneesImpositionTfuController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> createDonneesImpositionTfu(@RequestBody @Valid @Validated DonneesImpositionTfu donneesImpositionTfu) {
try {
donneesImpositionTfu = donneesImpositionTfuService.createDonneesImpositionTfu(donneesImpositionTfu);
@@ -72,7 +70,6 @@ public class DonneesImpositionTfuController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> updateDonneesImpositionTfu(@PathVariable Long id, @RequestBody DonneesImpositionTfu donneesImpositionTfu) {
try {
return new ResponseEntity<>(
@@ -96,7 +93,6 @@ public class DonneesImpositionTfuController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> deleteDonneesImpositionTfu(@PathVariable Long id) {
try {
donneesImpositionTfuService.deleteDonneesImpositionTfu(id);
@@ -120,61 +116,60 @@ 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")
public ResponseEntity<?> getAllDonneesImpositionTfuList() {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(), "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")
// 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-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 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-page/by-imposition-id/{impositionId}")
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdPageable(impositionId, pageable), "Liste des impositions chargée avec succès."),
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdPageable(impositionId, pageable), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -194,12 +189,11 @@ public class DonneesImpositionTfuController {
}
@GetMapping("/all-page/by-imposition-id/non-batie/{impositionId}")
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdNonBatiePaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdNonBatiePageable(impositionId, pageable), "Liste des impositions chargée avec succès."),
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdNonBatiePageable(impositionId, pageable), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -220,12 +214,11 @@ public class DonneesImpositionTfuController {
@GetMapping("/all-page/by-imposition-id/batie-batiment/{impositionId}")
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdBatieBatimentPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieBatimentPageable(impositionId, pageable), "Liste des impositions chargée avec succès."),
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieBatimentPageable(impositionId, pageable), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -245,12 +238,11 @@ public class DonneesImpositionTfuController {
}
@GetMapping("/all-page/by-imposition-id/batie-unite-logement/{impositionId}")
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdBatieUniteLogPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(impositionId, pageable), "Liste des impositions chargée avec succès."),
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(impositionId, pageable), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -270,7 +262,6 @@ public class DonneesImpositionTfuController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> getDonneesImpositionTfuById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -294,7 +285,6 @@ public class DonneesImpositionTfuController {
}
@Operation(summary = "Générer les données fiscales TFU des parcelle baties")
@PostMapping("/generer-batie")
@PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> genererDonneesFiscaleBatie(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
try {
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
@@ -343,65 +333,10 @@ public class DonneesImpositionTfuController {
}
@Operation(
summary = "Générer les données fiscales TFU pour une seule parcelle",
description = "Génère les impositions TFU pour une parcelle bâtie donnée"
)
@PostMapping("/generer-batie/{parcelleId}")
@PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> genererDonneesFiscaleBatieUneParcelle(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb,@PathVariable Long parcelleId) {
try {
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
if(optionalImpositionsTfu.isEmpty()){
return new ResponseEntity<>(
new ApiResponse<>(false, null, "L'instance d'imposition n'est pas trouvée."),
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){
return new ResponseEntity<>(
new ApiResponse<>(false, null, "Vous n'êtes pas autorisé à accéder à cette ressource"),
HttpStatus.OK
);
}
impositionsTfuPaylaodWeb=donneesImpositionTfuService.genererDonneesFiscalesParcelleBatieUneParcelle(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId(),parcelleId);
return new ResponseEntity<>(
new ApiResponse<>(true,impositionsTfuPaylaodWeb, "Données d'imposition des fonciers batis Géné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);
}
}
@Operation(summary = "Générer les données fiscales TFU des parcelle baties")
@PostMapping("/generer-non-batie")
@PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> genererDonneesImpositionNonBaties(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
try {
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
@@ -449,63 +384,8 @@ public class DonneesImpositionTfuController {
}
}
@Operation(
summary = "Générer les données fiscales TFU pour une seule parcelle",
description = "Génère les impositions TFU pour une parcelle non bâtie donnée"
)
@PostMapping("/generer-non-batie/{parcelleId}")
@PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> genererDonneesImpositionNonBatiesUneParcelle(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, @PathVariable Long parcelleId) {
try {
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
if(optionalImpositionsTfu.isEmpty()){
return new ResponseEntity<>(
new ApiResponse<>(false, null, "L'instance d'imposition n'est pas trouvée."),
HttpStatus.OK
);
}
// 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){
return new ResponseEntity<>(
new ApiResponse<>(false, null, "Vous n'êtes pas autorisé à accéder à cette ressource"),
HttpStatus.OK
);
}
impositionsTfuPaylaodWeb=donneesImpositionTfuService.genererDonneesFiscalesParcelleNonBatieUneParcelle(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId(),parcelleId);
return new ResponseEntity<>(
new ApiResponse<>(true,impositionsTfuPaylaodWeb, "Données d'imposition pour les fonciers non batis Géné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);
}
}
@Operation(summary = "Récuperer les avis d'id d'une imposition")
@GetMapping("/by-impositions-id/{impositionsId}")
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> getDonneesFiscale(@PathVariable Long impositionsId) {
try {
@@ -532,7 +412,6 @@ public class DonneesImpositionTfuController {
@Operation(summary = "Récuperer les avis d'id d'une imposition et l'id d'un arrondissement")
@GetMapping("/by-impositions-id/by-arrondissement/{impositionsId}/{arrondissementId}")
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> getDonneesFiscaleParImpositionArrondissement(@PathVariable Long impositionsId,@PathVariable Long arrondissementId) {
try {
@@ -555,82 +434,4 @@ public class DonneesImpositionTfuController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-page/by-exercice-id/by-structure-id/{exerciceId}/{structureId}")
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> getAllDonneesImpositionTfuByExerciceIdAndStructureIdPaged(@PathVariable Long exerciceId, @PathVariable Long structureId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
System.out.println("NOUS SOMMES ICI");
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByExerciceAndStructureIdPageable(exerciceId,structureId, 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/by-exercice-id/by-structure-id/by-quartier-id/{exerciceId}/{structureId}/{quartierId}")
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> getAllDonneesImpositionTfuByExerciceIdAndStructureId(@PathVariable Long exerciceId, @PathVariable Long structureId, @PathVariable Long quartierId) {
try {
System.out.println("NOUS SOMMES ICI");
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByExerciceAndStructureId(exerciceId,structureId,quartierId), "Liste des imposition 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-personne-id/{personneId}")
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
public ResponseEntity<?> getAllDonneesImpositionTfuByPersonneId(@PathVariable Long personneId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByPersonneId(personneId), "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);
}
}
}

View File

@@ -16,7 +16,6 @@ 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;
@@ -38,7 +37,6 @@ public class EnqueteActiviteController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_ENQUETEACTIVITE')")
public ResponseEntity<?> createEnqueteActivite(@RequestBody @Valid @Validated EnqueteActivitePayLoadWeb enqueteActivitePayLoadWeb) {
try {
EnqueteActivite enqueteActivite = enqueteActiviteService.createEnqueteActivite(enqueteActivitePayLoadWeb);
@@ -63,7 +61,6 @@ public class EnqueteActiviteController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_ENQUETEACTIVITE')")
public ResponseEntity<?> updateEnqueteActivite(@PathVariable Long id, @RequestBody EnqueteActivitePayLoadWeb enqueteActivitePayLoadWeb) {
try {
return new ResponseEntity<>(
@@ -87,7 +84,6 @@ public class EnqueteActiviteController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_ENQUETEACTIVITE')")
public ResponseEntity<?> deleteEnqueteActivite(@PathVariable Long id) {
try {
enqueteActiviteService.deleteEnqueteActivite(id);
@@ -112,7 +108,6 @@ public class EnqueteActiviteController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_ENQUETEACTIVITE')")
public ResponseEntity<?> getAllEnqueteActiviteList() {
try {
return new ResponseEntity<>(
@@ -136,7 +131,6 @@ public class EnqueteActiviteController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_ENQUETEACTIVITE')")
public ResponseEntity<?> getAllEnqueteActivitePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -161,7 +155,6 @@ public class EnqueteActiviteController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_ENQUETEACTIVITE')")
public ResponseEntity<?> getEnqueteActiviteById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -20,7 +20,6 @@ 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;
@@ -43,7 +42,6 @@ public class EnqueteBatimentController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_ENQUETEBATIMENT')")
public ResponseEntity<?> createEnqueteBatiment(@RequestBody @Valid @Validated EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) {
try {
enqueteBatimentPayloadWeb = enqueteBatimentService.createEnqueteBatiment(enqueteBatimentPayloadWeb);
@@ -69,7 +67,6 @@ public class EnqueteBatimentController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
public ResponseEntity<?> updateEnqueteBatiment(@PathVariable Long id, @RequestBody EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) {
try {
return new ResponseEntity<>(
@@ -93,7 +90,6 @@ public class EnqueteBatimentController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_ENQUETEBATIMENT')")
public ResponseEntity<?> deleteEnqueteBatiment(@PathVariable Long id) {
try {
enqueteBatimentService.deleteEnqueteBatiment(id);
@@ -118,7 +114,6 @@ public class EnqueteBatimentController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
public ResponseEntity<?> getAllEnqueteBatimentList() {
try {
return new ResponseEntity<>(
@@ -142,7 +137,6 @@ public class EnqueteBatimentController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
public ResponseEntity<?> getAllEnqueteBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -168,7 +162,6 @@ public class EnqueteBatimentController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
public ResponseEntity<?> getEnqueteBatimentById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -192,7 +185,6 @@ public class EnqueteBatimentController {
}
@GetMapping("/by-batiment-id/{batimentId}")
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
public ResponseEntity<?> getEnqueteBatimentByBatimentId(@PathVariable Long batimentId) {
try {
return new ResponseEntity<>(
@@ -216,7 +208,6 @@ public class EnqueteBatimentController {
}
@GetMapping("/page/by-batiment-id/{batimentId}")
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
public ResponseEntity<?> getEnqueteBatimentByBatimentIdPaged(@PathVariable Long batimentId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -242,7 +233,6 @@ public class EnqueteBatimentController {
@GetMapping("/all-paged/en-cours/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
public ResponseEntity<?> getAllEnqueteBatimentEnCoursByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -273,7 +263,6 @@ public class EnqueteBatimentController {
}
@GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
public ResponseEntity<?> getAllEnqueteBatimentClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -305,7 +294,6 @@ public class EnqueteBatimentController {
@PutMapping("/validation")
@PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try {
return new ResponseEntity<>(
@@ -329,7 +317,6 @@ public class EnqueteBatimentController {
}
@PutMapping("/rejet")
@PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try {
@@ -354,7 +341,6 @@ public class EnqueteBatimentController {
}
@PutMapping("/validation-lot")
@PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try {
return new ResponseEntity<>(
@@ -378,7 +364,6 @@ public class EnqueteBatimentController {
}
@PutMapping("/rejet-lot")
@PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try {
return new ResponseEntity<>(

View File

@@ -20,7 +20,6 @@ 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;
@@ -43,7 +42,6 @@ public class EnqueteUniteLogementController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> createEnqueteUniteLogement(@RequestBody @Valid @Validated EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) {
try {
enqueteUniteLogementPayloadWeb = enqueteUniteLogementService.createEnqueteUniteLogement(enqueteUniteLogementPayloadWeb);
@@ -68,7 +66,6 @@ public class EnqueteUniteLogementController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> updateEnqueteUniteLogement(@PathVariable Long id, @RequestBody EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) {
try {
return new ResponseEntity<>(
@@ -92,7 +89,6 @@ public class EnqueteUniteLogementController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> deleteEnqueteUniteLogement(@PathVariable Long id) {
try {
enqueteUniteLogementService.deleteEnqueteUniteLogement(id);
@@ -117,7 +113,6 @@ public class EnqueteUniteLogementController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> getAllEnqueteUniteLogementList() {
try {
return new ResponseEntity<>(
@@ -141,7 +136,6 @@ public class EnqueteUniteLogementController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> getAllEnqueteUniteLogementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -167,7 +161,6 @@ public class EnqueteUniteLogementController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> getEnqueteUniteLogementById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -191,7 +184,6 @@ public class EnqueteUniteLogementController {
}
@GetMapping("/by-unite-logement-id/{uniteLogementId}")
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> getEnqueteUniteLogementByUniteLogement(@PathVariable Long uniteLogementId) {
try {
return new ResponseEntity<>(
@@ -215,7 +207,6 @@ public class EnqueteUniteLogementController {
}
@GetMapping("/page/by-unite-logement-id/{uniteLogementId}")
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> getEnqueteUniteLogementByUniteLogementPaged(@PathVariable Long uniteLogementId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -241,7 +232,6 @@ public class EnqueteUniteLogementController {
@GetMapping("/all-paged/en-cours/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> getAllEnqueteUniteLogementEncoursByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -273,7 +263,6 @@ public class EnqueteUniteLogementController {
@GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> getAllEnqueteUniteLogementClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -305,7 +294,6 @@ public class EnqueteUniteLogementController {
@PutMapping("/validation")
@PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try {
return new ResponseEntity<>(
@@ -329,7 +317,6 @@ public class EnqueteUniteLogementController {
}
@PutMapping("/rejet")
@PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try {
@@ -354,7 +341,6 @@ public class EnqueteUniteLogementController {
}
@PutMapping("/validation-lot")
@PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try {
return new ResponseEntity<>(
@@ -378,7 +364,6 @@ public class EnqueteUniteLogementController {
}
@PutMapping("/rejet-lot")
@PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try {
return new ResponseEntity<>(

View File

@@ -24,7 +24,6 @@ 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;
@@ -45,7 +44,6 @@ public class ImpositionsTfuController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_IMPOSITIONSTFU')")
public ResponseEntity<?> createImpositionsTfu(@CurrentUser UserPrincipal currentUser,@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
try {
if(currentUser==null){
@@ -86,7 +84,6 @@ public class ImpositionsTfuController {
@PutMapping("/cloturer-enquete")
@PreAuthorize("hasAuthority('UPDATE_IMPOSITIONSTFU')")
public ResponseEntity<?> cloturer(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb ) {
try {
@@ -154,7 +151,6 @@ public class ImpositionsTfuController {
)
@PutMapping("/autoriser-generation-avis")
@PreAuthorize("hasAuthority('UPDATE_IMPOSITIONSTFU')")
public ResponseEntity<?> autoriserImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
try {
return new ResponseEntity<>(
@@ -178,7 +174,6 @@ public class ImpositionsTfuController {
}
@PutMapping("/rejeter")
@PreAuthorize("hasAuthority('UPDATE_IMPOSITIONSTFU')")
public ResponseEntity<?> annulerImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
try {
return new ResponseEntity<>(
@@ -202,7 +197,6 @@ public class ImpositionsTfuController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_IMPOSITIONSTFU')")
public ResponseEntity<?> deleteImpositionsTfu(@PathVariable Long id) {
try {
impositionsTfuService.deleteImpositionsTfu(id);
@@ -227,7 +221,6 @@ public class ImpositionsTfuController {
}
@GetMapping("/all/by-user")
@PreAuthorize("hasAuthority('READ_IMPOSITIONSTFU')")
public ResponseEntity<?> getAllImpositionsTfuList(@CurrentUser UserPrincipal userPrincipal) {
try {
@@ -259,7 +252,6 @@ public class ImpositionsTfuController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_IMPOSITIONSTFU')")
public ResponseEntity<?> getAllImpositionsTfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -285,7 +277,6 @@ public class ImpositionsTfuController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_IMPOSITIONSTFU')")
public ResponseEntity<?> getImpositionsTfuById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -16,7 +16,6 @@ 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;
@@ -37,7 +36,6 @@ public class UniteLogementController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_UNITELOGEMENT')")
public ResponseEntity<?> createUniteLogement(@RequestBody @Valid @Validated UniteLogementPaylaodWeb enqueteUniteLogementPaylaodWeb) {
try {
enqueteUniteLogementPaylaodWeb = enqueteUniteLogementService.createUniteLogement(enqueteUniteLogementPaylaodWeb);
@@ -62,7 +60,6 @@ public class UniteLogementController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_UNITELOGEMENT')")
public ResponseEntity<?> updateUniteLogement(@PathVariable Long id, @RequestBody UniteLogementPaylaodWeb enqueteUniteLogementPaylaodWeb) {
try {
return new ResponseEntity<>(
@@ -86,7 +83,6 @@ public class UniteLogementController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_UNITELOGEMENT')")
public ResponseEntity<?> deleteUniteLogement(@PathVariable Long id) {
try {
enqueteUniteLogementService.deleteUniteLogement(id);
@@ -111,7 +107,6 @@ public class UniteLogementController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
public ResponseEntity<?> getAllUniteLogementList() {
try {
return new ResponseEntity<>(
@@ -135,7 +130,6 @@ public class UniteLogementController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
public ResponseEntity<?> getAllUniteLogementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -161,7 +155,6 @@ public class UniteLogementController {
}
@GetMapping("/all/by-batiment-id/{batimentId}")
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
public ResponseEntity<?> getAllUniteLogementListByBatiment(@PathVariable Long batimentId) {
try {
return new ResponseEntity<>(
@@ -185,7 +178,6 @@ public class UniteLogementController {
}
@GetMapping("/all-paged/by-batiment-id/{batimentId}")
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
public ResponseEntity<?> getAllUniteLogementByBatimentPaged(@PathVariable Long batimentId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -211,7 +203,6 @@ public class UniteLogementController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
public ResponseEntity<?> getUniteLogementById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -235,7 +226,6 @@ public class UniteLogementController {
}
@GetMapping("/by-parcelle-id/{id}")
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
public ResponseEntity<?> getUniteLogementByParcelleId(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -257,56 +247,4 @@ public class UniteLogementController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-paged/by-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
public ResponseEntity<?> getAllUniteLogementByQuartierPaged(@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.getUniteLogementListByQuartierPageable(quartierId,pageable), "Liste des unites de logements 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-quartier-id/{quartierId}")
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
public ResponseEntity<?> getAllUniteLogementByQuartier(@PathVariable Long quartierId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.getUniteLogementListByQuartier(quartierId), "Liste des unites de logements 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

@@ -15,7 +15,6 @@ 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;
@@ -35,7 +34,6 @@ public class BaremRfuController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_BAREMRFUBATI')")
public ResponseEntity<?> createBaremRfu(@RequestBody @Valid @Validated BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) {
try {
baremRfuBatiPayloadWeb = baremRfuBatiService.createBaremRfu(baremRfuBatiPayloadWeb);
@@ -60,7 +58,6 @@ public class BaremRfuController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_BAREMRFUBATI')")
public ResponseEntity<?> updateBaremRfu(@PathVariable Long id, @RequestBody BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) {
try {
return new ResponseEntity<>(
@@ -84,7 +81,6 @@ public class BaremRfuController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_BAREMRFUBATI')")
public ResponseEntity<?> deleteBaremRfur(@PathVariable Long id) {
try {
baremRfuBatiService.deleteBaremRfu(id);
@@ -109,7 +105,6 @@ public class BaremRfuController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_BAREMRFUBATI')")
public ResponseEntity<?> getAllBaremRfuList() {
try {
return new ResponseEntity<>(
@@ -133,7 +128,6 @@ public class BaremRfuController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_BAREMRFUBATI')")
public ResponseEntity<?> getAllBaremRfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -159,7 +153,6 @@ public class BaremRfuController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_BAREMRFUBATI')")
public ResponseEntity<?> getBaremRfuById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -183,7 +176,6 @@ public class BaremRfuController {
}
@GetMapping("/by-categorie-batiment-id/{idCategorieBatiment}")
@PreAuthorize("hasAuthority('READ_BAREMRFUBATI')")
public ResponseEntity<?> getBaremRfuByType( //@Parameter(description = "ID de la catégorie de bâtiment", required = true)
@PathVariable Long idCategorieBatiment) {
@@ -210,7 +202,6 @@ public class BaremRfuController {
@GetMapping("/by-arrondissement-id/by-categorie-batiment-id/{idArrondissement}/{idCategorieBatiment}")
@PreAuthorize("hasAuthority('READ_BAREMRFUBATI')")
public ResponseEntity<?> getBaremRfuByArrondisementAndCategorie( //@Parameter(description = "ID de la catégorie de bâtiment", required = true)
@PathVariable Long idArrondissement,
@PathVariable Long idCategorieBatiment
@@ -238,7 +229,6 @@ public class BaremRfuController {
}
@GetMapping("/by-quartier-id/by-categorie-batiment-id/{idQuartier}/{idCategorieBatiment}")
@PreAuthorize("hasAuthority('READ_BAREMRFUBATI')")
public ResponseEntity<?> getBaremRfuByQuartierAndCategorie( //@Parameter(description = "ID de la catégorie de bâtiment", required = true)
@PathVariable Long idQuartier,
@PathVariable Long idCategorieBatiment

View File

@@ -15,7 +15,6 @@ 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;
@@ -36,7 +35,6 @@ public class BaremRfuNonBatiController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_BAREMRFUNONBATI')")
public ResponseEntity<?> createBaremRfuNonBati(@RequestBody BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) {
try {
baremRfuNonBatiPayloadWeb = baremRfuNonBatiService.createBaremRfuNonBati(baremRfuNonBatiPayloadWeb);
@@ -61,7 +59,6 @@ public class BaremRfuNonBatiController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_BAREMRFUNONBATI')")
public ResponseEntity<?> updateBaremRfuNonBati(@PathVariable Long id, @RequestBody BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) {
try {
return new ResponseEntity<>(
@@ -85,7 +82,6 @@ public class BaremRfuNonBatiController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_BAREMRFUNONBATI')")
public ResponseEntity<?> deleteBaremRfuNonBatir(@PathVariable Long id) {
try {
baremRfuNonBatiService.deleteBaremRfuNonBati(id);
@@ -110,7 +106,6 @@ public class BaremRfuNonBatiController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_BAREMRFUNONBATI')")
public ResponseEntity<?> getAllBaremRfuNonBatiList() {
try {
return new ResponseEntity<>(
@@ -134,7 +129,6 @@ public class BaremRfuNonBatiController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_BAREMRFUNONBATI')")
public ResponseEntity<?> getAllBaremRfuNonBatiPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +154,6 @@ public class BaremRfuNonBatiController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_BAREMRFUNONBATI')")
public ResponseEntity<?> getBaremRfuNonBatiById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -185,7 +178,6 @@ public class BaremRfuNonBatiController {
@GetMapping("/by-commune-id/by-zone-id/{communeId}/{zoneId}")
@PreAuthorize("hasAuthority('READ_BAREMRFUNONBATI')")
public ResponseEntity<?> getBaremRfuNonBatiByCommineAndZoneId(@PathVariable Long communeId, Long zoneId) {
try {
return new ResponseEntity<>(

View File

@@ -15,7 +15,6 @@ 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;
@@ -36,7 +35,6 @@ public class CampagneController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_CAMPAGNE')")
public ResponseEntity<?> createCampagne(@RequestBody @Valid @Validated Campagne campagne) {
try {
campagne = campagneService.createCampagne(campagne);
@@ -61,7 +59,6 @@ public class CampagneController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_CAMPAGNE')")
public ResponseEntity<?> updateCampagne(@PathVariable Long id, @RequestBody Campagne campagne) {
try {
return new ResponseEntity<>(
@@ -85,7 +82,6 @@ public class CampagneController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_CAMPAGNE')")
public ResponseEntity<?> deleteCampagner(@PathVariable Long id) {
try {
campagneService.deleteCampagne(id);
@@ -110,7 +106,6 @@ public class CampagneController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
public ResponseEntity<?> getAllCampagneList() {
try {
return new ResponseEntity<>(
@@ -134,7 +129,6 @@ public class CampagneController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
public ResponseEntity<?> getAllCampagnePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +154,6 @@ public class CampagneController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
public ResponseEntity<?> getCampagneById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -184,7 +177,6 @@ public class CampagneController {
}
@GetMapping("/type-campagne/{typeCampagne}")
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
public ResponseEntity<?> getCampagneByType(@PathVariable TypeCampagne typeCampagne) {
try {

View File

@@ -15,7 +15,6 @@ 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;
@@ -35,7 +34,6 @@ public class CaracteristiqueController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_CARACTERISTIQUE')")
public ResponseEntity<?> createCaracteristique(@RequestBody @Valid @Validated Caracteristique caracteristique) {
try {
caracteristique = caracteristiqueService.createCaracteristique(caracteristique);
@@ -60,7 +58,6 @@ public class CaracteristiqueController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_CARACTERISTIQUE')")
public ResponseEntity<?> updateCaracteristique(@PathVariable Long id, @RequestBody Caracteristique caracteristique) {
try {
return new ResponseEntity<>(
@@ -84,7 +81,6 @@ public class CaracteristiqueController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_CARACTERISTIQUE')")
public ResponseEntity<?> deleteCaracteristique(@PathVariable Long id) {
try {
caracteristiqueService.deleteCaracteristique(id);
@@ -109,7 +105,6 @@ public class CaracteristiqueController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUE')")
public ResponseEntity<?> getAllCaracteristiqueList() {
try {
return new ResponseEntity<>(
@@ -133,7 +128,6 @@ public class CaracteristiqueController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUE')")
public ResponseEntity<?> getAllCaracteristiquePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -159,7 +153,6 @@ public class CaracteristiqueController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUE')")
public ResponseEntity<?> getCaracteristiqueById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -14,7 +14,6 @@ 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;
@@ -35,7 +34,6 @@ public class CategorieBatimentController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_CATEGORIEBATIMENT')")
public ResponseEntity<?> createCategorieBatiment(@RequestBody @Valid @Validated CategorieBatiment categorieBatiment) {
try {
categorieBatiment = categorieBatimentService.createCategorieBatiment(categorieBatiment);
@@ -60,7 +58,6 @@ public class CategorieBatimentController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_CATEGORIEBATIMENT')")
public ResponseEntity<?> updateCategorieBatiment(@PathVariable Long id, @RequestBody CategorieBatiment categorieBatiment) {
try {
return new ResponseEntity<>(
@@ -84,7 +81,6 @@ public class CategorieBatimentController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_CATEGORIEBATIMENT')")
public ResponseEntity<?> deleteCategorieBatimentr(@PathVariable Long id) {
try {
categorieBatimentService.deleteCategorieBatiment(id);
@@ -109,7 +105,6 @@ public class CategorieBatimentController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_CATEGORIEBATIMENT')")
public ResponseEntity<?> getAllCategorieBatimentList() {
try {
return new ResponseEntity<>(
@@ -133,7 +128,6 @@ public class CategorieBatimentController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_CATEGORIEBATIMENT')")
public ResponseEntity<?> getAllCategorieBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -159,7 +153,6 @@ public class CategorieBatimentController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_CATEGORIEBATIMENT')")
public ResponseEntity<?> getCategorieBatimentById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -15,7 +15,6 @@ 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;
@@ -36,7 +35,6 @@ public class EquipeController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_EQUIPE')")
public ResponseEntity<?> createEquipe(@RequestBody @Valid @Validated EquipePayload equipePayload) {
try {
Equipe equipe = equipeService.createEquipe(equipePayload);
@@ -61,7 +59,6 @@ public class EquipeController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_EQUIPE')")
public ResponseEntity<?> updateEquipe(@PathVariable Long id, @RequestBody EquipePayload equipePayload) {
try {
return new ResponseEntity<>(
@@ -85,7 +82,6 @@ public class EquipeController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_EQUIPE')")
public ResponseEntity<?> deleteEquiper(@PathVariable Long id) {
try {
equipeService.deleteEquipe(id);
@@ -110,7 +106,6 @@ public class EquipeController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_EQUIPE')")
public ResponseEntity<?> getAllEquipeList() {
try {
return new ResponseEntity<>(
@@ -134,7 +129,6 @@ public class EquipeController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_EQUIPE')")
public ResponseEntity<?> getAllEquipePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -160,7 +154,6 @@ public class EquipeController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_EQUIPE')")
public ResponseEntity<?> getEquipeById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -14,7 +14,6 @@ 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;
@@ -35,7 +34,6 @@ public class ExerciceController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_EXERCICE')")
public ResponseEntity<?> createExercice(@RequestBody @Valid @Validated Exercice exercice) {
try {
exercice = exerciceService.createExercice(exercice);
@@ -60,7 +58,6 @@ public class ExerciceController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_EXERCICE')")
public ResponseEntity<?> updateExercice(@PathVariable Long id, @RequestBody Exercice exercice) {
try {
return new ResponseEntity<>(
@@ -84,7 +81,6 @@ public class ExerciceController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_EXERCICE')")
public ResponseEntity<?> deleteExercicer(@PathVariable Long id) {
try {
exerciceService.deleteExercice(id);
@@ -109,7 +105,6 @@ public class ExerciceController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_EXERCICE')")
public ResponseEntity<?> getAllExerciceList() {
try {
return new ResponseEntity<>(
@@ -133,7 +128,6 @@ public class ExerciceController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_EXERCICE')")
public ResponseEntity<?> getAllExercicePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -159,7 +153,6 @@ public class ExerciceController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_EXERCICE')")
public ResponseEntity<?> getExerciceById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -182,5 +175,6 @@ public class ExerciceController {
}
}
}

View File

@@ -15,7 +15,6 @@ 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;
@@ -35,7 +34,6 @@ public class TypeCaracteristiqueController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_TYPECARACTERISTIQUE')")
public ResponseEntity<?> createTypeCaracteristique(@RequestBody @Valid @Validated TypeCaracteristique typeCaracteristique) {
try {
typeCaracteristique = typeCaracteristiqueService.createTypeCaracteristique(typeCaracteristique);
@@ -60,7 +58,6 @@ public class TypeCaracteristiqueController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_TYPECARACTERISTIQUE')")
public ResponseEntity<?> updateTypeCaracteristique(@PathVariable Long id, @RequestBody TypeCaracteristique typeCaracteristique) {
try {
return new ResponseEntity<>(
@@ -84,7 +81,6 @@ public class TypeCaracteristiqueController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_TYPECARACTERISTIQUE')")
public ResponseEntity<?> deleteTypeCaracteristique(@PathVariable Long id) {
try {
typeCaracteristiqueService.deleteTypeCaracteristique(id);
@@ -109,7 +105,6 @@ public class TypeCaracteristiqueController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_TYPECARACTERISTIQUE')")
public ResponseEntity<?> getAllTypeCaracteristiqueList() {
try {
return new ResponseEntity<>(
@@ -133,7 +128,6 @@ public class TypeCaracteristiqueController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_TYPECARACTERISTIQUE')")
public ResponseEntity<?> getAllTypeCaracteristiquePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -159,7 +153,6 @@ public class TypeCaracteristiqueController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_TYPECARACTERISTIQUE')")
public ResponseEntity<?> getTypeCaracteristiqueById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -14,7 +14,6 @@ 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;
@@ -35,7 +34,6 @@ public class UsageController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_USAGE')")
public ResponseEntity<?> createUsage(@RequestBody @Valid @Validated Usage usage) {
try {
usage = usageService.createUsage(usage);
@@ -60,7 +58,6 @@ public class UsageController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_USAGE')")
public ResponseEntity<?> updateUsage(@PathVariable Long id, @RequestBody Usage usage) {
try {
return new ResponseEntity<>(
@@ -84,7 +81,6 @@ public class UsageController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_USAGE')")
public ResponseEntity<?> deleteUsager(@PathVariable Long id) {
try {
usageService.deleteUsage(id);
@@ -109,7 +105,6 @@ public class UsageController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_USAGE')")
public ResponseEntity<?> getAllUsageList() {
try {
return new ResponseEntity<>(
@@ -133,7 +128,6 @@ public class UsageController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_USAGE')")
public ResponseEntity<?> getAllUsagePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -159,7 +153,6 @@ public class UsageController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_USAGE')")
public ResponseEntity<?> getUsageById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -14,7 +14,6 @@ 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;
@@ -35,7 +34,6 @@ public class ZoneRfuController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_ZONERFU')")
public ResponseEntity<?> createZoneRfu(@RequestBody @Valid @Validated ZoneRfu zoneRfu) {
try {
zoneRfu = zoneRfuService.createZoneRfu(zoneRfu);
@@ -60,7 +58,6 @@ public class ZoneRfuController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_ZONERFU')")
public ResponseEntity<?> updateZoneRfu(@PathVariable Long id, @RequestBody ZoneRfu zoneRfu) {
try {
return new ResponseEntity<>(
@@ -84,7 +81,6 @@ public class ZoneRfuController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_ZONERFU')")
public ResponseEntity<?> deleteZoneRfur(@PathVariable Long id) {
try {
zoneRfuService.deleteZoneRfu(id);
@@ -109,7 +105,6 @@ public class ZoneRfuController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_ZONERFU')")
public ResponseEntity<?> getAllZoneRfuList() {
try {
return new ResponseEntity<>(
@@ -133,7 +128,6 @@ public class ZoneRfuController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_ZONERFU')")
public ResponseEntity<?> getAllZoneRfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -159,7 +153,6 @@ public class ZoneRfuController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_ZONERFU')")
public ResponseEntity<?> getZoneRfuById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -19,7 +19,7 @@ import org.springframework.web.client.HttpClientErrorException;
@SecurityRequirement(name = "bearer")
@Tag(name = "Restauration")
@CrossOrigin(origins = "*")
//@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_SUPERVISEUR') or hasRole('ROLE_ENQUETEUR')")
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_SUPERVISEUR') or hasRole('ROLE_ENQUETEUR')")
public class RestaurationController {
public final RestaurationService restaurationService;

View File

@@ -84,7 +84,7 @@ public class SynchronisationController {
@Transactional
@PostMapping("/personnes")
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncPersonne(@RequestBody List<PersonnePayLoad> personnePayLoads) {
try {
return new ResponseEntity<>(
@@ -108,7 +108,7 @@ public class SynchronisationController {
}
@PostMapping("/membre-groupe")
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncMembreGroupe(@RequestBody List<MembreGroupePayLoad> membreGroupePayLoads) {
try {
return new ResponseEntity<>(
@@ -132,7 +132,7 @@ public class SynchronisationController {
}
@PostMapping("/enquete")
// @PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncEnquete(@RequestBody List<EnquetePayLoad> enquetePayLoads) {
try {
return new ResponseEntity<>(
@@ -156,7 +156,7 @@ public class SynchronisationController {
}
@PostMapping("/parcelle")
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncParcelle(@RequestBody List<ParcellePayLoad> parcellePayLoads) {
try {
return new ResponseEntity<>(
@@ -180,7 +180,7 @@ public class SynchronisationController {
}
@PostMapping("/piece")
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncPiece(@RequestBody List<PiecePayLoad> piecePayLoads) {
try {
return new ResponseEntity<>(
@@ -205,7 +205,7 @@ public class SynchronisationController {
}
@PostMapping("/acteur-concerne")
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncActeurConcerne(@RequestBody List<ActeurConcernePayLoad> piecePayLoads) {
try {
return new ResponseEntity<>(
@@ -230,7 +230,7 @@ public class SynchronisationController {
@PostMapping("/enquete-activite")
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncEnqueteActivite(@RequestBody List<EnqueteActivitePayload> enqueteActivitePayloads) {
try {
return new ResponseEntity<>(
@@ -255,7 +255,7 @@ public class SynchronisationController {
}
@PostMapping("/declaraction-nc")
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncDeclarationNc(@RequestBody List<DeclarationNcPayload> declarationNcPayloads) {
try {
return new ResponseEntity<>(
@@ -335,7 +335,7 @@ public class SynchronisationController {
// }
@PostMapping(path = "/uploads")
// @PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncUploads(@RequestBody List<UploadPayLoad> uploadPayLoads) {
return new ResponseEntity<>(
new ApiResponse<>(true, synchronisationService.syncUpload(uploadPayLoads), "Liste des uploads synchronisée avec succès."),
@@ -369,7 +369,7 @@ public class SynchronisationController {
// }
@PostMapping(path = "/synchronise/all-enquete-data")
// @PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncAllEnqueteData(@ModelAttribute EnqueteAllDataPayload enqueteAllDataPayload) {
try {
return new ResponseEntity<>(
@@ -393,7 +393,7 @@ public class SynchronisationController {
}
@PostMapping(path = "/synchronise/enquete/confirme-from-mobile")
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncAllEnqueteData(@RequestBody List<Long> longList) {
try {
return new ResponseEntity<>(
@@ -418,7 +418,7 @@ public class SynchronisationController {
@PostMapping(path = "/batiment")
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncBatiment(@RequestBody List<BatimentPaylaod> batimentPaylaods) {
try {
return new ResponseEntity<>(
@@ -443,7 +443,7 @@ public class SynchronisationController {
}
@PostMapping(path = "/unite-logement")
// @PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncUniteLogement(@RequestBody List<UniteLogementPaylaod> uniteLogementPaylaods) {
try {
return new ResponseEntity<>(
@@ -468,7 +468,7 @@ public class SynchronisationController {
}
@PostMapping(path = "/caracteristique-batiment")
// @PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncCaracteristiqueBatiment(@RequestBody List<CaracteristiqueBatimentPayload> CaracteristiqueBatimentPayloads) {
try {
return new ResponseEntity<>(
@@ -493,7 +493,7 @@ public class SynchronisationController {
}
@PostMapping(path = "/caracteristique-parcelle")
// @PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncCaracteristiqueParcelle(@RequestBody List<CaracteristiqueParcellePayload> CaracteristiqueParcellePayloads) {
try {
return new ResponseEntity<>(
@@ -518,7 +518,7 @@ public class SynchronisationController {
}
@PostMapping(path = "/caracteristique-unite-logement")
// @PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncCaracteristiqueUniteLogement(@RequestBody List<CaracteristiqueUniteLogementPayload> CaracteristiqueUniteLogementPayloads) {
try {
return new ResponseEntity<>(
@@ -543,7 +543,7 @@ public class SynchronisationController {
}
@PostMapping("/enquete-batiment")
// @PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncEnqueteBatiment(@RequestBody List<EnqueteBatimentPayload> enqueteBatimentPayloads) {
try {
return new ResponseEntity<>(
@@ -568,7 +568,7 @@ public class SynchronisationController {
}
@PostMapping("/enquete-unite-logement")
// @PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public ResponseEntity<?> syncEnqueteUniteLogement(@RequestBody List<EnqueteUniteLogementPayload> enqueteUniteLogementPayloads) {
try {
return new ResponseEntity<>(

View File

@@ -16,7 +16,6 @@ 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;
@@ -38,7 +37,6 @@ public class AvoirFonctionController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_AVOIRFONCTION')")
public ResponseEntity<?> createAvoirFonction(@RequestBody @Valid @Validated AvoirFonctionPaylaodWeb avoirFonctionPaylaodWeb ) {
try {
return new ResponseEntity<>(
@@ -63,7 +61,6 @@ public class AvoirFonctionController {
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_AVOIRFONCTION')")
public ResponseEntity<?> updateAvoirFonction(@PathVariable Long id, @RequestBody AvoirFonctionPaylaodWeb avoirFonctionPaylaodWeb) {
try {
return new ResponseEntity<>(
@@ -87,7 +84,6 @@ public class AvoirFonctionController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_AVOIRFONCTION')")
public ResponseEntity<?> deleteAvoirFonction(@PathVariable Long id) {
try {
avoirFonctionService.deleteAvoirFonction(id);
@@ -112,7 +108,6 @@ public class AvoirFonctionController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_AVOIRFONCTION')")
public ResponseEntity<?> getAll() {
try {
return new ResponseEntity<>(
@@ -137,7 +132,6 @@ public class AvoirFonctionController {
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_AVOIRFONCTION')")
public ResponseEntity<?> getAllPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -163,7 +157,6 @@ public class AvoirFonctionController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_AVOIRFONCTION')")
public ResponseEntity<?> getById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -188,7 +181,6 @@ public class AvoirFonctionController {
@GetMapping("/by-utilisateur-id/{userId}")
@PreAuthorize("hasAuthority('READ_AVOIRFONCTION')")
public ResponseEntity<?> getByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
@@ -213,7 +205,6 @@ public class AvoirFonctionController {
@GetMapping("/page/by-utilisateur-id/{userId}")
@PreAuthorize("hasAuthority('READ_AVOIRFONCTION')")
public ResponseEntity<?> getByUserIdPageable(@PathVariable Long userId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);

View File

@@ -21,7 +21,6 @@ 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.web.bind.annotation.*;
import org.springframework.web.client.HttpClientErrorException;
@@ -44,7 +43,6 @@ public class DemandeReinitialisationMPController {
}
@GetMapping("/create")
@PreAuthorize("hasAuthority('CREATE_DEMANDEREINITIALISATIONMP')")
public ResponseEntity<?> createDemandeReinitialisationMP(@RequestParam String usernamrOrEmail) {
try {
demandeReinitialisationMPService.createDemandeReinitialisationMP(usernamrOrEmail);
@@ -69,7 +67,6 @@ public class DemandeReinitialisationMPController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_DEMANDEREINITIALISATIONMP')")
public ResponseEntity<?> updateDemandeReinitialisationMP(@PathVariable Long id, @RequestBody DemandeReinitialisationMP demandeReinitialisationMP) {
try {
return new ResponseEntity<>(
@@ -93,7 +90,6 @@ public class DemandeReinitialisationMPController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_DEMANDEREINITIALISATIONMP')")
public ResponseEntity<?> deleteDemandeReinitialisationMPr(@PathVariable Long id) {
try {
demandeReinitialisationMPService.deleteDemandeReinitialisationMP(id);
@@ -172,7 +168,6 @@ public class DemandeReinitialisationMPController {
// }
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_DEMANDEREINITIALISATIONMP')")
public ResponseEntity<?> getAllDemandeReinitialisationMPPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -198,7 +193,6 @@ public class DemandeReinitialisationMPController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_DEMANDEREINITIALISATIONMP')")
public ResponseEntity<?> getDemandeReinitialisationMPById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -222,7 +216,6 @@ public class DemandeReinitialisationMPController {
}
@GetMapping("/reset")
@PreAuthorize("hasAuthority('UPDATE_DEMANDEREINITIALISATIONMP')")
public ResponseEntity<?> traiterDemande(@RequestParam Long id, @RequestParam String password) {
try {
DemandeReinitialisationMP demandeReinitialisationMP = demandeReinitialisationMPService.traiterDemandeReinitialisation(id, password);

View File

@@ -16,7 +16,6 @@ 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;
@@ -38,7 +37,6 @@ public class FonctionController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_FONCTION')")
public ResponseEntity<?> createFonction(@RequestBody @Valid @Validated FonctionPaylaodWeb fonctionPaylaodWeb) {
try {
Fonction fonction = fonctionService.createFonction(fonctionPaylaodWeb);
@@ -63,7 +61,6 @@ public class FonctionController {
}
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_FONCTION')")
public ResponseEntity<?> updateFonction(@PathVariable Long id, @RequestBody FonctionPaylaodWeb fonctionPaylaodWeb) {
try {
return new ResponseEntity<>(
@@ -87,7 +84,6 @@ public class FonctionController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_FONCTION')")
public ResponseEntity<?> deleteFonction(@PathVariable Long id) {
try {
fonctionService.deleteFonction(id);
@@ -112,7 +108,6 @@ public class FonctionController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_FONCTION')")
public ResponseEntity<?> getAllFonctionList() {
try {
return new ResponseEntity<>(
@@ -136,7 +131,6 @@ public class FonctionController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_FONCTION')")
public ResponseEntity<?> getAllFonctionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -161,7 +155,6 @@ public class FonctionController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_FONCTION')")
public ResponseEntity<?> getFonctionById(@PathVariable Long id) {
try {
return new ResponseEntity<>(

View File

@@ -16,7 +16,6 @@ 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;
@@ -38,7 +37,6 @@ public class ProfileController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_PROFILE')")
public ResponseEntity<?> createProfile(@RequestBody @Valid @Validated ProfilePaylaodWeb profilePaylaodWeb ) {
try {
Profile profile = profileService.createProfile(profilePaylaodWeb);
@@ -64,7 +62,6 @@ public class ProfileController {
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_PROFILE')")
public ResponseEntity<?> updateProfile(@PathVariable Long id, @RequestBody ProfilePaylaodWeb profilePaylaodWeb) {
try {
return new ResponseEntity<>(
@@ -88,7 +85,6 @@ public class ProfileController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_PROFILE')")
public ResponseEntity<?> deleteProfile(@PathVariable Long id) {
try {
profileService.deleteProfile(id);
@@ -113,7 +109,6 @@ public class ProfileController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_PROFILE')")
public ResponseEntity<?> getAll() {
try {
return new ResponseEntity<>(
@@ -137,7 +132,6 @@ public class ProfileController {
}
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_PROFILE')")
public ResponseEntity<?> getById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -161,7 +155,6 @@ public class ProfileController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_PROFILE')")
public ResponseEntity<?> getAllPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);

View File

@@ -1,184 +0,0 @@
package io.gmss.fiscad.controllers.user;
import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.user.ProfileModuleFonctionnaliteService;
import io.gmss.fiscad.interfaces.user.ProfileModuleFonctionnaliteService;
import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.ProfileModuleFonctionnalitePayloadWeb;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;
@AllArgsConstructor
@RestController
@RequestMapping(value = "api/profile-module-fonctionnalite", produces = MediaType.APPLICATION_JSON_VALUE)
@SecurityRequirement(name = "bearer")
@Tag(name = "ProfileModuleFonctionnalite")
@CrossOrigin(origins = "*")
public class ProfileModuleFonctionnaliteController {
private final ProfileModuleFonctionnaliteService profileModuleFonctionnaliteService;
private static final Logger logger = LoggerFactory.getLogger(ProfileModuleFonctionnaliteController.class);
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_PROFILEMODULEFONCTIONNALITE')")
public ResponseEntity<?> createProfileModuleFonctionnalite(@RequestBody @Valid @Validated ProfileModuleFonctionnalitePayloadWeb modulePayLoadWeb) {
try {
modulePayLoadWeb = profileModuleFonctionnaliteService.createProfileModuleFonctionnalite(modulePayLoadWeb);
return new ResponseEntity<>(
new ApiResponse<>(true, modulePayLoadWeb, "ProfileModuleFonctionnalite 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_PROFILEMODULEFONCTIONNALITE')")
public ResponseEntity<?> updateProfileModuleFonctionnalite(@PathVariable Long id, @RequestBody ProfileModuleFonctionnalitePayloadWeb modulePayLoadWeb) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, profileModuleFonctionnaliteService.updateProfileModuleFonctionnalite(id,modulePayLoadWeb), "ProfileModuleFonctionnalite 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_PROFILEMODULEFONCTIONNALITE')")
public ResponseEntity<?> deleteProfileModuleFonctionnalite(@PathVariable Long id) {
try {
profileModuleFonctionnaliteService.deleteProfileModuleFonctionnalite(id);
return new ResponseEntity<>(
new ApiResponse<>(true, "ProfileModuleFonctionnalite 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_PROFILEMODULEFONCTIONNALITE')")
public ResponseEntity<?> getAllProfileModuleFonctionnaliteList() {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, profileModuleFonctionnaliteService.getProfileModuleFonctionnaliteListToDto(), "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-profil-id/{profilId}")
@PreAuthorize("hasAuthority('READ_PROFILEMODULEFONCTIONNALITE')")
public ResponseEntity<?> getAllProfileModuleFonctionnaliteByProfilList(@PathVariable Long profilId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, profileModuleFonctionnaliteService.getAllProfileModuleFonctionnaliteByProfilIdToDto(profilId), "Liste des modules 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_PROFILEMODULEFONCTIONNALITE')")
public ResponseEntity<?> getProfileModuleFonctionnaliteById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, profileModuleFonctionnaliteService.getProfileModuleFonctionnaliteByIdToDto(id), "ProfileModuleFonctionnalite 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

@@ -15,7 +15,6 @@ 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;
@@ -37,7 +36,6 @@ public class RoleController {
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_ROLE')")
public ResponseEntity<?> createRole(@RequestBody @Valid @Validated Role role) {
try {
role = roleService.createRole(role);
@@ -63,7 +61,6 @@ public class RoleController {
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_ROLE')")
public ResponseEntity<?> updateRole(@PathVariable Long id, @RequestBody Role role) {
try {
return new ResponseEntity<>(
@@ -87,7 +84,6 @@ public class RoleController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_ROLE')")
public ResponseEntity<?> deleteRole(@PathVariable Long id) {
try {
roleService.deleteRole(id);
@@ -112,7 +108,6 @@ public class RoleController {
}
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_ROLE')")
public ResponseEntity<?> getAll() {
try {
return new ResponseEntity<>(
@@ -136,7 +131,6 @@ public class RoleController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_ROLE')")
public ResponseEntity<?> getAllPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);

View File

@@ -20,7 +20,6 @@ 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;
@@ -45,7 +44,6 @@ public class UserController {
}
@PostMapping("/create")
@PreAuthorize("hasAuthority('CREATE_USER')")
public ResponseEntity<?> createUser(@RequestBody @Valid @Validated UserPaylaodWeb userPaylaodWeb) {
try {
userPaylaodWeb = userService.createUser(userPaylaodWeb);
@@ -70,7 +68,6 @@ public class UserController {
}
@PostMapping("/change-password")
@PreAuthorize("hasAuthority('UPDATE_USER')")
public ResponseEntity<?> changeUserPassword(@RequestBody @Valid @Validated Login login) {
try {
userService.updatePassword(login.getUsername(), login.getPassword());
@@ -95,7 +92,6 @@ public class UserController {
}
@PostMapping("/reset-password")
@PreAuthorize("hasAuthority('UPDATE_USER')")
public ResponseEntity<?> resetUserPassword(@RequestBody @Valid @Validated Login login) {
try {
UserPaylaodWeb userPaylaodWeb= userService.resetPassword(login.getUsername());
@@ -120,7 +116,6 @@ public class UserController {
}
@PostMapping("/validate-user-account/{userName}")
@PreAuthorize("hasAuthority('UPDATE_USER')")
public ResponseEntity<?> validateUserAccount(@PathVariable String userName) {
try {
User user = userService.validateUserAccount(userName);
@@ -146,7 +141,6 @@ public class UserController {
@PutMapping("/update/{id}")
@PreAuthorize("hasAuthority('UPDATE_USER')")
public ResponseEntity<?> updateUser(@PathVariable Long id, @RequestBody UserPaylaodWeb userPaylaodWeb) {
try {
return new ResponseEntity<>(
@@ -170,7 +164,6 @@ public class UserController {
}
@GetMapping("/activate/{id}")
@PreAuthorize("hasAuthority('UPDATE_USER')")
public ResponseEntity<?> acitvateUser(@PathVariable Long id) {
try {
User user = userService.activateUser(id);
@@ -196,7 +189,6 @@ public class UserController {
@GetMapping("/desactivate/{id}")
@PreAuthorize("hasAuthority('UPDATE_USER')")
public ResponseEntity<?> disacitvateUser(@PathVariable Long id) {
try {
User user = userService.disactivateUser(id);
@@ -221,7 +213,6 @@ public class UserController {
}
@DeleteMapping("/delete/{id}")
@PreAuthorize("hasAuthority('DELETE_USER')")
public ResponseEntity<?> deleteUser(@PathVariable Long id) {
try {
userService.deleteUser(id);
@@ -247,7 +238,6 @@ public class UserController {
@GetMapping("/all")
@PreAuthorize("hasAuthority('READ_USER')")
public ResponseEntity<?> getAll() {
try {
@@ -271,7 +261,6 @@ public class UserController {
}
@GetMapping("/all-paged")
@PreAuthorize("hasAuthority('READ_USER')")
public ResponseEntity<?> getAllPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -295,7 +284,6 @@ public class UserController {
}
@GetMapping("/all-by-structure/{structureId}")
@PreAuthorize("hasAuthority('READ_USER')")
public ResponseEntity<?> getAllByStructure(@PathVariable Long structureId) {
try {
@@ -322,7 +310,6 @@ public class UserController {
}
@GetMapping("/page/all-by-structure/{structureId}")
@PreAuthorize("hasAuthority('READ_USER')")
public ResponseEntity<?> getAllByStructurePaged(@PathVariable Long structureId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
@@ -351,7 +338,6 @@ public class UserController {
@GetMapping("/id/{id}")
@PreAuthorize("hasAuthority('READ_USER')")
public ResponseEntity<?> getUserById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
@@ -375,7 +361,6 @@ public class UserController {
}
@GetMapping("/username/{username}")
@PreAuthorize("hasAuthority('READ_USER')")
public ResponseEntity<?> getUserByUsername(@PathVariable String username) {
try {
return new ResponseEntity<>(

View File

@@ -1,28 +0,0 @@
package io.gmss.fiscad.entities.frontend;
import io.gmss.fiscad.entities.BaseEntity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Fonctionnalite extends BaseEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String code;
private String nom;
private String lien;
@Column(nullable = false, columnDefinition = "BOOLEAN DEFAULT true")
private Boolean actif;
@ManyToOne
private ModuleApp moduleApp;
}

View File

@@ -1,31 +0,0 @@
package io.gmss.fiscad.entities.frontend;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.gmss.fiscad.entities.BaseEntity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ModuleApp extends BaseEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String code;
private String nom;
private String lien;
@Column(nullable = false, columnDefinition = "BOOLEAN DEFAULT true")
private Boolean actif;
@JsonIgnore
@OneToMany(mappedBy = "moduleApp")
private List<Fonctionnalite> fonctionnalites;
}

View File

@@ -41,7 +41,6 @@ public class Personne extends BaseEntity implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String ifu;
private String nc;
private String nom;
private String prenom;
private String raisonSociale;

View File

@@ -1,62 +0,0 @@
package io.gmss.fiscad.entities.interface_sigibe;
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.decoupage.Quartier;
import io.gmss.fiscad.entities.infocad.parametre.Personne;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDate;
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DeclarationSpontaneBien extends BaseEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private Long idImposition ;
private String rImposition ;
private String ifu ;
private String rCommune ;
private String rQuartier ;
private String qipQuartier;
private String qipIlot;
private String qipParcelle;
private String nup;
private String gpsLatitude;
private String gpsLongitude;
private String commentaire;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateValidation;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateInformation;
private Long valeurBatiment;
private Long nub;
private Long nul;
private Long montantLocatifAnnuel ;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateConstruction;
private Float superficieSolBat;
private Float superficieSolUlot;
private Float superficieParcelle;
private String usage;
private Boolean bati;
@ManyToOne
private Personne personne;
@ManyToOne
private Quartier quartier;
}

View File

@@ -1,58 +0,0 @@
package io.gmss.fiscad.entities.interface_sigibe;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.infocad.parametre.PositionRepresentation;
import io.gmss.fiscad.entities.infocad.parametre.TypeContestation;
import io.gmss.fiscad.entities.infocad.parametre.TypeRepresentation;
import io.gmss.fiscad.enums.SourceDonnee;
import io.gmss.fiscad.enums.TypeDroit;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDate;
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class EpaiementAcompte extends BaseEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private Long idPaiementAcompte;
private Long idPaiementImpot;
private String rDoc;
private String rImpot;
private String idImpotType;
private String idImpotNature; /// participe unicité
private String ifu; /// participe unicité
private String rCommune;
private String rQuartier; /// participe unicité
private String qipQuartier;
private String qipIlot; /// participe unicité
private String qipParcelle; /// participe unicité
private String nup;
private Long exercice; /// participe unicité
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateValidation;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateAvisCredit;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateRapprochement;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateInformation;
private Long montantPayer;
}

View File

@@ -1,55 +0,0 @@
package io.gmss.fiscad.entities.interface_sigibe;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.enums.SourceDonnee;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDate;
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class EpaiementRetenu extends BaseEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private Long idPaiementRetenue;
private Long idEdiGenerique;
private Long idPaiementImpot;
private String rDoc;
private String rImpot;
private String idImpotType;
private String idImpotNature;
private String ifuPayeur;
private String ifuRetenue;
private String rCommune;
private String rQuartier;
private String qipQuartier;
private String qipIlot;
private String qipParcelle;
private String nup;
private Long exercice;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateValidation;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateAvisCredit;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateRapprochement;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateInformation;
private Long montantPayer;
}

View File

@@ -1,50 +0,0 @@
package io.gmss.fiscad.entities.interface_sigibe;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.enums.SourceDonnee;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDate;
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PaiementAvis extends BaseEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private Long idPaiementImpot;
private Long idAvis;
private Long idUniteFoncier;
private Long idContribuableFoncier;
private String rDoc;
private String rImpot;
private String idImpotType;
private String idImpotNature;
private String ifu;
private String rCommune;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateValidation;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateAvisCredit;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateRapprochement;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateInformation;
private Long montantPayer;
}

View File

@@ -1,67 +0,0 @@
package io.gmss.fiscad.entities.rfu.metier;
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.decoupage.Commune;
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
import io.gmss.fiscad.entities.infocad.metier.Tpe;
import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.enums.StatutEnregistrement;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDate;
@Entity
@Table(
uniqueConstraints = {
@UniqueConstraint(
name = "uk_structure_commune_personne",
columnNames = {"structure_id", "commune_id", "personne_id"}
)
}
)
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class CommuneCentreAssignation extends BaseEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@JsonIgnore
@ManyToOne
@JoinColumn(name = "structure_id", nullable = false)
private Structure structure;
@JsonIgnore
@ManyToOne
@JoinColumn(name = "commune_id", nullable = false)
private Commune commune;
@JsonIgnore
@ManyToOne
@JoinColumn(name = "personne_id")
private Personne personne;
@JsonIgnore
@ManyToOne
@JoinColumn(name = "parcelle_id")
private Parcelle parcelle;
private String nc;
private String ifu;
private String adresseContact ;
}

View File

@@ -36,22 +36,19 @@ public class DeclarationNc extends BaseEntity implements Serializable {
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateDerniereDeclaration;
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateDeclarationNc;
private String nc;
private String q;
private String i;
private String p;
private String numeroTitreFoncier;
private String nup;
private String observation;
@JsonIgnore
@ManyToOne
private Structure structure;
private Long enqueteExternalKey;
@JsonIgnore

View File

@@ -8,7 +8,6 @@ import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
import io.gmss.fiscad.entities.infocad.metier.Tpe;
import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.entities.rfu.parametre.ZoneRfu;
import io.gmss.fiscad.enums.NatureImpot;
@@ -74,7 +73,6 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
private String latitude;
private int superficieParc;
private Long superficieAuSolBat;
private Long superficieAuSolLoue;
private Long superficieAuSolUlog;
private Boolean batie;
private Boolean exonere;
@@ -98,12 +96,10 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateEnquete;
private Long enqueteId;
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "structure_id")
private Structure structure ;
private Long secteurId;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "zone_rfu_id")
@@ -114,11 +110,6 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
private Float tauxTfu;
private Long tfuPiscine;
private Float montantTaxe;
private Float penalite;
private Float retenuIrf ;
private Float acompte ;
private Float montantRestant ;
private Float montantTaxeBrut; //montant de la taxe calculée sans comparaisons avec TFU MINI
private Float tfuCalculeTauxPropParc;
private Float tfuSuperficieAuSolReel;
private Long valeurAdminParcelleNbMetreCarre;
@@ -145,12 +136,4 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "unite_logement_id")
private UniteLogement uniteLogementImposee ;
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY)
private Personne personne ;
private Boolean parcelleContact;
}

View File

@@ -1,29 +0,0 @@
package io.gmss.fiscad.entities.user;
import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.frontend.Fonctionnalite;
import io.gmss.fiscad.entities.frontend.ModuleApp;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
//@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
public class ProfileModuleFonctionnalite extends BaseEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne
private Profile profile;
@ManyToOne
private ModuleApp moduleApp;
@ManyToOne
private Fonctionnalite fonctionnalite ;
private Boolean actif;
}

View File

@@ -1,8 +1,6 @@
package io.gmss.fiscad.enums;
public enum NatureImpot {
FB,
FNB,
IRF,
SRTB
TFU,
IRF
}

View File

@@ -16,7 +16,5 @@ public enum ParametersType {
TAUX_TFU,
TAUX_VALEUR_LOCATIVE_PROFESSIONNELLE,
TAUX_DEFAUT_SUPERFICIE_AU_SOL,
TAUX_IRF,
TAXE_SRTB,
TFU_PAR_PISCINE;
}

View File

@@ -2,10 +2,8 @@ package io.gmss.fiscad.enums;
public enum StatusAvis {
EN_COURS,
CLOTURE,
GENERATION_AUTORISE,
REJETE,
TFU_FNB_GENERE,
GENERE

View File

@@ -1,77 +1,9 @@
package io.gmss.fiscad.enums;
public enum UserProfile {
EBANK_OPE,
ACAAGENT,
ADMINF,
ADMINT,
API_CONT,
API_CONT_CONSULTATION,
CASAGENT,
CASCHEF,
EBANK_OPE_BATI,
EBANK_OPE_BATI_DIRT,
EBANK_OPE_DIRT,
EBANK_OPE_PAIE,
EBANK_OPE_PAIE_DIRT,
ECP_ADMIN,
ENTDECL,
ENTEFI,
ENTFULL,
ENTGEST,
ENTREGL,
ENTREGLVALID,
ENTUSER,
ENTENR,
CNSS,
CNSS_REC,
COMPTABLE,
COMPTACHEFDIV,
CONSULTATION,
CTRLAGENT,
CTRLCHEF,
CTRLDIRECTEUR,
DIRECTEUR,
DIRGENERAL,
DLCAGENT,
DLCCHEF,
DLCDIRECTEUR,
DPSE,
DPSE_COLL,
EBANK_ADMIN,
EBANQUE_API,
EBANK_CONTROLE,
EBANK_CONTROLE_BATI,
EBANK_CONTROLE_PAIE,
EXP_ADMIN,
EXP_CON,
EXP_VAL,
GESAGENT,
GESCENTRE,
GESCHEF,
IMMAT,
IMMAT_SAISIE,
MINISTRE,
ORDRECHEFDIV,
OTM,
PROGAGENT,
PROGCHEF,
PSTAGENT,
PSTCHEFSEC,
RECAGENT,
RECCHB,
RECCHEF,
RECCHEFDIV,
RECCHEFSEC,
RECNAT,
SUPPORT,
SYSTEME,
VERIFAGENT,
CENTIFAGENT,
EBANQUE_CASAGENT,
EBANQUE_CASAGENT_DIRECT,
EBANQUE_CASCHEF,
ENRAGENT,
ENRCHEF,
AMFRE
INSPECTEUR_GESTIONNAIRE,
ADMIN_FONCTIONNEL,
INSPECTEUR_GESTIONNAIRE_CHEF_SECTEUR,
INSPECTEUR_GESTIONNAIRE_CHEF_SECTION,
INSPECTEUR_GESTIONNAIRE_CHEF_CENTRE
}

View File

@@ -1,281 +1,24 @@
package io.gmss.fiscad.enums;
public enum UserRole {
CREATE_ARRONDISSEMENT,
READ_ARRONDISSEMENT,
UPDATE_ARRONDISSEMENT,
DELETE_ARRONDISSEMENT,
CREATE_COMMUNE,
READ_COMMUNE,
UPDATE_COMMUNE,
DELETE_COMMUNE,
CREATE_DEPARTEMENT,
READ_DEPARTEMENT,
UPDATE_DEPARTEMENT,
DELETE_DEPARTEMENT,
CREATE_NATIONALITE,
READ_NATIONALITE,
UPDATE_NATIONALITE,
DELETE_NATIONALITE,
CREATE_QUARTIER,
READ_QUARTIER,
UPDATE_QUARTIER,
DELETE_QUARTIER,
CREATE_SECTEUR,
READ_SECTEUR,
UPDATE_SECTEUR,
DELETE_SECTEUR,
CREATE_SECTION,
READ_SECTION,
UPDATE_SECTION,
DELETE_SECTION,
CREATE_PARCELLE,
READ_PARCELLE,
UPDATE_PARCELLE,
DELETE_PARCELLE,
CREATE_PERSONNE,
READ_PERSONNE,
UPDATE_PERSONNE,
DELETE_PERSONNE,
CREATE_BATIMENT,
READ_BATIMENT,
UPDATE_BATIMENT,
DELETE_BATIMENT,
CREATE_ACTEURCONCERNE,
READ_ACTEURCONCERNE,
UPDATE_ACTEURCONCERNE,
DELETE_ACTEURCONCERNE,
CREATE_COMMENTAIRE,
READ_COMMENTAIRE,
UPDATE_COMMENTAIRE,
DELETE_COMMENTAIRE,
CREATE_ENQUETE,
READ_ENQUETE,
UPDATE_ENQUETE,
DELETE_ENQUETE,
CREATE_MEMBREGROUPE,
READ_MEMBREGROUPE,
UPDATE_MEMBREGROUPE,
DELETE_MEMBREGROUPE,
CREATE_PARCELLEGEOM,
READ_PARCELLEGEOM,
UPDATE_PARCELLEGEOM,
DELETE_PARCELLEGEOM,
CREATE_PIECE,
READ_PIECE,
UPDATE_PIECE,
DELETE_PIECE,
CREATE_RUE,
READ_RUE,
UPDATE_RUE,
DELETE_RUE,
CREATE_TPE,
READ_TPE,
UPDATE_TPE,
DELETE_TPE,
CREATE_UPLOAD,
READ_UPLOAD,
UPDATE_UPLOAD,
DELETE_UPLOAD,
CREATE_BLOC,
READ_BLOC,
UPDATE_BLOC,
DELETE_BLOC,
CREATE_MODEACQUISITION,
READ_MODEACQUISITION,
UPDATE_MODEACQUISITION,
DELETE_MODEACQUISITION,
CREATE_NATUREDOMAINE,
READ_NATUREDOMAINE,
UPDATE_NATUREDOMAINE,
DELETE_NATUREDOMAINE,
CREATE_POSITIONREPRESENTATION,
READ_POSITIONREPRESENTATION,
UPDATE_POSITIONREPRESENTATION,
DELETE_POSITIONREPRESENTATION,
CREATE_PROFESSION,
READ_PROFESSION,
UPDATE_PROFESSION,
DELETE_PROFESSION,
CREATE_SITUATIONGEOGRAPHIQUE,
READ_SITUATIONGEOGRAPHIQUE,
UPDATE_SITUATIONGEOGRAPHIQUE,
DELETE_SITUATIONGEOGRAPHIQUE,
CREATE_SITUATIONMATRIMONIALE,
READ_SITUATIONMATRIMONIALE,
UPDATE_SITUATIONMATRIMONIALE,
DELETE_SITUATIONMATRIMONIALE,
CREATE_SOURCEDROIT,
READ_SOURCEDROIT,
UPDATE_SOURCEDROIT,
DELETE_SOURCEDROIT,
CREATE_SOURCEDROITEXERCE,
READ_SOURCEDROITEXERCE,
UPDATE_SOURCEDROITEXERCE,
DELETE_SOURCEDROITEXERCE,
CREATE_STRUCTURE,
READ_STRUCTURE,
UPDATE_STRUCTURE,
DELETE_STRUCTURE,
CREATE_TYPECONTESTATION,
READ_TYPECONTESTATION,
UPDATE_TYPECONTESTATION,
DELETE_TYPECONTESTATION,
CREATE_TYPEDOMAINE,
READ_TYPEDOMAINE,
UPDATE_TYPEDOMAINE,
DELETE_TYPEDOMAINE,
CREATE_TYPEPERSONNE,
READ_TYPEPERSONNE,
UPDATE_TYPEPERSONNE,
DELETE_TYPEPERSONNE,
CREATE_TYPEPIECE,
READ_TYPEPIECE,
UPDATE_TYPEPIECE,
DELETE_TYPEPIECE,
CREATE_TYPEREPRESENTATION,
READ_TYPEREPRESENTATION,
UPDATE_TYPEREPRESENTATION,
DELETE_TYPEREPRESENTATION,
CREATE_TYPERUE,
READ_TYPERUE,
UPDATE_TYPERUE,
DELETE_TYPERUE,
CREATE_CARACTERISTIQUEBATIMENT,
READ_CARACTERISTIQUEBATIMENT,
UPDATE_CARACTERISTIQUEBATIMENT,
DELETE_CARACTERISTIQUEBATIMENT,
CREATE_CARACTERISTIQUEPARCELLE,
READ_CARACTERISTIQUEPARCELLE,
UPDATE_CARACTERISTIQUEPARCELLE,
DELETE_CARACTERISTIQUEPARCELLE,
CREATE_CARACTERISTIQUEUNITELOGEMENT,
READ_CARACTERISTIQUEUNITELOGEMENT,
UPDATE_CARACTERISTIQUEUNITELOGEMENT,
DELETE_CARACTERISTIQUEUNITELOGEMENT,
CREATE_COMMUNECENTREASSIGNATION,
READ_COMMUNECENTREASSIGNATION,
UPDATE_COMMUNECENTREASSIGNATION,
DELETE_COMMUNECENTREASSIGNATION,
CREATE_DECLARATIONNC,
READ_DECLARATIONNC,
UPDATE_DECLARATIONNC,
DELETE_DECLARATIONNC,
CREATE_DONNEESIMPOSITIONTFU,
READ_DONNEESIMPOSITIONTFU,
UPDATE_DONNEESIMPOSITIONTFU,
DELETE_DONNEESIMPOSITIONTFU,
CREATE_ENQUETEACTIVITE,
READ_ENQUETEACTIVITE,
UPDATE_ENQUETEACTIVITE,
DELETE_ENQUETEACTIVITE,
CREATE_ENQUETEBATIMENT,
READ_ENQUETEBATIMENT,
UPDATE_ENQUETEBATIMENT,
DELETE_ENQUETEBATIMENT,
CREATE_ENQUETEUNITELOGEMENT,
READ_ENQUETEUNITELOGEMENT,
UPDATE_ENQUETEUNITELOGEMENT,
DELETE_ENQUETEUNITELOGEMENT,
CREATE_IMPOSITIONSTFU,
READ_IMPOSITIONSTFU,
UPDATE_IMPOSITIONSTFU,
DELETE_IMPOSITIONSTFU,
CREATE_SITUATIONFISCALEPARCELLE,
READ_SITUATIONFISCALEPARCELLE,
UPDATE_SITUATIONFISCALEPARCELLE,
DELETE_SITUATIONFISCALEPARCELLE,
CREATE_UNITELOGEMENT,
READ_UNITELOGEMENT,
UPDATE_UNITELOGEMENT,
DELETE_UNITELOGEMENT,
CREATE_BAREMRFUBATI,
READ_BAREMRFUBATI,
UPDATE_BAREMRFUBATI,
DELETE_BAREMRFUBATI,
CREATE_BAREMRFUNONBATI,
READ_BAREMRFUNONBATI,
UPDATE_BAREMRFUNONBATI,
DELETE_BAREMRFUNONBATI,
CREATE_CAMPAGNE,
READ_CAMPAGNE,
UPDATE_CAMPAGNE,
DELETE_CAMPAGNE,
CREATE_CARACTERISTIQUE,
READ_CARACTERISTIQUE,
UPDATE_CARACTERISTIQUE,
DELETE_CARACTERISTIQUE,
CREATE_CATEGORIEBATIMENT,
READ_CATEGORIEBATIMENT,
UPDATE_CATEGORIEBATIMENT,
DELETE_CATEGORIEBATIMENT,
CREATE_EQUIPE,
READ_EQUIPE,
UPDATE_EQUIPE,
DELETE_EQUIPE,
CREATE_EXERCICE,
READ_EXERCICE,
UPDATE_EXERCICE,
DELETE_EXERCICE,
CREATE_PARTICIPER,
READ_PARTICIPER,
UPDATE_PARTICIPER,
DELETE_PARTICIPER,
CREATE_TYPECARACTERISTIQUE,
READ_TYPECARACTERISTIQUE,
UPDATE_TYPECARACTERISTIQUE,
DELETE_TYPECARACTERISTIQUE,
CREATE_USAGE,
READ_USAGE,
UPDATE_USAGE,
DELETE_USAGE,
CREATE_ZONERFU,
READ_ZONERFU,
UPDATE_ZONERFU,
DELETE_ZONERFU,
CREATE_AVOIRFONCTION,
READ_AVOIRFONCTION,
UPDATE_AVOIRFONCTION,
DELETE_AVOIRFONCTION,
CREATE_DEMANDEREINITIALISATIONMP,
READ_DEMANDEREINITIALISATIONMP,
UPDATE_DEMANDEREINITIALISATIONMP,
DELETE_DEMANDEREINITIALISATIONMP,
CREATE_FONCTION,
READ_FONCTION,
UPDATE_FONCTION,
DELETE_FONCTION,
CREATE_PROFILE,
READ_PROFILE,
UPDATE_PROFILE,
DELETE_PROFILE,
CREATE_ROLE,
READ_ROLE,
UPDATE_ROLE,
DELETE_ROLE,
ADMIN,
CREATE_USER,
READ_USER,
UPDATE_USER,
READ_USER,
DELETE_USER,
CREATE_PARAMETERS,
READ_PARAMETERS,
UPDATE_PARAMETERS,
DELETE_PARAMETERS,
CREATE_SECTEUR_DECOUPAGE,
READ_SECTEUR_DECOUPAGE,
UPDATE_SECTEUR_DECOUPAGE,
DELETE_SECTEUR_DECOUPAGE,
CREATE_MODULE,
READ_MODULE,
UPDATE_MODULE,
DELETE_MODULE,
CREATE_FONCTIONNALITE,
READ_FONCTIONNALITE,
UPDATE_FONCTIONNALITE,
DELETE_FONCTIONNALITE,
CREATE_PROFILEMODULEFONCTIONNALITE,
READ_PROFILEMODULEFONCTIONNALITE,
UPDATE_PROFILEMODULEFONCTIONNALITE,
DELETE_PROFILEMODULEFONCTIONNALITE
CREATE_PARCELLE,
UPDATE_PARCELLE,
READ_PARCELLE,
DELETE_PARCELLE,
CREATE_ENQUETE,
UPDATE_ENQUETE,
READ_ENQUETE,
DELETE_ENQUETE,
CREATE_BATIMENT,
UPDATE_BATIMENT,
READ_BATIMENT,
DELETE_BATIMENT
}

View File

@@ -136,7 +136,6 @@ public class SecteurDecoupageServiceImpl implements SecteurDecoupageService {
.map(Secteur::getId)
.toList();
System.out.println(statutEnquete);
System.out.println(secteurIds);
return enqueteBatimentRepository.findStatsEnqueteBatimentBySecteurs(secteurIds,statutEnquete);
}

View File

@@ -1,74 +0,0 @@
package io.gmss.fiscad.implementations.frontend;
import io.gmss.fiscad.entities.frontend.Fonctionnalite;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.frontend.FonctionnaliteService;
import io.gmss.fiscad.paylaods.request.crudweb.FonctionnalitePayloadWeb;
import io.gmss.fiscad.persistence.repositories.frontend.FonctionnaliteRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@AllArgsConstructor
@Service
public class FonctionnaliteServiceImpl implements FonctionnaliteService {
private final FonctionnaliteRepository fonctionnaliteRepository;
private final EntityFromPayLoadService entityFromPayLoadService;
@Override
public FonctionnalitePayloadWeb createFonctionnalite(FonctionnalitePayloadWeb fonctionnalitePayloadWeb) throws BadRequestException {
if (fonctionnalitePayloadWeb.getId() != null) {
throw new BadRequestException("Impossible de créer une nouvelle déclaration NC ayant un id non null.");
}
Fonctionnalite fonctionnalite= entityFromPayLoadService.getFonctionnaliteFromPayloadWeb(fonctionnalitePayloadWeb);
fonctionnalite = fonctionnaliteRepository.save(fonctionnalite);
return fonctionnaliteRepository.findPayloadById(fonctionnalite.getId()).orElse(null);
}
@Override
public FonctionnalitePayloadWeb updateFonctionnalite(Long id, FonctionnalitePayloadWeb fonctionnalitePayloadWeb) throws NotFoundException {
if (fonctionnalitePayloadWeb.getId() == null) {
throw new BadRequestException("La fonctionnaliteApp n'existe pas.");
}
if (!fonctionnaliteRepository.existsById(fonctionnalitePayloadWeb.getId())) {
throw new NotFoundException("La fonctionnaliteApp n'existe pas");
}
Fonctionnalite fonctionnaliteApp = entityFromPayLoadService.getFonctionnaliteFromPayloadWeb(fonctionnalitePayloadWeb);
fonctionnaliteApp =fonctionnaliteRepository.save(fonctionnaliteApp);
return fonctionnaliteRepository.findPayloadById(fonctionnaliteApp.getId()).orElse(null);
}
@Override
public void deleteFonctionnalite(Long id) throws NotFoundException {
Optional<Fonctionnalite> fonctionnaliteOptional = fonctionnaliteRepository.findById(id);
if (fonctionnaliteOptional.isPresent()) {
fonctionnaliteRepository.deleteById(fonctionnaliteOptional.get().getId());
} else {
throw new NotFoundException("Impossible de trouver la fonctionnalite à supprimer .");
}
}
@Override
public List<FonctionnalitePayloadWeb> getFonctionnaliteListToDto() {
return fonctionnaliteRepository.findAllPayload();
}
@Override
public Optional<FonctionnalitePayloadWeb> getFonctionnaliteByIdToDto(Long id) {
return fonctionnaliteRepository.findPayloadById(id);
}
@Override
public List<FonctionnalitePayloadWeb> getAllFonctionnaliteByProfilIdToDto(Long id) {
return fonctionnaliteRepository.findByProfileId(id);
}
}

View File

@@ -1,75 +0,0 @@
package io.gmss.fiscad.implementations.frontend;
import io.gmss.fiscad.entities.frontend.ModuleApp;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.frontend.ModuleService;
import io.gmss.fiscad.paylaods.request.crudweb.ModulePayloadWeb;
import io.gmss.fiscad.persistence.repositories.frontend.ModuleRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@AllArgsConstructor
@Service
public class ModuleServiceImpl implements ModuleService {
private final ModuleRepository moduleRepository;
private final EntityFromPayLoadService entityFromPayLoadService;
@Override
public ModulePayloadWeb createModule(ModulePayloadWeb modulePayloadWeb) throws BadRequestException {
if (modulePayloadWeb.getId() != null) {
throw new BadRequestException("Impossible de créer une nouvelle déclaration NC ayant un id non null.");
}
ModuleApp module= entityFromPayLoadService.getModuleFromPayloadWeb(modulePayloadWeb);
module = moduleRepository.save(module);
return moduleRepository.findPayloadById(module.getId()).orElse(null);
}
@Override
public ModulePayloadWeb updateModule(Long id, ModulePayloadWeb modulePayloadWeb) throws NotFoundException {
if (modulePayloadWeb.getId() == null) {
throw new BadRequestException("La moduleApp n'existe pas.");
}
if (!moduleRepository.existsById(modulePayloadWeb.getId())) {
throw new NotFoundException("La moduleApp n'existe pas");
}
ModuleApp moduleApp = entityFromPayLoadService.getModuleFromPayloadWeb(modulePayloadWeb);
moduleApp =moduleRepository.save(moduleApp);
return moduleRepository.findPayloadById(moduleApp.getId()).orElse(null);
}
@Override
public void deleteModule(Long id) throws NotFoundException {
Optional<ModuleApp> moduleOptional = moduleRepository.findById(id);
if (moduleOptional.isPresent()) {
moduleRepository.deleteById(moduleOptional.get().getId());
} else {
throw new NotFoundException("Impossible de trouver la module à supprimer .");
}
}
@Override
public List<ModulePayloadWeb> getModuleListToDto() {
return moduleRepository.findAllPayload();
}
@Override
public Optional<ModulePayloadWeb> getModuleByIdToDto(Long id) {
return moduleRepository.findPayloadById(id);
}
@Override
public List<ModulePayloadWeb> getAllModuleByProfilIdToDto(Long id) {
return moduleRepository.findPayloadByProfilId(id);
}
}

View File

@@ -121,7 +121,7 @@ public class EnqueteServiceImpl implements EnqueteService {
ParcellePayLoadWeb parcellePayLoadWeb= getParcellePayloadFromEnquetePl(enquetePayLoadWeb);
if(parcellePayLoadWeb.getId()==null){
if(enquetePayLoadWeb.getParcelleId()==null){
parcellePayLoadWeb=parcelleService.createParcelle(parcellePayLoadWeb);
}else{
parcellePayLoadWeb=parcelleService.updateParcelle(parcellePayLoadWeb.getId(),parcellePayLoadWeb);
@@ -138,7 +138,7 @@ public class EnqueteServiceImpl implements EnqueteService {
private ParcellePayLoadWeb getParcellePayloadFromEnquetePl(EnquetePayLoadWeb enquetePayLoadWeb) {
ParcellePayLoadWeb parcellePayLoadWeb=new ParcellePayLoadWeb();
parcellePayLoadWeb.setId(enquetePayLoadWeb.getParcelleId());
parcellePayLoadWeb.setId(enquetePayLoadWeb.getId());
parcellePayLoadWeb.setQ(enquetePayLoadWeb.getParcelleQ());
parcellePayLoadWeb.setI(enquetePayLoadWeb.getParcelleI());
parcellePayLoadWeb.setP(enquetePayLoadWeb.getParcelleP());
@@ -175,6 +175,7 @@ public class EnqueteServiceImpl implements EnqueteService {
throw new BadRequestException("Impossible d'enregistrer une enquête avec une parcelle inexistante");
}
Optional<Parcelle> optionalParcelle=Optional.empty();
Optional<User> optionalUser = userRepository.findById(enquetePayLoadWeb.getEnqueteurId());
if (!optionalUser.isPresent()) {
throw new BadRequestException("Echec de l'enregistrement : Enquêteur inexistant");
@@ -189,17 +190,15 @@ public class EnqueteServiceImpl implements EnqueteService {
throw new BadRequestException("Echec de l'enregistrement : zone inexistante");
}
if(enquetePayLoadWeb.getParcelleId()!=null) {
Optional<Parcelle> optionalParcelle = parcelleRepository.findById(enquetePayLoadWeb.getParcelleId());
if (!optionalParcelle.isPresent()) {
throw new BadRequestException("Echec de l'enregistrement : Parcelle inexistante");
}
if (enquetePayLoadWeb.getParcelleId() == null) {
throw new ApplicationException("Echec de l'enregistrement : La parcelle non renseignée.");
}
ParcellePayLoadWeb parcellePayLoadWeb= getParcellePayloadFromEnquetePl(enquetePayLoadWeb);
if(parcellePayLoadWeb.getId()==null){
if(enquetePayLoadWeb.getParcelleId()==null){
parcellePayLoadWeb=parcelleService.createParcelle(parcellePayLoadWeb);
}else{
parcellePayLoadWeb=parcelleService.updateParcelle(parcellePayLoadWeb.getId(),parcellePayLoadWeb);

View File

@@ -78,13 +78,10 @@ public class ParcelleServiceImpl implements ParcelleService {
@Override
public ParcellePayLoadWeb updateParcelle(Long id, ParcellePayLoadWeb parcellePayLoadWeb) throws NotFoundException {
if(parcellePayLoadWeb.getId()!=null) {
Optional<Parcelle> optionalParcelle = parcelleRepository.findById(parcellePayLoadWeb.getId());
if (!optionalParcelle.isPresent()) {
throw new NotFoundException("Impossible de trouver la parcelle que vous désirer modifier");
}
}
Optional<Parcelle> optionalParcelle = parcelleRepository.findById(parcellePayLoadWeb.getId());
if (!optionalParcelle.isPresent()) {
throw new NotFoundException("Impossible de trouver la parcelle que vous désirer modifier");
}
Parcelle parcelle = new Parcelle();
parcelle = entityFromPayLoadService.getParcelleFromPayload(parcellePayLoadWeb);
parcelle= parcelleRepository.save(parcelle);

View File

@@ -86,11 +86,6 @@ public class PersonneServiceImpl implements PersonneService {
return null;
}
@Override
public Page<PersonnePayLoadWeb> getPersonneListNonAssigneePage(Pageable pageable) {
return personneRepository.findAllPersonneNonAssigneCentreToDto(pageable);
}
@Override
public List<PersonnePayLoadWeb> getPersonneList() {
return null;
@@ -258,28 +253,12 @@ public class PersonneServiceImpl implements PersonneService {
@Override
public List<PersonnePayLoadWeb> recherchePersonne(RecherchePersonneResquestBody request) {
List<PersonnePayLoadWeb> result = new ArrayList<>(
recherchePersonneLocal(request)
);
try {
if(request.getIfu()!=null && !request.getIfu().equals("")){
List<PersonnePayLoadWeb> personnePayLoadWebs =personneRepository.findAllPersonneByIfuToDto(request.getIfu());
if(!personnePayLoadWebs.isEmpty())
return personnePayLoadWebs;
}
if(request.getNpi()!=null && !request.getNpi().equals("")){
List<PersonnePayLoadWeb> personnePayLoadWebs = personneRepository.findAllPersonneByNpiToDto(request.getNpi());
if(!personnePayLoadWebs.isEmpty())
return personnePayLoadWebs;
}
List<PersonnePayLoadWeb> result=new ArrayList<>();
result = recherchePersonneLocal(request);
if (result != null && !result.isEmpty()) {
return result;
}
// Conversion date en String format yyyy-MM-dd
String dateNaissance = Optional.ofNullable(request.getDateNaissance())
.map(d -> d.format(DateTimeFormatter.ISO_LOCAL_DATE))
@@ -322,48 +301,29 @@ public class PersonneServiceImpl implements PersonneService {
personne.setEtatIdentificationPersonne(EtatIdentificationPersonne.IFU);
result.add(personne);
}
return result;
} catch (Exception e) {
return new ArrayList<>();
// logger.error("Erreur appel IFU EN LIGNE", e);
}
return result;
}
// private List<PersonnePayLoadWeb> recherchePersonneLocal(RecherchePersonneResquestBody recherchePersonneResquestBody) {
// System.out.println("NOUS SOMMES DANS RECHERCHE NOM ET PRENOM :"+recherchePersonneResquestBody.getNom()+" "+recherchePersonneResquestBody.getPrenom());
// List<PersonnePayLoadWeb> personnePayLoadWebs=
// personneRepository.findByFiltersInBaseIfuNpiCorrecte(
// recherchePersonneResquestBody.getNom()==null?null: "%"+recherchePersonneResquestBody.getNom().trim().toUpperCase()+"%",
// recherchePersonneResquestBody.getPrenom()==null?null: "%"+recherchePersonneResquestBody.getPrenom().trim().toUpperCase()+"%",
// recherchePersonneResquestBody.getRaisonSociale()==null?null: "%"+recherchePersonneResquestBody.getRaisonSociale().trim().toUpperCase()+"%",
// recherchePersonneResquestBody.getNomMere()==null?null: "%"+recherchePersonneResquestBody.getNomMere().trim().toUpperCase()+"%"
// );
// return personnePayLoadWebs ;
// }
private List<PersonnePayLoadWeb> recherchePersonneLocal(RecherchePersonneResquestBody recherchePersonneResquestBody) {
private List<PersonnePayLoadWeb> recherchePersonneLocal(RecherchePersonneResquestBody request) {
String nom = normalizeLikeParam(request.getNom());
String prenom = normalizeLikeParam(request.getPrenom());
String raisonSociale = normalizeLikeParam(request.getRaisonSociale());
String nomMere = normalizeLikeParam(request.getNomMere());
return personneRepository.findByFiltersInBaseIfuNpiCorrecte(
nom,
prenom,
raisonSociale,
nomMere
);
List<PersonnePayLoadWeb> personnePayLoadWebs=
personneRepository.findByFiltersInBaseIfuNpiCorrecte(
recherchePersonneResquestBody.getIfu()==null?null:recherchePersonneResquestBody.getIfu().trim().toLowerCase(),
recherchePersonneResquestBody.getNpi()==null?null:recherchePersonneResquestBody.getNpi().trim().toLowerCase(),
recherchePersonneResquestBody.getNom()==null?null:recherchePersonneResquestBody.getNom().trim().toLowerCase(),
recherchePersonneResquestBody.getPrenom()==null?null:recherchePersonneResquestBody.getPrenom().trim().toLowerCase(),
recherchePersonneResquestBody.getRaisonSociale()==null?null:recherchePersonneResquestBody.getRaisonSociale().trim().toLowerCase(),
recherchePersonneResquestBody.getNomMere()==null?null:recherchePersonneResquestBody.getNomMere().trim().toLowerCase(),
recherchePersonneResquestBody.getDateNaissance()
);
return personnePayLoadWebs ;
}
private String normalizeLikeParam(String value) {
if (value == null) return null;
String cleaned = value.trim();
if (cleaned.isEmpty()) return null;
return "%" + cleaned.toUpperCase() + "%";
}
private List<PersonnePayLoadWeb> recherchePersonneSigibe(RecherchePersonneResquestBody recherchePersonneResquestBody) {
// callAPIService.callGetIfuEnLigneToken();

View File

@@ -118,14 +118,4 @@ public class BatimentServiceImpl implements BatimentService {
}
}
@Override
public Page<BatimentPaylaodWeb> getBatimentListByquartierPageable(Long quartierId, Pageable pageable) {
return batimentRepository.findAllBatimentsAvecOccupantCourantByQuartierToDtoPageble(quartierId,pageable);
}
@Override
public List<BatimentPaylaodWeb> getBatimentListByquartier(Long quartierId) {
return batimentRepository.findAllBatimentsAvecOccupantCourantByQuartierToDto(quartierId);
}
}

View File

@@ -1,187 +0,0 @@
package io.gmss.fiscad.implementations.rfu.metier;
import io.gmss.fiscad.entities.rfu.metier.CommuneCentreAssignation;
import io.gmss.fiscad.entities.user.User;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.rfu.metier.CommuneCentreAssignationService;
import io.gmss.fiscad.paylaods.request.crudweb.CommuneCentreAssignationPaylaodWeb;
import io.gmss.fiscad.persistence.repositories.decoupage.CommuneRepository;
import io.gmss.fiscad.persistence.repositories.infocad.metier.ParcelleRepository;
import io.gmss.fiscad.persistence.repositories.infocad.parametre.PersonneRepository;
import io.gmss.fiscad.persistence.repositories.infocad.parametre.StructureRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.CommuneCentreAssignationRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import jakarta.ws.rs.NotAcceptableException;
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 CommuneCentreAssignationServiceImpl implements CommuneCentreAssignationService {
private final EntityFromPayLoadService entityFromPayLoadService;
private final CommuneRepository communeRepository;
private final StructureRepository structureRepository ;
private final PersonneRepository personneRepository ;
private final ParcelleRepository parcelleRepository ;
private final CommuneCentreAssignationRepository communeCentreAssignationRepository;
@Override
public CommuneCentreAssignationPaylaodWeb createCommuneCentreAssignation(User user, CommuneCentreAssignationPaylaodWeb communeCentreAssignationPaylaodWeb) throws BadRequestException {
if (user.getStructure() == null) {
throw new BadRequestException("Impossible de créer l'assignation: Votre centre doit être précisé.");
}
if (user.getStructure().getCommune() == null) {
throw new BadRequestException("Impossible de créer un nouveau communeCentreAssignation: votre commune doit être précisée.");
}
if (communeCentreAssignationPaylaodWeb.getPersonneId() == null) {
throw new BadRequestException("Impossible de créer un nouveau communeCentreAssignation: Le contribuable doit être précisée.");
}else {
if(!personneRepository.existsById(communeCentreAssignationPaylaodWeb.getPersonneId()))
throw new BadRequestException("Impossible de créer un nouveau communeCentreAssignation: Le contribuable doit être précisée.");
}
if (communeCentreAssignationPaylaodWeb.getParcelleContactId() == null) {
throw new BadRequestException("Impossible de créer une nouvelle assignation de centre : La parcelle de contact doit être précisée.");
}else {
if(!parcelleRepository.existsById(communeCentreAssignationPaylaodWeb.getParcelleContactId()))
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());
if(communeCentreAssignationPaylaodWeb.getId()==null && communeCentreAssignationPaylaodWebOptional.isPresent()){
throw new NotAcceptableException("Impossible de créer une nouvelle assignation de centre: Le contribuable est déjà assigné au centre : "+communeCentreAssignationPaylaodWebOptional.get().getStructureNom());
}
CommuneCentreAssignation communeCentreAssignation= entityFromPayLoadService.getCommuneCentreAssignationFromPayLoadWeb(communeCentreAssignationPaylaodWeb);
communeCentreAssignation.setStructure(user.getStructure());
communeCentreAssignation.setCommune(user.getStructure().getCommune());
communeCentreAssignation= communeCentreAssignationRepository.save(communeCentreAssignation);
return communeCentreAssignationRepository.findUnique(communeCentreAssignation.getId()).orElse(null);
}
@Override
public CommuneCentreAssignationPaylaodWeb updateCommuneCentreAssignation(Long id,CommuneCentreAssignationPaylaodWeb communeCentreAssignationPaylaodWeb) throws NotFoundException {
if (communeCentreAssignationPaylaodWeb.getId() == null) {
throw new BadRequestException("Impossible de modifier un nouveau communeCentreAssignation ayant un id null.");
}
if (communeCentreAssignationPaylaodWeb.getCommuneId() == null) {
throw new BadRequestException("Impossible de modifier un nouveau communeCentreAssignation: La commune doit être précisée.");
}else {
if(!communeRepository.existsById(communeCentreAssignationPaylaodWeb.getCommuneId()))
throw new BadRequestException("Impossible de modifier un nouveau communeCentreAssignation: La commune doit être précisée.");
}
if (communeCentreAssignationPaylaodWeb.getStructureId() == null) {
throw new BadRequestException("Impossible de modifier un nouveau communeCentreAssignation: Le centre doit être précisée.");
}else {
if(!structureRepository.existsById(communeCentreAssignationPaylaodWeb.getStructureId()))
throw new BadRequestException("Impossible de modifier un nouveau communeCentreAssignation: Le centre doit être précisée.");
}
if (communeCentreAssignationPaylaodWeb.getPersonneId() == null) {
throw new BadRequestException("Impossible de modifier un nouveau communeCentreAssignation: Le contribuable doit être précisée.");
}else {
if(!personneRepository.existsById(communeCentreAssignationPaylaodWeb.getPersonneId()))
throw new BadRequestException("Impossible de modifier un nouveau communeCentreAssignation: Le contribuable doit être précisée.");
}
CommuneCentreAssignation communeCentreAssignation= entityFromPayLoadService.getCommuneCentreAssignationFromPayLoadWeb(communeCentreAssignationPaylaodWeb);
communeCentreAssignation= communeCentreAssignationRepository.save(communeCentreAssignation);
return communeCentreAssignationRepository.findUnique(communeCentreAssignation.getId()).orElse(null);
}
@Override
public CommuneCentreAssignationPaylaodWeb detacherCommuneCentreAssignation(User user, CommuneCentreAssignationPaylaodWeb communeCentreAssignationPaylaodWeb) throws NotFoundException {
if (communeCentreAssignationPaylaodWeb.getId() != null) {
throw new BadRequestException("Impossible de fait de detachement. L'assignation n'est pas précisée");
}
Optional<CommuneCentreAssignation> communeCentreAssignationOptional= communeCentreAssignationRepository.findById(communeCentreAssignationPaylaodWeb.getId());
if (communeCentreAssignationOptional.isEmpty()) {
throw new BadRequestException("Impossible de fait de detachement. L'assignation n'est pas précisée");
}
if(communeCentreAssignationOptional.get().getStructure() != user.getStructure()){
throw new BadRequestException("Impossible de fait de detachement. Le contribuable n'est pas rattaché à votre centre. Veuillez contracter : "+user.getStructure().getNom());
}
communeCentreAssignationOptional.get().setStructure(null);
CommuneCentreAssignation communeCentreAssignation = communeCentreAssignationRepository.save(communeCentreAssignationOptional.get());
return communeCentreAssignationRepository.findUnique(communeCentreAssignation.getId()).orElse(null);
}
@Override
public void deleteCommuneCentreAssignation(Long id) throws NotFoundException {
Optional<CommuneCentreAssignation> communeCentreAssignationOptional = communeCentreAssignationRepository.findById(id);
if (communeCentreAssignationOptional.isPresent()) {
communeCentreAssignationRepository.deleteById(communeCentreAssignationOptional.get().getId());
} else {
throw new NotFoundException("Impossible de trouver le communeCentreAssignation spécifié dans notre base de données.");
}
}
@Override
public Page<CommuneCentreAssignationPaylaodWeb> getCommuneCentreAssignationList(Pageable pageable) {
return communeCentreAssignationRepository.findAllPayload(pageable);
}
@Override
public Page<CommuneCentreAssignationPaylaodWeb> getCommuneCentreAssignationListByCommunePageable(Long communeId, Pageable pageable) {
return communeCentreAssignationRepository.findByCommuneId(communeId,pageable);
}
@Override
public Optional<CommuneCentreAssignationPaylaodWeb> getCommuneCentreAssignationById(Long id) {
if (communeCentreAssignationRepository.existsById(id)) {
return communeCentreAssignationRepository.findUnique(id);
} else {
throw new NotFoundException("Impossible de trouver le centre d'assignation spécifiée dans la base de données.");
}
}
@Override
public Optional<CommuneCentreAssignationPaylaodWeb> getCommuneCentreAssignationByPersonneIdCommune(User user,Long personneId) {
if (user.getStructure() == null) {
throw new BadRequestException("Impossible de récuperer l'assignation: Votre centre doit être précisé.");
}
if (user.getStructure().getCommune() == null) {
throw new BadRequestException("Impossible de récuperer une assignation: votre commune doit être précisée.");
}
if (personneId == null) {
throw new BadRequestException("Impossible de récuperer l'assignation: Le contribuable doit être précisée.");
}else {
if(!personneRepository.existsById(personneId))
throw new BadRequestException("Impossible de récuperer l'assignation: Le contribuable précisée n'existe pas.");
}
Optional<CommuneCentreAssignationPaylaodWeb> communeCentreAssignationPaylaodWebOptional=communeCentreAssignationRepository.findbyCommuneAndPersonne(user.getStructure().getCommune().getId(),personneId);
return communeCentreAssignationPaylaodWebOptional;
}
@Override
public Page<CommuneCentreAssignationPaylaodWeb> getCommuneCentreAssignationListByCentrePageable(Long centreId, Pageable pageable) {
return communeCentreAssignationRepository.findByStructureId(centreId,pageable);
}
}

View File

@@ -38,11 +38,6 @@ public class DeclarationNcServiceImpl implements DeclarationNcService {
if (!structureRepository.existsById(declarationNcPayloadWeb.getStructureId())) {
throw new BadRequestException("Veuillez préciser le centre.");
}
List<DeclarationNcPayloadWeb> declarationNcPayloadWebs= declarationNcRepository.findAllDeclarationNcByNcNotPersonneToDto(declarationNcPayloadWeb.getNc(),declarationNcPayloadWeb.getPersonneId());
if (!declarationNcPayloadWebs.isEmpty()) {
throw new BadRequestException("Ce numéro Contribuable est déjà rattaché à un autre IFU");
}
DeclarationNc declarationNc= entityFromPayLoadService.getDeclarationNcFromPayLoadWeb(declarationNcPayloadWeb);
declarationNc =declarationNcRepository.save(declarationNc);

View File

@@ -109,69 +109,14 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
}
@Override
@Transactional
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleNonBatieUneParcelle(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId,Long parcelleId) {
Integer nb= donneesImpositionTfuRepository.genererDonneesTfuNonBatie(impositionsTfuPaylaodWeb.getId(),userId,parcelleId);
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
impositionsTfu.setStatusAvis(StatusAvis.TFU_FNB_GENERE);
impositionsTfu.setNombreAvisFnb(nb);
impositionsTfuRepository.save(impositionsTfu);
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
}
@Override
@Transactional
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleBatie(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId) {
Integer nbb= donneesImpositionTfuRepository.genererDonneesTfuBatie(impositionsTfuPaylaodWeb.getId(),userId);
Integer nbirfbtPlusieursBati = donneesImpositionTfuRepository.majDonneesTfuBatiePlusieursBatiment(impositionsTfuPaylaodWeb.getId());
Integer nbulo= donneesImpositionTfuRepository.genererDonneesTfuBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId);
Integer nbirfbt= donneesImpositionTfuRepository.genererDonneesIrfBatie(impositionsTfuPaylaodWeb.getId(),userId);
Integer nbirfulo= donneesImpositionTfuRepository.genererDonneesIrfBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId);
Integer nbsrtbbt= donneesImpositionTfuRepository.genererDonneesSrtbBatie(impositionsTfuPaylaodWeb.getId(),userId);
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
impositionsTfu.setStatusAvis(StatusAvis.GENERE);
impositionsTfu.setNombreAvis(nbb+nbulo+ (impositionsTfu.getNombreAvisFnb()==null?0:impositionsTfu.getNombreAvisFnb()));
impositionsTfu.setNombreAvisBatiment(nbb);
impositionsTfu.setNombreAvisUniteLog(nbulo);
impositionsTfuRepository.save(impositionsTfu);
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
}
@Override
@Transactional
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleBatieUneParcelle(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId, Long parcelleId) {
Integer nbb= donneesImpositionTfuRepository.genererDonneesTfuBatie(impositionsTfuPaylaodWeb.getId(),userId,parcelleId);
Integer nbirfbtPlusieursBati = donneesImpositionTfuRepository.majDonneesTfuBatiePlusieursBatiment(impositionsTfuPaylaodWeb.getId(),parcelleId);
Integer nbulo= donneesImpositionTfuRepository.genererDonneesTfuBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId,parcelleId);
Integer nbirfbt= donneesImpositionTfuRepository.genererDonneesIrfBatie(impositionsTfuPaylaodWeb.getId(),userId,parcelleId);
Integer nbirfulo= donneesImpositionTfuRepository.genererDonneesIrfBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId,parcelleId);
Integer nbsrtbbt= donneesImpositionTfuRepository.genererDonneesSrtbBatie(impositionsTfuPaylaodWeb.getId(),userId,parcelleId);
Integer nbMajAcompteRirf= donneesImpositionTfuRepository.majDonneesAcompteRirf(impositionsTfuPaylaodWeb.getId());
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
impositionsTfu.setStatusAvis(StatusAvis.GENERE);
@@ -219,39 +164,4 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable) {
return donneesImpositionTfuRepository.findAllByImpositionTfuIdBatieUniteLogPageable(impositionsTfuId,pageable);
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionIrfIdBatieBatimentPageable(Long impositionsTfuId, Pageable pageable) {
return null;
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionIrfIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable) {
return null;
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionSrtbIdBatieBatimentPageable(Long impositionsTfuId, Pageable pageable) {
return null;
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionSrtbIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable) {
return null;
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureIdPageable(Long exerciceId, Long structureId, Pageable pageable) {
return donneesImpositionTfuRepository.findAllByExericeIdStructureIdPageable(exerciceId,structureId,pageable);
}
@Override
public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureId(Long exerciceId, Long structureId,Long quartierId) {
return donneesImpositionTfuRepository.findAllByExericeIdStructureId(exerciceId,structureId,quartierId);
}
@Override
public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByPersonneId(Long personneId) {
return donneesImpositionTfuRepository.findAllByPersonneId(personneId);
}
}

View File

@@ -60,7 +60,7 @@ public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
}
BatimentPaylaodWeb batimentPaylaodWeb= getBatimentPayloadFromEnqueteBat(enqueteBatimentPayloadWeb);
if(batimentPaylaodWeb.getId()==null){
if(enqueteBatimentPayloadWeb.getBatimentId()==null){
batimentPaylaodWeb=batimentService.createBatiment(batimentPaylaodWeb);
}else{
batimentPaylaodWeb=batimentService.updateBatiment(batimentPaylaodWeb.getId(),batimentPaylaodWeb);
@@ -76,7 +76,7 @@ public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
private BatimentPaylaodWeb getBatimentPayloadFromEnqueteBat(EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) {
BatimentPaylaodWeb batimentPaylaodWeb= new BatimentPaylaodWeb();
batimentPaylaodWeb.setId(enqueteBatimentPayloadWeb.getBatimentId());
batimentPaylaodWeb.setId(enqueteBatimentPayloadWeb.getId());
batimentPaylaodWeb.setNub(enqueteBatimentPayloadWeb.getNub());
batimentPaylaodWeb.setCode(enqueteBatimentPayloadWeb.getCode());
batimentPaylaodWeb.setDateConstruction(enqueteBatimentPayloadWeb.getDateConstruction());
@@ -111,7 +111,7 @@ public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
BatimentPaylaodWeb batimentPaylaodWeb= getBatimentPayloadFromEnqueteBat(enqueteBatimentPayloadWeb);
if(batimentPaylaodWeb.getId()==null){
if(enqueteBatimentPayloadWeb.getBatimentId()==null){
batimentPaylaodWeb=batimentService.createBatiment(batimentPaylaodWeb);
}else{
batimentPaylaodWeb=batimentService.updateBatiment(batimentPaylaodWeb.getId(),batimentPaylaodWeb);

View File

@@ -59,10 +59,10 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
UniteLogementPaylaodWeb uniteLogementPaylaodWeb=getUniteLogementPayloadFromEnqueteUl(enqueteUniteLogementPayloadWeb);
if(uniteLogementPaylaodWeb.getId()==null){
if(enqueteUniteLogementPayloadWeb.getId()==null){
uniteLogementPaylaodWeb= uniteLogementService.createUniteLogement(uniteLogementPaylaodWeb);
}else{
uniteLogementPaylaodWeb= uniteLogementService.updateUniteLogement(uniteLogementPaylaodWeb.getId(),uniteLogementPaylaodWeb);
uniteLogementPaylaodWeb= uniteLogementService.createUniteLogement(uniteLogementPaylaodWeb);
}
enqueteUniteLogementPayloadWeb.setUniteLogementId(uniteLogementPaylaodWeb.getId());
@@ -74,7 +74,7 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
private UniteLogementPaylaodWeb getUniteLogementPayloadFromEnqueteUl(EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) {
UniteLogementPaylaodWeb uniteLogementPaylaodWeb=new UniteLogementPaylaodWeb();
uniteLogementPaylaodWeb.setId(enqueteUniteLogementPayloadWeb.getUniteLogementId());
uniteLogementPaylaodWeb.setId(enqueteUniteLogementPayloadWeb.getId());
uniteLogementPaylaodWeb.setNul(enqueteUniteLogementPayloadWeb.getNul());
uniteLogementPaylaodWeb.setNumeroEtage(enqueteUniteLogementPayloadWeb.getNumeroEtage());
uniteLogementPaylaodWeb.setCode(enqueteUniteLogementPayloadWeb.getCode());
@@ -114,10 +114,10 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
UniteLogementPaylaodWeb uniteLogementPaylaodWeb=getUniteLogementPayloadFromEnqueteUl(enqueteUniteLogementPayloadWeb);
if(uniteLogementPaylaodWeb.getId()==null){
if(enqueteUniteLogementPayloadWeb.getId()==null){
uniteLogementPaylaodWeb= uniteLogementService.createUniteLogement(uniteLogementPaylaodWeb);
}else{
uniteLogementPaylaodWeb= uniteLogementService.updateUniteLogement(uniteLogementPaylaodWeb.getId(),uniteLogementPaylaodWeb);
uniteLogementPaylaodWeb= uniteLogementService.createUniteLogement(uniteLogementPaylaodWeb);
}
enqueteUniteLogementPayloadWeb.setUniteLogementId(uniteLogementPaylaodWeb.getId());

View File

@@ -47,7 +47,7 @@ public class ImpositionsTfuServiceImpl implements ImpositionsTfuService {
}
List<ImpositionsTfu> impositionsTfus=impositionsTfuRepository.getImpositionsTfuByStructureAndExercice(impositionsTfuPaylaodWeb.getStructureId(), impositionsTfuPaylaodWeb.getExerciceId());
if (!impositionsTfus.isEmpty()) {
throw new BadRequestException("Une Imposition non annulée existe déjà ce centre et le même exercice ");
throw new BadRequestException("Une Imposition non annulée existe déjà");
}
List<StatusAvis> statusAvis= new ArrayList<>();
statusAvis.add(StatusAvis.EN_COURS);

View File

@@ -111,14 +111,4 @@ public class UniteLogementServiceImpl implements UniteLogementService {
public List<UniteLogementPaylaodWeb> getUniteLogementListByParcelle(Long parcelleId) {
return uniteLogementRepository.findAllUnitesLogementAvecOccupantCourantByParcelleToDto(parcelleId);
}
@Override
public Page<UniteLogementPaylaodWeb> getUniteLogementListByQuartierPageable(Long quartierId, Pageable pageable) {
return uniteLogementRepository.findUnitesLogementAvecOccupantCourantByQuartierToDtoPageable(quartierId,pageable);
}
@Override
public List<UniteLogementPaylaodWeb> getUniteLogementListByQuartier(Long quartierId) {
return uniteLogementRepository.findUnitesLogementAvecOccupantCourantByQuartierToDto(quartierId);
}
}

View File

@@ -1,77 +0,0 @@
package io.gmss.fiscad.implementations.user;
import io.gmss.fiscad.entities.frontend.Fonctionnalite;
import io.gmss.fiscad.entities.user.ProfileModuleFonctionnalite;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.frontend.FonctionnaliteService;
import io.gmss.fiscad.interfaces.user.ProfileModuleFonctionnaliteService;
import io.gmss.fiscad.paylaods.request.crudweb.ProfileModuleFonctionnalitePayloadWeb;
import io.gmss.fiscad.persistence.repositories.frontend.FonctionnaliteRepository;
import io.gmss.fiscad.persistence.repositories.user.ProfileModuleFonctionnaliteRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@AllArgsConstructor
@Service
public class ProfileModuleFonctionnaliteServiceImpl implements ProfileModuleFonctionnaliteService {
private final ProfileModuleFonctionnaliteRepository profileModuleFonctionnaliteRepository;
private final EntityFromPayLoadService entityFromPayLoadService;
@Override
public ProfileModuleFonctionnalitePayloadWeb createProfileModuleFonctionnalite(ProfileModuleFonctionnalitePayloadWeb profileModuleFonctionnalitePayloadWeb) throws BadRequestException {
if (profileModuleFonctionnalitePayloadWeb.getId() != null) {
throw new BadRequestException("Impossible de créer une nouvelle déclaration NC ayant un id non null.");
}
ProfileModuleFonctionnalite profileModuleFonctionnalite= entityFromPayLoadService.getProfileModuleFonctionnaliteFromPayloadWeb(profileModuleFonctionnalitePayloadWeb);
profileModuleFonctionnalite = profileModuleFonctionnaliteRepository.save(profileModuleFonctionnalite);
return profileModuleFonctionnaliteRepository.findPayloadById(profileModuleFonctionnalite.getId()).orElse(null);
}
@Override
public ProfileModuleFonctionnalitePayloadWeb updateProfileModuleFonctionnalite(Long id, ProfileModuleFonctionnalitePayloadWeb profileModuleFonctionnalitePayloadWeb) throws NotFoundException {
if (profileModuleFonctionnalitePayloadWeb.getId() == null) {
throw new BadRequestException("La fonctionnaliteApp n'existe pas.");
}
if (!profileModuleFonctionnaliteRepository.existsById(profileModuleFonctionnalitePayloadWeb.getId())) {
throw new NotFoundException("La fonctionnaliteApp n'existe pas");
}
ProfileModuleFonctionnalite profileModuleFonctionnalite = entityFromPayLoadService.getProfileModuleFonctionnaliteFromPayloadWeb(profileModuleFonctionnalitePayloadWeb);
profileModuleFonctionnalite =profileModuleFonctionnaliteRepository.save(profileModuleFonctionnalite);
return profileModuleFonctionnaliteRepository.findPayloadById(profileModuleFonctionnalite.getId()).orElse(null);
}
@Override
public void deleteProfileModuleFonctionnalite(Long id) throws NotFoundException {
Optional<ProfileModuleFonctionnalite> profileModuleFonctionnaliteOptional = profileModuleFonctionnaliteRepository.findById(id);
if (profileModuleFonctionnaliteOptional.isPresent()) {
profileModuleFonctionnaliteRepository.deleteById(profileModuleFonctionnaliteOptional.get().getId());
} else {
throw new NotFoundException("Impossible de trouver la fonctionnalite à supprimer .");
}
}
@Override
public List<ProfileModuleFonctionnalitePayloadWeb> getProfileModuleFonctionnaliteListToDto() {
return profileModuleFonctionnaliteRepository.findAllPayload();
}
@Override
public Optional<ProfileModuleFonctionnalitePayloadWeb> getProfileModuleFonctionnaliteByIdToDto(Long id) {
return profileModuleFonctionnaliteRepository.findPayloadById(id);
}
@Override
public List<ProfileModuleFonctionnalitePayloadWeb> getAllProfileModuleFonctionnaliteByProfilIdToDto(Long id) {
return profileModuleFonctionnaliteRepository.findByProfileId(id);
}
}

View File

@@ -1,32 +0,0 @@
package io.gmss.fiscad.interfaces.frontend;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.FonctionnalitePayloadWeb;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Optional;
public interface FonctionnaliteService {
FonctionnalitePayloadWeb createFonctionnalite(FonctionnalitePayloadWeb fonctionnalitePayLoadWeb) throws BadRequestException;
FonctionnalitePayloadWeb updateFonctionnalite(Long id, FonctionnalitePayloadWeb fonctionnalitePayLoadWeb) throws NotFoundException;
void deleteFonctionnalite(Long id) throws NotFoundException;
//Page<FonctionnalitePayloadWeb> getFonctionnaliteListToDtoPageable(Pageable pageable);
List<FonctionnalitePayloadWeb> getFonctionnaliteListToDto();
Optional<FonctionnalitePayloadWeb> getFonctionnaliteByIdToDto(Long id);
//List<FonctionnalitePayloadWeb> getAllFonctionnaliteByEnqueteToDto(Long id);
//Page<FonctionnalitePayloadWeb> getAllFonctionnaliteByEnqueteToDtoPageable(Long id,Pageable pageable);
//List<FonctionnalitePayloadWeb> getAllFonctionnaliteByEnqueteBatimentToDto(Long id);
List<FonctionnalitePayloadWeb> getAllFonctionnaliteByProfilIdToDto(Long id);
}

View File

@@ -1,30 +0,0 @@
package io.gmss.fiscad.interfaces.frontend;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.ModulePayloadWeb;
import io.gmss.fiscad.paylaods.request.crudweb.ModulePayloadWeb;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Optional;
public interface ModuleService {
ModulePayloadWeb createModule(ModulePayloadWeb modulePayLoadWeb) throws BadRequestException;
ModulePayloadWeb updateModule(Long id, ModulePayloadWeb modulePayLoadWeb) throws NotFoundException;
void deleteModule(Long id) throws NotFoundException;
//Page<ModulePayloadWeb> getModuleListToDtoPageable(Pageable pageable);
List<ModulePayloadWeb> getModuleListToDto();
Optional<ModulePayloadWeb> getModuleByIdToDto(Long id);
List<ModulePayloadWeb> getAllModuleByProfilIdToDto(Long id);
}

View File

@@ -21,7 +21,6 @@ public interface PersonneService {
void deletePersonne(Long id) throws NotFoundException;
Page<PersonnePayLoadWeb> getPersonneList(Pageable pageable);
Page<PersonnePayLoadWeb> getPersonneListNonAssigneePage(Pageable pageable);
List<PersonnePayLoadWeb> getPersonneList();

View File

@@ -27,10 +27,4 @@ public interface BatimentService {
List<BatimentPaylaodWeb> getBatimentListByParcelle(Long parcelleId);
Optional<BatimentPaylaodWeb> getBatimentById(Long id);
Page<BatimentPaylaodWeb> getBatimentListByquartierPageable(Long quartierId, Pageable pageable);
List<BatimentPaylaodWeb> getBatimentListByquartier(Long quartierId);
}

View File

@@ -1,38 +0,0 @@
package io.gmss.fiscad.interfaces.rfu.metier;
import io.gmss.fiscad.entities.user.User;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.CommuneCentreAssignationPaylaodWeb;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Optional;
public interface CommuneCentreAssignationService {
CommuneCentreAssignationPaylaodWeb createCommuneCentreAssignation(User user, CommuneCentreAssignationPaylaodWeb communeCentreAssignationPaylaodWeb) throws BadRequestException;
CommuneCentreAssignationPaylaodWeb updateCommuneCentreAssignation(Long id,CommuneCentreAssignationPaylaodWeb communeCentreAssignationPaylaodWeb) throws NotFoundException;
CommuneCentreAssignationPaylaodWeb detacherCommuneCentreAssignation(User user,CommuneCentreAssignationPaylaodWeb communeCentreAssignationPaylaodWeb) throws NotFoundException;
void deleteCommuneCentreAssignation(Long id) throws NotFoundException;
Page<CommuneCentreAssignationPaylaodWeb> getCommuneCentreAssignationList(Pageable pageable);
Page<CommuneCentreAssignationPaylaodWeb> getCommuneCentreAssignationListByCommunePageable(Long communeId, Pageable pageable);
Optional<CommuneCentreAssignationPaylaodWeb> getCommuneCentreAssignationById(Long id);
Optional<CommuneCentreAssignationPaylaodWeb> getCommuneCentreAssignationByPersonneIdCommune(User user,Long personneId);
Page<CommuneCentreAssignationPaylaodWeb> getCommuneCentreAssignationListByCentrePageable(Long centreId, Pageable pageable);
// public CommuneCentreAssignationPaylaodWeb getCommuneCentreAssignationPersonneCommune(User user, Long personneId);
}

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