Compare commits
17 Commits
5094b1a945
...
features/f
| Author | SHA1 | Date | |
|---|---|---|---|
| 23682b2b1d | |||
| 91303f184c | |||
| 35e99b62b8 | |||
| 939c338b22 | |||
| 5169d2d464 | |||
| 6ddcf786c8 | |||
| 8250b2053e | |||
| 649da1940a | |||
| 43ca94c535 | |||
| 668b101d53 | |||
| 7b074663ce | |||
| 06c8b06909 | |||
| ae2f5bd188 | |||
| 71e566da25 | |||
| fc82e6b1df | |||
| ec991b7df9 | |||
| 03f38dfe1c |
@@ -45,6 +45,7 @@ public class ArrondissementController {
|
|||||||
@io.swagger.v3.oas.annotations.responses.ApiResponse(description = "Unauthorized / Invalid Token", responseCode = "403")}
|
@io.swagger.v3.oas.annotations.responses.ApiResponse(description = "Unauthorized / Invalid Token", responseCode = "403")}
|
||||||
)
|
)
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_ARRONDISSEMENT')")
|
||||||
public ResponseEntity<?> createArrondissement(@RequestBody @Valid @Validated Arrondissement arrondissement) {
|
public ResponseEntity<?> createArrondissement(@RequestBody @Valid @Validated Arrondissement arrondissement) {
|
||||||
try {
|
try {
|
||||||
arrondissement = arrondissementService.createArrondissement(arrondissement);
|
arrondissement = arrondissementService.createArrondissement(arrondissement);
|
||||||
@@ -76,6 +77,7 @@ public class ArrondissementController {
|
|||||||
@io.swagger.v3.oas.annotations.responses.ApiResponse(description = "Unauthorized / Invalid Token", responseCode = "403")}
|
@io.swagger.v3.oas.annotations.responses.ApiResponse(description = "Unauthorized / Invalid Token", responseCode = "403")}
|
||||||
)
|
)
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ARRONDISSEMENT')")
|
||||||
public ResponseEntity<?> updateArrondissement(@PathVariable Long id, @RequestBody Arrondissement arrondissement) {
|
public ResponseEntity<?> updateArrondissement(@PathVariable Long id, @RequestBody Arrondissement arrondissement) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -99,6 +101,7 @@ public class ArrondissementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_ARRONDISSEMENT')")
|
||||||
public ResponseEntity<?> deleteArrondissement(@PathVariable Long id) {
|
public ResponseEntity<?> deleteArrondissement(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
arrondissementService.deleteArrondissement(id);
|
arrondissementService.deleteArrondissement(id);
|
||||||
@@ -123,6 +126,7 @@ public class ArrondissementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ARRONDISSEMENT')")
|
||||||
public ResponseEntity<?> getAllArrondissementList() {
|
public ResponseEntity<?> getAllArrondissementList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -147,6 +151,7 @@ public class ArrondissementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ARRONDISSEMENT')")
|
||||||
public ResponseEntity<?> getAllArrondissementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllArrondissementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -172,6 +177,7 @@ public class ArrondissementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ARRONDISSEMENT')")
|
||||||
public ResponseEntity<?> getArrondissementById(@PathVariable Long id) {
|
public ResponseEntity<?> getArrondissementById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -196,6 +202,7 @@ public class ArrondissementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/commune/{communeId}")
|
@GetMapping("/commune/{communeId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ARRONDISSEMENT')")
|
||||||
public ResponseEntity<?> getArrondissementByCommune(@PathVariable Long communeId) {
|
public ResponseEntity<?> getArrondissementByCommune(@PathVariable Long communeId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -219,6 +226,7 @@ public class ArrondissementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page/commune/{communeId}")
|
@GetMapping("/page/commune/{communeId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ARRONDISSEMENT')")
|
||||||
public ResponseEntity<?> getArrondissementByCommune(@PathVariable Long communeId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getArrondissementByCommune(@PathVariable Long communeId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public class CommuneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_COMMUNE')")
|
||||||
public ResponseEntity<?> createCommune(@RequestBody @Valid @Validated Commune commune) {
|
public ResponseEntity<?> createCommune(@RequestBody @Valid @Validated Commune commune) {
|
||||||
try {
|
try {
|
||||||
commune = communeService.createCommune(commune);
|
commune = communeService.createCommune(commune);
|
||||||
@@ -62,6 +63,7 @@ public class CommuneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_COMMUNE')")
|
||||||
public ResponseEntity<?> updateCommune(@PathVariable Long id, @RequestBody Commune commune) {
|
public ResponseEntity<?> updateCommune(@PathVariable Long id, @RequestBody Commune commune) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -85,6 +87,7 @@ public class CommuneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_COMMUNE')")
|
||||||
public ResponseEntity<?> deleteCommuner(@PathVariable Long id) {
|
public ResponseEntity<?> deleteCommuner(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
communeService.deleteCommune(id);
|
communeService.deleteCommune(id);
|
||||||
@@ -109,6 +112,7 @@ public class CommuneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_COMMUNE')")
|
||||||
public ResponseEntity<?> getAllCommuneList() {
|
public ResponseEntity<?> getAllCommuneList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -133,6 +137,7 @@ public class CommuneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_COMMUNE')")
|
||||||
public ResponseEntity<?> getAllCommunePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllCommunePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -158,6 +163,7 @@ public class CommuneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_COMMUNE')")
|
||||||
public ResponseEntity<?> getCommuneById(@PathVariable Long id) {
|
public ResponseEntity<?> getCommuneById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -181,6 +187,7 @@ public class CommuneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/departement/{departementId}")
|
@GetMapping("/departement/{departementId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_COMMUNE')")
|
||||||
public ResponseEntity<?> getCommuneByDepartement(@PathVariable Long departementId) {
|
public ResponseEntity<?> getCommuneByDepartement(@PathVariable Long departementId) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -205,6 +212,7 @@ public class CommuneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page/by-departement-id/{departementId}")
|
@GetMapping("/page/by-departement-id/{departementId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_COMMUNE')")
|
||||||
public ResponseEntity<?> getCommuneByDepartementIdPaged(@PathVariable Long departementId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getCommuneByDepartementIdPaged(@PathVariable Long departementId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class DepartementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_DEPARTEMENT')")
|
||||||
public ResponseEntity<?> createDepartement(@RequestBody @Valid @Validated Departement departement) {
|
public ResponseEntity<?> createDepartement(@RequestBody @Valid @Validated Departement departement) {
|
||||||
try {
|
try {
|
||||||
departement = departementService.createDepartement(departement);
|
departement = departementService.createDepartement(departement);
|
||||||
@@ -61,6 +62,7 @@ public class DepartementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_DEPARTEMENT')")
|
||||||
public ResponseEntity<?> updateDepartement(@PathVariable Long id, @RequestBody Departement departement) {
|
public ResponseEntity<?> updateDepartement(@PathVariable Long id, @RequestBody Departement departement) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class DepartementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_DEPARTEMENT')")
|
||||||
public ResponseEntity<?> deleteDepartementr(@PathVariable Long id) {
|
public ResponseEntity<?> deleteDepartementr(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
departementService.deleteDepartement(id);
|
departementService.deleteDepartement(id);
|
||||||
@@ -108,6 +111,7 @@ public class DepartementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DEPARTEMENT')")
|
||||||
public ResponseEntity<?> getAllDepartementList() {
|
public ResponseEntity<?> getAllDepartementList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -132,6 +136,7 @@ public class DepartementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DEPARTEMENT')")
|
||||||
public ResponseEntity<?> getAllDepartementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllDepartementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -157,6 +162,7 @@ public class DepartementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DEPARTEMENT')")
|
||||||
public ResponseEntity<?> getDepartementById(@PathVariable Long id) {
|
public ResponseEntity<?> getDepartementById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class NationaliteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_NATIONALITE')")
|
||||||
public ResponseEntity<?> createNationalite(@RequestBody @Valid @Validated Nationalite nationalite) {
|
public ResponseEntity<?> createNationalite(@RequestBody @Valid @Validated Nationalite nationalite) {
|
||||||
try {
|
try {
|
||||||
nationalite = nationaliteService.createNationalite(nationalite);
|
nationalite = nationaliteService.createNationalite(nationalite);
|
||||||
@@ -61,6 +62,7 @@ public class NationaliteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_NATIONALITE')")
|
||||||
public ResponseEntity<?> updateNationalite(@PathVariable Long id, @RequestBody Nationalite nationalite) {
|
public ResponseEntity<?> updateNationalite(@PathVariable Long id, @RequestBody Nationalite nationalite) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class NationaliteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_NATIONALITE')")
|
||||||
public ResponseEntity<?> deleteNationaliter(@PathVariable Long id) {
|
public ResponseEntity<?> deleteNationaliter(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
nationaliteService.deleteNationalite(id);
|
nationaliteService.deleteNationalite(id);
|
||||||
@@ -108,6 +111,7 @@ public class NationaliteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_NATIONALITE')")
|
||||||
public ResponseEntity<?> getAllNationaliteList() {
|
public ResponseEntity<?> getAllNationaliteList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +135,7 @@ public class NationaliteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_NATIONALITE')")
|
||||||
public ResponseEntity<?> getAllNationalitePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllNationalitePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -156,6 +161,7 @@ public class NationaliteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_NATIONALITE')")
|
||||||
public ResponseEntity<?> getNationaliteById(@PathVariable Long id) {
|
public ResponseEntity<?> getNationaliteById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class QuartierController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_QUARTIER')")
|
||||||
public ResponseEntity<?> createQuartier(@RequestBody @Valid @Validated Quartier quartier) {
|
public ResponseEntity<?> createQuartier(@RequestBody @Valid @Validated Quartier quartier) {
|
||||||
try {
|
try {
|
||||||
quartier = quartierService.createQuartier(quartier);
|
quartier = quartierService.createQuartier(quartier);
|
||||||
@@ -61,6 +62,7 @@ public class QuartierController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_QUARTIER')")
|
||||||
public ResponseEntity<?> updateQuartier(@PathVariable Long id, @RequestBody Quartier quartier) {
|
public ResponseEntity<?> updateQuartier(@PathVariable Long id, @RequestBody Quartier quartier) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class QuartierController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_QUARTIER')")
|
||||||
public ResponseEntity<?> deleteQuartier(@PathVariable Long id) {
|
public ResponseEntity<?> deleteQuartier(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
quartierService.deleteQuartier(id);
|
quartierService.deleteQuartier(id);
|
||||||
@@ -108,6 +111,7 @@ public class QuartierController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_QUARTIER')")
|
||||||
public ResponseEntity<?> getAllQuartierList() {
|
public ResponseEntity<?> getAllQuartierList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +135,7 @@ public class QuartierController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_QUARTIER')")
|
||||||
public ResponseEntity<?> getAllQuartierPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllQuartierPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +160,7 @@ public class QuartierController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_QUARTIER')")
|
||||||
public ResponseEntity<?> getQuartierById(@PathVariable Long id) {
|
public ResponseEntity<?> getQuartierById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -178,6 +184,7 @@ public class QuartierController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/arrondissement/{arrondissementId}")
|
@GetMapping("/arrondissement/{arrondissementId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_QUARTIER')")
|
||||||
public ResponseEntity<?> getQuartierByArrondissement(@PathVariable Long arrondissementId) {
|
public ResponseEntity<?> getQuartierByArrondissement(@PathVariable Long arrondissementId) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -202,6 +209,7 @@ public class QuartierController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page/arrondissement/{arrondissementId}")
|
@GetMapping("/page/arrondissement/{arrondissementId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_QUARTIER')")
|
||||||
public ResponseEntity<?> getQuartierByArrondissementPaged(@PathVariable Long arrondissementId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getQuartierByArrondissementPaged(@PathVariable Long arrondissementId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ public class SecteurController {
|
|||||||
description = "Permet de Créer un secteur"
|
description = "Permet de Créer un secteur"
|
||||||
)
|
)
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_SECTEUR')")
|
||||||
public ResponseEntity<?> createSecteur(@RequestBody @Valid @Validated SecteurPaylaodWeb secteurPaylaodWeb) {
|
public ResponseEntity<?> createSecteur(@RequestBody @Valid @Validated SecteurPaylaodWeb secteurPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
secteurPaylaodWeb = secteurService.createSecteur(secteurPaylaodWeb);
|
secteurPaylaodWeb = secteurService.createSecteur(secteurPaylaodWeb);
|
||||||
@@ -70,6 +71,7 @@ public class SecteurController {
|
|||||||
description = "Permet de modifier un secteur"
|
description = "Permet de modifier un secteur"
|
||||||
)
|
)
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_SECTEUR')")
|
||||||
public ResponseEntity<?> updateSecteur(@PathVariable Long id, @RequestBody SecteurPaylaodWeb secteurPayloadWeb) {
|
public ResponseEntity<?> updateSecteur(@PathVariable Long id, @RequestBody SecteurPaylaodWeb secteurPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -96,6 +98,7 @@ public class SecteurController {
|
|||||||
description = "Permet de supprimer un secteur"
|
description = "Permet de supprimer un secteur"
|
||||||
)
|
)
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_SECTEUR')")
|
||||||
public ResponseEntity<?> deleteSecteurr(@PathVariable Long id) {
|
public ResponseEntity<?> deleteSecteurr(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
secteurService.deleteSecteur(id);
|
secteurService.deleteSecteur(id);
|
||||||
@@ -123,6 +126,7 @@ public class SecteurController {
|
|||||||
description = "Permet de récuperer l'ensemble des secteurs"
|
description = "Permet de récuperer l'ensemble des secteurs"
|
||||||
)
|
)
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR')")
|
||||||
public ResponseEntity<?> getAllSecteurList() {
|
public ResponseEntity<?> getAllSecteurList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -150,6 +154,7 @@ public class SecteurController {
|
|||||||
description = "Permet de récuperer l'ensemble des secteurs avec pagination"
|
description = "Permet de récuperer l'ensemble des secteurs avec pagination"
|
||||||
)
|
)
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR')")
|
||||||
public ResponseEntity<?> getAllSecteurPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllSecteurPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -178,6 +183,7 @@ public class SecteurController {
|
|||||||
description = "Permet de récuperer le secteur ayant l'ID fournie en path"
|
description = "Permet de récuperer le secteur ayant l'ID fournie en path"
|
||||||
)
|
)
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR')")
|
||||||
public ResponseEntity<?> getSecteurById(@PathVariable Long id) {
|
public ResponseEntity<?> getSecteurById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -205,6 +211,7 @@ public class SecteurController {
|
|||||||
description = "Permet de récuperer l'ensemble des secteurs de la structure dont l'ID est fourni en path"
|
description = "Permet de récuperer l'ensemble des secteurs de la structure dont l'ID est fourni en path"
|
||||||
)
|
)
|
||||||
@GetMapping("/by-structure-id/{structureId}")
|
@GetMapping("/by-structure-id/{structureId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR')")
|
||||||
public ResponseEntity<?> getSecteurByStructureId(@PathVariable Long structureId) {
|
public ResponseEntity<?> getSecteurByStructureId(@PathVariable Long structureId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -233,6 +240,7 @@ public class SecteurController {
|
|||||||
description = "Permet de récuperer l'ensemble des secteurs de la structure dont l'ID est fourni en path avec pagination"
|
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}")
|
@GetMapping("/page/by-structure-id/{structureId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR')")
|
||||||
public ResponseEntity<?> getSecteurByStructureIdPage(@PathVariable Long structureId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getSecteurByStructureIdPage(@PathVariable Long structureId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -263,6 +271,7 @@ public class SecteurController {
|
|||||||
description = "Permet de récuperer l'ensemble des secteurs de la section dont l'ID est fourni en path"
|
description = "Permet de récuperer l'ensemble des secteurs de la section dont l'ID est fourni en path"
|
||||||
)
|
)
|
||||||
@GetMapping("/by-section-id/{sectionId}")
|
@GetMapping("/by-section-id/{sectionId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR')")
|
||||||
public ResponseEntity<?> getSecteurBySectionId(@PathVariable Long sectionId) {
|
public ResponseEntity<?> getSecteurBySectionId(@PathVariable Long sectionId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -291,6 +300,7 @@ public class SecteurController {
|
|||||||
description = "Permet de récuperer l'ensemble des secteurs de la section dont l'ID est fourni en path avec pagination"
|
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}")
|
@GetMapping("/page/by-section-id/{sectionId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR')")
|
||||||
public ResponseEntity<?> getSecteurBySectionIdPage(@PathVariable Long sectionId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getSecteurBySectionIdPage(@PathVariable Long sectionId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -320,6 +330,7 @@ public class SecteurController {
|
|||||||
description = "Permet de récuperer l'ensemble des secteurs du departement dont l'ID est fourni en path"
|
description = "Permet de récuperer l'ensemble des secteurs du departement dont l'ID est fourni en path"
|
||||||
)
|
)
|
||||||
@GetMapping("/by-departement-id/{departementId}")
|
@GetMapping("/by-departement-id/{departementId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR')")
|
||||||
public ResponseEntity<?> getSecteurByDepartementId(@PathVariable Long departementId) {
|
public ResponseEntity<?> getSecteurByDepartementId(@PathVariable Long departementId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class SecteurDecoupageController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> createSecteurDecoupage(@RequestBody @Valid @Validated SecteurDecoupagePaylaodWeb secteurDecoupagePaylaodWeb) {
|
public ResponseEntity<?> createSecteurDecoupage(@RequestBody @Valid @Validated SecteurDecoupagePaylaodWeb secteurDecoupagePaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
secteurDecoupagePaylaodWeb = secteurDecoupageService.createSecteurDecoupage(secteurDecoupagePaylaodWeb);
|
secteurDecoupagePaylaodWeb = secteurDecoupageService.createSecteurDecoupage(secteurDecoupagePaylaodWeb);
|
||||||
@@ -61,6 +62,7 @@ public class SecteurDecoupageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> updateSecteurDecoupage(@PathVariable Long id, @RequestBody SecteurDecoupagePaylaodWeb secteurDecoupagePaylaodWeb) {
|
public ResponseEntity<?> updateSecteurDecoupage(@PathVariable Long id, @RequestBody SecteurDecoupagePaylaodWeb secteurDecoupagePaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class SecteurDecoupageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> deleteSecteurDecoupager(@PathVariable Long id) {
|
public ResponseEntity<?> deleteSecteurDecoupager(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
secteurDecoupageService.deleteSecteurDecoupage(id);
|
secteurDecoupageService.deleteSecteurDecoupage(id);
|
||||||
@@ -108,6 +111,7 @@ public class SecteurDecoupageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getAllSecteurDecoupageList() {
|
public ResponseEntity<?> getAllSecteurDecoupageList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +135,7 @@ public class SecteurDecoupageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getAllSecteurDecoupagePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllSecteurDecoupagePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +160,7 @@ public class SecteurDecoupageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/by-secteur-id/{secteurId}")
|
@GetMapping("/by-secteur-id/{secteurId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getAllSecteurDecoupageListBySecteurId(@PathVariable Long secteurId) {
|
public ResponseEntity<?> getAllSecteurDecoupageListBySecteurId(@PathVariable Long secteurId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -178,6 +184,7 @@ public class SecteurDecoupageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page/by-secteur-decoupage-id/{secteurId}")
|
@GetMapping("/page/by-secteur-decoupage-id/{secteurId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getAllSecteurDecoupageListBySecteurIdPaged(@PathVariable Long secteurId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllSecteurDecoupageListBySecteurIdPaged(@PathVariable Long secteurId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -202,6 +209,7 @@ public class SecteurDecoupageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getSecteurDecoupageById(@PathVariable Long id) {
|
public ResponseEntity<?> getSecteurDecoupageById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -226,6 +234,7 @@ public class SecteurDecoupageController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/arbre/user-id/{userId}")
|
@GetMapping("/arbre/user-id/{userId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getArborescenceByUserId(@PathVariable Long userId) {
|
public ResponseEntity<?> getArborescenceByUserId(@PathVariable Long userId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -250,6 +259,7 @@ public class SecteurDecoupageController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/arbre/enquete-en-cours/user-id/{userId}")
|
@GetMapping("/arbre/enquete-en-cours/user-id/{userId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getArborescenceEnqueteEncoursByUserId(@PathVariable Long userId) {
|
public ResponseEntity<?> getArborescenceEnqueteEncoursByUserId(@PathVariable Long userId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -274,6 +284,7 @@ public class SecteurDecoupageController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/arbre/enquete-valide/user-id/{userId}")
|
@GetMapping("/arbre/enquete-valide/user-id/{userId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getArborescenceEnqueteValideByUserId(@PathVariable Long userId) {
|
public ResponseEntity<?> getArborescenceEnqueteValideByUserId(@PathVariable Long userId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -298,6 +309,7 @@ public class SecteurDecoupageController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/arbre/enquete-cloture/user-id/{userId}")
|
@GetMapping("/arbre/enquete-cloture/user-id/{userId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getArborescenceEnqueteClotureByUserId(@PathVariable Long userId) {
|
public ResponseEntity<?> getArborescenceEnqueteClotureByUserId(@PathVariable Long userId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -323,6 +335,7 @@ public class SecteurDecoupageController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/arbre/enquete-batiment-en-cours/user-id/{userId}")
|
@GetMapping("/arbre/enquete-batiment-en-cours/user-id/{userId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getArborescenceEnqueteBatimentEncoursByUserId(@PathVariable Long userId) {
|
public ResponseEntity<?> getArborescenceEnqueteBatimentEncoursByUserId(@PathVariable Long userId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -347,6 +360,7 @@ public class SecteurDecoupageController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/arbre/enquete-batiment-valide/user-id/{userId}")
|
@GetMapping("/arbre/enquete-batiment-valide/user-id/{userId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getArborescenceEnqueteBatimentValideByUserId(@PathVariable Long userId) {
|
public ResponseEntity<?> getArborescenceEnqueteBatimentValideByUserId(@PathVariable Long userId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -371,6 +385,7 @@ public class SecteurDecoupageController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/arbre/enquete-batiment-cloture/user-id/{userId}")
|
@GetMapping("/arbre/enquete-batiment-cloture/user-id/{userId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getArborescenceEnqueteBatimentClotureByUserId(@PathVariable Long userId) {
|
public ResponseEntity<?> getArborescenceEnqueteBatimentClotureByUserId(@PathVariable Long userId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -395,6 +410,7 @@ public class SecteurDecoupageController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/arbre/enquete-unitlog-en-cours/user-id/{userId}")
|
@GetMapping("/arbre/enquete-unitlog-en-cours/user-id/{userId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getArborescenceEnqueteUniteLogEncoursByUserId(@PathVariable Long userId) {
|
public ResponseEntity<?> getArborescenceEnqueteUniteLogEncoursByUserId(@PathVariable Long userId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -419,6 +435,7 @@ public class SecteurDecoupageController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/arbre/enquete-unitlog-valide/user-id/{userId}")
|
@GetMapping("/arbre/enquete-unitlog-valide/user-id/{userId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getArborescenceEnqueteUniteLogValideByUserId(@PathVariable Long userId) {
|
public ResponseEntity<?> getArborescenceEnqueteUniteLogValideByUserId(@PathVariable Long userId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -443,6 +460,7 @@ public class SecteurDecoupageController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/arbre/enquete-unitlog-cloture/user-id/{userId}")
|
@GetMapping("/arbre/enquete-unitlog-cloture/user-id/{userId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||||
public ResponseEntity<?> getArborescenceEnqueteUniteLigClotureByUserId(@PathVariable Long userId) {
|
public ResponseEntity<?> getArborescenceEnqueteUniteLigClotureByUserId(@PathVariable Long userId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -39,6 +40,7 @@ public class SectionController {
|
|||||||
description = "Permet de Créer un section"
|
description = "Permet de Créer un section"
|
||||||
)
|
)
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_SECTION')")
|
||||||
public ResponseEntity<?> createSection(@RequestBody @Valid @Validated SectionPaylaodWeb sectionPaylaodWeb) {
|
public ResponseEntity<?> createSection(@RequestBody @Valid @Validated SectionPaylaodWeb sectionPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
sectionPaylaodWeb = sectionService.createSection(sectionPaylaodWeb);
|
sectionPaylaodWeb = sectionService.createSection(sectionPaylaodWeb);
|
||||||
@@ -67,6 +69,7 @@ public class SectionController {
|
|||||||
description = "Permet de modifier un section"
|
description = "Permet de modifier un section"
|
||||||
)
|
)
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_SECTION')")
|
||||||
public ResponseEntity<?> updateSection(@PathVariable Long id, @RequestBody SectionPaylaodWeb sectionPayloadWeb) {
|
public ResponseEntity<?> updateSection(@PathVariable Long id, @RequestBody SectionPaylaodWeb sectionPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -93,6 +96,7 @@ public class SectionController {
|
|||||||
description = "Permet de supprimer un section"
|
description = "Permet de supprimer un section"
|
||||||
)
|
)
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_SECTION')")
|
||||||
public ResponseEntity<?> deleteSection(@PathVariable Long id) {
|
public ResponseEntity<?> deleteSection(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
sectionService.deleteSection(id);
|
sectionService.deleteSection(id);
|
||||||
@@ -120,6 +124,7 @@ public class SectionController {
|
|||||||
description = "Permet de récuperer l'ensemble des sections"
|
description = "Permet de récuperer l'ensemble des sections"
|
||||||
)
|
)
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTION')")
|
||||||
public ResponseEntity<?> getAllSectionList() {
|
public ResponseEntity<?> getAllSectionList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -147,6 +152,7 @@ public class SectionController {
|
|||||||
description = "Permet de récuperer l'ensemble des sections avec pagination"
|
description = "Permet de récuperer l'ensemble des sections avec pagination"
|
||||||
)
|
)
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTION')")
|
||||||
public ResponseEntity<?> getAllSectionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllSectionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -175,6 +181,7 @@ public class SectionController {
|
|||||||
description = "Permet de récuperer le section ayant l'ID fournie en path"
|
description = "Permet de récuperer le section ayant l'ID fournie en path"
|
||||||
)
|
)
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTION')")
|
||||||
public ResponseEntity<?> getSectionById(@PathVariable Long id) {
|
public ResponseEntity<?> getSectionById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -202,6 +209,7 @@ public class SectionController {
|
|||||||
description = "Permet de récuperer l'ensemble des sections de la structure dont l'ID est fourni en path"
|
description = "Permet de récuperer l'ensemble des sections de la structure dont l'ID est fourni en path"
|
||||||
)
|
)
|
||||||
@GetMapping("/by-structure-id/{structureId}")
|
@GetMapping("/by-structure-id/{structureId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTION')")
|
||||||
public ResponseEntity<?> getSectionByStructureId(@PathVariable Long structureId) {
|
public ResponseEntity<?> getSectionByStructureId(@PathVariable Long structureId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -230,6 +238,7 @@ public class SectionController {
|
|||||||
description = "Permet de récuperer l'ensemble des sections de la structure dont l'ID est fourni en path avec pagination"
|
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}")
|
@GetMapping("/page/by-structure-id/{structureId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SECTION')")
|
||||||
public ResponseEntity<?> getSectionByStructureIdPage(@PathVariable Long structureId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getSectionByStructureIdPage(@PathVariable Long structureId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|||||||
@@ -0,0 +1,183 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,185 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Actuer concerné")
|
@Tag(name = "Actuer concerné")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class ActeurConcerneController {
|
public class ActeurConcerneController {
|
||||||
|
|
||||||
private final ActeurConcerneService acteurConcerneService;
|
private final ActeurConcerneService acteurConcerneService;
|
||||||
@@ -36,6 +36,7 @@ public class ActeurConcerneController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ACTEURCONCERNE')")
|
||||||
public ResponseEntity<?> getArrondissementById(@PathVariable Long id) {
|
public ResponseEntity<?> getArrondissementById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -58,6 +59,7 @@ public class ActeurConcerneController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@GetMapping("/get-details/{id}")
|
@GetMapping("/get-details/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ACTEURCONCERNE')")
|
||||||
public ResponseEntity<?> getDetails(@PathVariable Long id) {
|
public ResponseEntity<?> getDetails(@PathVariable Long id) {
|
||||||
try{
|
try{
|
||||||
PersonneCompletDTO personneCompletDTO = personneService.getPersonneComplete(id);
|
PersonneCompletDTO personneCompletDTO = personneService.getPersonneComplete(id);
|
||||||
|
|||||||
@@ -39,8 +39,9 @@ public class CommentaireController {
|
|||||||
this.commentaireService = commentaireService;
|
this.commentaireService = commentaireService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_COMMENTAIRE')")
|
||||||
public ResponseEntity<?> createcommentaire(@RequestBody @Valid @Validated Commentaire commentaire) {
|
public ResponseEntity<?> createcommentaire(@RequestBody @Valid @Validated Commentaire commentaire) {
|
||||||
try {
|
try {
|
||||||
commentaire.setDateCommentaire(LocalDateTime.now());
|
commentaire.setDateCommentaire(LocalDateTime.now());
|
||||||
@@ -64,8 +65,9 @@ public class CommentaireController {
|
|||||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_COMMENTAIRE')")
|
||||||
public ResponseEntity<?> updatecommentaire(@PathVariable Long id, @RequestBody Commentaire commentaire) {
|
public ResponseEntity<?> updatecommentaire(@PathVariable Long id, @RequestBody Commentaire commentaire) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -87,8 +89,9 @@ public class CommentaireController {
|
|||||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_COMMENTAIRE')")
|
||||||
public ResponseEntity<?> deletecommentaire(@PathVariable Long id) {
|
public ResponseEntity<?> deletecommentaire(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
commentaireService.deleteCommentaire(id);
|
commentaireService.deleteCommentaire(id);
|
||||||
@@ -111,8 +114,9 @@ public class CommentaireController {
|
|||||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_COMMENTAIRE')")
|
||||||
public ResponseEntity<?> getAllcommentaireList() {
|
public ResponseEntity<?> getAllcommentaireList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -134,8 +138,9 @@ public class CommentaireController {
|
|||||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_COMMENTAIRE')")
|
||||||
public ResponseEntity<?> getcommentaireById(@PathVariable Long id) {
|
public ResponseEntity<?> getcommentaireById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -157,8 +162,9 @@ public class CommentaireController {
|
|||||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
@GetMapping("/nup/{nup}")
|
@GetMapping("/nup/{nup}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_COMMENTAIRE')")
|
||||||
public ResponseEntity<?> getcommentaireByNup(@PathVariable String nup) {
|
public ResponseEntity<?> getcommentaireByNup(@PathVariable String nup) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -180,8 +186,9 @@ public class CommentaireController {
|
|||||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
@PostMapping("/enquete")
|
@PostMapping("/enquete")
|
||||||
|
@PreAuthorize("hasAuthority('READ_COMMENTAIRE')")
|
||||||
public ResponseEntity<?> getcommentaireByEnquete(@RequestBody Commentaire commentaire) {
|
public ResponseEntity<?> getcommentaireByEnquete(@RequestBody Commentaire commentaire) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -203,8 +210,9 @@ public class CommentaireController {
|
|||||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
@PostMapping("/enquete-and-state")
|
@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")
|
//@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) {
|
public ResponseEntity<?> getcommentaireByEnqueteAndStatut(@RequestBody Commentaire commentaire) {
|
||||||
try {
|
try {
|
||||||
@@ -227,8 +235,9 @@ public class CommentaireController {
|
|||||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
@PostMapping("/all-by-params")
|
@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")
|
//@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) {
|
public ResponseEntity<?> getcommentaireByParams(@RequestBody CommentaireRequest commentaireRequest) {
|
||||||
try {
|
try {
|
||||||
@@ -253,6 +262,7 @@ public class CommentaireController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("synchronise/from-mobile")
|
@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.")
|
//@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) {
|
public ResponseEntity<?> synchroniseCommentairesFromMobile(@RequestBody List<Commentaire> commentaires) {
|
||||||
try {
|
try {
|
||||||
@@ -277,6 +287,7 @@ public class CommentaireController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("synchronise/from-web")
|
@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")
|
//@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) {
|
public ResponseEntity<?> synchroniseCommentairesFromWeb(@RequestBody CommentaireRequest commentaireRequest) {
|
||||||
try {
|
try {
|
||||||
@@ -299,8 +310,9 @@ public class CommentaireController {
|
|||||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
@PostMapping("synchronise/notify-done-from-mobile")
|
@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. ")
|
//@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) {
|
public ResponseEntity<?> notifyDoneSynchronizedFromMobile(@RequestBody List<SyncCommentaireRequest> syncCommentaireRequests) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public class EnqueteController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_ENQUETE')")
|
||||||
public ResponseEntity<?> createEnquete(@RequestBody @Valid @Validated EnquetePayLoadWeb enquetePayLoadWeb) {
|
public ResponseEntity<?> createEnquete(@RequestBody @Valid @Validated EnquetePayLoadWeb enquetePayLoadWeb) {
|
||||||
try {
|
try {
|
||||||
enquetePayLoadWeb = enqueteService.createEnquete(enquetePayLoadWeb);
|
enquetePayLoadWeb = enqueteService.createEnquete(enquetePayLoadWeb);
|
||||||
@@ -76,6 +77,7 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETE')")
|
||||||
public ResponseEntity<?> updateEnquete(@PathVariable Long id, @RequestBody EnquetePayLoadWeb enquetePayLoadWeb) {
|
public ResponseEntity<?> updateEnquete(@PathVariable Long id, @RequestBody EnquetePayLoadWeb enquetePayLoadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -99,6 +101,7 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/validation")
|
@PutMapping("/validation")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETE')")
|
||||||
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -122,6 +125,7 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/rejet")
|
@PutMapping("/rejet")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETE')")
|
||||||
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -146,6 +150,7 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/validation-lot")
|
@PutMapping("/validation-lot")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETE')")
|
||||||
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -169,6 +174,7 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/rejet-lot")
|
@PutMapping("/rejet-lot")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETE')")
|
||||||
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -192,6 +198,7 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all/decoupage-admin-for-enquete")
|
@GetMapping("/all/decoupage-admin-for-enquete")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETE')")
|
||||||
public ResponseEntity<?> getAllByEnqueteDecoupageAdmin() {
|
public ResponseEntity<?> getAllByEnqueteDecoupageAdmin() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -219,6 +226,7 @@ public class EnqueteController {
|
|||||||
description = "Permet de récuperer les enquêtes déjà réalisées sur une parcelles"
|
description = "Permet de récuperer les enquêtes déjà réalisées sur une parcelles"
|
||||||
)
|
)
|
||||||
@GetMapping("/by-parcelle-id/{parcelleId}")
|
@GetMapping("/by-parcelle-id/{parcelleId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETE')")
|
||||||
public ResponseEntity<?> getAllByParcelle(@PathVariable Long parcelleId) {
|
public ResponseEntity<?> getAllByParcelle(@PathVariable Long parcelleId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -247,6 +255,7 @@ public class EnqueteController {
|
|||||||
description = "Permet de récuperer les enquêtes déjà réalisées sur une parcelles"
|
description = "Permet de récuperer les enquêtes déjà réalisées sur une parcelles"
|
||||||
)
|
)
|
||||||
@GetMapping("/page/by-parcelle-id/{parcelleId}")
|
@GetMapping("/page/by-parcelle-id/{parcelleId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETE')")
|
||||||
public ResponseEntity<?> getAllByParcellePaged(@PathVariable Long parcelleId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllByParcellePaged(@PathVariable Long parcelleId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -275,6 +284,7 @@ public class EnqueteController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all/dgi/decoupage-admin-for-enquete")
|
@GetMapping("/all/dgi/decoupage-admin-for-enquete")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETE')")
|
||||||
public ResponseEntity<?> getAllByEnqueteDecoupageAdminForDgi() {
|
public ResponseEntity<?> getAllByEnqueteDecoupageAdminForDgi() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -299,6 +309,7 @@ public class EnqueteController {
|
|||||||
|
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_ENQUETE')")
|
||||||
public ResponseEntity<?> deleteStructurer(@PathVariable Long id) {
|
public ResponseEntity<?> deleteStructurer(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
enqueteService.deleteEnquete(id);
|
enqueteService.deleteEnquete(id);
|
||||||
@@ -323,6 +334,7 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETE')")
|
||||||
public ResponseEntity<?> getAllStructureList() {
|
public ResponseEntity<?> getAllStructureList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -346,6 +358,7 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all/com-arrond-bloc")
|
@GetMapping("/all/com-arrond-bloc")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETE')")
|
||||||
public ResponseEntity<?> getAllByCommuneArrondBloc() {
|
public ResponseEntity<?> getAllByCommuneArrondBloc() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -369,6 +382,7 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/all/com-arrond-bloc/filtre")
|
@PostMapping("/all/com-arrond-bloc/filtre")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETE')")
|
||||||
public ResponseEntity<?> getAllByCommuneArrondBlocFiltre(@RequestBody FiltreEnquetePayLoad filtreEnquetePayLoad) {
|
public ResponseEntity<?> getAllByCommuneArrondBlocFiltre(@RequestBody FiltreEnquetePayLoad filtreEnquetePayLoad) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -392,6 +406,7 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETE')")
|
||||||
public ResponseEntity<?> getAllEnquetePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllEnquetePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -416,6 +431,7 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/fiche/id/{id}")
|
@GetMapping("/fiche/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETE')")
|
||||||
public ResponseEntity<?> getFicheEnqueteById(@PathVariable Long id) {
|
public ResponseEntity<?> getFicheEnqueteById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -439,6 +455,7 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/fiche/nup-provisoir/{nupProvisoir}")
|
@GetMapping("/fiche/nup-provisoir/{nupProvisoir}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETE')")
|
||||||
public ResponseEntity<?> getFicheEnqueteByNupProvisoir(@PathVariable String nupProvisoir) {
|
public ResponseEntity<?> getFicheEnqueteByNupProvisoir(@PathVariable String nupProvisoir) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -462,6 +479,7 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETE')")
|
||||||
public ResponseEntity<?> getStructureById(@PathVariable Long id) {
|
public ResponseEntity<?> getStructureById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -487,6 +505,7 @@ public class EnqueteController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-paged/en-cours/by-quartier-id/{quartierId}")
|
@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) {
|
public ResponseEntity<?> getAllEnqueteEncoursByQuartierPaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -518,6 +537,7 @@ public class EnqueteController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}")
|
@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) {
|
public ResponseEntity<?> getAllEnqueteClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -49,6 +50,7 @@ public class ParcelleController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_PARCELLE')")
|
||||||
public ResponseEntity<?> createParcelle(@RequestBody @Valid @Validated ParcellePayLoadWeb parcellePayLoadWeb) {
|
public ResponseEntity<?> createParcelle(@RequestBody @Valid @Validated ParcellePayLoadWeb parcellePayLoadWeb) {
|
||||||
try {
|
try {
|
||||||
parcellePayLoadWeb = parcelleService.createParcelle(parcellePayLoadWeb);
|
parcellePayLoadWeb = parcelleService.createParcelle(parcellePayLoadWeb);
|
||||||
@@ -74,6 +76,7 @@ public class ParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_PARCELLE')")
|
||||||
public ResponseEntity<?> updateEnquete(@PathVariable Long id, @RequestBody ParcellePayLoadWeb parcellePayLoadWeb) {
|
public ResponseEntity<?> updateEnquete(@PathVariable Long id, @RequestBody ParcellePayLoadWeb parcellePayLoadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -100,6 +103,7 @@ public class ParcelleController {
|
|||||||
|
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_PARCELLE')")
|
||||||
public ResponseEntity<?> deleteStructurer(@PathVariable Long id) {
|
public ResponseEntity<?> deleteStructurer(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
parcelleService.deleteParcelle(id);
|
parcelleService.deleteParcelle(id);
|
||||||
@@ -145,6 +149,7 @@ public class ParcelleController {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLE')")
|
||||||
public ResponseEntity<?> getParcelleById(@CurrentUser UserPrincipal currentUser, @PathVariable Long id) {
|
public ResponseEntity<?> getParcelleById(@CurrentUser UserPrincipal currentUser, @PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
if(currentUser==null)
|
if(currentUser==null)
|
||||||
@@ -173,6 +178,7 @@ public class ParcelleController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLE')")
|
||||||
public ResponseEntity<?> getAllParcelle(@CurrentUser UserPrincipal currentUser) {
|
public ResponseEntity<?> getAllParcelle(@CurrentUser UserPrincipal currentUser) {
|
||||||
try {
|
try {
|
||||||
if(currentUser==null)
|
if(currentUser==null)
|
||||||
@@ -202,6 +208,7 @@ public class ParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLE')")
|
||||||
public ResponseEntity<?> getAllParcellePaged(@CurrentUser UserPrincipal currentUser,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllParcellePaged(@CurrentUser UserPrincipal currentUser,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -234,6 +241,7 @@ public class ParcelleController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/all-paged/multi-criteres")
|
@PostMapping("/all-paged/multi-criteres")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLE')")
|
||||||
public ResponseEntity<?> getAllParcelleFiltrePaged(@CurrentUser UserPrincipal currentUser, @RequestParam int pageNo, @RequestParam int pageSize, @RequestBody FiltreParcelle filtreParcelle) {
|
public ResponseEntity<?> getAllParcelleFiltrePaged(@CurrentUser UserPrincipal currentUser, @RequestParam int pageNo, @RequestParam int pageSize, @RequestBody FiltreParcelle filtreParcelle) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -266,6 +274,7 @@ public class ParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all/by-quartier-id/{quartierId}")
|
@GetMapping("/all/by-quartier-id/{quartierId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLE')")
|
||||||
public ResponseEntity<?> getAllParcelleByQuartier(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId) {
|
public ResponseEntity<?> getAllParcelleByQuartier(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId) {
|
||||||
try {
|
try {
|
||||||
if(currentUser==null)
|
if(currentUser==null)
|
||||||
@@ -295,6 +304,7 @@ public class ParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged/by-quartier-id/{quartierId}")
|
@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) {
|
public ResponseEntity<?> getAllParcelleByQuartierPaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -327,6 +337,7 @@ public class ParcelleController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all/by-rue-id/{rueId}")
|
@GetMapping("/all/by-rue-id/{rueId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLE')")
|
||||||
public ResponseEntity<?> getAllParcelleByRue(@CurrentUser UserPrincipal currentUser,@PathVariable Long rueId) {
|
public ResponseEntity<?> getAllParcelleByRue(@CurrentUser UserPrincipal currentUser,@PathVariable Long rueId) {
|
||||||
try {
|
try {
|
||||||
if(currentUser==null)
|
if(currentUser==null)
|
||||||
@@ -356,6 +367,7 @@ public class ParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged/by-rue-id/{rueId}")
|
@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) {
|
public ResponseEntity<?> getAllParcelleByRuePaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long rueId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -389,6 +401,7 @@ public class ParcelleController {
|
|||||||
|
|
||||||
|
|
||||||
@PutMapping("/syncrhonise-etat-batie-parcelle")
|
@PutMapping("/syncrhonise-etat-batie-parcelle")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLE')")
|
||||||
public ResponseEntity<?> putSynchroniseEtatBatieParcelle() {
|
public ResponseEntity<?> putSynchroniseEtatBatieParcelle() {
|
||||||
try {
|
try {
|
||||||
Integer nombreParcelleSync= parcelleService.majParcelleBatieNonbatie();
|
Integer nombreParcelleSync= parcelleService.majParcelleBatieNonbatie();
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ public class ParcelleGeomController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping(value = "/create-from-geojsonfile",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
@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) {
|
public ResponseEntity<?> createTpe(@RequestPart(required = true) MultipartFile file,@RequestParam String reference,@RequestParam String description) {
|
||||||
try{
|
try{
|
||||||
int n = parcelleGeomService.createParcelleFromGeoJsonFile(file, reference, description);
|
int n = parcelleGeomService.createParcelleFromGeoJsonFile(file, reference, description);
|
||||||
@@ -48,6 +49,7 @@ public class ParcelleGeomController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
|
||||||
public ResponseEntity<?> getAllTpeList() {
|
public ResponseEntity<?> getAllTpeList() {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomList(), "Liste des parcelle chargée avec succès."),
|
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomList(), "Liste des parcelle chargée avec succès."),
|
||||||
@@ -56,6 +58,7 @@ public class ParcelleGeomController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/by-quartier/{codeQuartier}")
|
@GetMapping("/by-quartier/{codeQuartier}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
|
||||||
public ResponseEntity<?> getParcellesGeomsByQuartier(@PathVariable String codeQuartier) {
|
public ResponseEntity<?> getParcellesGeomsByQuartier(@PathVariable String codeQuartier) {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListUnQuatier(codeQuartier), "Liste des parcelle chargée avec succès."),
|
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListUnQuatier(codeQuartier), "Liste des parcelle chargée avec succès."),
|
||||||
@@ -65,6 +68,7 @@ public class ParcelleGeomController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/by-quartier-id/{quartierId}")
|
@GetMapping("/by-quartier-id/{quartierId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
|
||||||
public ResponseEntity<?> getParcellesGeomsByQuartierId(@PathVariable Long quartierId) {
|
public ResponseEntity<?> getParcellesGeomsByQuartierId(@PathVariable Long quartierId) {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListByQuatierId(quartierId), "Liste des parcelle chargée avec succès."),
|
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListByQuatierId(quartierId), "Liste des parcelle chargée avec succès."),
|
||||||
@@ -73,6 +77,7 @@ public class ParcelleGeomController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page/by-quartier-id/{quartierId}")
|
@GetMapping("/page/by-quartier-id/{quartierId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
|
||||||
public ResponseEntity<?> getParcellesGeomsByQuartierIdPaged(@PathVariable Long quartierId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getParcellesGeomsByQuartierIdPaged(@PathVariable Long quartierId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -82,6 +87,7 @@ public class ParcelleGeomController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/by-arrondissement/{codeArrondissement}")
|
@GetMapping("/by-arrondissement/{codeArrondissement}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
|
||||||
public ResponseEntity<?> getParcellesGeomsByArrondissement(@PathVariable String codeArrondissement) {
|
public ResponseEntity<?> getParcellesGeomsByArrondissement(@PathVariable String codeArrondissement) {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListUnArrondissement(codeArrondissement), "Liste des parcelle chargée avec succès."),
|
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListUnArrondissement(codeArrondissement), "Liste des parcelle chargée avec succès."),
|
||||||
@@ -91,6 +97,7 @@ public class ParcelleGeomController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
|
||||||
public ResponseEntity<?> getAllTpePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllTpePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -100,6 +107,7 @@ public class ParcelleGeomController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PARCELLEGEOM')")
|
||||||
public ResponseEntity<?> getParcelleGeomById(@PathVariable Long id) {
|
public ResponseEntity<?> getParcelleGeomById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public class PersonneController {
|
|||||||
private final PersonneService personneService;
|
private final PersonneService personneService;
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_PERSONNE')")
|
||||||
public ResponseEntity<?> createPersonne(@RequestBody @Valid @Validated PersonnePayLoadWeb personnePayLoadWeb) {
|
public ResponseEntity<?> createPersonne(@RequestBody @Valid @Validated PersonnePayLoadWeb personnePayLoadWeb) {
|
||||||
try {
|
try {
|
||||||
personnePayLoadWeb = personneService.createPersonne(personnePayLoadWeb);
|
personnePayLoadWeb = personneService.createPersonne(personnePayLoadWeb);
|
||||||
@@ -64,6 +65,7 @@ public class PersonneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_PERSONNE')")
|
||||||
public ResponseEntity<?> updatePersonne(@PathVariable Long id, @RequestBody PersonnePayLoadWeb personnePayLoadWeb) {
|
public ResponseEntity<?> updatePersonne(@PathVariable Long id, @RequestBody PersonnePayLoadWeb personnePayLoadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -86,6 +88,7 @@ public class PersonneController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@GetMapping("/get-details/{id}")
|
@GetMapping("/get-details/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PERSONNE')")
|
||||||
public ResponseEntity<?> getDetails(@PathVariable Long id) {
|
public ResponseEntity<?> getDetails(@PathVariable Long id) {
|
||||||
try{
|
try{
|
||||||
PersonneCompletDTO personneCompletDTO = personneService.getPersonneComplete(id);
|
PersonneCompletDTO personneCompletDTO = personneService.getPersonneComplete(id);
|
||||||
@@ -102,6 +105,7 @@ public class PersonneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PERSONNE')")
|
||||||
public ResponseEntity<?> getPersonneById(@PathVariable Long id) {
|
public ResponseEntity<?> getPersonneById(@PathVariable Long id) {
|
||||||
try{
|
try{
|
||||||
Optional<PersonnePayLoadWeb> optionalPersonne= personneService.getPersonneById(id);
|
Optional<PersonnePayLoadWeb> optionalPersonne= personneService.getPersonneById(id);
|
||||||
@@ -118,6 +122,7 @@ public class PersonneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/recherche")
|
@PostMapping("/recherche")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PERSONNE')")
|
||||||
public ResponseEntity<?> rechercherPersonne(@RequestBody RecherchePersonneResquestBody recherchePersonneResquestBody ) {
|
public ResponseEntity<?> rechercherPersonne(@RequestBody RecherchePersonneResquestBody recherchePersonneResquestBody ) {
|
||||||
try{
|
try{
|
||||||
// personneService.recherchePersonne(recherchePersonneResquestBody);
|
// personneService.recherchePersonne(recherchePersonneResquestBody);
|
||||||
@@ -135,6 +140,7 @@ public class PersonneController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PERSONNE')")
|
||||||
public ResponseEntity<?> getAllPersonne() {
|
public ResponseEntity<?> getAllPersonne() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -159,6 +165,7 @@ public class PersonneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PERSONNE')")
|
||||||
public ResponseEntity<?> getAllPersonnePaged(@CurrentUser UserPrincipal currentUser,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllPersonnePaged(@CurrentUser UserPrincipal currentUser,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -35,6 +36,7 @@ public class PieceController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_PIECE')")
|
||||||
public ResponseEntity<?> createPiece(@RequestBody @Valid @Validated PiecePayLoadWeb piecePayLoadWeb) {
|
public ResponseEntity<?> createPiece(@RequestBody @Valid @Validated PiecePayLoadWeb piecePayLoadWeb) {
|
||||||
try {
|
try {
|
||||||
piecePayLoadWeb = pieceService.createPiece(piecePayLoadWeb);
|
piecePayLoadWeb = pieceService.createPiece(piecePayLoadWeb);
|
||||||
@@ -59,6 +61,7 @@ public class PieceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_PIECE')")
|
||||||
public ResponseEntity<?> updatePiece(@PathVariable Long id, @RequestBody PiecePayLoadWeb piecePayLoadWeb) {
|
public ResponseEntity<?> updatePiece(@PathVariable Long id, @RequestBody PiecePayLoadWeb piecePayLoadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -82,6 +85,7 @@ public class PieceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_PIECE')")
|
||||||
public ResponseEntity<?> deletePiece(@PathVariable Long id) {
|
public ResponseEntity<?> deletePiece(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
pieceService.deletePiece(id);
|
pieceService.deletePiece(id);
|
||||||
@@ -106,6 +110,7 @@ public class PieceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PIECE')")
|
||||||
public ResponseEntity<?> getAllPieceList() {
|
public ResponseEntity<?> getAllPieceList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -129,6 +134,7 @@ public class PieceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PIECE')")
|
||||||
public ResponseEntity<?> getAllPiecePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllPiecePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -153,6 +159,7 @@ public class PieceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all/by-enquete-id/{enqueteId}")
|
@GetMapping("/all/by-enquete-id/{enqueteId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PIECE')")
|
||||||
public ResponseEntity<?> getAllPieceByEnqueteList(@PathVariable Long enqueteId) {
|
public ResponseEntity<?> getAllPieceByEnqueteList(@PathVariable Long enqueteId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -176,6 +183,7 @@ public class PieceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged/by-enquete-id/{enqueteId}")
|
@GetMapping("/all-paged/by-enquete-id/{enqueteId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PIECE')")
|
||||||
public ResponseEntity<?> getAllPieceByParcellePaged(@PathVariable Long enqueteId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllPieceByParcellePaged(@PathVariable Long enqueteId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -201,6 +209,7 @@ public class PieceController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/by-enquete-batiment-id/{enqueteBatimentId}")
|
@GetMapping("/by-enquete-batiment-id/{enqueteBatimentId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PIECE')")
|
||||||
public ResponseEntity<?> getAllPieceByEnqueteBatiment(@PathVariable Long enqueteBatimentId) {
|
public ResponseEntity<?> getAllPieceByEnqueteBatiment(@PathVariable Long enqueteBatimentId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -225,6 +234,7 @@ public class PieceController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/by-enquete-unite-logement-id/{enqueteUniteLogementId}")
|
@GetMapping("/by-enquete-unite-logement-id/{enqueteUniteLogementId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PIECE')")
|
||||||
public ResponseEntity<?> getAllPieceByEnqueteUniteLogement(@PathVariable Long enqueteUniteLogementId) {
|
public ResponseEntity<?> getAllPieceByEnqueteUniteLogement(@PathVariable Long enqueteUniteLogementId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -248,6 +258,7 @@ public class PieceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PIECE')")
|
||||||
public ResponseEntity<?> getPieceById(@PathVariable Long id) {
|
public ResponseEntity<?> getPieceById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Tpe")
|
@Tag(name = "Tpe")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class TpeController {
|
public class TpeController {
|
||||||
|
|
||||||
private final TpeService tpeService;
|
private final TpeService tpeService;
|
||||||
@@ -37,6 +37,7 @@ public class TpeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_TPE')")
|
||||||
public ResponseEntity<?> createTpe(@RequestBody @Valid @Validated Tpe tpe) {
|
public ResponseEntity<?> createTpe(@RequestBody @Valid @Validated Tpe tpe) {
|
||||||
try {
|
try {
|
||||||
tpe = tpeService.createTpe(tpe);
|
tpe = tpeService.createTpe(tpe);
|
||||||
@@ -60,6 +61,7 @@ public class TpeController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PostMapping("/re-create")
|
@PostMapping("/re-create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_TPE')")
|
||||||
public ResponseEntity<?> reCreateTpe(@RequestBody @Valid @Validated Tpe tpe) {
|
public ResponseEntity<?> reCreateTpe(@RequestBody @Valid @Validated Tpe tpe) {
|
||||||
try{
|
try{
|
||||||
tpe = tpeService.majTpe(tpe.getId(),tpe);
|
tpe = tpeService.majTpe(tpe.getId(),tpe);
|
||||||
@@ -75,6 +77,7 @@ public class TpeController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_TPE')")
|
||||||
public ResponseEntity<?> majTpe(@PathVariable Long id, @RequestBody Tpe tpe) {
|
public ResponseEntity<?> majTpe(@PathVariable Long id, @RequestBody Tpe tpe) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -99,6 +102,7 @@ public class TpeController {
|
|||||||
|
|
||||||
|
|
||||||
@PutMapping("/restaure/{id}")
|
@PutMapping("/restaure/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_TPE')")
|
||||||
public ResponseEntity<?> updateTpe(@PathVariable Long id, @RequestBody Tpe tpe) {
|
public ResponseEntity<?> updateTpe(@PathVariable Long id, @RequestBody Tpe tpe) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -122,6 +126,7 @@ public class TpeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_TPE')")
|
||||||
public ResponseEntity<?> deleteTper(@PathVariable Long id) {
|
public ResponseEntity<?> deleteTper(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
tpeService.deleteTpe(id);
|
tpeService.deleteTpe(id);
|
||||||
@@ -146,6 +151,7 @@ public class TpeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TPE')")
|
||||||
public ResponseEntity<?> getAllTpeList() {
|
public ResponseEntity<?> getAllTpeList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -169,6 +175,7 @@ public class TpeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-by-model/{model}")
|
@GetMapping("/all-by-model/{model}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TPE')")
|
||||||
public ResponseEntity<?> getAllTpeListByModel(@PathVariable String model) {
|
public ResponseEntity<?> getAllTpeListByModel(@PathVariable String model) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -192,6 +199,7 @@ public class TpeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-by-userId/{userId}")
|
@GetMapping("/all-by-userId/{userId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TPE')")
|
||||||
public ResponseEntity<?> getAllTpeListByUserId(@PathVariable Long userId) {
|
public ResponseEntity<?> getAllTpeListByUserId(@PathVariable Long userId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -216,6 +224,7 @@ public class TpeController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TPE')")
|
||||||
public ResponseEntity<?> getAllTpePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllTpePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -240,6 +249,7 @@ public class TpeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TPE')")
|
||||||
public ResponseEntity<?> getTpeById(@PathVariable Long id) {
|
public ResponseEntity<?> getTpeById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -263,6 +273,7 @@ public class TpeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/identifier/{identifier}")
|
@GetMapping("/identifier/{identifier}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TPE')")
|
||||||
public ResponseEntity<?> getTpeByIdentifier(@PathVariable String identifier) {
|
public ResponseEntity<?> getTpeByIdentifier(@PathVariable String identifier) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public class UploadController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_UPLOAD')")
|
||||||
public ResponseEntity<?> all() {
|
public ResponseEntity<?> all() {
|
||||||
try {
|
try {
|
||||||
if (uploadRepository.findAll().isEmpty()) {
|
if (uploadRepository.findAll().isEmpty()) {
|
||||||
@@ -95,6 +96,7 @@ public class UploadController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_UPLOAD')")
|
||||||
public ResponseEntity<?> one(@PathVariable Long id) {
|
public ResponseEntity<?> one(@PathVariable Long id) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -121,6 +123,7 @@ public class UploadController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/downloadfile/{fileName:.+}")
|
@GetMapping("/downloadfile/{fileName:.+}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_UPLOAD')")
|
||||||
public ResponseEntity<Resource> downloadFile(@PathVariable String fileName, HttpServletRequest request) {
|
public ResponseEntity<Resource> downloadFile(@PathVariable String fileName, HttpServletRequest request) {
|
||||||
// Load file as Resource
|
// Load file as Resource
|
||||||
Resource resource = fileStorageService.loadFileAsResource(fileName);
|
Resource resource = fileStorageService.loadFileAsResource(fileName);
|
||||||
@@ -148,6 +151,7 @@ public class UploadController {
|
|||||||
value = "/save",
|
value = "/save",
|
||||||
consumes = MediaType.MULTIPART_FORM_DATA_VALUE
|
consumes = MediaType.MULTIPART_FORM_DATA_VALUE
|
||||||
)
|
)
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_UPLOAD')")
|
||||||
public ResponseEntity<?> saveFilePieceId(
|
public ResponseEntity<?> saveFilePieceId(
|
||||||
@Parameter(
|
@Parameter(
|
||||||
description = "Fichier à uploader",
|
description = "Fichier à uploader",
|
||||||
@@ -178,6 +182,7 @@ public class UploadController {
|
|||||||
|
|
||||||
|
|
||||||
@DeleteMapping("/delete/id/{id}")
|
@DeleteMapping("/delete/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_UPLOAD')")
|
||||||
public ResponseEntity<?> delete(@PathVariable Long id) {
|
public ResponseEntity<?> delete(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
if (id != null || uploadRepository.findById(id).isPresent()) {
|
if (id != null || uploadRepository.findById(id).isPresent()) {
|
||||||
@@ -204,6 +209,7 @@ public class UploadController {
|
|||||||
consumes = MediaType.MULTIPART_FORM_DATA_VALUE,
|
consumes = MediaType.MULTIPART_FORM_DATA_VALUE,
|
||||||
produces = MediaType.APPLICATION_JSON_VALUE
|
produces = MediaType.APPLICATION_JSON_VALUE
|
||||||
)
|
)
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_UPLOAD')")
|
||||||
public ResponseEntity<?> submit(@RequestPart("file") MultipartFile file) throws Exception {
|
public ResponseEntity<?> submit(@RequestPart("file") MultipartFile file) throws Exception {
|
||||||
if (file == null || file.isEmpty())
|
if (file == null || file.isEmpty())
|
||||||
return new ResponseEntity<>(new ApiResponse(false,null, "Le fichier envoyé est introuvable ou inexistant."), HttpStatus.BAD_REQUEST);
|
return new ResponseEntity<>(new ApiResponse(false,null, "Le fichier envoyé est introuvable ou inexistant."), HttpStatus.BAD_REQUEST);
|
||||||
@@ -244,6 +250,7 @@ public class UploadController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(path = "/by-piece/{pieceId}")
|
@GetMapping(path = "/by-piece/{pieceId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_UPLOAD')")
|
||||||
public ResponseEntity<?> getByPiece(@PathVariable("pieceId") Long pieceId) {
|
public ResponseEntity<?> getByPiece(@PathVariable("pieceId") Long pieceId) {
|
||||||
try{
|
try{
|
||||||
return new ResponseEntity<>(new ApiResponse(true, uploadService.getAllUploadByPiece(pieceId), "Liste des fichier de la piece"), HttpStatus.OK);
|
return new ResponseEntity<>(new ApiResponse(true, uploadService.getAllUploadByPiece(pieceId), "Liste des fichier de la piece"), HttpStatus.OK);
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public class BlocController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_BLOC')")
|
||||||
public ResponseEntity<?> createBloc(@RequestBody @Valid @Validated Bloc bloc, @CurrentUser UserPrincipal userPrincipal) {
|
public ResponseEntity<?> createBloc(@RequestBody @Valid @Validated Bloc bloc, @CurrentUser UserPrincipal userPrincipal) {
|
||||||
try {
|
try {
|
||||||
bloc = blocService.createBloc(bloc);
|
bloc = blocService.createBloc(bloc);
|
||||||
@@ -63,6 +64,7 @@ public class BlocController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_BLOC')")
|
||||||
public ResponseEntity<?> updateBloc(@PathVariable Long id, @RequestBody Bloc bloc) {
|
public ResponseEntity<?> updateBloc(@PathVariable Long id, @RequestBody Bloc bloc) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -86,6 +88,7 @@ public class BlocController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_BLOC')")
|
||||||
public ResponseEntity<?> deleteBlocr(@PathVariable Long id) {
|
public ResponseEntity<?> deleteBlocr(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
blocService.deleteBloc(id);
|
blocService.deleteBloc(id);
|
||||||
@@ -110,6 +113,7 @@ public class BlocController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BLOC')")
|
||||||
public ResponseEntity<?> getAllBlocList() {
|
public ResponseEntity<?> getAllBlocList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -134,6 +138,7 @@ public class BlocController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/list-by-arrondissement")
|
@GetMapping("/list-by-arrondissement")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BLOC')")
|
||||||
public ResponseEntity<?> getAllBlocListByArrondissement(@RequestParam Long idArrondissement) {
|
public ResponseEntity<?> getAllBlocListByArrondissement(@RequestParam Long idArrondissement) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -159,6 +164,7 @@ public class BlocController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/list-by-structure")
|
@GetMapping("/list-by-structure")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BLOC')")
|
||||||
public ResponseEntity<?> getAllBlocListByStructure(@RequestParam Long idStructure) {
|
public ResponseEntity<?> getAllBlocListByStructure(@RequestParam Long idStructure) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -183,6 +189,7 @@ public class BlocController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/list-by-secteur")
|
@GetMapping("/list-by-secteur")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BLOC')")
|
||||||
@Tag(name = "Liste blocs", description = "Liste des blocs d'un secteur")
|
@Tag(name = "Liste blocs", description = "Liste des blocs d'un secteur")
|
||||||
public ResponseEntity<?> getAllBlocListBySecteur(@RequestParam Long idSecteur) {
|
public ResponseEntity<?> getAllBlocListBySecteur(@RequestParam Long idSecteur) {
|
||||||
try {
|
try {
|
||||||
@@ -207,6 +214,7 @@ public class BlocController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BLOC')")
|
||||||
public ResponseEntity<?> getAllBlocPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllBlocPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -233,6 +241,7 @@ public class BlocController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BLOC')")
|
||||||
public ResponseEntity<?> getBlocById(@PathVariable Long id) {
|
public ResponseEntity<?> getBlocById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public class ModeAcquisitionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_MODEACQUISITION')")
|
||||||
public ResponseEntity<?> createModeAcquisition(@RequestBody @Valid @Validated ModeAcquisition modeAcquisition) {
|
public ResponseEntity<?> createModeAcquisition(@RequestBody @Valid @Validated ModeAcquisition modeAcquisition) {
|
||||||
try {
|
try {
|
||||||
modeAcquisition = modeAcquisitionService.createModeAcquisition(modeAcquisition);
|
modeAcquisition = modeAcquisitionService.createModeAcquisition(modeAcquisition);
|
||||||
@@ -62,6 +63,7 @@ public class ModeAcquisitionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_MODEACQUISITION')")
|
||||||
public ResponseEntity<?> updateModeAcquisition(@PathVariable Long id, @RequestBody ModeAcquisition modeAcquisition) {
|
public ResponseEntity<?> updateModeAcquisition(@PathVariable Long id, @RequestBody ModeAcquisition modeAcquisition) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -85,6 +87,7 @@ public class ModeAcquisitionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_MODEACQUISITION')")
|
||||||
public ResponseEntity<?> deleteModeAcquisitionr(@PathVariable Long id) {
|
public ResponseEntity<?> deleteModeAcquisitionr(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
modeAcquisitionService.deleteModeAcquisition(id);
|
modeAcquisitionService.deleteModeAcquisition(id);
|
||||||
@@ -109,6 +112,7 @@ public class ModeAcquisitionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_MODEACQUISITION')")
|
||||||
public ResponseEntity<?> getAllModeAcquisitionList() {
|
public ResponseEntity<?> getAllModeAcquisitionList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -132,6 +136,7 @@ public class ModeAcquisitionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_MODEACQUISITION')")
|
||||||
public ResponseEntity<?> getAllModeAcquisitionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllModeAcquisitionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -156,6 +161,7 @@ public class ModeAcquisitionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_MODEACQUISITION')")
|
||||||
public ResponseEntity<?> getModeAcquisitionById(@PathVariable Long id) {
|
public ResponseEntity<?> getModeAcquisitionById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class NatureDomaineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_NATUREDOMAINE')")
|
||||||
public ResponseEntity<?> createNatureDomaine(@RequestBody @Valid @Validated NatureDomaine natureDomaine) {
|
public ResponseEntity<?> createNatureDomaine(@RequestBody @Valid @Validated NatureDomaine natureDomaine) {
|
||||||
try {
|
try {
|
||||||
natureDomaine = natureDomaineService.createNatureDomaine(natureDomaine);
|
natureDomaine = natureDomaineService.createNatureDomaine(natureDomaine);
|
||||||
@@ -61,6 +62,7 @@ public class NatureDomaineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_NATUREDOMAINE')")
|
||||||
public ResponseEntity<?> updateNatureDomaine(@PathVariable Long id, @RequestBody NatureDomaine natureDomaine) {
|
public ResponseEntity<?> updateNatureDomaine(@PathVariable Long id, @RequestBody NatureDomaine natureDomaine) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class NatureDomaineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_NATUREDOMAINE')")
|
||||||
public ResponseEntity<?> deleteNatureDomainer(@PathVariable Long id) {
|
public ResponseEntity<?> deleteNatureDomainer(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
natureDomaineService.deleteNatureDomaine(id);
|
natureDomaineService.deleteNatureDomaine(id);
|
||||||
@@ -108,6 +111,7 @@ public class NatureDomaineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_NATUREDOMAINE')")
|
||||||
public ResponseEntity<?> getAllNatureDomaineList() {
|
public ResponseEntity<?> getAllNatureDomaineList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +135,7 @@ public class NatureDomaineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_NATUREDOMAINE')")
|
||||||
public ResponseEntity<?> getAllNatureDomainePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllNatureDomainePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +160,7 @@ public class NatureDomaineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_NATUREDOMAINE')")
|
||||||
public ResponseEntity<?> getNatureDomaineById(@PathVariable Long id) {
|
public ResponseEntity<?> getNatureDomaineById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class PositionRepresentationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_POSITIONREPRESENTATION')")
|
||||||
public ResponseEntity<?> createPositionRepresentation(@RequestBody @Valid @Validated PositionRepresentation positionRepresentation) {
|
public ResponseEntity<?> createPositionRepresentation(@RequestBody @Valid @Validated PositionRepresentation positionRepresentation) {
|
||||||
try {
|
try {
|
||||||
positionRepresentation = positionRepresentationService.createPositionRepresentation(positionRepresentation);
|
positionRepresentation = positionRepresentationService.createPositionRepresentation(positionRepresentation);
|
||||||
@@ -61,6 +62,7 @@ public class PositionRepresentationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_POSITIONREPRESENTATION')")
|
||||||
public ResponseEntity<?> updatePositionRepresentation(@PathVariable Long id, @RequestBody PositionRepresentation positionRepresentation) {
|
public ResponseEntity<?> updatePositionRepresentation(@PathVariable Long id, @RequestBody PositionRepresentation positionRepresentation) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class PositionRepresentationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_POSITIONREPRESENTATION')")
|
||||||
public ResponseEntity<?> deletePositionRepresentation(@PathVariable Long id) {
|
public ResponseEntity<?> deletePositionRepresentation(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
positionRepresentationService.deletePositionRepresentation(id);
|
positionRepresentationService.deletePositionRepresentation(id);
|
||||||
@@ -108,6 +111,7 @@ public class PositionRepresentationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_POSITIONREPRESENTATION')")
|
||||||
public ResponseEntity<?> getAllPositionRepresentationList() {
|
public ResponseEntity<?> getAllPositionRepresentationList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +135,7 @@ public class PositionRepresentationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_POSITIONREPRESENTATION')")
|
||||||
public ResponseEntity<?> getAllPositionRepresentationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllPositionRepresentationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -157,6 +162,7 @@ public class PositionRepresentationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_POSITIONREPRESENTATION')")
|
||||||
public ResponseEntity<?> getPositionRepresentationById(@PathVariable Long id) {
|
public ResponseEntity<?> getPositionRepresentationById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public class ProfessionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_PROFESSION')")
|
||||||
public ResponseEntity<?> createProfession(@RequestBody @Valid @Validated Profession profession) {
|
public ResponseEntity<?> createProfession(@RequestBody @Valid @Validated Profession profession) {
|
||||||
try {
|
try {
|
||||||
profession = professionService.createProfession(profession);
|
profession = professionService.createProfession(profession);
|
||||||
@@ -62,6 +63,7 @@ public class ProfessionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_PROFESSION')")
|
||||||
public ResponseEntity<?> updateProfession(@PathVariable Long id, @RequestBody Profession profession) {
|
public ResponseEntity<?> updateProfession(@PathVariable Long id, @RequestBody Profession profession) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -85,6 +87,7 @@ public class ProfessionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_PROFESSION')")
|
||||||
public ResponseEntity<?> deleteProfessionr(@PathVariable Long id) {
|
public ResponseEntity<?> deleteProfessionr(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
professionService.deleteProfession(id);
|
professionService.deleteProfession(id);
|
||||||
@@ -109,6 +112,7 @@ public class ProfessionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PROFESSION')")
|
||||||
public ResponseEntity<?> getAllProfessionList() {
|
public ResponseEntity<?> getAllProfessionList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -133,6 +137,7 @@ public class ProfessionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PROFESSION')")
|
||||||
public ResponseEntity<?> getAllProfessionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllProfessionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -158,6 +163,7 @@ public class ProfessionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PROFESSION')")
|
||||||
public ResponseEntity<?> getProfessionById(@PathVariable Long id) {
|
public ResponseEntity<?> getProfessionById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class SituationGeographiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_SITUATIONGEOGRAPHIQUE')")
|
||||||
public ResponseEntity<?> createSituationGeographique(@RequestBody @Valid @Validated SituationGeographique situationGeographique) {
|
public ResponseEntity<?> createSituationGeographique(@RequestBody @Valid @Validated SituationGeographique situationGeographique) {
|
||||||
try {
|
try {
|
||||||
situationGeographique = situationGeographiqueService.createSituationGeographique(situationGeographique);
|
situationGeographique = situationGeographiqueService.createSituationGeographique(situationGeographique);
|
||||||
@@ -61,6 +62,7 @@ public class SituationGeographiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_SITUATIONGEOGRAPHIQUE')")
|
||||||
public ResponseEntity<?> updateSituationGeographique(@PathVariable Long id, @RequestBody SituationGeographique situationGeographique) {
|
public ResponseEntity<?> updateSituationGeographique(@PathVariable Long id, @RequestBody SituationGeographique situationGeographique) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class SituationGeographiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_SITUATIONGEOGRAPHIQUE')")
|
||||||
public ResponseEntity<?> deleteSituationGeographiquer(@PathVariable Long id) {
|
public ResponseEntity<?> deleteSituationGeographiquer(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
situationGeographiqueService.deleteSituationGeographique(id);
|
situationGeographiqueService.deleteSituationGeographique(id);
|
||||||
@@ -108,6 +111,7 @@ public class SituationGeographiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SITUATIONGEOGRAPHIQUE')")
|
||||||
public ResponseEntity<?> getAllSituationGeographiqueList() {
|
public ResponseEntity<?> getAllSituationGeographiqueList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +135,7 @@ public class SituationGeographiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SITUATIONGEOGRAPHIQUE')")
|
||||||
public ResponseEntity<?> getAllSituationGeographiquePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllSituationGeographiquePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +160,7 @@ public class SituationGeographiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SITUATIONGEOGRAPHIQUE')")
|
||||||
public ResponseEntity<?> getSituationGeographiqueById(@PathVariable Long id) {
|
public ResponseEntity<?> getSituationGeographiqueById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class SituationMatrimonialeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_SITUATIONMATRIMONIALE')")
|
||||||
public ResponseEntity<?> createSituationMatrimoniale(@RequestBody @Valid @Validated SituationMatrimoniale situationMatrimoniale) {
|
public ResponseEntity<?> createSituationMatrimoniale(@RequestBody @Valid @Validated SituationMatrimoniale situationMatrimoniale) {
|
||||||
try {
|
try {
|
||||||
situationMatrimoniale = situationMatrimonialeService.createSituationMatrimoniale(situationMatrimoniale);
|
situationMatrimoniale = situationMatrimonialeService.createSituationMatrimoniale(situationMatrimoniale);
|
||||||
@@ -61,6 +62,7 @@ public class SituationMatrimonialeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_SITUATIONMATRIMONIALE')")
|
||||||
public ResponseEntity<?> updateSituationMatrimoniale(@PathVariable Long id, @RequestBody SituationMatrimoniale situationMatrimoniale) {
|
public ResponseEntity<?> updateSituationMatrimoniale(@PathVariable Long id, @RequestBody SituationMatrimoniale situationMatrimoniale) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class SituationMatrimonialeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_SITUATIONMATRIMONIALE')")
|
||||||
public ResponseEntity<?> deleteSituationMatrimonialer(@PathVariable Long id) {
|
public ResponseEntity<?> deleteSituationMatrimonialer(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
situationMatrimonialeService.deleteSituationMatrimoniale(id);
|
situationMatrimonialeService.deleteSituationMatrimoniale(id);
|
||||||
@@ -108,6 +111,7 @@ public class SituationMatrimonialeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SITUATIONMATRIMONIALE')")
|
||||||
public ResponseEntity<?> getAllSituationMatrimonialeList() {
|
public ResponseEntity<?> getAllSituationMatrimonialeList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +135,7 @@ public class SituationMatrimonialeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SITUATIONMATRIMONIALE')")
|
||||||
public ResponseEntity<?> getAllSituationMatrimonialePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllSituationMatrimonialePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +160,7 @@ public class SituationMatrimonialeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SITUATIONMATRIMONIALE')")
|
||||||
public ResponseEntity<?> getSituationMatrimonialeById(@PathVariable Long id) {
|
public ResponseEntity<?> getSituationMatrimonialeById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class SourceDroitController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_SOURCEDROIT')")
|
||||||
public ResponseEntity<?> createSourceDroit(@RequestBody @Valid @Validated SourceDroit sourceDroit) {
|
public ResponseEntity<?> createSourceDroit(@RequestBody @Valid @Validated SourceDroit sourceDroit) {
|
||||||
try {
|
try {
|
||||||
sourceDroit = sourceDroitService.createSourceDroit(sourceDroit);
|
sourceDroit = sourceDroitService.createSourceDroit(sourceDroit);
|
||||||
@@ -61,6 +62,7 @@ public class SourceDroitController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_SOURCEDROIT')")
|
||||||
public ResponseEntity<?> updateSourceDroit(@PathVariable Long id, @RequestBody SourceDroit sourceDroit) {
|
public ResponseEntity<?> updateSourceDroit(@PathVariable Long id, @RequestBody SourceDroit sourceDroit) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class SourceDroitController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_SOURCEDROIT')")
|
||||||
public ResponseEntity<?> deleteSourceDroitr(@PathVariable Long id) {
|
public ResponseEntity<?> deleteSourceDroitr(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
sourceDroitService.deleteSourceDroit(id);
|
sourceDroitService.deleteSourceDroit(id);
|
||||||
@@ -108,6 +111,7 @@ public class SourceDroitController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SOURCEDROIT')")
|
||||||
public ResponseEntity<?> getAllSourceDroitList() {
|
public ResponseEntity<?> getAllSourceDroitList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +135,7 @@ public class SourceDroitController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SOURCEDROIT')")
|
||||||
public ResponseEntity<?> getAllSourceDroitPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllSourceDroitPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +160,7 @@ public class SourceDroitController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_SOURCEDROIT')")
|
||||||
public ResponseEntity<?> getSourceDroitById(@PathVariable Long id) {
|
public ResponseEntity<?> getSourceDroitById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ public class StructureController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_STRUCTURE')")
|
||||||
public ResponseEntity<?> createStructure(@RequestBody StructurePaylaodWeb structurePaylaodWeb) {
|
public ResponseEntity<?> createStructure(@RequestBody StructurePaylaodWeb structurePaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
structurePaylaodWeb = structureService.createStructure(structurePaylaodWeb);
|
structurePaylaodWeb = structureService.createStructure(structurePaylaodWeb);
|
||||||
@@ -65,6 +66,7 @@ public class StructureController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_STRUCTURE')")
|
||||||
public ResponseEntity<?> updateStructure(@PathVariable Long id, @RequestBody StructurePaylaodWeb structurePaylaodWeb) {
|
public ResponseEntity<?> updateStructure(@PathVariable Long id, @RequestBody StructurePaylaodWeb structurePaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -88,6 +90,7 @@ public class StructureController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_STRUCTURE')")
|
||||||
public ResponseEntity<?> deleteStructurer(@PathVariable Long id) {
|
public ResponseEntity<?> deleteStructurer(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
structureService.deleteStructure(id);
|
structureService.deleteStructure(id);
|
||||||
@@ -112,6 +115,7 @@ public class StructureController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_STRUCTURE')")
|
||||||
public ResponseEntity<?> getAllStructureList() {
|
public ResponseEntity<?> getAllStructureList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -136,6 +140,7 @@ public class StructureController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_STRUCTURE')")
|
||||||
public ResponseEntity<?> getAllStructurePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllStructurePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -161,6 +166,7 @@ public class StructureController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/by-commune/{communeId}")
|
@GetMapping("/by-commune/{communeId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_STRUCTURE')")
|
||||||
public ResponseEntity<?> getAllStructureListByCommune(@PathVariable Long communeId) {
|
public ResponseEntity<?> getAllStructureListByCommune(@PathVariable Long communeId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -184,6 +190,7 @@ public class StructureController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page/by-commune/{communeId}")
|
@GetMapping("/page/by-commune/{communeId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_STRUCTURE')")
|
||||||
public ResponseEntity<?> getAllStructureListByCommunePageable(@PathVariable Long communeId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllStructureListByCommunePageable(@PathVariable Long communeId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -208,6 +215,7 @@ public class StructureController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_STRUCTURE')")
|
||||||
public ResponseEntity<?> getStructureById(@PathVariable Long id) {
|
public ResponseEntity<?> getStructureById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class TypeContestationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_TYPECONTESTATION')")
|
||||||
public ResponseEntity<?> createTypeContestation(@RequestBody @Valid @Validated TypeContestation typeContestation) {
|
public ResponseEntity<?> createTypeContestation(@RequestBody @Valid @Validated TypeContestation typeContestation) {
|
||||||
try {
|
try {
|
||||||
typeContestation = typeContestationService.createTypeContestation(typeContestation);
|
typeContestation = typeContestationService.createTypeContestation(typeContestation);
|
||||||
@@ -61,6 +62,7 @@ public class TypeContestationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_TYPECONTESTATION')")
|
||||||
public ResponseEntity<?> updateTypeContestation(@PathVariable Long id, @RequestBody TypeContestation typeContestation) {
|
public ResponseEntity<?> updateTypeContestation(@PathVariable Long id, @RequestBody TypeContestation typeContestation) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class TypeContestationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_TYPECONTESTATION')")
|
||||||
public ResponseEntity<?> deleteTypeContestationr(@PathVariable Long id) {
|
public ResponseEntity<?> deleteTypeContestationr(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
typeContestationService.deleteTypeContestation(id);
|
typeContestationService.deleteTypeContestation(id);
|
||||||
@@ -108,6 +111,7 @@ public class TypeContestationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPECONTESTATION')")
|
||||||
public ResponseEntity<?> getAllTypeContestationList() {
|
public ResponseEntity<?> getAllTypeContestationList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +135,7 @@ public class TypeContestationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPECONTESTATION')")
|
||||||
public ResponseEntity<?> getAllTypeContestationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllTypeContestationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +160,7 @@ public class TypeContestationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPECONTESTATION')")
|
||||||
public ResponseEntity<?> getTypeContestationById(@PathVariable Long id) {
|
public ResponseEntity<?> getTypeContestationById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class TypeDomaineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_TYPEDOMAINE')")
|
||||||
public ResponseEntity<?> createTypeDomaine(@RequestBody @Valid @Validated TypeDomaine typeDomaine) {
|
public ResponseEntity<?> createTypeDomaine(@RequestBody @Valid @Validated TypeDomaine typeDomaine) {
|
||||||
try {
|
try {
|
||||||
typeDomaine = typeDomaineService.createTypeDomaine(typeDomaine);
|
typeDomaine = typeDomaineService.createTypeDomaine(typeDomaine);
|
||||||
@@ -61,6 +62,7 @@ public class TypeDomaineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_TYPEDOMAINE')")
|
||||||
public ResponseEntity<?> updateTypeDomaine(@PathVariable Long id, @RequestBody TypeDomaine typeDomaine) {
|
public ResponseEntity<?> updateTypeDomaine(@PathVariable Long id, @RequestBody TypeDomaine typeDomaine) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class TypeDomaineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_TYPEDOMAINE')")
|
||||||
public ResponseEntity<?> deleteTypeDomainer(@PathVariable Long id) {
|
public ResponseEntity<?> deleteTypeDomainer(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
typeDomaineService.deleteTypeDomaine(id);
|
typeDomaineService.deleteTypeDomaine(id);
|
||||||
@@ -108,6 +111,7 @@ public class TypeDomaineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPEDOMAINE')")
|
||||||
public ResponseEntity<?> getAllTypeDomaineList() {
|
public ResponseEntity<?> getAllTypeDomaineList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +135,7 @@ public class TypeDomaineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPEDOMAINE')")
|
||||||
public ResponseEntity<?> getAllTypeDomainePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllTypeDomainePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +160,7 @@ public class TypeDomaineController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPEDOMAINE')")
|
||||||
public ResponseEntity<?> getTypeDomaineById(@PathVariable Long id) {
|
public ResponseEntity<?> getTypeDomaineById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class TypePersonneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_TYPEPERSONNE')")
|
||||||
public ResponseEntity<?> createTypePersonne(@RequestBody @Valid @Validated TypePersonne typePersonne) {
|
public ResponseEntity<?> createTypePersonne(@RequestBody @Valid @Validated TypePersonne typePersonne) {
|
||||||
try {
|
try {
|
||||||
typePersonne = typePersonneService.createTypePersonne(typePersonne);
|
typePersonne = typePersonneService.createTypePersonne(typePersonne);
|
||||||
@@ -61,6 +62,7 @@ public class TypePersonneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_TYPEPERSONNE')")
|
||||||
public ResponseEntity<?> updateTypePersonne(@PathVariable Long id, @RequestBody TypePersonne typePersonne) {
|
public ResponseEntity<?> updateTypePersonne(@PathVariable Long id, @RequestBody TypePersonne typePersonne) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class TypePersonneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_TYPEPERSONNE')")
|
||||||
public ResponseEntity<?> deleteTypePersonner(@PathVariable Long id) {
|
public ResponseEntity<?> deleteTypePersonner(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
typePersonneService.deleteTypePersonne(id);
|
typePersonneService.deleteTypePersonne(id);
|
||||||
@@ -108,6 +111,7 @@ public class TypePersonneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPEPERSONNE')")
|
||||||
public ResponseEntity<?> getAllTypePersonneList() {
|
public ResponseEntity<?> getAllTypePersonneList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +135,7 @@ public class TypePersonneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPEPERSONNE')")
|
||||||
public ResponseEntity<?> getAllTypePersonnePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllTypePersonnePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +160,7 @@ public class TypePersonneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPEPERSONNE')")
|
||||||
public ResponseEntity<?> getTypePersonneById(@PathVariable Long id) {
|
public ResponseEntity<?> getTypePersonneById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class TypePieceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_TYPEPIECE')")
|
||||||
public ResponseEntity<?> createTypePiece(@RequestBody @Valid @Validated TypePiece typePiece) {
|
public ResponseEntity<?> createTypePiece(@RequestBody @Valid @Validated TypePiece typePiece) {
|
||||||
try {
|
try {
|
||||||
typePiece = typePieceService.createTypePiece(typePiece);
|
typePiece = typePieceService.createTypePiece(typePiece);
|
||||||
@@ -61,6 +62,7 @@ public class TypePieceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_TYPEPIECE')")
|
||||||
public ResponseEntity<?> updateTypePiece(@PathVariable Long id, @RequestBody TypePiece typePiece) {
|
public ResponseEntity<?> updateTypePiece(@PathVariable Long id, @RequestBody TypePiece typePiece) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class TypePieceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_TYPEPIECE')")
|
||||||
public ResponseEntity<?> deleteTypePiecer(@PathVariable Long id) {
|
public ResponseEntity<?> deleteTypePiecer(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
typePieceService.deleteTypePiece(id);
|
typePieceService.deleteTypePiece(id);
|
||||||
@@ -108,6 +111,7 @@ public class TypePieceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPEPIECE')")
|
||||||
public ResponseEntity<?> getAllTypePieceList() {
|
public ResponseEntity<?> getAllTypePieceList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +135,7 @@ public class TypePieceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPEPIECE')")
|
||||||
public ResponseEntity<?> getAllTypePiecePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllTypePiecePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +160,7 @@ public class TypePieceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPEPIECE')")
|
||||||
public ResponseEntity<?> getTypePieceById(@PathVariable Long id) {
|
public ResponseEntity<?> getTypePieceById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class TypeRepresentationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_TYPEREPRESENTATION')")
|
||||||
public ResponseEntity<?> createTypeRepresentation(@RequestBody @Valid @Validated TypeRepresentation typeRepresentation) {
|
public ResponseEntity<?> createTypeRepresentation(@RequestBody @Valid @Validated TypeRepresentation typeRepresentation) {
|
||||||
try {
|
try {
|
||||||
typeRepresentation = typeRepresentationService.createTypeRepresentation(typeRepresentation);
|
typeRepresentation = typeRepresentationService.createTypeRepresentation(typeRepresentation);
|
||||||
@@ -61,6 +62,7 @@ public class TypeRepresentationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_TYPEREPRESENTATION')")
|
||||||
public ResponseEntity<?> updateTypeRepresentation(@PathVariable Long id, @RequestBody TypeRepresentation typeRepresentation) {
|
public ResponseEntity<?> updateTypeRepresentation(@PathVariable Long id, @RequestBody TypeRepresentation typeRepresentation) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +86,7 @@ public class TypeRepresentationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_TYPEREPRESENTATION')")
|
||||||
public ResponseEntity<?> deleteTypeRepresentationr(@PathVariable Long id) {
|
public ResponseEntity<?> deleteTypeRepresentationr(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
typeRepresentationService.deleteTypeRepresentation(id);
|
typeRepresentationService.deleteTypeRepresentation(id);
|
||||||
@@ -108,6 +111,7 @@ public class TypeRepresentationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPEREPRESENTATION')")
|
||||||
public ResponseEntity<?> getAllTypeRepresentationList() {
|
public ResponseEntity<?> getAllTypeRepresentationList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +135,7 @@ public class TypeRepresentationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPEREPRESENTATION')")
|
||||||
public ResponseEntity<?> getAllTypeRepresentationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllTypeRepresentationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +160,7 @@ public class TypeRepresentationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPEREPRESENTATION')")
|
||||||
public ResponseEntity<?> getTypeRepresentationById(@PathVariable Long id) {
|
public ResponseEntity<?> getTypeRepresentationById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -37,6 +38,7 @@ public class BatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_BATIMENT')")
|
||||||
public ResponseEntity<?> createBatiment(@RequestBody @Valid @Validated BatimentPaylaodWeb batimentPaylaodWeb) {
|
public ResponseEntity<?> createBatiment(@RequestBody @Valid @Validated BatimentPaylaodWeb batimentPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
batimentPaylaodWeb = batimentService.createBatiment(batimentPaylaodWeb);
|
batimentPaylaodWeb = batimentService.createBatiment(batimentPaylaodWeb);
|
||||||
@@ -61,6 +63,7 @@ public class BatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_BATIMENT')")
|
||||||
public ResponseEntity<?> updateBatiment(@PathVariable Long id, @RequestBody BatimentPaylaodWeb batimentPaylaodWeb) {
|
public ResponseEntity<?> updateBatiment(@PathVariable Long id, @RequestBody BatimentPaylaodWeb batimentPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +87,7 @@ public class BatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_BATIMENT')")
|
||||||
public ResponseEntity<?> deleteBatiment(@PathVariable Long id) {
|
public ResponseEntity<?> deleteBatiment(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
batimentService.deleteBatiment(id);
|
batimentService.deleteBatiment(id);
|
||||||
@@ -108,6 +112,7 @@ public class BatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BATIMENT')")
|
||||||
public ResponseEntity<?> getAllBatimentList() {
|
public ResponseEntity<?> getAllBatimentList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +136,7 @@ public class BatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BATIMENT')")
|
||||||
public ResponseEntity<?> getAllBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +161,7 @@ public class BatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all/by-parcelle-id/{parcelleId}")
|
@GetMapping("/all/by-parcelle-id/{parcelleId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BATIMENT')")
|
||||||
public ResponseEntity<?> getAllBatimentByParcelleList(@PathVariable Long parcelleId) {
|
public ResponseEntity<?> getAllBatimentByParcelleList(@PathVariable Long parcelleId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -178,6 +185,7 @@ public class BatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged/by-parcelle-id/{parcelleId}")
|
@GetMapping("/all-paged/by-parcelle-id/{parcelleId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BATIMENT')")
|
||||||
public ResponseEntity<?> getAllBatimentByParcellePaged(@PathVariable Long parcelleId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllBatimentByParcellePaged(@PathVariable Long parcelleId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -202,6 +210,7 @@ public class BatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BATIMENT')")
|
||||||
public ResponseEntity<?> getBatimentById(@PathVariable Long id) {
|
public ResponseEntity<?> getBatimentById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -225,6 +234,7 @@ public class BatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged/by-quartier-id/{quartierId}")
|
@GetMapping("/all-paged/by-quartier-id/{quartierId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BATIMENT')")
|
||||||
public ResponseEntity<?> getAllBatimentByQuartierPaged(@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllBatimentByQuartierPaged(@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -250,6 +260,7 @@ public class BatimentController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all/by-quartier-id/{quartierId}")
|
@GetMapping("/all/by-quartier-id/{quartierId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BATIMENT')")
|
||||||
public ResponseEntity<?> getAllBatimentByQuartier(@PathVariable Long quartierId) {
|
public ResponseEntity<?> getAllBatimentByQuartier(@PathVariable Long quartierId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package io.gmss.fiscad.controllers.rfu.metier;
|
|||||||
|
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
|
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.exceptions.*;
|
||||||
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueBatimentService;
|
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueBatimentService;
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
@@ -16,6 +18,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -36,8 +39,10 @@ public class CaracteristiqueBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_CARACTERISTIQUEBATIMENT')")
|
||||||
public ResponseEntity<?> createCaracteristiqueBatiment(@RequestBody @Valid @Validated CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb) {
|
public ResponseEntity<?> createCaracteristiqueBatiment(@RequestBody @Valid @Validated CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
caracteristiqueBatimentPayloadWeb = caracteristiqueBatimentService.createCaracteristiqueBatiment(caracteristiqueBatimentPayloadWeb);
|
caracteristiqueBatimentPayloadWeb = caracteristiqueBatimentService.createCaracteristiqueBatiment(caracteristiqueBatimentPayloadWeb);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, caracteristiqueBatimentPayloadWeb, "Caracteristique du batiment créé avec succès."),
|
new ApiResponse<>(true, caracteristiqueBatimentPayloadWeb, "Caracteristique du batiment créé avec succès."),
|
||||||
@@ -51,6 +56,7 @@ public class CaracteristiqueBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_CARACTERISTIQUEBATIMENT')")
|
||||||
public ResponseEntity<?> updateCaracteristiqueBatiment(@PathVariable Long id, @RequestBody CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb) {
|
public ResponseEntity<?> updateCaracteristiqueBatiment(@PathVariable Long id, @RequestBody CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -74,6 +80,7 @@ public class CaracteristiqueBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_CARACTERISTIQUEBATIMENT')")
|
||||||
public ResponseEntity<?> deleteCaracteristiqueBatiment(@PathVariable Long id) {
|
public ResponseEntity<?> deleteCaracteristiqueBatiment(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
caracteristiqueBatimentService.deleteCaracteristiqueBatiment(id);
|
caracteristiqueBatimentService.deleteCaracteristiqueBatiment(id);
|
||||||
@@ -98,6 +105,7 @@ public class CaracteristiqueBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||||
public ResponseEntity<?> getAllCaracteristiqueBatimentList() {
|
public ResponseEntity<?> getAllCaracteristiqueBatimentList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -121,6 +129,7 @@ public class CaracteristiqueBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||||
public ResponseEntity<?> getAllCaracteristiqueBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllCaracteristiqueBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -145,6 +154,7 @@ public class CaracteristiqueBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||||
public ResponseEntity<?> getCaracteristiqueBatimentById(@PathVariable Long id) {
|
public ResponseEntity<?> getCaracteristiqueBatimentById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -168,6 +178,7 @@ public class CaracteristiqueBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/by-enquete-batiment-id/{enqueteBatimentId}")
|
@GetMapping("/by-enquete-batiment-id/{enqueteBatimentId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||||
public ResponseEntity<?> getCaracteristiqueBatimentByBatimentId(@PathVariable Long enqueteBatimentId) {
|
public ResponseEntity<?> getCaracteristiqueBatimentByBatimentId(@PathVariable Long enqueteBatimentId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -191,6 +202,7 @@ public class CaracteristiqueBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page/by-enquete-batiment-id/{enqueteBatimentId}")
|
@GetMapping("/page/by-enquete-batiment-id/{enqueteBatimentId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||||
public ResponseEntity<?> getCaracteristiqueBatimentByEnqueteBatimentIdPaged(@PathVariable Long enqueteBatimentId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getCaracteristiqueBatimentByEnqueteBatimentIdPaged(@PathVariable Long enqueteBatimentId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -36,6 +37,7 @@ public class CaracteristiqueParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_CARACTERISTIQUEPARCELLE')")
|
||||||
public ResponseEntity<?> createCaracteristiqueParcelle(@RequestBody @Valid @Validated CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb) {
|
public ResponseEntity<?> createCaracteristiqueParcelle(@RequestBody @Valid @Validated CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb) {
|
||||||
try {
|
try {
|
||||||
caracteristiqueParcellePayloadWeb = caracteristiqueParcelleService.createCaracteristiqueParcelle(caracteristiqueParcellePayloadWeb);
|
caracteristiqueParcellePayloadWeb = caracteristiqueParcelleService.createCaracteristiqueParcelle(caracteristiqueParcellePayloadWeb);
|
||||||
@@ -60,6 +62,7 @@ public class CaracteristiqueParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_CARACTERISTIQUEPARCELLE')")
|
||||||
public ResponseEntity<?> updateCaracteristiqueParcelle(@PathVariable Long id, @RequestBody CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb) {
|
public ResponseEntity<?> updateCaracteristiqueParcelle(@PathVariable Long id, @RequestBody CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -83,6 +86,7 @@ public class CaracteristiqueParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_CARACTERISTIQUEPARCELLE')")
|
||||||
public ResponseEntity<?> deleteCaracteristiqueParcelle(@PathVariable Long id) {
|
public ResponseEntity<?> deleteCaracteristiqueParcelle(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
caracteristiqueParcelleService.deleteCaracteristiqueParcelle(id);
|
caracteristiqueParcelleService.deleteCaracteristiqueParcelle(id);
|
||||||
@@ -107,6 +111,7 @@ public class CaracteristiqueParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEPARCELLE')")
|
||||||
public ResponseEntity<?> getAllCaracteristiqueParcelleList() {
|
public ResponseEntity<?> getAllCaracteristiqueParcelleList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -130,6 +135,7 @@ public class CaracteristiqueParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEPARCELLE')")
|
||||||
public ResponseEntity<?> getAllCaracteristiqueParcellePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllCaracteristiqueParcellePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -154,6 +160,7 @@ public class CaracteristiqueParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEPARCELLE')")
|
||||||
public ResponseEntity<?> getCaracteristiqueParcelleById(@PathVariable Long id) {
|
public ResponseEntity<?> getCaracteristiqueParcelleById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -178,6 +185,7 @@ public class CaracteristiqueParcelleController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/by-enquete-id/{enqueteId}")
|
@GetMapping("/by-enquete-id/{enqueteId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEPARCELLE')")
|
||||||
public ResponseEntity<?> getAllCaracteristiqueParcelleList(@PathVariable Long enqueteId) {
|
public ResponseEntity<?> getAllCaracteristiqueParcelleList(@PathVariable Long enqueteId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -201,6 +209,7 @@ public class CaracteristiqueParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page/by-enquete-id/{enqueteId}")
|
@GetMapping("/page/by-enquete-id/{enqueteId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEPARCELLE')")
|
||||||
public ResponseEntity<?> getAllCaracteristiqueParcellePaged(@PathVariable Long enqueteId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllCaracteristiqueParcellePaged(@PathVariable Long enqueteId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -36,6 +37,7 @@ public class CaracteristiqueUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_CARACTERISTIQUEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> createCaracteristiqueUniteLogement(@RequestBody @Valid @Validated CaracteristiqueUniteLogementPayloadWeb caracteristiqueUniteLogementPayloadWeb) {
|
public ResponseEntity<?> createCaracteristiqueUniteLogement(@RequestBody @Valid @Validated CaracteristiqueUniteLogementPayloadWeb caracteristiqueUniteLogementPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
caracteristiqueUniteLogementPayloadWeb = caracteristiqueUniteLogementService.createCaracteristiqueUniteLogement(caracteristiqueUniteLogementPayloadWeb);
|
caracteristiqueUniteLogementPayloadWeb = caracteristiqueUniteLogementService.createCaracteristiqueUniteLogement(caracteristiqueUniteLogementPayloadWeb);
|
||||||
@@ -60,6 +62,7 @@ public class CaracteristiqueUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_CARACTERISTIQUEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> updateCaracteristiqueUniteLogement(@PathVariable Long id, @RequestBody CaracteristiqueUniteLogementPayloadWeb caracteristiqueUniteLogementPayloadWeb) {
|
public ResponseEntity<?> updateCaracteristiqueUniteLogement(@PathVariable Long id, @RequestBody CaracteristiqueUniteLogementPayloadWeb caracteristiqueUniteLogementPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -83,6 +86,7 @@ public class CaracteristiqueUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_CARACTERISTIQUEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> deleteCaracteristiqueUniteLogement(@PathVariable Long id) {
|
public ResponseEntity<?> deleteCaracteristiqueUniteLogement(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
caracteristiqueUniteLogementService.deleteCaracteristiqueUniteLogement(id);
|
caracteristiqueUniteLogementService.deleteCaracteristiqueUniteLogement(id);
|
||||||
@@ -107,6 +111,7 @@ public class CaracteristiqueUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getAllCaracteristiqueUniteLogementList() {
|
public ResponseEntity<?> getAllCaracteristiqueUniteLogementList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -130,6 +135,7 @@ public class CaracteristiqueUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getAllCaracteristiqueUniteLogementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllCaracteristiqueUniteLogementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -154,6 +160,7 @@ public class CaracteristiqueUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getCaracteristiqueUniteLogementById(@PathVariable Long id) {
|
public ResponseEntity<?> getCaracteristiqueUniteLogementById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -177,6 +184,7 @@ public class CaracteristiqueUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/by-enquete-ulo-id/{enqueteUloId}")
|
@GetMapping("/by-enquete-ulo-id/{enqueteUloId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getAllCaracteristiqueUniteLogementListByEul(@PathVariable Long enqueteUloId) {
|
public ResponseEntity<?> getAllCaracteristiqueUniteLogementListByEul(@PathVariable Long enqueteUloId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -200,6 +208,7 @@ public class CaracteristiqueUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page/by-enquete-ulo-id/{enqueteUloId}")
|
@GetMapping("/page/by-enquete-ulo-id/{enqueteUloId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getAllCaracteristiqueUniteLogementByEulPaged(@PathVariable Long enqueteUloId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllCaracteristiqueUniteLogementByEulPaged(@PathVariable Long enqueteUloId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|||||||
@@ -0,0 +1,325 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -18,6 +18,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -36,7 +37,8 @@ public class DeclarationNcController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public ResponseEntity<?> createDeclarationNc(@RequestBody @Valid @Validated DeclarationNcPayloadWeb declarationNcPayloadWeb) {
|
@PreAuthorize("hasAuthority('CREATE_DECLARATIONNC')")
|
||||||
|
public ResponseEntity<?> createDeclarationNc(@RequestBody DeclarationNcPayloadWeb declarationNcPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
declarationNcPayloadWeb = declarationNcService.createDeclarationNc(declarationNcPayloadWeb);
|
declarationNcPayloadWeb = declarationNcService.createDeclarationNc(declarationNcPayloadWeb);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -60,6 +62,7 @@ public class DeclarationNcController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_DECLARATIONNC')")
|
||||||
public ResponseEntity<?> updateEnqueteBatiment(@PathVariable Long id, @RequestBody DeclarationNcPayloadWeb declarationNcPayloadWeb) {
|
public ResponseEntity<?> updateEnqueteBatiment(@PathVariable Long id, @RequestBody DeclarationNcPayloadWeb declarationNcPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -83,6 +86,7 @@ public class DeclarationNcController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_DECLARATIONNC')")
|
||||||
public ResponseEntity<?> deleteEnqueteBatiment(@PathVariable Long id) {
|
public ResponseEntity<?> deleteEnqueteBatiment(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
declarationNcService.deleteDeclarationNc(id);
|
declarationNcService.deleteDeclarationNc(id);
|
||||||
@@ -107,6 +111,7 @@ public class DeclarationNcController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DECLARATIONNC')")
|
||||||
public ResponseEntity<?> getAllEnqueteBatimentList() {
|
public ResponseEntity<?> getAllEnqueteBatimentList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -130,6 +135,7 @@ public class DeclarationNcController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DECLARATIONNC')")
|
||||||
public ResponseEntity<?> getAllEnqueteBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllEnqueteBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +161,7 @@ public class DeclarationNcController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DECLARATIONNC')")
|
||||||
public ResponseEntity<?> getEnqueteBatimentById(@PathVariable Long id) {
|
public ResponseEntity<?> getEnqueteBatimentById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -178,6 +185,7 @@ public class DeclarationNcController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/by-personne-id/{personneId}")
|
@GetMapping("/by-personne-id/{personneId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DECLARATIONNC')")
|
||||||
public ResponseEntity<?> getDeclarationNcByPersonne(@PathVariable Long personneId) {
|
public ResponseEntity<?> getDeclarationNcByPersonne(@PathVariable Long personneId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -201,6 +209,7 @@ public class DeclarationNcController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page/by-personne-id/{personneId}")
|
@GetMapping("/page/by-personne-id/{personneId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DECLARATIONNC')")
|
||||||
public ResponseEntity<?> getDeclarationNcByPersonnePaged(@PathVariable Long personneId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getDeclarationNcByPersonnePaged(@PathVariable Long personneId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -46,6 +47,7 @@ public class DonneesImpositionTfuController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_DONNEESIMPOSITIONTFU')")
|
||||||
public ResponseEntity<?> createDonneesImpositionTfu(@RequestBody @Valid @Validated DonneesImpositionTfu donneesImpositionTfu) {
|
public ResponseEntity<?> createDonneesImpositionTfu(@RequestBody @Valid @Validated DonneesImpositionTfu donneesImpositionTfu) {
|
||||||
try {
|
try {
|
||||||
donneesImpositionTfu = donneesImpositionTfuService.createDonneesImpositionTfu(donneesImpositionTfu);
|
donneesImpositionTfu = donneesImpositionTfuService.createDonneesImpositionTfu(donneesImpositionTfu);
|
||||||
@@ -70,6 +72,7 @@ public class DonneesImpositionTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_DONNEESIMPOSITIONTFU')")
|
||||||
public ResponseEntity<?> updateDonneesImpositionTfu(@PathVariable Long id, @RequestBody DonneesImpositionTfu donneesImpositionTfu) {
|
public ResponseEntity<?> updateDonneesImpositionTfu(@PathVariable Long id, @RequestBody DonneesImpositionTfu donneesImpositionTfu) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -93,6 +96,7 @@ public class DonneesImpositionTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_DONNEESIMPOSITIONTFU')")
|
||||||
public ResponseEntity<?> deleteDonneesImpositionTfu(@PathVariable Long id) {
|
public ResponseEntity<?> deleteDonneesImpositionTfu(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
donneesImpositionTfuService.deleteDonneesImpositionTfu(id);
|
donneesImpositionTfuService.deleteDonneesImpositionTfu(id);
|
||||||
@@ -116,55 +120,56 @@ public class DonneesImpositionTfuController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
// @GetMapping("/all")
|
||||||
public ResponseEntity<?> getAllDonneesImpositionTfuList() {
|
// public ResponseEntity<?> getAllDonneesImpositionTfuList() {
|
||||||
try {
|
// try {
|
||||||
return new ResponseEntity<>(
|
// return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(), "Liste des impositions chargée avec succès."),
|
// new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(), "Liste des impositions chargée avec succès."),
|
||||||
HttpStatus.OK
|
// HttpStatus.OK
|
||||||
);
|
// );
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
// } catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
logger.error(e.getLocalizedMessage());
|
// logger.error(e.getLocalizedMessage());
|
||||||
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
// return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||||
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
// } catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||||
FileStorageException e) {
|
// FileStorageException e) {
|
||||||
logger.error(e.getLocalizedMessage());
|
// logger.error(e.getLocalizedMessage());
|
||||||
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
// return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||||
} catch (NullPointerException e) {
|
// } catch (NullPointerException e) {
|
||||||
logger.error(e.getLocalizedMessage());
|
// logger.error(e.getLocalizedMessage());
|
||||||
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
// return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
logger.error(e.getLocalizedMessage());
|
// logger.error(e.getLocalizedMessage());
|
||||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
// return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
// @GetMapping("/all-paged")
|
||||||
public ResponseEntity<?> getAllDonneesImpositionTfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
// public ResponseEntity<?> getAllDonneesImpositionTfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
// try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
// Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
return new ResponseEntity<>(
|
// return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(pageable), "Liste des impositions chargée avec succès."),
|
// new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(pageable), "Liste des impositions chargée avec succès."),
|
||||||
HttpStatus.OK
|
// HttpStatus.OK
|
||||||
);
|
// );
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
// } catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
logger.error(e.getLocalizedMessage());
|
// logger.error(e.getLocalizedMessage());
|
||||||
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
// return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||||
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
// } catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||||
FileStorageException e) {
|
// FileStorageException e) {
|
||||||
logger.error(e.getLocalizedMessage());
|
// logger.error(e.getLocalizedMessage());
|
||||||
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
// return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||||
} catch (NullPointerException e) {
|
// } catch (NullPointerException e) {
|
||||||
logger.error(e.getLocalizedMessage());
|
// logger.error(e.getLocalizedMessage());
|
||||||
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
// return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
logger.error(e.getLocalizedMessage());
|
// logger.error(e.getLocalizedMessage());
|
||||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
// return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-page/by-imposition-id/{impositionId}")
|
@GetMapping("/all-page/by-imposition-id/{impositionId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
|
||||||
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -189,6 +194,7 @@ public class DonneesImpositionTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-page/by-imposition-id/non-batie/{impositionId}")
|
@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) {
|
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdNonBatiePaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -214,6 +220,7 @@ public class DonneesImpositionTfuController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-page/by-imposition-id/batie-batiment/{impositionId}")
|
@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) {
|
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdBatieBatimentPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -238,6 +245,7 @@ public class DonneesImpositionTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-page/by-imposition-id/batie-unite-logement/{impositionId}")
|
@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) {
|
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdBatieUniteLogPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -262,6 +270,7 @@ public class DonneesImpositionTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
|
||||||
public ResponseEntity<?> getDonneesImpositionTfuById(@PathVariable Long id) {
|
public ResponseEntity<?> getDonneesImpositionTfuById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -285,6 +294,7 @@ public class DonneesImpositionTfuController {
|
|||||||
}
|
}
|
||||||
@Operation(summary = "Générer les données fiscales TFU des parcelle baties")
|
@Operation(summary = "Générer les données fiscales TFU des parcelle baties")
|
||||||
@PostMapping("/generer-batie")
|
@PostMapping("/generer-batie")
|
||||||
|
@PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')")
|
||||||
public ResponseEntity<?> genererDonneesFiscaleBatie(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
public ResponseEntity<?> genererDonneesFiscaleBatie(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
|
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
|
||||||
@@ -333,10 +343,65 @@ 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")
|
@Operation(summary = "Générer les données fiscales TFU des parcelle baties")
|
||||||
@PostMapping("/generer-non-batie")
|
@PostMapping("/generer-non-batie")
|
||||||
|
@PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')")
|
||||||
public ResponseEntity<?> genererDonneesImpositionNonBaties(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
public ResponseEntity<?> genererDonneesImpositionNonBaties(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
|
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
|
||||||
@@ -384,8 +449,63 @@ 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")
|
@Operation(summary = "Récuperer les avis d'id d'une imposition")
|
||||||
@GetMapping("/by-impositions-id/{impositionsId}")
|
@GetMapping("/by-impositions-id/{impositionsId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
|
||||||
public ResponseEntity<?> getDonneesFiscale(@PathVariable Long impositionsId) {
|
public ResponseEntity<?> getDonneesFiscale(@PathVariable Long impositionsId) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -412,6 +532,7 @@ public class DonneesImpositionTfuController {
|
|||||||
|
|
||||||
@Operation(summary = "Récuperer les avis d'id d'une imposition et l'id d'un arrondissement")
|
@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}")
|
@GetMapping("/by-impositions-id/by-arrondissement/{impositionsId}/{arrondissementId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
|
||||||
public ResponseEntity<?> getDonneesFiscaleParImpositionArrondissement(@PathVariable Long impositionsId,@PathVariable Long arrondissementId) {
|
public ResponseEntity<?> getDonneesFiscaleParImpositionArrondissement(@PathVariable Long impositionsId,@PathVariable Long arrondissementId) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -437,6 +558,7 @@ public class DonneesImpositionTfuController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-page/by-exercice-id/by-structure-id/{exerciceId}/{structureId}")
|
@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) {
|
public ResponseEntity<?> getAllDonneesImpositionTfuByExerciceIdAndStructureIdPaged(@PathVariable Long exerciceId, @PathVariable Long structureId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -462,6 +584,7 @@ public class DonneesImpositionTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all/by-exercice-id/by-structure-id/by-quartier-id/{exerciceId}/{structureId}/{quartierId}")
|
@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) {
|
public ResponseEntity<?> getAllDonneesImpositionTfuByExerciceIdAndStructureId(@PathVariable Long exerciceId, @PathVariable Long structureId, @PathVariable Long quartierId) {
|
||||||
try {
|
try {
|
||||||
System.out.println("NOUS SOMMES ICI");
|
System.out.println("NOUS SOMMES ICI");
|
||||||
@@ -488,6 +611,7 @@ public class DonneesImpositionTfuController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all/by-personne-id/{personneId}")
|
@GetMapping("/all/by-personne-id/{personneId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DONNEESIMPOSITIONTFU')")
|
||||||
public ResponseEntity<?> getAllDonneesImpositionTfuByPersonneId(@PathVariable Long personneId) {
|
public ResponseEntity<?> getAllDonneesImpositionTfuByPersonneId(@PathVariable Long personneId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -37,6 +38,7 @@ public class EnqueteActiviteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_ENQUETEACTIVITE')")
|
||||||
public ResponseEntity<?> createEnqueteActivite(@RequestBody @Valid @Validated EnqueteActivitePayLoadWeb enqueteActivitePayLoadWeb) {
|
public ResponseEntity<?> createEnqueteActivite(@RequestBody @Valid @Validated EnqueteActivitePayLoadWeb enqueteActivitePayLoadWeb) {
|
||||||
try {
|
try {
|
||||||
EnqueteActivite enqueteActivite = enqueteActiviteService.createEnqueteActivite(enqueteActivitePayLoadWeb);
|
EnqueteActivite enqueteActivite = enqueteActiviteService.createEnqueteActivite(enqueteActivitePayLoadWeb);
|
||||||
@@ -61,6 +63,7 @@ public class EnqueteActiviteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETEACTIVITE')")
|
||||||
public ResponseEntity<?> updateEnqueteActivite(@PathVariable Long id, @RequestBody EnqueteActivitePayLoadWeb enqueteActivitePayLoadWeb) {
|
public ResponseEntity<?> updateEnqueteActivite(@PathVariable Long id, @RequestBody EnqueteActivitePayLoadWeb enqueteActivitePayLoadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +87,7 @@ public class EnqueteActiviteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_ENQUETEACTIVITE')")
|
||||||
public ResponseEntity<?> deleteEnqueteActivite(@PathVariable Long id) {
|
public ResponseEntity<?> deleteEnqueteActivite(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
enqueteActiviteService.deleteEnqueteActivite(id);
|
enqueteActiviteService.deleteEnqueteActivite(id);
|
||||||
@@ -108,6 +112,7 @@ public class EnqueteActiviteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETEACTIVITE')")
|
||||||
public ResponseEntity<?> getAllEnqueteActiviteList() {
|
public ResponseEntity<?> getAllEnqueteActiviteList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +136,7 @@ public class EnqueteActiviteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETEACTIVITE')")
|
||||||
public ResponseEntity<?> getAllEnqueteActivitePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllEnqueteActivitePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +161,7 @@ public class EnqueteActiviteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETEACTIVITE')")
|
||||||
public ResponseEntity<?> getEnqueteActiviteById(@PathVariable Long id) {
|
public ResponseEntity<?> getEnqueteActiviteById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -42,6 +43,7 @@ public class EnqueteBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_ENQUETEBATIMENT')")
|
||||||
public ResponseEntity<?> createEnqueteBatiment(@RequestBody @Valid @Validated EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) {
|
public ResponseEntity<?> createEnqueteBatiment(@RequestBody @Valid @Validated EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
enqueteBatimentPayloadWeb = enqueteBatimentService.createEnqueteBatiment(enqueteBatimentPayloadWeb);
|
enqueteBatimentPayloadWeb = enqueteBatimentService.createEnqueteBatiment(enqueteBatimentPayloadWeb);
|
||||||
@@ -67,6 +69,7 @@ public class EnqueteBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
|
||||||
public ResponseEntity<?> updateEnqueteBatiment(@PathVariable Long id, @RequestBody EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) {
|
public ResponseEntity<?> updateEnqueteBatiment(@PathVariable Long id, @RequestBody EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -90,6 +93,7 @@ public class EnqueteBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_ENQUETEBATIMENT')")
|
||||||
public ResponseEntity<?> deleteEnqueteBatiment(@PathVariable Long id) {
|
public ResponseEntity<?> deleteEnqueteBatiment(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
enqueteBatimentService.deleteEnqueteBatiment(id);
|
enqueteBatimentService.deleteEnqueteBatiment(id);
|
||||||
@@ -114,6 +118,7 @@ public class EnqueteBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
|
||||||
public ResponseEntity<?> getAllEnqueteBatimentList() {
|
public ResponseEntity<?> getAllEnqueteBatimentList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -137,6 +142,7 @@ public class EnqueteBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
|
||||||
public ResponseEntity<?> getAllEnqueteBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllEnqueteBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -162,6 +168,7 @@ public class EnqueteBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
|
||||||
public ResponseEntity<?> getEnqueteBatimentById(@PathVariable Long id) {
|
public ResponseEntity<?> getEnqueteBatimentById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -185,6 +192,7 @@ public class EnqueteBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/by-batiment-id/{batimentId}")
|
@GetMapping("/by-batiment-id/{batimentId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
|
||||||
public ResponseEntity<?> getEnqueteBatimentByBatimentId(@PathVariable Long batimentId) {
|
public ResponseEntity<?> getEnqueteBatimentByBatimentId(@PathVariable Long batimentId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -208,6 +216,7 @@ public class EnqueteBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page/by-batiment-id/{batimentId}")
|
@GetMapping("/page/by-batiment-id/{batimentId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETEBATIMENT')")
|
||||||
public ResponseEntity<?> getEnqueteBatimentByBatimentIdPaged(@PathVariable Long batimentId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getEnqueteBatimentByBatimentIdPaged(@PathVariable Long batimentId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -233,6 +242,7 @@ public class EnqueteBatimentController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-paged/en-cours/by-quartier-id/{quartierId}")
|
@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) {
|
public ResponseEntity<?> getAllEnqueteBatimentEnCoursByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -263,6 +273,7 @@ public class EnqueteBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}")
|
@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) {
|
public ResponseEntity<?> getAllEnqueteBatimentClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -294,6 +305,7 @@ public class EnqueteBatimentController {
|
|||||||
|
|
||||||
|
|
||||||
@PutMapping("/validation")
|
@PutMapping("/validation")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
|
||||||
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -317,6 +329,7 @@ public class EnqueteBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/rejet")
|
@PutMapping("/rejet")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
|
||||||
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -341,6 +354,7 @@ public class EnqueteBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/validation-lot")
|
@PutMapping("/validation-lot")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
|
||||||
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -364,6 +378,7 @@ public class EnqueteBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/rejet-lot")
|
@PutMapping("/rejet-lot")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETEBATIMENT')")
|
||||||
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -42,6 +43,7 @@ public class EnqueteUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_ENQUETEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> createEnqueteUniteLogement(@RequestBody @Valid @Validated EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) {
|
public ResponseEntity<?> createEnqueteUniteLogement(@RequestBody @Valid @Validated EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
enqueteUniteLogementPayloadWeb = enqueteUniteLogementService.createEnqueteUniteLogement(enqueteUniteLogementPayloadWeb);
|
enqueteUniteLogementPayloadWeb = enqueteUniteLogementService.createEnqueteUniteLogement(enqueteUniteLogementPayloadWeb);
|
||||||
@@ -66,6 +68,7 @@ public class EnqueteUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> updateEnqueteUniteLogement(@PathVariable Long id, @RequestBody EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) {
|
public ResponseEntity<?> updateEnqueteUniteLogement(@PathVariable Long id, @RequestBody EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -89,6 +92,7 @@ public class EnqueteUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_ENQUETEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> deleteEnqueteUniteLogement(@PathVariable Long id) {
|
public ResponseEntity<?> deleteEnqueteUniteLogement(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
enqueteUniteLogementService.deleteEnqueteUniteLogement(id);
|
enqueteUniteLogementService.deleteEnqueteUniteLogement(id);
|
||||||
@@ -113,6 +117,7 @@ public class EnqueteUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getAllEnqueteUniteLogementList() {
|
public ResponseEntity<?> getAllEnqueteUniteLogementList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -136,6 +141,7 @@ public class EnqueteUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getAllEnqueteUniteLogementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllEnqueteUniteLogementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -161,6 +167,7 @@ public class EnqueteUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getEnqueteUniteLogementById(@PathVariable Long id) {
|
public ResponseEntity<?> getEnqueteUniteLogementById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -184,6 +191,7 @@ public class EnqueteUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/by-unite-logement-id/{uniteLogementId}")
|
@GetMapping("/by-unite-logement-id/{uniteLogementId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getEnqueteUniteLogementByUniteLogement(@PathVariable Long uniteLogementId) {
|
public ResponseEntity<?> getEnqueteUniteLogementByUniteLogement(@PathVariable Long uniteLogementId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -207,6 +215,7 @@ public class EnqueteUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page/by-unite-logement-id/{uniteLogementId}")
|
@GetMapping("/page/by-unite-logement-id/{uniteLogementId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ENQUETEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getEnqueteUniteLogementByUniteLogementPaged(@PathVariable Long uniteLogementId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getEnqueteUniteLogementByUniteLogementPaged(@PathVariable Long uniteLogementId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -232,6 +241,7 @@ public class EnqueteUniteLogementController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-paged/en-cours/by-quartier-id/{quartierId}")
|
@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) {
|
public ResponseEntity<?> getAllEnqueteUniteLogementEncoursByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -263,6 +273,7 @@ public class EnqueteUniteLogementController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}")
|
@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) {
|
public ResponseEntity<?> getAllEnqueteUniteLogementClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -294,6 +305,7 @@ public class EnqueteUniteLogementController {
|
|||||||
|
|
||||||
|
|
||||||
@PutMapping("/validation")
|
@PutMapping("/validation")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -317,6 +329,7 @@ public class EnqueteUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/rejet")
|
@PutMapping("/rejet")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -341,6 +354,7 @@ public class EnqueteUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/validation-lot")
|
@PutMapping("/validation-lot")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -364,6 +378,7 @@ public class EnqueteUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/rejet-lot")
|
@PutMapping("/rejet-lot")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ENQUETEUNITELOGEMENT')")
|
||||||
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -44,6 +45,7 @@ public class ImpositionsTfuController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_IMPOSITIONSTFU')")
|
||||||
public ResponseEntity<?> createImpositionsTfu(@CurrentUser UserPrincipal currentUser,@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
public ResponseEntity<?> createImpositionsTfu(@CurrentUser UserPrincipal currentUser,@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
if(currentUser==null){
|
if(currentUser==null){
|
||||||
@@ -84,6 +86,7 @@ public class ImpositionsTfuController {
|
|||||||
|
|
||||||
|
|
||||||
@PutMapping("/cloturer-enquete")
|
@PutMapping("/cloturer-enquete")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_IMPOSITIONSTFU')")
|
||||||
public ResponseEntity<?> cloturer(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb ) {
|
public ResponseEntity<?> cloturer(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb ) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -151,6 +154,7 @@ public class ImpositionsTfuController {
|
|||||||
)
|
)
|
||||||
|
|
||||||
@PutMapping("/autoriser-generation-avis")
|
@PutMapping("/autoriser-generation-avis")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_IMPOSITIONSTFU')")
|
||||||
public ResponseEntity<?> autoriserImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
public ResponseEntity<?> autoriserImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -174,6 +178,7 @@ public class ImpositionsTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/rejeter")
|
@PutMapping("/rejeter")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_IMPOSITIONSTFU')")
|
||||||
public ResponseEntity<?> annulerImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
public ResponseEntity<?> annulerImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -197,6 +202,7 @@ public class ImpositionsTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_IMPOSITIONSTFU')")
|
||||||
public ResponseEntity<?> deleteImpositionsTfu(@PathVariable Long id) {
|
public ResponseEntity<?> deleteImpositionsTfu(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
impositionsTfuService.deleteImpositionsTfu(id);
|
impositionsTfuService.deleteImpositionsTfu(id);
|
||||||
@@ -221,6 +227,7 @@ public class ImpositionsTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all/by-user")
|
@GetMapping("/all/by-user")
|
||||||
|
@PreAuthorize("hasAuthority('READ_IMPOSITIONSTFU')")
|
||||||
public ResponseEntity<?> getAllImpositionsTfuList(@CurrentUser UserPrincipal userPrincipal) {
|
public ResponseEntity<?> getAllImpositionsTfuList(@CurrentUser UserPrincipal userPrincipal) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -252,6 +259,7 @@ public class ImpositionsTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_IMPOSITIONSTFU')")
|
||||||
public ResponseEntity<?> getAllImpositionsTfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllImpositionsTfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -277,6 +285,7 @@ public class ImpositionsTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_IMPOSITIONSTFU')")
|
||||||
public ResponseEntity<?> getImpositionsTfuById(@PathVariable Long id) {
|
public ResponseEntity<?> getImpositionsTfuById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -36,6 +37,7 @@ public class UniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_UNITELOGEMENT')")
|
||||||
public ResponseEntity<?> createUniteLogement(@RequestBody @Valid @Validated UniteLogementPaylaodWeb enqueteUniteLogementPaylaodWeb) {
|
public ResponseEntity<?> createUniteLogement(@RequestBody @Valid @Validated UniteLogementPaylaodWeb enqueteUniteLogementPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
enqueteUniteLogementPaylaodWeb = enqueteUniteLogementService.createUniteLogement(enqueteUniteLogementPaylaodWeb);
|
enqueteUniteLogementPaylaodWeb = enqueteUniteLogementService.createUniteLogement(enqueteUniteLogementPaylaodWeb);
|
||||||
@@ -60,6 +62,7 @@ public class UniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_UNITELOGEMENT')")
|
||||||
public ResponseEntity<?> updateUniteLogement(@PathVariable Long id, @RequestBody UniteLogementPaylaodWeb enqueteUniteLogementPaylaodWeb) {
|
public ResponseEntity<?> updateUniteLogement(@PathVariable Long id, @RequestBody UniteLogementPaylaodWeb enqueteUniteLogementPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -83,6 +86,7 @@ public class UniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_UNITELOGEMENT')")
|
||||||
public ResponseEntity<?> deleteUniteLogement(@PathVariable Long id) {
|
public ResponseEntity<?> deleteUniteLogement(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
enqueteUniteLogementService.deleteUniteLogement(id);
|
enqueteUniteLogementService.deleteUniteLogement(id);
|
||||||
@@ -107,6 +111,7 @@ public class UniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getAllUniteLogementList() {
|
public ResponseEntity<?> getAllUniteLogementList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -130,6 +135,7 @@ public class UniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getAllUniteLogementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllUniteLogementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +161,7 @@ public class UniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all/by-batiment-id/{batimentId}")
|
@GetMapping("/all/by-batiment-id/{batimentId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getAllUniteLogementListByBatiment(@PathVariable Long batimentId) {
|
public ResponseEntity<?> getAllUniteLogementListByBatiment(@PathVariable Long batimentId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -178,6 +185,7 @@ public class UniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged/by-batiment-id/{batimentId}")
|
@GetMapping("/all-paged/by-batiment-id/{batimentId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getAllUniteLogementByBatimentPaged(@PathVariable Long batimentId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllUniteLogementByBatimentPaged(@PathVariable Long batimentId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -203,6 +211,7 @@ public class UniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getUniteLogementById(@PathVariable Long id) {
|
public ResponseEntity<?> getUniteLogementById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -226,6 +235,7 @@ public class UniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/by-parcelle-id/{id}")
|
@GetMapping("/by-parcelle-id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getUniteLogementByParcelleId(@PathVariable Long id) {
|
public ResponseEntity<?> getUniteLogementByParcelleId(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -250,6 +260,7 @@ public class UniteLogementController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-paged/by-quartier-id/{quartierId}")
|
@GetMapping("/all-paged/by-quartier-id/{quartierId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getAllUniteLogementByQuartierPaged(@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllUniteLogementByQuartierPaged(@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -276,6 +287,7 @@ public class UniteLogementController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all/by-quartier-id/{quartierId}")
|
@GetMapping("/all/by-quartier-id/{quartierId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_UNITELOGEMENT')")
|
||||||
public ResponseEntity<?> getAllUniteLogementByQuartier(@PathVariable Long quartierId) {
|
public ResponseEntity<?> getAllUniteLogementByQuartier(@PathVariable Long quartierId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -34,6 +35,7 @@ public class BaremRfuController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_BAREMRFUBATI')")
|
||||||
public ResponseEntity<?> createBaremRfu(@RequestBody @Valid @Validated BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) {
|
public ResponseEntity<?> createBaremRfu(@RequestBody @Valid @Validated BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
baremRfuBatiPayloadWeb = baremRfuBatiService.createBaremRfu(baremRfuBatiPayloadWeb);
|
baremRfuBatiPayloadWeb = baremRfuBatiService.createBaremRfu(baremRfuBatiPayloadWeb);
|
||||||
@@ -58,6 +60,7 @@ public class BaremRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_BAREMRFUBATI')")
|
||||||
public ResponseEntity<?> updateBaremRfu(@PathVariable Long id, @RequestBody BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) {
|
public ResponseEntity<?> updateBaremRfu(@PathVariable Long id, @RequestBody BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -81,6 +84,7 @@ public class BaremRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_BAREMRFUBATI')")
|
||||||
public ResponseEntity<?> deleteBaremRfur(@PathVariable Long id) {
|
public ResponseEntity<?> deleteBaremRfur(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
baremRfuBatiService.deleteBaremRfu(id);
|
baremRfuBatiService.deleteBaremRfu(id);
|
||||||
@@ -105,6 +109,7 @@ public class BaremRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BAREMRFUBATI')")
|
||||||
public ResponseEntity<?> getAllBaremRfuList() {
|
public ResponseEntity<?> getAllBaremRfuList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -128,6 +133,7 @@ public class BaremRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BAREMRFUBATI')")
|
||||||
public ResponseEntity<?> getAllBaremRfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllBaremRfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -153,6 +159,7 @@ public class BaremRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BAREMRFUBATI')")
|
||||||
public ResponseEntity<?> getBaremRfuById(@PathVariable Long id) {
|
public ResponseEntity<?> getBaremRfuById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -176,6 +183,7 @@ public class BaremRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/by-categorie-batiment-id/{idCategorieBatiment}")
|
@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)
|
public ResponseEntity<?> getBaremRfuByType( //@Parameter(description = "ID de la catégorie de bâtiment", required = true)
|
||||||
@PathVariable Long idCategorieBatiment) {
|
@PathVariable Long idCategorieBatiment) {
|
||||||
|
|
||||||
@@ -202,6 +210,7 @@ public class BaremRfuController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/by-arrondissement-id/by-categorie-batiment-id/{idArrondissement}/{idCategorieBatiment}")
|
@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)
|
public ResponseEntity<?> getBaremRfuByArrondisementAndCategorie( //@Parameter(description = "ID de la catégorie de bâtiment", required = true)
|
||||||
@PathVariable Long idArrondissement,
|
@PathVariable Long idArrondissement,
|
||||||
@PathVariable Long idCategorieBatiment
|
@PathVariable Long idCategorieBatiment
|
||||||
@@ -229,6 +238,7 @@ public class BaremRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/by-quartier-id/by-categorie-batiment-id/{idQuartier}/{idCategorieBatiment}")
|
@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)
|
public ResponseEntity<?> getBaremRfuByQuartierAndCategorie( //@Parameter(description = "ID de la catégorie de bâtiment", required = true)
|
||||||
@PathVariable Long idQuartier,
|
@PathVariable Long idQuartier,
|
||||||
@PathVariable Long idCategorieBatiment
|
@PathVariable Long idCategorieBatiment
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -35,6 +36,7 @@ public class BaremRfuNonBatiController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_BAREMRFUNONBATI')")
|
||||||
public ResponseEntity<?> createBaremRfuNonBati(@RequestBody BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) {
|
public ResponseEntity<?> createBaremRfuNonBati(@RequestBody BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
baremRfuNonBatiPayloadWeb = baremRfuNonBatiService.createBaremRfuNonBati(baremRfuNonBatiPayloadWeb);
|
baremRfuNonBatiPayloadWeb = baremRfuNonBatiService.createBaremRfuNonBati(baremRfuNonBatiPayloadWeb);
|
||||||
@@ -59,6 +61,7 @@ public class BaremRfuNonBatiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_BAREMRFUNONBATI')")
|
||||||
public ResponseEntity<?> updateBaremRfuNonBati(@PathVariable Long id, @RequestBody BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) {
|
public ResponseEntity<?> updateBaremRfuNonBati(@PathVariable Long id, @RequestBody BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -82,6 +85,7 @@ public class BaremRfuNonBatiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_BAREMRFUNONBATI')")
|
||||||
public ResponseEntity<?> deleteBaremRfuNonBatir(@PathVariable Long id) {
|
public ResponseEntity<?> deleteBaremRfuNonBatir(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
baremRfuNonBatiService.deleteBaremRfuNonBati(id);
|
baremRfuNonBatiService.deleteBaremRfuNonBati(id);
|
||||||
@@ -106,6 +110,7 @@ public class BaremRfuNonBatiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BAREMRFUNONBATI')")
|
||||||
public ResponseEntity<?> getAllBaremRfuNonBatiList() {
|
public ResponseEntity<?> getAllBaremRfuNonBatiList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -129,6 +134,7 @@ public class BaremRfuNonBatiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BAREMRFUNONBATI')")
|
||||||
public ResponseEntity<?> getAllBaremRfuNonBatiPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllBaremRfuNonBatiPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -154,6 +160,7 @@ public class BaremRfuNonBatiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BAREMRFUNONBATI')")
|
||||||
public ResponseEntity<?> getBaremRfuNonBatiById(@PathVariable Long id) {
|
public ResponseEntity<?> getBaremRfuNonBatiById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -178,6 +185,7 @@ public class BaremRfuNonBatiController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/by-commune-id/by-zone-id/{communeId}/{zoneId}")
|
@GetMapping("/by-commune-id/by-zone-id/{communeId}/{zoneId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_BAREMRFUNONBATI')")
|
||||||
public ResponseEntity<?> getBaremRfuNonBatiByCommineAndZoneId(@PathVariable Long communeId, Long zoneId) {
|
public ResponseEntity<?> getBaremRfuNonBatiByCommineAndZoneId(@PathVariable Long communeId, Long zoneId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -35,6 +36,7 @@ public class CampagneController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_CAMPAGNE')")
|
||||||
public ResponseEntity<?> createCampagne(@RequestBody @Valid @Validated Campagne campagne) {
|
public ResponseEntity<?> createCampagne(@RequestBody @Valid @Validated Campagne campagne) {
|
||||||
try {
|
try {
|
||||||
campagne = campagneService.createCampagne(campagne);
|
campagne = campagneService.createCampagne(campagne);
|
||||||
@@ -59,6 +61,7 @@ public class CampagneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_CAMPAGNE')")
|
||||||
public ResponseEntity<?> updateCampagne(@PathVariable Long id, @RequestBody Campagne campagne) {
|
public ResponseEntity<?> updateCampagne(@PathVariable Long id, @RequestBody Campagne campagne) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -82,6 +85,7 @@ public class CampagneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_CAMPAGNE')")
|
||||||
public ResponseEntity<?> deleteCampagner(@PathVariable Long id) {
|
public ResponseEntity<?> deleteCampagner(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
campagneService.deleteCampagne(id);
|
campagneService.deleteCampagne(id);
|
||||||
@@ -106,6 +110,7 @@ public class CampagneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
|
||||||
public ResponseEntity<?> getAllCampagneList() {
|
public ResponseEntity<?> getAllCampagneList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -129,6 +134,7 @@ public class CampagneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
|
||||||
public ResponseEntity<?> getAllCampagnePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllCampagnePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -154,6 +160,7 @@ public class CampagneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
|
||||||
public ResponseEntity<?> getCampagneById(@PathVariable Long id) {
|
public ResponseEntity<?> getCampagneById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -177,6 +184,7 @@ public class CampagneController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/type-campagne/{typeCampagne}")
|
@GetMapping("/type-campagne/{typeCampagne}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
|
||||||
public ResponseEntity<?> getCampagneByType(@PathVariable TypeCampagne typeCampagne) {
|
public ResponseEntity<?> getCampagneByType(@PathVariable TypeCampagne typeCampagne) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -34,6 +35,7 @@ public class CaracteristiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_CARACTERISTIQUE')")
|
||||||
public ResponseEntity<?> createCaracteristique(@RequestBody @Valid @Validated Caracteristique caracteristique) {
|
public ResponseEntity<?> createCaracteristique(@RequestBody @Valid @Validated Caracteristique caracteristique) {
|
||||||
try {
|
try {
|
||||||
caracteristique = caracteristiqueService.createCaracteristique(caracteristique);
|
caracteristique = caracteristiqueService.createCaracteristique(caracteristique);
|
||||||
@@ -58,6 +60,7 @@ public class CaracteristiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_CARACTERISTIQUE')")
|
||||||
public ResponseEntity<?> updateCaracteristique(@PathVariable Long id, @RequestBody Caracteristique caracteristique) {
|
public ResponseEntity<?> updateCaracteristique(@PathVariable Long id, @RequestBody Caracteristique caracteristique) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -81,6 +84,7 @@ public class CaracteristiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_CARACTERISTIQUE')")
|
||||||
public ResponseEntity<?> deleteCaracteristique(@PathVariable Long id) {
|
public ResponseEntity<?> deleteCaracteristique(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
caracteristiqueService.deleteCaracteristique(id);
|
caracteristiqueService.deleteCaracteristique(id);
|
||||||
@@ -105,6 +109,7 @@ public class CaracteristiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUE')")
|
||||||
public ResponseEntity<?> getAllCaracteristiqueList() {
|
public ResponseEntity<?> getAllCaracteristiqueList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -128,6 +133,7 @@ public class CaracteristiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUE')")
|
||||||
public ResponseEntity<?> getAllCaracteristiquePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllCaracteristiquePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -153,6 +159,7 @@ public class CaracteristiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CARACTERISTIQUE')")
|
||||||
public ResponseEntity<?> getCaracteristiqueById(@PathVariable Long id) {
|
public ResponseEntity<?> getCaracteristiqueById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -34,6 +35,7 @@ public class CategorieBatimentController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_CATEGORIEBATIMENT')")
|
||||||
public ResponseEntity<?> createCategorieBatiment(@RequestBody @Valid @Validated CategorieBatiment categorieBatiment) {
|
public ResponseEntity<?> createCategorieBatiment(@RequestBody @Valid @Validated CategorieBatiment categorieBatiment) {
|
||||||
try {
|
try {
|
||||||
categorieBatiment = categorieBatimentService.createCategorieBatiment(categorieBatiment);
|
categorieBatiment = categorieBatimentService.createCategorieBatiment(categorieBatiment);
|
||||||
@@ -58,6 +60,7 @@ public class CategorieBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_CATEGORIEBATIMENT')")
|
||||||
public ResponseEntity<?> updateCategorieBatiment(@PathVariable Long id, @RequestBody CategorieBatiment categorieBatiment) {
|
public ResponseEntity<?> updateCategorieBatiment(@PathVariable Long id, @RequestBody CategorieBatiment categorieBatiment) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -81,6 +84,7 @@ public class CategorieBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_CATEGORIEBATIMENT')")
|
||||||
public ResponseEntity<?> deleteCategorieBatimentr(@PathVariable Long id) {
|
public ResponseEntity<?> deleteCategorieBatimentr(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
categorieBatimentService.deleteCategorieBatiment(id);
|
categorieBatimentService.deleteCategorieBatiment(id);
|
||||||
@@ -105,6 +109,7 @@ public class CategorieBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CATEGORIEBATIMENT')")
|
||||||
public ResponseEntity<?> getAllCategorieBatimentList() {
|
public ResponseEntity<?> getAllCategorieBatimentList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -128,6 +133,7 @@ public class CategorieBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CATEGORIEBATIMENT')")
|
||||||
public ResponseEntity<?> getAllCategorieBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllCategorieBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -153,6 +159,7 @@ public class CategorieBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_CATEGORIEBATIMENT')")
|
||||||
public ResponseEntity<?> getCategorieBatimentById(@PathVariable Long id) {
|
public ResponseEntity<?> getCategorieBatimentById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -35,6 +36,7 @@ public class EquipeController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_EQUIPE')")
|
||||||
public ResponseEntity<?> createEquipe(@RequestBody @Valid @Validated EquipePayload equipePayload) {
|
public ResponseEntity<?> createEquipe(@RequestBody @Valid @Validated EquipePayload equipePayload) {
|
||||||
try {
|
try {
|
||||||
Equipe equipe = equipeService.createEquipe(equipePayload);
|
Equipe equipe = equipeService.createEquipe(equipePayload);
|
||||||
@@ -59,6 +61,7 @@ public class EquipeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_EQUIPE')")
|
||||||
public ResponseEntity<?> updateEquipe(@PathVariable Long id, @RequestBody EquipePayload equipePayload) {
|
public ResponseEntity<?> updateEquipe(@PathVariable Long id, @RequestBody EquipePayload equipePayload) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -82,6 +85,7 @@ public class EquipeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_EQUIPE')")
|
||||||
public ResponseEntity<?> deleteEquiper(@PathVariable Long id) {
|
public ResponseEntity<?> deleteEquiper(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
equipeService.deleteEquipe(id);
|
equipeService.deleteEquipe(id);
|
||||||
@@ -106,6 +110,7 @@ public class EquipeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_EQUIPE')")
|
||||||
public ResponseEntity<?> getAllEquipeList() {
|
public ResponseEntity<?> getAllEquipeList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -129,6 +134,7 @@ public class EquipeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_EQUIPE')")
|
||||||
public ResponseEntity<?> getAllEquipePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllEquipePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -154,6 +160,7 @@ public class EquipeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_EQUIPE')")
|
||||||
public ResponseEntity<?> getEquipeById(@PathVariable Long id) {
|
public ResponseEntity<?> getEquipeById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -34,6 +35,7 @@ public class ExerciceController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_EXERCICE')")
|
||||||
public ResponseEntity<?> createExercice(@RequestBody @Valid @Validated Exercice exercice) {
|
public ResponseEntity<?> createExercice(@RequestBody @Valid @Validated Exercice exercice) {
|
||||||
try {
|
try {
|
||||||
exercice = exerciceService.createExercice(exercice);
|
exercice = exerciceService.createExercice(exercice);
|
||||||
@@ -58,6 +60,7 @@ public class ExerciceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_EXERCICE')")
|
||||||
public ResponseEntity<?> updateExercice(@PathVariable Long id, @RequestBody Exercice exercice) {
|
public ResponseEntity<?> updateExercice(@PathVariable Long id, @RequestBody Exercice exercice) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -81,6 +84,7 @@ public class ExerciceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_EXERCICE')")
|
||||||
public ResponseEntity<?> deleteExercicer(@PathVariable Long id) {
|
public ResponseEntity<?> deleteExercicer(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
exerciceService.deleteExercice(id);
|
exerciceService.deleteExercice(id);
|
||||||
@@ -105,6 +109,7 @@ public class ExerciceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_EXERCICE')")
|
||||||
public ResponseEntity<?> getAllExerciceList() {
|
public ResponseEntity<?> getAllExerciceList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -128,6 +133,7 @@ public class ExerciceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_EXERCICE')")
|
||||||
public ResponseEntity<?> getAllExercicePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllExercicePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -153,6 +159,7 @@ public class ExerciceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_EXERCICE')")
|
||||||
public ResponseEntity<?> getExerciceById(@PathVariable Long id) {
|
public ResponseEntity<?> getExerciceById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -175,6 +182,5 @@ public class ExerciceController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -34,6 +35,7 @@ public class TypeCaracteristiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_TYPECARACTERISTIQUE')")
|
||||||
public ResponseEntity<?> createTypeCaracteristique(@RequestBody @Valid @Validated TypeCaracteristique typeCaracteristique) {
|
public ResponseEntity<?> createTypeCaracteristique(@RequestBody @Valid @Validated TypeCaracteristique typeCaracteristique) {
|
||||||
try {
|
try {
|
||||||
typeCaracteristique = typeCaracteristiqueService.createTypeCaracteristique(typeCaracteristique);
|
typeCaracteristique = typeCaracteristiqueService.createTypeCaracteristique(typeCaracteristique);
|
||||||
@@ -58,6 +60,7 @@ public class TypeCaracteristiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_TYPECARACTERISTIQUE')")
|
||||||
public ResponseEntity<?> updateTypeCaracteristique(@PathVariable Long id, @RequestBody TypeCaracteristique typeCaracteristique) {
|
public ResponseEntity<?> updateTypeCaracteristique(@PathVariable Long id, @RequestBody TypeCaracteristique typeCaracteristique) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -81,6 +84,7 @@ public class TypeCaracteristiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_TYPECARACTERISTIQUE')")
|
||||||
public ResponseEntity<?> deleteTypeCaracteristique(@PathVariable Long id) {
|
public ResponseEntity<?> deleteTypeCaracteristique(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
typeCaracteristiqueService.deleteTypeCaracteristique(id);
|
typeCaracteristiqueService.deleteTypeCaracteristique(id);
|
||||||
@@ -105,6 +109,7 @@ public class TypeCaracteristiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPECARACTERISTIQUE')")
|
||||||
public ResponseEntity<?> getAllTypeCaracteristiqueList() {
|
public ResponseEntity<?> getAllTypeCaracteristiqueList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -128,6 +133,7 @@ public class TypeCaracteristiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPECARACTERISTIQUE')")
|
||||||
public ResponseEntity<?> getAllTypeCaracteristiquePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllTypeCaracteristiquePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -153,6 +159,7 @@ public class TypeCaracteristiqueController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_TYPECARACTERISTIQUE')")
|
||||||
public ResponseEntity<?> getTypeCaracteristiqueById(@PathVariable Long id) {
|
public ResponseEntity<?> getTypeCaracteristiqueById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -34,6 +35,7 @@ public class UsageController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_USAGE')")
|
||||||
public ResponseEntity<?> createUsage(@RequestBody @Valid @Validated Usage usage) {
|
public ResponseEntity<?> createUsage(@RequestBody @Valid @Validated Usage usage) {
|
||||||
try {
|
try {
|
||||||
usage = usageService.createUsage(usage);
|
usage = usageService.createUsage(usage);
|
||||||
@@ -58,6 +60,7 @@ public class UsageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_USAGE')")
|
||||||
public ResponseEntity<?> updateUsage(@PathVariable Long id, @RequestBody Usage usage) {
|
public ResponseEntity<?> updateUsage(@PathVariable Long id, @RequestBody Usage usage) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -81,6 +84,7 @@ public class UsageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_USAGE')")
|
||||||
public ResponseEntity<?> deleteUsager(@PathVariable Long id) {
|
public ResponseEntity<?> deleteUsager(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
usageService.deleteUsage(id);
|
usageService.deleteUsage(id);
|
||||||
@@ -105,6 +109,7 @@ public class UsageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_USAGE')")
|
||||||
public ResponseEntity<?> getAllUsageList() {
|
public ResponseEntity<?> getAllUsageList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -128,6 +133,7 @@ public class UsageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_USAGE')")
|
||||||
public ResponseEntity<?> getAllUsagePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllUsagePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -153,6 +159,7 @@ public class UsageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_USAGE')")
|
||||||
public ResponseEntity<?> getUsageById(@PathVariable Long id) {
|
public ResponseEntity<?> getUsageById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -34,6 +35,7 @@ public class ZoneRfuController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_ZONERFU')")
|
||||||
public ResponseEntity<?> createZoneRfu(@RequestBody @Valid @Validated ZoneRfu zoneRfu) {
|
public ResponseEntity<?> createZoneRfu(@RequestBody @Valid @Validated ZoneRfu zoneRfu) {
|
||||||
try {
|
try {
|
||||||
zoneRfu = zoneRfuService.createZoneRfu(zoneRfu);
|
zoneRfu = zoneRfuService.createZoneRfu(zoneRfu);
|
||||||
@@ -58,6 +60,7 @@ public class ZoneRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ZONERFU')")
|
||||||
public ResponseEntity<?> updateZoneRfu(@PathVariable Long id, @RequestBody ZoneRfu zoneRfu) {
|
public ResponseEntity<?> updateZoneRfu(@PathVariable Long id, @RequestBody ZoneRfu zoneRfu) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -81,6 +84,7 @@ public class ZoneRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_ZONERFU')")
|
||||||
public ResponseEntity<?> deleteZoneRfur(@PathVariable Long id) {
|
public ResponseEntity<?> deleteZoneRfur(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
zoneRfuService.deleteZoneRfu(id);
|
zoneRfuService.deleteZoneRfu(id);
|
||||||
@@ -105,6 +109,7 @@ public class ZoneRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ZONERFU')")
|
||||||
public ResponseEntity<?> getAllZoneRfuList() {
|
public ResponseEntity<?> getAllZoneRfuList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -128,6 +133,7 @@ public class ZoneRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ZONERFU')")
|
||||||
public ResponseEntity<?> getAllZoneRfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllZoneRfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -153,6 +159,7 @@ public class ZoneRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ZONERFU')")
|
||||||
public ResponseEntity<?> getZoneRfuById(@PathVariable Long id) {
|
public ResponseEntity<?> getZoneRfuById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Restauration")
|
@Tag(name = "Restauration")
|
||||||
@CrossOrigin(origins = "*")
|
@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 class RestaurationController {
|
||||||
public final RestaurationService restaurationService;
|
public final RestaurationService restaurationService;
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class SynchronisationController {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@PostMapping("/personnes")
|
@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) {
|
public ResponseEntity<?> syncPersonne(@RequestBody List<PersonnePayLoad> personnePayLoads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -108,7 +108,7 @@ public class SynchronisationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/membre-groupe")
|
@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) {
|
public ResponseEntity<?> syncMembreGroupe(@RequestBody List<MembreGroupePayLoad> membreGroupePayLoads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -132,7 +132,7 @@ public class SynchronisationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/enquete")
|
@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) {
|
public ResponseEntity<?> syncEnquete(@RequestBody List<EnquetePayLoad> enquetePayLoads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -156,7 +156,7 @@ public class SynchronisationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/parcelle")
|
@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) {
|
public ResponseEntity<?> syncParcelle(@RequestBody List<ParcellePayLoad> parcellePayLoads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -180,7 +180,7 @@ public class SynchronisationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/piece")
|
@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) {
|
public ResponseEntity<?> syncPiece(@RequestBody List<PiecePayLoad> piecePayLoads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -205,7 +205,7 @@ public class SynchronisationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/acteur-concerne")
|
@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) {
|
public ResponseEntity<?> syncActeurConcerne(@RequestBody List<ActeurConcernePayLoad> piecePayLoads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -230,7 +230,7 @@ public class SynchronisationController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/enquete-activite")
|
@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) {
|
public ResponseEntity<?> syncEnqueteActivite(@RequestBody List<EnqueteActivitePayload> enqueteActivitePayloads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -255,7 +255,7 @@ public class SynchronisationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/declaraction-nc")
|
@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) {
|
public ResponseEntity<?> syncDeclarationNc(@RequestBody List<DeclarationNcPayload> declarationNcPayloads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -335,7 +335,7 @@ public class SynchronisationController {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
@PostMapping(path = "/uploads")
|
@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) {
|
public ResponseEntity<?> syncUploads(@RequestBody List<UploadPayLoad> uploadPayLoads) {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, synchronisationService.syncUpload(uploadPayLoads), "Liste des uploads synchronisée avec succès."),
|
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")
|
@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) {
|
public ResponseEntity<?> syncAllEnqueteData(@ModelAttribute EnqueteAllDataPayload enqueteAllDataPayload) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -393,7 +393,7 @@ public class SynchronisationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(path = "/synchronise/enquete/confirme-from-mobile")
|
@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) {
|
public ResponseEntity<?> syncAllEnqueteData(@RequestBody List<Long> longList) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -418,7 +418,7 @@ public class SynchronisationController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping(path = "/batiment")
|
@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) {
|
public ResponseEntity<?> syncBatiment(@RequestBody List<BatimentPaylaod> batimentPaylaods) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -443,7 +443,7 @@ public class SynchronisationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(path = "/unite-logement")
|
@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) {
|
public ResponseEntity<?> syncUniteLogement(@RequestBody List<UniteLogementPaylaod> uniteLogementPaylaods) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -468,7 +468,7 @@ public class SynchronisationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(path = "/caracteristique-batiment")
|
@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) {
|
public ResponseEntity<?> syncCaracteristiqueBatiment(@RequestBody List<CaracteristiqueBatimentPayload> CaracteristiqueBatimentPayloads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -493,7 +493,7 @@ public class SynchronisationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(path = "/caracteristique-parcelle")
|
@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) {
|
public ResponseEntity<?> syncCaracteristiqueParcelle(@RequestBody List<CaracteristiqueParcellePayload> CaracteristiqueParcellePayloads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -518,7 +518,7 @@ public class SynchronisationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(path = "/caracteristique-unite-logement")
|
@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) {
|
public ResponseEntity<?> syncCaracteristiqueUniteLogement(@RequestBody List<CaracteristiqueUniteLogementPayload> CaracteristiqueUniteLogementPayloads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -543,7 +543,7 @@ public class SynchronisationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/enquete-batiment")
|
@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) {
|
public ResponseEntity<?> syncEnqueteBatiment(@RequestBody List<EnqueteBatimentPayload> enqueteBatimentPayloads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -568,7 +568,7 @@ public class SynchronisationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/enquete-unite-logement")
|
@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) {
|
public ResponseEntity<?> syncEnqueteUniteLogement(@RequestBody List<EnqueteUniteLogementPayload> enqueteUniteLogementPayloads) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -37,6 +38,7 @@ public class AvoirFonctionController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_AVOIRFONCTION')")
|
||||||
public ResponseEntity<?> createAvoirFonction(@RequestBody @Valid @Validated AvoirFonctionPaylaodWeb avoirFonctionPaylaodWeb ) {
|
public ResponseEntity<?> createAvoirFonction(@RequestBody @Valid @Validated AvoirFonctionPaylaodWeb avoirFonctionPaylaodWeb ) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -61,6 +63,7 @@ public class AvoirFonctionController {
|
|||||||
|
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_AVOIRFONCTION')")
|
||||||
public ResponseEntity<?> updateAvoirFonction(@PathVariable Long id, @RequestBody AvoirFonctionPaylaodWeb avoirFonctionPaylaodWeb) {
|
public ResponseEntity<?> updateAvoirFonction(@PathVariable Long id, @RequestBody AvoirFonctionPaylaodWeb avoirFonctionPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +87,7 @@ public class AvoirFonctionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_AVOIRFONCTION')")
|
||||||
public ResponseEntity<?> deleteAvoirFonction(@PathVariable Long id) {
|
public ResponseEntity<?> deleteAvoirFonction(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
avoirFonctionService.deleteAvoirFonction(id);
|
avoirFonctionService.deleteAvoirFonction(id);
|
||||||
@@ -108,6 +112,7 @@ public class AvoirFonctionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_AVOIRFONCTION')")
|
||||||
public ResponseEntity<?> getAll() {
|
public ResponseEntity<?> getAll() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -132,6 +137,7 @@ public class AvoirFonctionController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_AVOIRFONCTION')")
|
||||||
public ResponseEntity<?> getAllPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -157,6 +163,7 @@ public class AvoirFonctionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_AVOIRFONCTION')")
|
||||||
public ResponseEntity<?> getById(@PathVariable Long id) {
|
public ResponseEntity<?> getById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -181,6 +188,7 @@ public class AvoirFonctionController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/by-utilisateur-id/{userId}")
|
@GetMapping("/by-utilisateur-id/{userId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_AVOIRFONCTION')")
|
||||||
public ResponseEntity<?> getByUserId(@PathVariable Long userId) {
|
public ResponseEntity<?> getByUserId(@PathVariable Long userId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -205,6 +213,7 @@ public class AvoirFonctionController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/page/by-utilisateur-id/{userId}")
|
@GetMapping("/page/by-utilisateur-id/{userId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_AVOIRFONCTION')")
|
||||||
public ResponseEntity<?> getByUserIdPageable(@PathVariable Long userId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getByUserIdPageable(@PathVariable Long userId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
|
|
||||||
@@ -43,6 +44,7 @@ public class DemandeReinitialisationMPController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/create")
|
@GetMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_DEMANDEREINITIALISATIONMP')")
|
||||||
public ResponseEntity<?> createDemandeReinitialisationMP(@RequestParam String usernamrOrEmail) {
|
public ResponseEntity<?> createDemandeReinitialisationMP(@RequestParam String usernamrOrEmail) {
|
||||||
try {
|
try {
|
||||||
demandeReinitialisationMPService.createDemandeReinitialisationMP(usernamrOrEmail);
|
demandeReinitialisationMPService.createDemandeReinitialisationMP(usernamrOrEmail);
|
||||||
@@ -67,6 +69,7 @@ public class DemandeReinitialisationMPController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_DEMANDEREINITIALISATIONMP')")
|
||||||
public ResponseEntity<?> updateDemandeReinitialisationMP(@PathVariable Long id, @RequestBody DemandeReinitialisationMP demandeReinitialisationMP) {
|
public ResponseEntity<?> updateDemandeReinitialisationMP(@PathVariable Long id, @RequestBody DemandeReinitialisationMP demandeReinitialisationMP) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -90,6 +93,7 @@ public class DemandeReinitialisationMPController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_DEMANDEREINITIALISATIONMP')")
|
||||||
public ResponseEntity<?> deleteDemandeReinitialisationMPr(@PathVariable Long id) {
|
public ResponseEntity<?> deleteDemandeReinitialisationMPr(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
demandeReinitialisationMPService.deleteDemandeReinitialisationMP(id);
|
demandeReinitialisationMPService.deleteDemandeReinitialisationMP(id);
|
||||||
@@ -168,6 +172,7 @@ public class DemandeReinitialisationMPController {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DEMANDEREINITIALISATIONMP')")
|
||||||
public ResponseEntity<?> getAllDemandeReinitialisationMPPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllDemandeReinitialisationMPPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -193,6 +198,7 @@ public class DemandeReinitialisationMPController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_DEMANDEREINITIALISATIONMP')")
|
||||||
public ResponseEntity<?> getDemandeReinitialisationMPById(@PathVariable Long id) {
|
public ResponseEntity<?> getDemandeReinitialisationMPById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -216,6 +222,7 @@ public class DemandeReinitialisationMPController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/reset")
|
@GetMapping("/reset")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_DEMANDEREINITIALISATIONMP')")
|
||||||
public ResponseEntity<?> traiterDemande(@RequestParam Long id, @RequestParam String password) {
|
public ResponseEntity<?> traiterDemande(@RequestParam Long id, @RequestParam String password) {
|
||||||
try {
|
try {
|
||||||
DemandeReinitialisationMP demandeReinitialisationMP = demandeReinitialisationMPService.traiterDemandeReinitialisation(id, password);
|
DemandeReinitialisationMP demandeReinitialisationMP = demandeReinitialisationMPService.traiterDemandeReinitialisation(id, password);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -37,6 +38,7 @@ public class FonctionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_FONCTION')")
|
||||||
public ResponseEntity<?> createFonction(@RequestBody @Valid @Validated FonctionPaylaodWeb fonctionPaylaodWeb) {
|
public ResponseEntity<?> createFonction(@RequestBody @Valid @Validated FonctionPaylaodWeb fonctionPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
Fonction fonction = fonctionService.createFonction(fonctionPaylaodWeb);
|
Fonction fonction = fonctionService.createFonction(fonctionPaylaodWeb);
|
||||||
@@ -61,6 +63,7 @@ public class FonctionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_FONCTION')")
|
||||||
public ResponseEntity<?> updateFonction(@PathVariable Long id, @RequestBody FonctionPaylaodWeb fonctionPaylaodWeb) {
|
public ResponseEntity<?> updateFonction(@PathVariable Long id, @RequestBody FonctionPaylaodWeb fonctionPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +87,7 @@ public class FonctionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_FONCTION')")
|
||||||
public ResponseEntity<?> deleteFonction(@PathVariable Long id) {
|
public ResponseEntity<?> deleteFonction(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
fonctionService.deleteFonction(id);
|
fonctionService.deleteFonction(id);
|
||||||
@@ -108,6 +112,7 @@ public class FonctionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_FONCTION')")
|
||||||
public ResponseEntity<?> getAllFonctionList() {
|
public ResponseEntity<?> getAllFonctionList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +136,7 @@ public class FonctionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_FONCTION')")
|
||||||
public ResponseEntity<?> getAllFonctionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllFonctionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -155,6 +161,7 @@ public class FonctionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_FONCTION')")
|
||||||
public ResponseEntity<?> getFonctionById(@PathVariable Long id) {
|
public ResponseEntity<?> getFonctionById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -37,6 +38,7 @@ public class ProfileController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_PROFILE')")
|
||||||
public ResponseEntity<?> createProfile(@RequestBody @Valid @Validated ProfilePaylaodWeb profilePaylaodWeb ) {
|
public ResponseEntity<?> createProfile(@RequestBody @Valid @Validated ProfilePaylaodWeb profilePaylaodWeb ) {
|
||||||
try {
|
try {
|
||||||
Profile profile = profileService.createProfile(profilePaylaodWeb);
|
Profile profile = profileService.createProfile(profilePaylaodWeb);
|
||||||
@@ -62,6 +64,7 @@ public class ProfileController {
|
|||||||
|
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_PROFILE')")
|
||||||
public ResponseEntity<?> updateProfile(@PathVariable Long id, @RequestBody ProfilePaylaodWeb profilePaylaodWeb) {
|
public ResponseEntity<?> updateProfile(@PathVariable Long id, @RequestBody ProfilePaylaodWeb profilePaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -85,6 +88,7 @@ public class ProfileController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_PROFILE')")
|
||||||
public ResponseEntity<?> deleteProfile(@PathVariable Long id) {
|
public ResponseEntity<?> deleteProfile(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
profileService.deleteProfile(id);
|
profileService.deleteProfile(id);
|
||||||
@@ -109,6 +113,7 @@ public class ProfileController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PROFILE')")
|
||||||
public ResponseEntity<?> getAll() {
|
public ResponseEntity<?> getAll() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -132,6 +137,7 @@ public class ProfileController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PROFILE')")
|
||||||
public ResponseEntity<?> getById(@PathVariable Long id) {
|
public ResponseEntity<?> getById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -155,6 +161,7 @@ public class ProfileController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_PROFILE')")
|
||||||
public ResponseEntity<?> getAllPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|||||||
@@ -0,0 +1,184 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -36,6 +37,7 @@ public class RoleController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_ROLE')")
|
||||||
public ResponseEntity<?> createRole(@RequestBody @Valid @Validated Role role) {
|
public ResponseEntity<?> createRole(@RequestBody @Valid @Validated Role role) {
|
||||||
try {
|
try {
|
||||||
role = roleService.createRole(role);
|
role = roleService.createRole(role);
|
||||||
@@ -61,6 +63,7 @@ public class RoleController {
|
|||||||
|
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_ROLE')")
|
||||||
public ResponseEntity<?> updateRole(@PathVariable Long id, @RequestBody Role role) {
|
public ResponseEntity<?> updateRole(@PathVariable Long id, @RequestBody Role role) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -84,6 +87,7 @@ public class RoleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_ROLE')")
|
||||||
public ResponseEntity<?> deleteRole(@PathVariable Long id) {
|
public ResponseEntity<?> deleteRole(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
roleService.deleteRole(id);
|
roleService.deleteRole(id);
|
||||||
@@ -108,6 +112,7 @@ public class RoleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ROLE')")
|
||||||
public ResponseEntity<?> getAll() {
|
public ResponseEntity<?> getAll() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -131,6 +136,7 @@ public class RoleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_ROLE')")
|
||||||
public ResponseEntity<?> getAllPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
@@ -44,6 +45,7 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
|
@PreAuthorize("hasAuthority('CREATE_USER')")
|
||||||
public ResponseEntity<?> createUser(@RequestBody @Valid @Validated UserPaylaodWeb userPaylaodWeb) {
|
public ResponseEntity<?> createUser(@RequestBody @Valid @Validated UserPaylaodWeb userPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
userPaylaodWeb = userService.createUser(userPaylaodWeb);
|
userPaylaodWeb = userService.createUser(userPaylaodWeb);
|
||||||
@@ -68,6 +70,7 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/change-password")
|
@PostMapping("/change-password")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_USER')")
|
||||||
public ResponseEntity<?> changeUserPassword(@RequestBody @Valid @Validated Login login) {
|
public ResponseEntity<?> changeUserPassword(@RequestBody @Valid @Validated Login login) {
|
||||||
try {
|
try {
|
||||||
userService.updatePassword(login.getUsername(), login.getPassword());
|
userService.updatePassword(login.getUsername(), login.getPassword());
|
||||||
@@ -92,6 +95,7 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/reset-password")
|
@PostMapping("/reset-password")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_USER')")
|
||||||
public ResponseEntity<?> resetUserPassword(@RequestBody @Valid @Validated Login login) {
|
public ResponseEntity<?> resetUserPassword(@RequestBody @Valid @Validated Login login) {
|
||||||
try {
|
try {
|
||||||
UserPaylaodWeb userPaylaodWeb= userService.resetPassword(login.getUsername());
|
UserPaylaodWeb userPaylaodWeb= userService.resetPassword(login.getUsername());
|
||||||
@@ -116,6 +120,7 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/validate-user-account/{userName}")
|
@PostMapping("/validate-user-account/{userName}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_USER')")
|
||||||
public ResponseEntity<?> validateUserAccount(@PathVariable String userName) {
|
public ResponseEntity<?> validateUserAccount(@PathVariable String userName) {
|
||||||
try {
|
try {
|
||||||
User user = userService.validateUserAccount(userName);
|
User user = userService.validateUserAccount(userName);
|
||||||
@@ -141,6 +146,7 @@ public class UserController {
|
|||||||
|
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_USER')")
|
||||||
public ResponseEntity<?> updateUser(@PathVariable Long id, @RequestBody UserPaylaodWeb userPaylaodWeb) {
|
public ResponseEntity<?> updateUser(@PathVariable Long id, @RequestBody UserPaylaodWeb userPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -164,6 +170,7 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/activate/{id}")
|
@GetMapping("/activate/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_USER')")
|
||||||
public ResponseEntity<?> acitvateUser(@PathVariable Long id) {
|
public ResponseEntity<?> acitvateUser(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
User user = userService.activateUser(id);
|
User user = userService.activateUser(id);
|
||||||
@@ -189,6 +196,7 @@ public class UserController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/desactivate/{id}")
|
@GetMapping("/desactivate/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('UPDATE_USER')")
|
||||||
public ResponseEntity<?> disacitvateUser(@PathVariable Long id) {
|
public ResponseEntity<?> disacitvateUser(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
User user = userService.disactivateUser(id);
|
User user = userService.disactivateUser(id);
|
||||||
@@ -213,6 +221,7 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('DELETE_USER')")
|
||||||
public ResponseEntity<?> deleteUser(@PathVariable Long id) {
|
public ResponseEntity<?> deleteUser(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
userService.deleteUser(id);
|
userService.deleteUser(id);
|
||||||
@@ -238,6 +247,7 @@ public class UserController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
|
@PreAuthorize("hasAuthority('READ_USER')")
|
||||||
public ResponseEntity<?> getAll() {
|
public ResponseEntity<?> getAll() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -261,6 +271,7 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-paged")
|
@GetMapping("/all-paged")
|
||||||
|
@PreAuthorize("hasAuthority('READ_USER')")
|
||||||
public ResponseEntity<?> getAllPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -284,6 +295,7 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all-by-structure/{structureId}")
|
@GetMapping("/all-by-structure/{structureId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_USER')")
|
||||||
public ResponseEntity<?> getAllByStructure(@PathVariable Long structureId) {
|
public ResponseEntity<?> getAllByStructure(@PathVariable Long structureId) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -310,6 +322,7 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page/all-by-structure/{structureId}")
|
@GetMapping("/page/all-by-structure/{structureId}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_USER')")
|
||||||
public ResponseEntity<?> getAllByStructurePaged(@PathVariable Long structureId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getAllByStructurePaged(@PathVariable Long structureId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -338,6 +351,7 @@ public class UserController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_USER')")
|
||||||
public ResponseEntity<?> getUserById(@PathVariable Long id) {
|
public ResponseEntity<?> getUserById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -361,6 +375,7 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/username/{username}")
|
@GetMapping("/username/{username}")
|
||||||
|
@PreAuthorize("hasAuthority('READ_USER')")
|
||||||
public ResponseEntity<?> getUserByUsername(@PathVariable String username) {
|
public ResponseEntity<?> getUserByUsername(@PathVariable String username) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -41,6 +41,7 @@ public class Personne extends BaseEntity implements Serializable {
|
|||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
private String ifu;
|
private String ifu;
|
||||||
|
private String nc;
|
||||||
private String nom;
|
private String nom;
|
||||||
private String prenom;
|
private String prenom;
|
||||||
private String raisonSociale;
|
private String raisonSociale;
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||||||
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
|
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
|
||||||
import io.gmss.fiscad.entities.BaseEntity;
|
import io.gmss.fiscad.entities.BaseEntity;
|
||||||
import io.gmss.fiscad.entities.decoupage.Commune;
|
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.metier.Tpe;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.Structure;
|
import io.gmss.fiscad.entities.infocad.parametre.Structure;
|
||||||
@@ -19,11 +20,19 @@ import lombok.NoArgsConstructor;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@Entity
|
@Entity
|
||||||
|
@Table(
|
||||||
|
uniqueConstraints = {
|
||||||
|
@UniqueConstraint(
|
||||||
|
name = "uk_structure_commune_personne",
|
||||||
|
columnNames = {"structure_id", "commune_id", "personne_id"}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class CommuneCentreAssignation extends BaseEntity implements Serializable {
|
public class CommuneCentreAssignation extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@@ -32,14 +41,27 @@ public class CommuneCentreAssignation extends BaseEntity implements Serializable
|
|||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "structure_id", nullable = false)
|
||||||
private Structure structure;
|
private Structure structure;
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "commune_id", nullable = false)
|
||||||
private Commune commune;
|
private Commune commune;
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Personne personne ;
|
@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 ;
|
||||||
}
|
}
|
||||||
@@ -36,19 +36,22 @@ public class DeclarationNc extends BaseEntity implements Serializable {
|
|||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
private LocalDate dateDerniereDeclaration;
|
private LocalDate dateDerniereDeclaration;
|
||||||
|
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
private LocalDate dateDeclarationNc;
|
private LocalDate dateDeclarationNc;
|
||||||
|
|
||||||
private String nc;
|
private String nc;
|
||||||
|
private String q;
|
||||||
|
private String i;
|
||||||
|
private String p;
|
||||||
|
private String numeroTitreFoncier;
|
||||||
|
private String nup;
|
||||||
private String observation;
|
private String observation;
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Structure structure;
|
private Structure structure;
|
||||||
|
|
||||||
|
|
||||||
private Long enqueteExternalKey;
|
private Long enqueteExternalKey;
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
|
|||||||
@@ -114,6 +114,11 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
|
|||||||
private Float tauxTfu;
|
private Float tauxTfu;
|
||||||
private Long tfuPiscine;
|
private Long tfuPiscine;
|
||||||
private Float montantTaxe;
|
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 tfuCalculeTauxPropParc;
|
||||||
private Float tfuSuperficieAuSolReel;
|
private Float tfuSuperficieAuSolReel;
|
||||||
private Long valeurAdminParcelleNbMetreCarre;
|
private Long valeurAdminParcelleNbMetreCarre;
|
||||||
@@ -146,5 +151,6 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
|
|||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
private Personne personne ;
|
private Personne personne ;
|
||||||
|
|
||||||
|
private Boolean parcelleContact;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
29
src/main/java/io/gmss/fiscad/entities/user/ProfileModuleFonctionnalite.java
Executable file
29
src/main/java/io/gmss/fiscad/entities/user/ProfileModuleFonctionnalite.java
Executable file
@@ -0,0 +1,29 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
package io.gmss.fiscad.enums;
|
package io.gmss.fiscad.enums;
|
||||||
|
|
||||||
public enum NatureImpot {
|
public enum NatureImpot {
|
||||||
TFU,
|
FB,
|
||||||
|
FNB,
|
||||||
IRF,
|
IRF,
|
||||||
SRTB
|
SRTB
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,77 @@
|
|||||||
package io.gmss.fiscad.enums;
|
package io.gmss.fiscad.enums;
|
||||||
|
|
||||||
public enum UserProfile {
|
public enum UserProfile {
|
||||||
INSPECTEUR_GESTIONNAIRE,
|
EBANK_OPE,
|
||||||
ADMIN_FONCTIONNEL,
|
ACAAGENT,
|
||||||
INSPECTEUR_GESTIONNAIRE_CHEF_SECTEUR,
|
ADMINF,
|
||||||
INSPECTEUR_GESTIONNAIRE_CHEF_SECTION,
|
ADMINT,
|
||||||
INSPECTEUR_GESTIONNAIRE_CHEF_CENTRE
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,281 @@
|
|||||||
package io.gmss.fiscad.enums;
|
package io.gmss.fiscad.enums;
|
||||||
|
|
||||||
public enum UserRole {
|
public enum UserRole {
|
||||||
|
CREATE_ARRONDISSEMENT,
|
||||||
ADMIN,
|
READ_ARRONDISSEMENT,
|
||||||
CREATE_USER,
|
UPDATE_ARRONDISSEMENT,
|
||||||
UPDATE_USER,
|
DELETE_ARRONDISSEMENT,
|
||||||
READ_USER,
|
CREATE_COMMUNE,
|
||||||
DELETE_USER,
|
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,
|
CREATE_PARCELLE,
|
||||||
UPDATE_PARCELLE,
|
|
||||||
READ_PARCELLE,
|
READ_PARCELLE,
|
||||||
|
UPDATE_PARCELLE,
|
||||||
DELETE_PARCELLE,
|
DELETE_PARCELLE,
|
||||||
CREATE_ENQUETE,
|
CREATE_PERSONNE,
|
||||||
UPDATE_ENQUETE,
|
READ_PERSONNE,
|
||||||
READ_ENQUETE,
|
UPDATE_PERSONNE,
|
||||||
DELETE_ENQUETE,
|
DELETE_PERSONNE,
|
||||||
CREATE_BATIMENT,
|
CREATE_BATIMENT,
|
||||||
UPDATE_BATIMENT,
|
|
||||||
READ_BATIMENT,
|
READ_BATIMENT,
|
||||||
DELETE_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,
|
||||||
|
CREATE_USER,
|
||||||
|
READ_USER,
|
||||||
|
UPDATE_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
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -86,6 +86,11 @@ public class PersonneServiceImpl implements PersonneService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PersonnePayLoadWeb> getPersonneListNonAssigneePage(Pageable pageable) {
|
||||||
|
return personneRepository.findAllPersonneNonAssigneCentreToDto(pageable);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PersonnePayLoadWeb> getPersonneList() {
|
public List<PersonnePayLoadWeb> getPersonneList() {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -0,0 +1,187 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -38,6 +38,11 @@ public class DeclarationNcServiceImpl implements DeclarationNcService {
|
|||||||
if (!structureRepository.existsById(declarationNcPayloadWeb.getStructureId())) {
|
if (!structureRepository.existsById(declarationNcPayloadWeb.getStructureId())) {
|
||||||
throw new BadRequestException("Veuillez préciser le centre.");
|
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 declarationNc= entityFromPayLoadService.getDeclarationNcFromPayLoadWeb(declarationNcPayloadWeb);
|
||||||
declarationNc =declarationNcRepository.save(declarationNc);
|
declarationNc =declarationNcRepository.save(declarationNc);
|
||||||
|
|||||||
@@ -109,21 +109,68 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
|
|||||||
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
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
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleBatie(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId) {
|
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleBatie(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId) {
|
||||||
|
|
||||||
Integer nbb= donneesImpositionTfuRepository.genererDonneesTfuBatie(impositionsTfuPaylaodWeb.getId(),userId);
|
Integer nbb= donneesImpositionTfuRepository.genererDonneesTfuBatie(impositionsTfuPaylaodWeb.getId(),userId);
|
||||||
|
|
||||||
|
Integer nbirfbtPlusieursBati = donneesImpositionTfuRepository.majDonneesTfuBatiePlusieursBatiment(impositionsTfuPaylaodWeb.getId());
|
||||||
|
|
||||||
Integer nbulo= donneesImpositionTfuRepository.genererDonneesTfuBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId);
|
Integer nbulo= donneesImpositionTfuRepository.genererDonneesTfuBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId);
|
||||||
|
|
||||||
Integer nbirfbt= donneesImpositionTfuRepository.genererDonneesIrfBatie(impositionsTfuPaylaodWeb.getId(),userId);
|
Integer nbirfbt= donneesImpositionTfuRepository.genererDonneesIrfBatie(impositionsTfuPaylaodWeb.getId(),userId);
|
||||||
//
|
|
||||||
Integer nbirfulo= donneesImpositionTfuRepository.genererDonneesIrfBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId);
|
Integer nbirfulo= donneesImpositionTfuRepository.genererDonneesIrfBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId);
|
||||||
//
|
|
||||||
Integer nbsrtbbt= donneesImpositionTfuRepository.genererDonneesSrtbBatie(impositionsTfuPaylaodWeb.getId(),userId);
|
Integer nbsrtbbt= donneesImpositionTfuRepository.genererDonneesSrtbBatie(impositionsTfuPaylaodWeb.getId(),userId);
|
||||||
//
|
|
||||||
Integer nbsrtbulo= donneesImpositionTfuRepository.genererDonneesSrtbBatieUniteLogement(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 impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
32
src/main/java/io/gmss/fiscad/interfaces/frontend/FonctionnaliteService.java
Executable file
32
src/main/java/io/gmss/fiscad/interfaces/frontend/FonctionnaliteService.java
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
30
src/main/java/io/gmss/fiscad/interfaces/frontend/ModuleService.java
Executable file
30
src/main/java/io/gmss/fiscad/interfaces/frontend/ModuleService.java
Executable file
@@ -0,0 +1,30 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ public interface PersonneService {
|
|||||||
void deletePersonne(Long id) throws NotFoundException;
|
void deletePersonne(Long id) throws NotFoundException;
|
||||||
|
|
||||||
Page<PersonnePayLoadWeb> getPersonneList(Pageable pageable);
|
Page<PersonnePayLoadWeb> getPersonneList(Pageable pageable);
|
||||||
|
Page<PersonnePayLoadWeb> getPersonneListNonAssigneePage(Pageable pageable);
|
||||||
|
|
||||||
List<PersonnePayLoadWeb> getPersonneList();
|
List<PersonnePayLoadWeb> getPersonneList();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
@@ -27,6 +27,7 @@ public interface DonneesImpositionTfuService {
|
|||||||
|
|
||||||
ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleBatie(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb,Long userId);
|
ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleBatie(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb,Long userId);
|
||||||
ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleNonBatie(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb,Long userId);
|
ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleNonBatie(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb,Long userId);
|
||||||
|
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleNonBatieUneParcelle(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId,Long parcelleId);
|
||||||
List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImposition(Long impositionsId);
|
List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImposition(Long impositionsId);
|
||||||
List<DonneesImpositionTfu> getDonneesFiscalesByImpositionArrondissement(Long impositionsId,Long arrondissementId);
|
List<DonneesImpositionTfu> getDonneesFiscalesByImpositionArrondissement(Long impositionsId,Long arrondissementId);
|
||||||
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdPageable(Long impositionsTfuId, Pageable pageable);
|
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdPageable(Long impositionsTfuId, Pageable pageable);
|
||||||
@@ -47,5 +48,7 @@ public interface DonneesImpositionTfuService {
|
|||||||
|
|
||||||
List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByPersonneId(Long personneId);
|
List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByPersonneId(Long personneId);
|
||||||
|
|
||||||
|
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleBatieUneParcelle(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId, Long parcelleId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package io.gmss.fiscad.interfaces.user;
|
||||||
|
|
||||||
|
import io.gmss.fiscad.exceptions.BadRequestException;
|
||||||
|
import io.gmss.fiscad.exceptions.NotFoundException;
|
||||||
|
import io.gmss.fiscad.paylaods.request.crudweb.ProfileModuleFonctionnalitePayloadWeb;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
public interface ProfileModuleFonctionnaliteService {
|
||||||
|
|
||||||
|
ProfileModuleFonctionnalitePayloadWeb createProfileModuleFonctionnalite(ProfileModuleFonctionnalitePayloadWeb profileModuleFonctionnalitePayloadWeb) throws BadRequestException;
|
||||||
|
|
||||||
|
ProfileModuleFonctionnalitePayloadWeb updateProfileModuleFonctionnalite(Long id, ProfileModuleFonctionnalitePayloadWeb profileModuleFonctionnalitePayloadWeb) throws NotFoundException;
|
||||||
|
|
||||||
|
void deleteProfileModuleFonctionnalite(Long id) throws NotFoundException;
|
||||||
|
|
||||||
|
//Page<ProfileModuleFonctionnalitePayloadWeb> getProfileModuleFonctionnaliteListToDtoPageable(Pageable pageable);
|
||||||
|
|
||||||
|
List<ProfileModuleFonctionnalitePayloadWeb> getProfileModuleFonctionnaliteListToDto();
|
||||||
|
|
||||||
|
Optional<ProfileModuleFonctionnalitePayloadWeb> getProfileModuleFonctionnaliteByIdToDto(Long id);
|
||||||
|
|
||||||
|
//List<ProfileModuleFonctionnalitePayloadWeb> getAllProfileModuleFonctionnaliteByEnqueteToDto(Long id);
|
||||||
|
//Page<ProfileModuleFonctionnalitePayloadWeb> getAllProfileModuleFonctionnaliteByEnqueteToDtoPageable(Long id,Pageable pageable);
|
||||||
|
|
||||||
|
//List<ProfileModuleFonctionnalitePayloadWeb> getAllProfileModuleFonctionnaliteByEnqueteBatimentToDto(Long id);
|
||||||
|
|
||||||
|
List<ProfileModuleFonctionnalitePayloadWeb> getAllProfileModuleFonctionnaliteByProfilIdToDto(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package io.gmss.fiscad.paylaods.request.crudweb;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class CommuneCentreAssignationPaylaodWeb {
|
||||||
|
private Long id;
|
||||||
|
private String code;
|
||||||
|
private String nom;
|
||||||
|
private Long communeId;
|
||||||
|
private String communeCode;
|
||||||
|
private String communeNom;
|
||||||
|
private Long structureId;
|
||||||
|
private String structureCode;
|
||||||
|
private String structureNom;
|
||||||
|
private Long personneId;
|
||||||
|
private String personneNom;
|
||||||
|
private String personnePrenom;
|
||||||
|
private String personneRaisonSociale;
|
||||||
|
private String personneIfu;
|
||||||
|
private String personneNc;
|
||||||
|
private String personneNpi;
|
||||||
|
private Long parcelleContactId;
|
||||||
|
private String parcelleContactQuartierCode;
|
||||||
|
private String parcelleContactQ;
|
||||||
|
private String parcelleContactI;
|
||||||
|
private String parcelleContactP;
|
||||||
|
private String adresseContact;
|
||||||
|
|
||||||
|
public CommuneCentreAssignationPaylaodWeb(Long id, Long communeId, String communeCode, String communeNom, Long structureId, String structureCode, String structureNom, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, String personneIfu, String personneNc, String personneNpi, Long parcelleContactId, String parcelleContactQuartierCode, String parcelleContactQ, String parcelleContactI, String parcelleContactP,
|
||||||
|
String adresseContact) {
|
||||||
|
this.id = id;
|
||||||
|
this.communeId = communeId;
|
||||||
|
this.communeCode = communeCode;
|
||||||
|
this.communeNom = communeNom;
|
||||||
|
this.structureId = structureId;
|
||||||
|
this.structureCode = structureCode;
|
||||||
|
this.structureNom = structureNom;
|
||||||
|
this.personneId = personneId;
|
||||||
|
this.personneNom = personneNom;
|
||||||
|
this.personnePrenom = personnePrenom;
|
||||||
|
this.personneRaisonSociale = personneRaisonSociale;
|
||||||
|
this.personneIfu = personneIfu;
|
||||||
|
this.personneNc = personneNc;
|
||||||
|
this.personneNpi = personneNpi;
|
||||||
|
this.parcelleContactId = parcelleContactId;
|
||||||
|
this.parcelleContactQuartierCode = parcelleContactQuartierCode;
|
||||||
|
this.parcelleContactQ = parcelleContactQ;
|
||||||
|
this.parcelleContactI = parcelleContactI;
|
||||||
|
this.parcelleContactP = parcelleContactP;
|
||||||
|
this.adresseContact=adresseContact;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,6 +15,11 @@ public class DeclarationNcPayloadWeb {
|
|||||||
private LocalDate dateDerniereDeclaration;
|
private LocalDate dateDerniereDeclaration;
|
||||||
private LocalDate dateDeclarationNc;
|
private LocalDate dateDeclarationNc;
|
||||||
private String nc;
|
private String nc;
|
||||||
|
private String q;
|
||||||
|
private String i;
|
||||||
|
private String p;
|
||||||
|
private String numeroTitreFoncier;
|
||||||
|
private String nup;
|
||||||
private Long structureId;
|
private Long structureId;
|
||||||
private String structureCode;
|
private String structureCode;
|
||||||
private String structureNom;
|
private String structureNom;
|
||||||
@@ -24,7 +29,14 @@ public class DeclarationNcPayloadWeb {
|
|||||||
private String personneRaisonSociale;
|
private String personneRaisonSociale;
|
||||||
private String observation;
|
private String observation;
|
||||||
|
|
||||||
public DeclarationNcPayloadWeb(Long id, LocalDate dateDerniereDeclaration, LocalDate dateDeclarationNc, String nc, Long structureId, String structureCode, String structureNom, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, String observation) {
|
public DeclarationNcPayloadWeb(Long id, LocalDate dateDerniereDeclaration, LocalDate dateDeclarationNc, String nc, Long structureId, String structureCode, String structureNom, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale,
|
||||||
|
String observation,
|
||||||
|
String q,
|
||||||
|
String i,
|
||||||
|
String p,
|
||||||
|
String numeroTitreFoncier,
|
||||||
|
String nup
|
||||||
|
) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.dateDerniereDeclaration = dateDerniereDeclaration;
|
this.dateDerniereDeclaration = dateDerniereDeclaration;
|
||||||
this.dateDeclarationNc = dateDeclarationNc;
|
this.dateDeclarationNc = dateDeclarationNc;
|
||||||
@@ -36,6 +48,11 @@ public class DeclarationNcPayloadWeb {
|
|||||||
this.personneNom = personneNom;
|
this.personneNom = personneNom;
|
||||||
this.personnePrenom = personnePrenom;
|
this.personnePrenom = personnePrenom;
|
||||||
this.personneRaisonSociale = personneRaisonSociale;
|
this.personneRaisonSociale = personneRaisonSociale;
|
||||||
|
this.q = q;
|
||||||
|
this.i = i;
|
||||||
|
this.p = p;
|
||||||
|
this.numeroTitreFoncier = numeroTitreFoncier;
|
||||||
this.observation = observation;
|
this.observation = observation;
|
||||||
|
this.nup = nup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package io.gmss.fiscad.paylaods.request.crudweb;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class FonctionnalitePayloadWeb {
|
||||||
|
private Long id;
|
||||||
|
private String code;
|
||||||
|
private String nom;
|
||||||
|
private Long moduleId;
|
||||||
|
private String moduleCode;
|
||||||
|
private String moduleNom;
|
||||||
|
private Boolean actif;
|
||||||
|
private String lien;
|
||||||
|
|
||||||
|
public FonctionnalitePayloadWeb(Long id, String code, String nom, Long moduleId, String moduleCode, String moduleNom, Boolean actif, String lien) {
|
||||||
|
this.id = id;
|
||||||
|
this.code = code;
|
||||||
|
this.nom = nom;
|
||||||
|
this.moduleId = moduleId;
|
||||||
|
this.moduleCode = moduleCode;
|
||||||
|
this.moduleNom = moduleNom;
|
||||||
|
this.actif = actif;
|
||||||
|
this.lien = lien;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package io.gmss.fiscad.paylaods.request.crudweb;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class ModulePayloadWeb {
|
||||||
|
private Long id;
|
||||||
|
private String code;
|
||||||
|
private String nom;
|
||||||
|
private Boolean actif;
|
||||||
|
private String lien;
|
||||||
|
|
||||||
|
public ModulePayloadWeb(Long id, String code, String nom, Boolean actif, String lien) {
|
||||||
|
this.id = id;
|
||||||
|
this.code = code;
|
||||||
|
this.nom = nom;
|
||||||
|
this.actif = actif;
|
||||||
|
this.lien = lien;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package io.gmss.fiscad.paylaods.request.crudweb;
|
||||||
|
|
||||||
|
import io.gmss.fiscad.enums.ProfileApp;
|
||||||
|
import io.gmss.fiscad.enums.UserProfile;
|
||||||
|
import jakarta.persistence.EnumType;
|
||||||
|
import jakarta.persistence.Enumerated;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class ProfileModuleFonctionnalitePayloadWeb {
|
||||||
|
private Long id;
|
||||||
|
private Long profileId;
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private UserProfile profileNom;
|
||||||
|
private String profileDescription;
|
||||||
|
private Long moduleId;
|
||||||
|
private String moduleCode;
|
||||||
|
private String moduleNom;
|
||||||
|
private Long fonctionnaliteId;
|
||||||
|
private String fonctionnaliteCode;
|
||||||
|
private String fonctionnaliteNom;
|
||||||
|
private String fonctionnaliteLien;
|
||||||
|
private Boolean actif;
|
||||||
|
|
||||||
|
public ProfileModuleFonctionnalitePayloadWeb(Long id, Long profileId, UserProfile profileNom, String profileDescription, Long moduleId, String moduleCode, String moduleNom, Long fonctionnaliteId, String fonctionnaliteCode, String fonctionnaliteNom, String fonctionnaliteLien, Boolean actif) {
|
||||||
|
this.id = id;
|
||||||
|
this.profileId = profileId;
|
||||||
|
this.profileNom = profileNom;
|
||||||
|
this.profileDescription = profileDescription;
|
||||||
|
this.moduleId = moduleId;
|
||||||
|
this.moduleCode = moduleCode;
|
||||||
|
this.moduleNom = moduleNom;
|
||||||
|
this.fonctionnaliteId = fonctionnaliteId;
|
||||||
|
this.fonctionnaliteCode = fonctionnaliteCode;
|
||||||
|
this.fonctionnaliteNom = fonctionnaliteNom;
|
||||||
|
this.fonctionnaliteLien = fonctionnaliteLien;
|
||||||
|
this.actif = actif;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,497 @@
|
|||||||
|
/*CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_srtb_batie(
|
||||||
|
p_impositions_tfu_id BIGINT,
|
||||||
|
p_user_id BIGINT
|
||||||
|
)
|
||||||
|
RETURNS INTEGER
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS
|
||||||
|
$$
|
||||||
|
DECLARE
|
||||||
|
v_rows_inserted INTEGER;
|
||||||
|
v_annee BIGINT;
|
||||||
|
v_structure_id BIGINT;
|
||||||
|
v_montant_srtb NUMERIC;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
-- récupération de l'année
|
||||||
|
SELECT ex.annee, it.structure_id
|
||||||
|
INTO STRICT v_annee, v_structure_id
|
||||||
|
FROM impositions_tfu it
|
||||||
|
join exercice ex on ex.id =it.exercice_id
|
||||||
|
WHERE it.id = p_impositions_tfu_id;
|
||||||
|
|
||||||
|
|
||||||
|
select value
|
||||||
|
into STRICT v_montant_srtb
|
||||||
|
from parameters
|
||||||
|
where name ='TAXE_SRTB';
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO donnees_imposition_tfu(
|
||||||
|
annee,
|
||||||
|
code_departement,
|
||||||
|
nom_departement,
|
||||||
|
code_commune,
|
||||||
|
nom_commune,
|
||||||
|
code_arrondissement,
|
||||||
|
nom_arrondissement,
|
||||||
|
code_quartier_village,
|
||||||
|
nom_quartier_village,
|
||||||
|
q,
|
||||||
|
ilot,
|
||||||
|
parcelle,
|
||||||
|
nup,
|
||||||
|
titre_foncier,
|
||||||
|
num_batiment,
|
||||||
|
ifu,
|
||||||
|
npi,
|
||||||
|
tel_prop,
|
||||||
|
email_prop,
|
||||||
|
nom_prop,
|
||||||
|
prenom_prop,
|
||||||
|
raison_sociale,
|
||||||
|
adresse_prop,
|
||||||
|
tel_sc,
|
||||||
|
nom_sc,
|
||||||
|
prenom_sc,
|
||||||
|
longitude,
|
||||||
|
latitude,
|
||||||
|
batie,
|
||||||
|
exonere,
|
||||||
|
batiment_exonere,
|
||||||
|
standing_bat,
|
||||||
|
categorie_bat,
|
||||||
|
nombre_piscine,
|
||||||
|
date_enquete,
|
||||||
|
structure_id,
|
||||||
|
zone_rfu_id,
|
||||||
|
nature_impot,
|
||||||
|
superficie_parc,
|
||||||
|
superficie_au_sol_bat,
|
||||||
|
valeur_batiment,
|
||||||
|
valeur_locative_adm_metre_carre,
|
||||||
|
montant_loyer_annuel,
|
||||||
|
tfu_metre_carre,
|
||||||
|
tfu_minimum,
|
||||||
|
impositions_tfu_id,
|
||||||
|
deleted,
|
||||||
|
created_at ,
|
||||||
|
created_by ,
|
||||||
|
"source",
|
||||||
|
updated_at ,
|
||||||
|
updated_by,
|
||||||
|
categorie_usage,
|
||||||
|
superficie_au_sol_taux_prop_parc, ---70% de la surperficie au sol de la parcelle
|
||||||
|
valeur_locative_adm_taux_prop_parc,
|
||||||
|
tfu_calcule_taux_prop_parc, ----tfu correspondant au 70%
|
||||||
|
valeur_locative_adm_sup_reel,
|
||||||
|
valeur_locative_adm, ----------valeur locative administrative
|
||||||
|
tfu_superficie_au_sol_reel, ----tfu correspondant à la superficie au sol reelle
|
||||||
|
tfu_piscine,
|
||||||
|
montant_taxe, ----tfu finale
|
||||||
|
taux_tfu, ----taux tfu batie
|
||||||
|
parcelle_id,
|
||||||
|
batiment_id,
|
||||||
|
unite_logement_id,
|
||||||
|
superficie_au_sol_loue
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
v_annee,
|
||||||
|
d.code,
|
||||||
|
d.nom,
|
||||||
|
c.code,
|
||||||
|
c.nom,
|
||||||
|
a.code,
|
||||||
|
a.nom,
|
||||||
|
q.code,
|
||||||
|
q.nom,
|
||||||
|
p.q,
|
||||||
|
p.i,
|
||||||
|
p.p,
|
||||||
|
p.nup,
|
||||||
|
ep.numero_titre_foncier,
|
||||||
|
b.nub,
|
||||||
|
pers.ifu,
|
||||||
|
pers.npi,
|
||||||
|
pers.tel1,
|
||||||
|
pers.email,
|
||||||
|
pers.nom,
|
||||||
|
pers.prenom,
|
||||||
|
pers.raison_sociale,
|
||||||
|
pers.adresse,
|
||||||
|
ep.representant_tel,
|
||||||
|
ep.representant_nom,
|
||||||
|
ep.representant_prenom,
|
||||||
|
p.longitude,
|
||||||
|
p.latitude,
|
||||||
|
TRUE,
|
||||||
|
(
|
||||||
|
CURRENT_DATE >= ep.date_debut_exemption
|
||||||
|
AND CURRENT_DATE <= COALESCE(ep.date_fin_exemption, CURRENT_DATE)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
CURRENT_DATE >= eb.date_debut_excemption
|
||||||
|
AND CURRENT_DATE <= COALESCE(eb.date_fin_excemption, CURRENT_DATE)
|
||||||
|
),
|
||||||
|
cb.standing,
|
||||||
|
cb.nom,
|
||||||
|
eb.nombre_piscine,
|
||||||
|
eb.date_enquete,
|
||||||
|
st.id,
|
||||||
|
ep.zone_rfu_id,
|
||||||
|
'SRTB',
|
||||||
|
p.superficie,
|
||||||
|
eb.superficie_au_sol,
|
||||||
|
case -------valeur_batiment
|
||||||
|
WHEN eb.valeur_batiment_reel IS NOT NULL AND eb.valeur_batiment_reel <> 0 THEN eb.valeur_batiment_reel
|
||||||
|
WHEN eb.valeur_batiment_calcule IS NOT NULL AND eb.valeur_batiment_calcule <> 0 THEN eb.valeur_batiment_calcule
|
||||||
|
WHEN eb.valeur_batiment_estime IS NOT NULL AND eb.valeur_batiment_estime <> 0 THEN eb.valeur_batiment_estime
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
brb.valeur_locative,
|
||||||
|
case ----- montant_loyer_annuel
|
||||||
|
WHEN eb.montant_locatif_annuel_declare IS NOT NULL AND eb.montant_locatif_annuel_declare <> 0 THEN eb.montant_locatif_annuel_declare
|
||||||
|
WHEN eb.montant_locatif_annuel_calcule IS NOT NULL AND eb.montant_locatif_annuel_calcule <> 0 THEN eb.montant_locatif_annuel_calcule
|
||||||
|
WHEN eb.montant_locatif_annuel_estime IS NOT NULL AND eb.montant_locatif_annuel_estime <> 0 THEN eb.montant_locatif_annuel_estime
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
brb.tfu_metre_carre,
|
||||||
|
brb.tfu_minimum,
|
||||||
|
p_impositions_tfu_id,
|
||||||
|
false,
|
||||||
|
current_date ,
|
||||||
|
p_user_id ,
|
||||||
|
'FISCAD',
|
||||||
|
current_date ,
|
||||||
|
p_user_id,
|
||||||
|
eb.categorie_usage,
|
||||||
|
0,---superficie_au_sol_70pour100
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
eb.superficie_au_sol * brb.valeur_locative,
|
||||||
|
0, ------ valeur_locative_adm : en attente de update
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
v_montant_srtb,
|
||||||
|
0,
|
||||||
|
p.id,
|
||||||
|
b.id,
|
||||||
|
null,
|
||||||
|
eb.superficie_louee
|
||||||
|
FROM parcelle p
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT DISTINCT ON (parcelle_id)
|
||||||
|
parcelle_id,
|
||||||
|
superficie,
|
||||||
|
personne_id,
|
||||||
|
numero_titre_foncier,
|
||||||
|
date_enquete,
|
||||||
|
representant_tel,
|
||||||
|
representant_nom,
|
||||||
|
representant_prenom,
|
||||||
|
representant_npi,
|
||||||
|
date_debut_exemption,
|
||||||
|
date_fin_exemption,
|
||||||
|
zone_rfu_id
|
||||||
|
FROM enquete
|
||||||
|
ORDER BY parcelle_id, date_enquete DESC, id DESC
|
||||||
|
) ep ON ep.parcelle_id = p.id
|
||||||
|
LEFT JOIN personne pers
|
||||||
|
ON pers.id = ep.personne_id
|
||||||
|
JOIN quartier q ON q.id = p.quartier_id
|
||||||
|
JOIN arrondissement a ON a.id = q.arrondissement_id
|
||||||
|
JOIN commune c ON c.id = a.commune_id
|
||||||
|
JOIN departement d ON d.id = c.departement_id
|
||||||
|
--JOIN secteur_decoupage sd ON sd.quartier_id = q.id
|
||||||
|
JOIN (
|
||||||
|
SELECT DISTINCT ON (quartier_id)
|
||||||
|
quartier_id,
|
||||||
|
secteur_id
|
||||||
|
FROM secteur_decoupage
|
||||||
|
ORDER BY quartier_id
|
||||||
|
) sd ON sd.quartier_id = q.id
|
||||||
|
JOIN secteur sect ON sect.id = sd.secteur_id
|
||||||
|
JOIN section ses ON ses.id = sect.section_id
|
||||||
|
JOIN "structure" st ON st.id = ses.structure_id
|
||||||
|
JOIN batiment b ON b.parcelle_id = p.id
|
||||||
|
JOIN (
|
||||||
|
SELECT DISTINCT ON (batiment_id)
|
||||||
|
batiment_id,
|
||||||
|
superficie_au_sol,
|
||||||
|
nombre_piscine,
|
||||||
|
categorie_batiment_id,
|
||||||
|
date_enquete,
|
||||||
|
montant_locatif_annuel_declare,
|
||||||
|
montant_locatif_annuel_calcule,
|
||||||
|
montant_locatif_annuel_estime,
|
||||||
|
date_debut_excemption,
|
||||||
|
date_fin_excemption,
|
||||||
|
valeur_batiment_reel,
|
||||||
|
valeur_batiment_calcule,
|
||||||
|
valeur_batiment_estime,
|
||||||
|
u.categorie_usage,
|
||||||
|
superficie_louee
|
||||||
|
FROM enquete_batiment eb
|
||||||
|
join usage u on u.id=eb.usage_id
|
||||||
|
ORDER BY batiment_id, date_enquete DESC, eb.id DESC
|
||||||
|
) eb ON eb.batiment_id = b.id
|
||||||
|
JOIN categorie_batiment cb
|
||||||
|
ON cb.id = eb.categorie_batiment_id
|
||||||
|
JOIN LATERAL (
|
||||||
|
SELECT *
|
||||||
|
FROM barem_rfu_bati br
|
||||||
|
WHERE br.categorie_batiment_id = cb.id
|
||||||
|
AND br.arrondissement_id = a.id
|
||||||
|
AND (br.quartier_id = q.id OR br.quartier_id IS NULL)
|
||||||
|
ORDER BY br.quartier_id DESC NULLS LAST
|
||||||
|
LIMIT 1
|
||||||
|
) brb ON TRUE
|
||||||
|
WHERE p.batie = TRUE
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM unite_logement ul
|
||||||
|
WHERE ul.batiment_id = b.id
|
||||||
|
)
|
||||||
|
AND st.id = v_structure_id
|
||||||
|
ON CONFLICT DO NOTHING;
|
||||||
|
|
||||||
|
GET DIAGNOSTICS v_rows_inserted = ROW_COUNT;
|
||||||
|
|
||||||
|
RETURN v_rows_inserted;
|
||||||
|
END;
|
||||||
|
$$; */
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_srtb_batie(
|
||||||
|
p_impositions_tfu_id BIGINT,
|
||||||
|
p_user_id BIGINT
|
||||||
|
)
|
||||||
|
RETURNS INTEGER
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
v_rows_inserted INTEGER;
|
||||||
|
v_annee BIGINT;
|
||||||
|
v_structure_id BIGINT;
|
||||||
|
|
||||||
|
v_montant_srtb NUMERIC;
|
||||||
|
v_today DATE;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
v_today := CURRENT_DATE;
|
||||||
|
|
||||||
|
-- 1. année + structure
|
||||||
|
SELECT ex.annee, it.structure_id
|
||||||
|
INTO STRICT v_annee, v_structure_id
|
||||||
|
FROM impositions_tfu it
|
||||||
|
JOIN exercice ex ON ex.id = it.exercice_id
|
||||||
|
WHERE it.id = p_impositions_tfu_id;
|
||||||
|
|
||||||
|
-- 2. paramètre (une seule requête)
|
||||||
|
SELECT value
|
||||||
|
INTO STRICT v_montant_srtb
|
||||||
|
FROM parameters
|
||||||
|
WHERE name = 'TAXE_SRTB';
|
||||||
|
|
||||||
|
-- 3. INSERT optimisé (SANS DISTINCT ON, SANS UPDATE)
|
||||||
|
INSERT INTO donnees_imposition_tfu (
|
||||||
|
annee,
|
||||||
|
code_departement, nom_departement,
|
||||||
|
code_commune, nom_commune,
|
||||||
|
code_arrondissement, nom_arrondissement,
|
||||||
|
code_quartier_village, nom_quartier_village,
|
||||||
|
q, ilot, parcelle, nup,
|
||||||
|
titre_foncier,
|
||||||
|
num_batiment,
|
||||||
|
ifu, npi, tel_prop, email_prop,
|
||||||
|
nom_prop, prenom_prop, raison_sociale, adresse_prop,
|
||||||
|
tel_sc, nom_sc, prenom_sc,
|
||||||
|
longitude, latitude,
|
||||||
|
batie,
|
||||||
|
exonere,
|
||||||
|
batiment_exonere,
|
||||||
|
standing_bat, categorie_bat,
|
||||||
|
nombre_piscine,
|
||||||
|
date_enquete,
|
||||||
|
structure_id,
|
||||||
|
zone_rfu_id,
|
||||||
|
nature_impot,
|
||||||
|
superficie_parc,
|
||||||
|
superficie_au_sol_bat,
|
||||||
|
valeur_batiment,
|
||||||
|
valeur_locative_adm_metre_carre,
|
||||||
|
montant_loyer_annuel,
|
||||||
|
tfu_metre_carre,
|
||||||
|
tfu_minimum,
|
||||||
|
impositions_tfu_id,
|
||||||
|
deleted,
|
||||||
|
created_at,
|
||||||
|
created_by,
|
||||||
|
source,
|
||||||
|
updated_at,
|
||||||
|
updated_by,
|
||||||
|
categorie_usage,
|
||||||
|
superficie_au_sol_taux_prop_parc,
|
||||||
|
valeur_locative_adm_taux_prop_parc,
|
||||||
|
tfu_calcule_taux_prop_parc,
|
||||||
|
valeur_locative_adm_sup_reel,
|
||||||
|
valeur_locative_adm,
|
||||||
|
tfu_superficie_au_sol_reel,
|
||||||
|
tfu_piscine,
|
||||||
|
montant_taxe,
|
||||||
|
taux_tfu,
|
||||||
|
parcelle_id,
|
||||||
|
batiment_id,
|
||||||
|
unite_logement_id,
|
||||||
|
superficie_au_sol_loue,
|
||||||
|
personne_id
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
v_annee,
|
||||||
|
d.code, d.nom,
|
||||||
|
c.code, c.nom,
|
||||||
|
a.code, a.nom,
|
||||||
|
q.code, q.nom,
|
||||||
|
p.q, p.i, p.p, p.nup,
|
||||||
|
ep.numero_titre_foncier,
|
||||||
|
b.nub,
|
||||||
|
|
||||||
|
pers.ifu, pers.npi, pers.tel1, pers.email,
|
||||||
|
pers.nom, pers.prenom, pers.raison_sociale, pers.adresse,
|
||||||
|
ep.representant_tel, ep.representant_nom, ep.representant_prenom,
|
||||||
|
|
||||||
|
p.longitude, p.latitude,
|
||||||
|
TRUE,
|
||||||
|
|
||||||
|
(v_today BETWEEN ep.date_debut_exemption AND COALESCE(ep.date_fin_exemption, v_today)),
|
||||||
|
(v_today BETWEEN eb.date_debut_excemption AND COALESCE(eb.date_fin_excemption, v_today)),
|
||||||
|
|
||||||
|
cb.standing,
|
||||||
|
cb.nom,
|
||||||
|
|
||||||
|
COALESCE(eb.nombre_piscine, 0),
|
||||||
|
eb.date_enquete,
|
||||||
|
|
||||||
|
st.id,
|
||||||
|
ep.zone_rfu_id,
|
||||||
|
'SRTB',
|
||||||
|
|
||||||
|
p.superficie,
|
||||||
|
eb.superficie_au_sol,
|
||||||
|
|
||||||
|
-- valeur bâtiment optimisée
|
||||||
|
COALESCE(
|
||||||
|
NULLIF(eb.valeur_batiment_reel,0),
|
||||||
|
NULLIF(eb.valeur_batiment_calcule,0),
|
||||||
|
NULLIF(eb.valeur_batiment_estime,0),
|
||||||
|
0
|
||||||
|
),
|
||||||
|
|
||||||
|
brb.valeur_locative,
|
||||||
|
|
||||||
|
-- loyer optimisé
|
||||||
|
COALESCE(
|
||||||
|
NULLIF(eb.montant_locatif_annuel_declare,0),
|
||||||
|
NULLIF(eb.montant_locatif_annuel_calcule,0),
|
||||||
|
NULLIF(eb.montant_locatif_annuel_estime,0),
|
||||||
|
0
|
||||||
|
),
|
||||||
|
|
||||||
|
brb.tfu_metre_carre,
|
||||||
|
brb.tfu_minimum,
|
||||||
|
|
||||||
|
p_impositions_tfu_id,
|
||||||
|
FALSE,
|
||||||
|
v_today, p_user_id, 'FISCAD',
|
||||||
|
v_today, p_user_id,
|
||||||
|
eb.categorie_usage,
|
||||||
|
|
||||||
|
0, 0, 0,
|
||||||
|
|
||||||
|
eb.superficie_au_sol * brb.valeur_locative,
|
||||||
|
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
|
||||||
|
-- 🔥 SRTB = valeur directe (pas de calcul)
|
||||||
|
v_montant_srtb,
|
||||||
|
|
||||||
|
0,
|
||||||
|
|
||||||
|
p.id,
|
||||||
|
b.id,
|
||||||
|
NULL,
|
||||||
|
eb.superficie_louee,
|
||||||
|
ep.personne_id
|
||||||
|
|
||||||
|
FROM parcelle p
|
||||||
|
|
||||||
|
-- dernière enquête parcelle
|
||||||
|
LEFT JOIN LATERAL (
|
||||||
|
SELECT *
|
||||||
|
FROM enquete e
|
||||||
|
WHERE e.parcelle_id = p.id
|
||||||
|
ORDER BY date_enquete DESC, id DESC
|
||||||
|
LIMIT 1
|
||||||
|
) ep ON TRUE
|
||||||
|
|
||||||
|
LEFT JOIN personne pers ON pers.id = ep.personne_id
|
||||||
|
|
||||||
|
JOIN quartier q ON q.id = p.quartier_id
|
||||||
|
JOIN arrondissement a ON a.id = q.arrondissement_id
|
||||||
|
JOIN commune c ON c.id = a.commune_id
|
||||||
|
JOIN departement d ON d.id = c.departement_id
|
||||||
|
|
||||||
|
-- structure via secteur
|
||||||
|
JOIN LATERAL (
|
||||||
|
SELECT secteur_id
|
||||||
|
FROM secteur_decoupage
|
||||||
|
WHERE quartier_id = q.id
|
||||||
|
LIMIT 1
|
||||||
|
) sd ON TRUE
|
||||||
|
|
||||||
|
JOIN secteur sect ON sect.id = sd.secteur_id
|
||||||
|
JOIN section ses ON ses.id = sect.section_id
|
||||||
|
JOIN structure st ON st.id = ses.structure_id
|
||||||
|
|
||||||
|
JOIN batiment b ON b.parcelle_id = p.id
|
||||||
|
|
||||||
|
-- 🔥 remplace DISTINCT ON
|
||||||
|
JOIN LATERAL (
|
||||||
|
SELECT eb2.*,u.categorie_usage
|
||||||
|
FROM enquete_batiment eb2
|
||||||
|
LEFT JOIN usage u ON u.id = eb2.usage_id
|
||||||
|
WHERE eb2.batiment_id = b.id
|
||||||
|
ORDER BY eb2.date_enquete DESC, eb2.id DESC
|
||||||
|
LIMIT 1
|
||||||
|
) eb ON TRUE
|
||||||
|
|
||||||
|
JOIN categorie_batiment cb ON cb.id = eb.categorie_batiment_id
|
||||||
|
|
||||||
|
JOIN LATERAL (
|
||||||
|
SELECT *
|
||||||
|
FROM barem_rfu_bati br
|
||||||
|
WHERE br.categorie_batiment_id = cb.id
|
||||||
|
AND br.arrondissement_id = a.id
|
||||||
|
AND (br.quartier_id = q.id OR br.quartier_id IS NULL)
|
||||||
|
ORDER BY br.quartier_id DESC NULLS LAST
|
||||||
|
LIMIT 1
|
||||||
|
) brb ON TRUE
|
||||||
|
|
||||||
|
WHERE p.batie = TRUE
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM unite_logement ul
|
||||||
|
WHERE ul.batiment_id = b.id
|
||||||
|
)
|
||||||
|
AND st.id = v_structure_id
|
||||||
|
|
||||||
|
ON CONFLICT DO NOTHING;
|
||||||
|
|
||||||
|
GET DIAGNOSTICS v_rows_inserted = ROW_COUNT;
|
||||||
|
|
||||||
|
RETURN v_rows_inserted;
|
||||||
|
END;
|
||||||
|
$$;
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,754 @@
|
|||||||
|
/*CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_tfu_batie(
|
||||||
|
p_impositions_tfu_id BIGINT,
|
||||||
|
p_user_id BIGINT
|
||||||
|
)
|
||||||
|
RETURNS INTEGER
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS
|
||||||
|
$$
|
||||||
|
DECLARE
|
||||||
|
v_rows_inserted INTEGER;
|
||||||
|
v_annee BIGINT;
|
||||||
|
v_structure_id BIGINT;
|
||||||
|
v_taux_defaut_sup_sol NUMERIC;
|
||||||
|
v_taux_tfu NUMERIC;
|
||||||
|
v_taux_valeur_locat_prof NUMERIC;
|
||||||
|
v_tfu_piscine_unitaire NUMERIC;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
-- récupération de l'année
|
||||||
|
SELECT ex.annee, it.structure_id
|
||||||
|
INTO STRICT v_annee, v_structure_id
|
||||||
|
FROM impositions_tfu it
|
||||||
|
join exercice ex on ex.id =it.exercice_id
|
||||||
|
WHERE it.id = p_impositions_tfu_id;
|
||||||
|
|
||||||
|
|
||||||
|
select value
|
||||||
|
into strict v_taux_defaut_sup_sol
|
||||||
|
from parameters
|
||||||
|
where name ='TAUX_DEFAUT_SUPERFICIE_AU_SOL';
|
||||||
|
|
||||||
|
select value
|
||||||
|
into STRICT v_taux_tfu
|
||||||
|
from parameters
|
||||||
|
where name ='TAUX_TFU';
|
||||||
|
|
||||||
|
|
||||||
|
select value
|
||||||
|
into STRICT v_taux_valeur_locat_prof
|
||||||
|
from parameters
|
||||||
|
where name ='TAUX_VALEUR_LOCATIVE_PROFESSIONNELLE';
|
||||||
|
|
||||||
|
select value
|
||||||
|
into STRICT v_tfu_piscine_unitaire
|
||||||
|
from parameters
|
||||||
|
where name ='TFU_PAR_PISCINE';
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO donnees_imposition_tfu(
|
||||||
|
annee,
|
||||||
|
code_departement,
|
||||||
|
nom_departement,
|
||||||
|
code_commune,
|
||||||
|
nom_commune,
|
||||||
|
code_arrondissement,
|
||||||
|
nom_arrondissement,
|
||||||
|
code_quartier_village,
|
||||||
|
nom_quartier_village,
|
||||||
|
q,
|
||||||
|
ilot,
|
||||||
|
parcelle,
|
||||||
|
nup,
|
||||||
|
titre_foncier,
|
||||||
|
num_batiment,
|
||||||
|
ifu,
|
||||||
|
npi,
|
||||||
|
tel_prop,
|
||||||
|
email_prop,
|
||||||
|
nom_prop,
|
||||||
|
prenom_prop,
|
||||||
|
raison_sociale,
|
||||||
|
adresse_prop,
|
||||||
|
tel_sc,
|
||||||
|
nom_sc,
|
||||||
|
prenom_sc,
|
||||||
|
longitude,
|
||||||
|
latitude,
|
||||||
|
batie,
|
||||||
|
exonere,
|
||||||
|
batiment_exonere,
|
||||||
|
standing_bat,
|
||||||
|
categorie_bat,
|
||||||
|
nombre_piscine,
|
||||||
|
date_enquete,
|
||||||
|
structure_id,
|
||||||
|
zone_rfu_id,
|
||||||
|
nature_impot,
|
||||||
|
superficie_parc,
|
||||||
|
superficie_au_sol_bat,
|
||||||
|
valeur_batiment,
|
||||||
|
valeur_locative_adm_metre_carre,
|
||||||
|
montant_loyer_annuel,
|
||||||
|
tfu_metre_carre,
|
||||||
|
tfu_minimum,
|
||||||
|
impositions_tfu_id,
|
||||||
|
deleted,
|
||||||
|
created_at ,
|
||||||
|
created_by ,
|
||||||
|
"source",
|
||||||
|
updated_at ,
|
||||||
|
updated_by,
|
||||||
|
categorie_usage,
|
||||||
|
superficie_au_sol_taux_prop_parc, ---70% de la surperficie au sol de la parcelle
|
||||||
|
valeur_locative_adm_taux_prop_parc,
|
||||||
|
tfu_calcule_taux_prop_parc, ----tfu correspondant au 70%
|
||||||
|
valeur_locative_adm_sup_reel,
|
||||||
|
valeur_locative_adm, ----------valeur locative administrative
|
||||||
|
tfu_superficie_au_sol_reel, ----tfu correspondant à la superficie au sol reelle
|
||||||
|
tfu_piscine,
|
||||||
|
montant_taxe, ----tfu finale
|
||||||
|
taux_tfu, ----taux tfu batie
|
||||||
|
parcelle_id,
|
||||||
|
batiment_id,
|
||||||
|
unite_logement_id
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
v_annee,
|
||||||
|
d.code,
|
||||||
|
d.nom,
|
||||||
|
c.code,
|
||||||
|
c.nom,
|
||||||
|
a.code,
|
||||||
|
a.nom,
|
||||||
|
q.code,
|
||||||
|
q.nom,
|
||||||
|
p.q,
|
||||||
|
p.i,
|
||||||
|
p.p,
|
||||||
|
p.nup,
|
||||||
|
ep.numero_titre_foncier,
|
||||||
|
b.nub,
|
||||||
|
pers.ifu,
|
||||||
|
pers.npi,
|
||||||
|
pers.tel1,
|
||||||
|
pers.email,
|
||||||
|
pers.nom,
|
||||||
|
pers.prenom,
|
||||||
|
pers.raison_sociale,
|
||||||
|
pers.adresse,
|
||||||
|
ep.representant_tel,
|
||||||
|
ep.representant_nom,
|
||||||
|
ep.representant_prenom,
|
||||||
|
p.longitude,
|
||||||
|
p.latitude,
|
||||||
|
TRUE,
|
||||||
|
(
|
||||||
|
CURRENT_DATE >= ep.date_debut_exemption
|
||||||
|
AND CURRENT_DATE <= COALESCE(ep.date_fin_exemption, CURRENT_DATE)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
CURRENT_DATE >= eb.date_debut_excemption
|
||||||
|
AND CURRENT_DATE <= COALESCE(eb.date_fin_excemption, CURRENT_DATE)
|
||||||
|
),
|
||||||
|
cb.standing,
|
||||||
|
cb.nom,
|
||||||
|
eb.nombre_piscine,
|
||||||
|
eb.date_enquete,
|
||||||
|
st.id,
|
||||||
|
ep.zone_rfu_id,
|
||||||
|
'TFU',
|
||||||
|
p.superficie,
|
||||||
|
eb.superficie_au_sol,
|
||||||
|
COALESCE(
|
||||||
|
NULLIF(eb.valeur_batiment_reel, 0),
|
||||||
|
NULLIF(eb.valeur_batiment_calcule, 0),
|
||||||
|
NULLIF(eb.valeur_batiment_estime, 0),
|
||||||
|
0
|
||||||
|
),
|
||||||
|
brb.valeur_locative,
|
||||||
|
COALESCE(
|
||||||
|
NULLIF(eb.montant_locatif_annuel_declare, 0),
|
||||||
|
NULLIF(eb.montant_locatif_annuel_calcule, 0),
|
||||||
|
NULLIF(eb.montant_locatif_annuel_estime, 0),
|
||||||
|
0
|
||||||
|
),
|
||||||
|
brb.tfu_metre_carre,
|
||||||
|
brb.tfu_minimum,
|
||||||
|
p_impositions_tfu_id,
|
||||||
|
false,
|
||||||
|
current_date ,
|
||||||
|
p_user_id ,
|
||||||
|
'FISCAD',
|
||||||
|
current_date ,
|
||||||
|
p_user_id,
|
||||||
|
eb.categorie_usage,
|
||||||
|
p.superficie*v_taux_defaut_sup_sol/100,---superficie_au_sol_70pour100
|
||||||
|
case ----valeur_locative_adm70pour100
|
||||||
|
when eb.categorie_usage = 'HABITATION' then (p.superficie * v_taux_defaut_sup_sol/100) * brb.valeur_locative
|
||||||
|
else 0
|
||||||
|
end,
|
||||||
|
case ----tfu calcule 70 pour 100 superficie parcelle
|
||||||
|
when eb.categorie_usage= 'HABITATION' then (p.superficie * v_taux_defaut_sup_sol/100) * brb.valeur_locative * v_taux_tfu/100
|
||||||
|
else 0
|
||||||
|
end,
|
||||||
|
case -----valeur_locative_adm_sup_reel
|
||||||
|
when eb.categorie_usage='HABITATION' then eb.superficie_au_sol * brb.valeur_locative
|
||||||
|
else 0
|
||||||
|
end,
|
||||||
|
0, ------ valeur_locative_adm : en attente de update
|
||||||
|
case -----tfu_superficie_au_sol_reel
|
||||||
|
when eb.categorie_usage='HABITATION' then eb.superficie_au_sol * brb.valeur_locative * v_taux_tfu/100 +eb.nombre_piscine * v_tfu_piscine_unitaire
|
||||||
|
else 0
|
||||||
|
end,
|
||||||
|
eb.nombre_piscine * v_tfu_piscine_unitaire,
|
||||||
|
0,
|
||||||
|
v_taux_tfu,
|
||||||
|
p.id,
|
||||||
|
b.id,
|
||||||
|
null
|
||||||
|
FROM parcelle p
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT DISTINCT ON (parcelle_id)
|
||||||
|
parcelle_id,
|
||||||
|
superficie,
|
||||||
|
personne_id,
|
||||||
|
numero_titre_foncier,
|
||||||
|
date_enquete,
|
||||||
|
representant_tel,
|
||||||
|
representant_nom,
|
||||||
|
representant_prenom,
|
||||||
|
representant_npi,
|
||||||
|
date_debut_exemption,
|
||||||
|
date_fin_exemption,
|
||||||
|
zone_rfu_id
|
||||||
|
FROM enquete
|
||||||
|
ORDER BY parcelle_id, date_enquete DESC, id DESC
|
||||||
|
) ep ON ep.parcelle_id = p.id
|
||||||
|
LEFT JOIN personne pers
|
||||||
|
ON pers.id = ep.personne_id
|
||||||
|
JOIN quartier q ON q.id = p.quartier_id
|
||||||
|
JOIN arrondissement a ON a.id = q.arrondissement_id
|
||||||
|
JOIN commune c ON c.id = a.commune_id
|
||||||
|
JOIN departement d ON d.id = c.departement_id
|
||||||
|
--JOIN secteur_decoupage sd ON sd.quartier_id = q.id
|
||||||
|
JOIN (
|
||||||
|
SELECT DISTINCT ON (quartier_id)
|
||||||
|
quartier_id,
|
||||||
|
secteur_id
|
||||||
|
FROM secteur_decoupage
|
||||||
|
ORDER BY quartier_id
|
||||||
|
) sd ON sd.quartier_id = q.id
|
||||||
|
JOIN secteur sect ON sect.id = sd.secteur_id
|
||||||
|
JOIN section ses ON ses.id = sect.section_id
|
||||||
|
JOIN "structure" st ON st.id = ses.structure_id
|
||||||
|
JOIN batiment b ON b.parcelle_id = p.id
|
||||||
|
JOIN (
|
||||||
|
SELECT DISTINCT ON (batiment_id)
|
||||||
|
batiment_id,
|
||||||
|
superficie_au_sol,
|
||||||
|
nombre_piscine,
|
||||||
|
categorie_batiment_id,
|
||||||
|
date_enquete,
|
||||||
|
montant_locatif_annuel_declare,
|
||||||
|
montant_locatif_annuel_calcule,
|
||||||
|
montant_locatif_annuel_estime,
|
||||||
|
date_debut_excemption,
|
||||||
|
date_fin_excemption,
|
||||||
|
valeur_batiment_reel,
|
||||||
|
valeur_batiment_calcule,
|
||||||
|
valeur_batiment_estime,
|
||||||
|
u.categorie_usage
|
||||||
|
FROM enquete_batiment eb
|
||||||
|
join usage u on u.id=eb.usage_id
|
||||||
|
ORDER BY batiment_id, date_enquete DESC, eb.id DESC
|
||||||
|
) eb ON eb.batiment_id = b.id
|
||||||
|
|
||||||
|
JOIN categorie_batiment cb
|
||||||
|
ON cb.id = eb.categorie_batiment_id
|
||||||
|
JOIN LATERAL (
|
||||||
|
SELECT *
|
||||||
|
FROM barem_rfu_bati br
|
||||||
|
WHERE br.categorie_batiment_id = cb.id
|
||||||
|
AND br.arrondissement_id = a.id
|
||||||
|
AND (br.quartier_id = q.id OR br.quartier_id IS NULL)
|
||||||
|
ORDER BY br.quartier_id DESC NULLS LAST
|
||||||
|
LIMIT 1
|
||||||
|
) brb ON TRUE
|
||||||
|
WHERE p.batie = TRUE
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM unite_logement ul
|
||||||
|
WHERE ul.batiment_id = b.id
|
||||||
|
)
|
||||||
|
AND st.id = v_structure_id
|
||||||
|
ON CONFLICT DO NOTHING;
|
||||||
|
|
||||||
|
GET DIAGNOSTICS v_rows_inserted = ROW_COUNT;
|
||||||
|
|
||||||
|
UPDATE donnees_imposition_tfu dtfu
|
||||||
|
SET
|
||||||
|
valeur_locative_adm =
|
||||||
|
CASE
|
||||||
|
WHEN categorie_usage = 'HABITATION' AND superficie_au_sol_bat <> 0
|
||||||
|
THEN valeur_locative_adm_sup_reel
|
||||||
|
|
||||||
|
WHEN categorie_usage = 'HABITATION' AND superficie_au_sol_bat = 0
|
||||||
|
THEN valeur_locative_adm_taux_prop_parc
|
||||||
|
|
||||||
|
WHEN categorie_usage IN ('PROFESSIONNELLE','MIXTE') AND valeur_batiment <> 0
|
||||||
|
THEN valeur_batiment * (v_taux_valeur_locat_prof/100)
|
||||||
|
|
||||||
|
WHEN categorie_usage IN ('PROFESSIONNELLE','MIXTE') AND valeur_batiment = 0
|
||||||
|
THEN montant_loyer_annuel
|
||||||
|
END,
|
||||||
|
|
||||||
|
montant_taxe =
|
||||||
|
CASE
|
||||||
|
WHEN categorie_usage = 'HABITATION' AND superficie_au_sol_bat <> 0 THEN
|
||||||
|
CASE
|
||||||
|
WHEN tfu_minimum < valeur_locative_adm_sup_reel * (v_taux_tfu/100) + tfu_piscine
|
||||||
|
THEN valeur_locative_adm_sup_reel * (v_taux_tfu/100) + tfu_piscine
|
||||||
|
ELSE tfu_minimum
|
||||||
|
END
|
||||||
|
|
||||||
|
WHEN categorie_usage = 'HABITATION' AND superficie_au_sol_bat = 0 THEN
|
||||||
|
CASE
|
||||||
|
WHEN tfu_minimum < valeur_locative_adm_taux_prop_parc * (v_taux_tfu/100) + tfu_piscine
|
||||||
|
THEN valeur_locative_adm_taux_prop_parc * (v_taux_tfu/100) + tfu_piscine
|
||||||
|
ELSE tfu_minimum
|
||||||
|
END
|
||||||
|
|
||||||
|
WHEN categorie_usage IN ('PROFESSIONNELLE','MIXTE') AND valeur_batiment <> 0 THEN
|
||||||
|
CASE
|
||||||
|
WHEN tfu_minimum < valeur_batiment * (v_taux_valeur_locat_prof/100) * (v_taux_tfu/100)
|
||||||
|
THEN valeur_batiment * (v_taux_valeur_locat_prof/100) * (v_taux_tfu/100)
|
||||||
|
ELSE tfu_minimum
|
||||||
|
END
|
||||||
|
|
||||||
|
WHEN categorie_usage IN ('PROFESSIONNELLE','MIXTE') AND valeur_batiment = 0 THEN
|
||||||
|
CASE
|
||||||
|
WHEN tfu_minimum < montant_loyer_annuel * (v_taux_tfu/100)
|
||||||
|
THEN montant_loyer_annuel * (v_taux_tfu/100)
|
||||||
|
ELSE tfu_minimum
|
||||||
|
END
|
||||||
|
END
|
||||||
|
WHERE impositions_tfu_id = p_impositions_tfu_id
|
||||||
|
AND batie = TRUE
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM unite_logement ul
|
||||||
|
WHERE ul.batiment_id = dtfu.batiment_id
|
||||||
|
);
|
||||||
|
RETURN v_rows_inserted;
|
||||||
|
END;
|
||||||
|
$$;*/
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_tfu_batie(
|
||||||
|
p_impositions_tfu_id BIGINT,
|
||||||
|
p_user_id BIGINT
|
||||||
|
)
|
||||||
|
RETURNS INTEGER
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
v_rows_inserted INTEGER;
|
||||||
|
v_annee BIGINT;
|
||||||
|
v_structure_id BIGINT;
|
||||||
|
v_taux_defaut_sup_sol NUMERIC;
|
||||||
|
v_taux_tfu NUMERIC;
|
||||||
|
v_taux_tfu_ratio NUMERIC; -- v_taux_tfu / 100 (pré-calculé)
|
||||||
|
v_taux_valeur_locat_prof NUMERIC;
|
||||||
|
v_taux_vlp_ratio NUMERIC; -- v_taux_valeur_locat_prof / 100 (pré-calculé)
|
||||||
|
v_tfu_piscine_unitaire NUMERIC;
|
||||||
|
v_today DATE;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
v_today := CURRENT_DATE;
|
||||||
|
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
-- 1. Récupération de l'année et de la structure (inchangée)
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
SELECT ex.annee, it.structure_id
|
||||||
|
INTO STRICT v_annee, v_structure_id
|
||||||
|
FROM impositions_tfu it
|
||||||
|
JOIN exercice ex ON ex.id = it.exercice_id
|
||||||
|
WHERE it.id = p_impositions_tfu_id;
|
||||||
|
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
-- 2. Récupération des 4 paramètres en UNE seule requête
|
||||||
|
-- (évite 4 accès séquentiels à la table parameters)
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
SELECT
|
||||||
|
MAX(value) FILTER (WHERE name = 'TAUX_DEFAUT_SUPERFICIE_AU_SOL'),
|
||||||
|
MAX(value) FILTER (WHERE name = 'TAUX_TFU'),
|
||||||
|
MAX(value) FILTER (WHERE name = 'TAUX_VALEUR_LOCATIVE_PROFESSIONNELLE'),
|
||||||
|
MAX(value) FILTER (WHERE name = 'TFU_PAR_PISCINE')
|
||||||
|
INTO STRICT
|
||||||
|
v_taux_defaut_sup_sol,
|
||||||
|
v_taux_tfu,
|
||||||
|
v_taux_valeur_locat_prof,
|
||||||
|
v_tfu_piscine_unitaire
|
||||||
|
FROM parameters
|
||||||
|
WHERE name IN (
|
||||||
|
'TAUX_DEFAUT_SUPERFICIE_AU_SOL',
|
||||||
|
'TAUX_TFU',
|
||||||
|
'TAUX_VALEUR_LOCATIVE_PROFESSIONNELLE',
|
||||||
|
'TFU_PAR_PISCINE'
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Ratios pré-calculés pour éviter la division répétée dans le SELECT
|
||||||
|
v_taux_tfu_ratio := v_taux_tfu / 100.0;
|
||||||
|
v_taux_vlp_ratio := v_taux_valeur_locat_prof / 100.0;
|
||||||
|
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
-- 3. INSERT avec calcul complet de valeur_locative_adm et montant_taxe
|
||||||
|
-- → supprime l'UPDATE post-INSERT (économie d'un second scan de table)
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
INSERT INTO donnees_imposition_tfu (
|
||||||
|
annee,
|
||||||
|
code_departement,
|
||||||
|
nom_departement,
|
||||||
|
code_commune,
|
||||||
|
nom_commune,
|
||||||
|
code_arrondissement,
|
||||||
|
nom_arrondissement,
|
||||||
|
code_quartier_village,
|
||||||
|
nom_quartier_village,
|
||||||
|
q,
|
||||||
|
ilot,
|
||||||
|
parcelle,
|
||||||
|
nup,
|
||||||
|
titre_foncier,
|
||||||
|
num_batiment,
|
||||||
|
ifu,
|
||||||
|
npi,
|
||||||
|
tel_prop,
|
||||||
|
email_prop,
|
||||||
|
nom_prop,
|
||||||
|
prenom_prop,
|
||||||
|
raison_sociale,
|
||||||
|
adresse_prop,
|
||||||
|
tel_sc,
|
||||||
|
nom_sc,
|
||||||
|
prenom_sc,
|
||||||
|
longitude,
|
||||||
|
latitude,
|
||||||
|
batie,
|
||||||
|
exonere,
|
||||||
|
batiment_exonere,
|
||||||
|
standing_bat,
|
||||||
|
categorie_bat,
|
||||||
|
nombre_piscine,
|
||||||
|
date_enquete,
|
||||||
|
structure_id,
|
||||||
|
zone_rfu_id,
|
||||||
|
nature_impot,
|
||||||
|
superficie_parc,
|
||||||
|
superficie_au_sol_bat,
|
||||||
|
valeur_batiment,
|
||||||
|
valeur_locative_adm_metre_carre,
|
||||||
|
montant_loyer_annuel,
|
||||||
|
tfu_metre_carre,
|
||||||
|
tfu_minimum,
|
||||||
|
impositions_tfu_id,
|
||||||
|
deleted,
|
||||||
|
created_at,
|
||||||
|
created_by,
|
||||||
|
"source",
|
||||||
|
updated_at,
|
||||||
|
updated_by,
|
||||||
|
categorie_usage,
|
||||||
|
superficie_au_sol_taux_prop_parc, -- 70 % superficie parcelle
|
||||||
|
valeur_locative_adm_taux_prop_parc,
|
||||||
|
tfu_calcule_taux_prop_parc, -- TFU à 70 %
|
||||||
|
valeur_locative_adm_sup_reel,
|
||||||
|
valeur_locative_adm, -- valeur locative administrative finale
|
||||||
|
tfu_superficie_au_sol_reel,
|
||||||
|
tfu_piscine,
|
||||||
|
montant_taxe, -- TFU finale
|
||||||
|
taux_tfu,
|
||||||
|
parcelle_id,
|
||||||
|
batiment_id,
|
||||||
|
unite_logement_id,
|
||||||
|
personne_id
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
v_annee,
|
||||||
|
d.code,
|
||||||
|
d.nom,
|
||||||
|
c.code,
|
||||||
|
c.nom,
|
||||||
|
a.code,
|
||||||
|
a.nom,
|
||||||
|
q.code,
|
||||||
|
q.nom,
|
||||||
|
p.q,
|
||||||
|
p.i,
|
||||||
|
p.p,
|
||||||
|
p.nup,
|
||||||
|
ep.numero_titre_foncier,
|
||||||
|
b.nub,
|
||||||
|
pers.ifu,
|
||||||
|
pers.npi,
|
||||||
|
pers.tel1,
|
||||||
|
pers.email,
|
||||||
|
pers.nom,
|
||||||
|
pers.prenom,
|
||||||
|
pers.raison_sociale,
|
||||||
|
pers.adresse,
|
||||||
|
ep.representant_tel,
|
||||||
|
ep.representant_nom,
|
||||||
|
ep.representant_prenom,
|
||||||
|
p.longitude,
|
||||||
|
p.latitude,
|
||||||
|
TRUE,
|
||||||
|
-- exonere parcelle
|
||||||
|
(v_today BETWEEN ep.date_debut_exemption
|
||||||
|
AND COALESCE(ep.date_fin_exemption, v_today)),
|
||||||
|
-- exonere batiment
|
||||||
|
(v_today BETWEEN eb.date_debut_excemption
|
||||||
|
AND COALESCE(eb.date_fin_excemption, v_today)),
|
||||||
|
cb.standing,
|
||||||
|
cb.nom,
|
||||||
|
eb.nombre_piscine,
|
||||||
|
eb.date_enquete,
|
||||||
|
st.id,
|
||||||
|
ep.zone_rfu_id,
|
||||||
|
'TFU',
|
||||||
|
p.superficie,
|
||||||
|
eb.superficie_au_sol,
|
||||||
|
-- valeur_batiment : première valeur non nulle non zéro
|
||||||
|
COALESCE(
|
||||||
|
NULLIF(eb.valeur_batiment_reel, 0),
|
||||||
|
NULLIF(eb.valeur_batiment_calcule, 0),
|
||||||
|
NULLIF(eb.valeur_batiment_estime, 0),
|
||||||
|
0
|
||||||
|
),
|
||||||
|
brb.valeur_locative,
|
||||||
|
-- montant_loyer_annuel
|
||||||
|
COALESCE(
|
||||||
|
NULLIF(eb.montant_locatif_annuel_declare, 0),
|
||||||
|
NULLIF(eb.montant_locatif_annuel_calcule, 0),
|
||||||
|
NULLIF(eb.montant_locatif_annuel_estime, 0),
|
||||||
|
0
|
||||||
|
),
|
||||||
|
brb.tfu_metre_carre,
|
||||||
|
brb.tfu_minimum,
|
||||||
|
p_impositions_tfu_id,
|
||||||
|
FALSE,
|
||||||
|
v_today,
|
||||||
|
p_user_id,
|
||||||
|
'FISCAD',
|
||||||
|
v_today,
|
||||||
|
p_user_id,
|
||||||
|
eb.categorie_usage,
|
||||||
|
|
||||||
|
-- superficie_au_sol_taux_prop_parc (70 % parcelle)
|
||||||
|
p.superficie * v_taux_defaut_sup_sol / 100.0,
|
||||||
|
|
||||||
|
-- valeur_locative_adm_taux_prop_parc
|
||||||
|
CASE WHEN eb.categorie_usage = 'HABITATION'
|
||||||
|
THEN (p.superficie * v_taux_defaut_sup_sol / 100.0) * brb.valeur_locative
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
|
||||||
|
-- tfu_calcule_taux_prop_parc
|
||||||
|
CASE WHEN eb.categorie_usage = 'HABITATION'
|
||||||
|
THEN (p.superficie * v_taux_defaut_sup_sol / 100.0) * brb.valeur_locative * v_taux_tfu_ratio
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
|
||||||
|
-- valeur_locative_adm_sup_reel
|
||||||
|
CASE WHEN eb.categorie_usage = 'HABITATION'
|
||||||
|
THEN eb.superficie_au_sol * brb.valeur_locative
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
|
||||||
|
-- ---------------------------------------------------------------
|
||||||
|
-- 🔧 CORRECTION : valeur_locative_adm avec tests explicites
|
||||||
|
-- ---------------------------------------------------------------
|
||||||
|
CASE
|
||||||
|
WHEN eb.categorie_usage = 'HABITATION'
|
||||||
|
AND eb.superficie_au_sol <> 0
|
||||||
|
THEN eb.superficie_au_sol * brb.valeur_locative
|
||||||
|
|
||||||
|
WHEN eb.categorie_usage = 'HABITATION'
|
||||||
|
AND eb.superficie_au_sol = 0
|
||||||
|
THEN (p.superficie * v_taux_defaut_sup_sol / 100.0) * brb.valeur_locative
|
||||||
|
|
||||||
|
-- ✅ Test explicite : valeur_batiment <> 0
|
||||||
|
WHEN eb.categorie_usage IN ('PROFESSIONNELLE', 'MIXTE')
|
||||||
|
AND COALESCE(NULLIF(eb.valeur_batiment_reel, 0),
|
||||||
|
NULLIF(eb.valeur_batiment_calcule, 0),
|
||||||
|
NULLIF(eb.valeur_batiment_estime, 0), 0) <> 0
|
||||||
|
THEN COALESCE(NULLIF(eb.valeur_batiment_reel, 0),
|
||||||
|
NULLIF(eb.valeur_batiment_calcule, 0),
|
||||||
|
NULLIF(eb.valeur_batiment_estime, 0), 0)
|
||||||
|
* v_taux_vlp_ratio
|
||||||
|
|
||||||
|
-- ✅ Test explicite : valeur_batiment = 0
|
||||||
|
WHEN eb.categorie_usage IN ('PROFESSIONNELLE', 'MIXTE')
|
||||||
|
AND COALESCE(NULLIF(eb.valeur_batiment_reel, 0),
|
||||||
|
NULLIF(eb.valeur_batiment_calcule, 0),
|
||||||
|
NULLIF(eb.valeur_batiment_estime, 0), 0) = 0
|
||||||
|
THEN COALESCE(NULLIF(eb.montant_locatif_annuel_declare, 0),
|
||||||
|
NULLIF(eb.montant_locatif_annuel_calcule, 0),
|
||||||
|
NULLIF(eb.montant_locatif_annuel_estime, 0), 0)
|
||||||
|
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
|
||||||
|
-- tfu_superficie_au_sol_reel
|
||||||
|
CASE WHEN eb.categorie_usage = 'HABITATION'
|
||||||
|
THEN eb.superficie_au_sol * brb.valeur_locative * v_taux_tfu_ratio * eb.nombre_piscine * v_tfu_piscine_unitaire
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
|
||||||
|
-- tfu_piscine
|
||||||
|
eb.nombre_piscine * v_tfu_piscine_unitaire,
|
||||||
|
|
||||||
|
-- ---------------------------------------------------------------
|
||||||
|
-- montant_taxe ← calculé directement (plus d'UPDATE)
|
||||||
|
-- Utilise des CTE inline via expression pour éviter la redondance
|
||||||
|
-- ---------------------------------------------------------------
|
||||||
|
(
|
||||||
|
-- On matérialise valeur_batiment et valeur_locative une seule fois
|
||||||
|
WITH calc AS (
|
||||||
|
SELECT
|
||||||
|
COALESCE(NULLIF(eb.valeur_batiment_reel, 0),
|
||||||
|
NULLIF(eb.valeur_batiment_calcule, 0),
|
||||||
|
NULLIF(eb.valeur_batiment_estime, 0), 0) AS vb,
|
||||||
|
COALESCE(NULLIF(eb.montant_locatif_annuel_declare, 0),
|
||||||
|
NULLIF(eb.montant_locatif_annuel_calcule, 0),
|
||||||
|
NULLIF(eb.montant_locatif_annuel_estime, 0), 0) AS loyer,
|
||||||
|
eb.superficie_au_sol * brb.valeur_locative AS vla_reel,
|
||||||
|
(p.superficie * v_taux_defaut_sup_sol / 100.0)
|
||||||
|
* brb.valeur_locative AS vla_70
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
CASE
|
||||||
|
WHEN eb.categorie_usage = 'HABITATION'
|
||||||
|
AND eb.superficie_au_sol <> 0
|
||||||
|
THEN GREATEST(brb.tfu_minimum,
|
||||||
|
calc.vla_reel * v_taux_tfu_ratio
|
||||||
|
+ eb.nombre_piscine * v_tfu_piscine_unitaire)
|
||||||
|
|
||||||
|
WHEN eb.categorie_usage = 'HABITATION'
|
||||||
|
AND eb.superficie_au_sol = 0
|
||||||
|
THEN GREATEST(brb.tfu_minimum,
|
||||||
|
calc.vla_70 * v_taux_tfu_ratio
|
||||||
|
+ eb.nombre_piscine * v_tfu_piscine_unitaire)
|
||||||
|
|
||||||
|
WHEN eb.categorie_usage IN ('PROFESSIONNELLE', 'MIXTE')
|
||||||
|
AND calc.vb <> 0
|
||||||
|
THEN GREATEST(brb.tfu_minimum,
|
||||||
|
calc.vb * v_taux_vlp_ratio * v_taux_tfu_ratio)
|
||||||
|
|
||||||
|
WHEN eb.categorie_usage IN ('PROFESSIONNELLE', 'MIXTE')
|
||||||
|
AND calc.vb = 0
|
||||||
|
THEN GREATEST(brb.tfu_minimum,
|
||||||
|
calc.loyer * v_taux_tfu_ratio)
|
||||||
|
|
||||||
|
ELSE brb.tfu_minimum
|
||||||
|
END
|
||||||
|
FROM calc
|
||||||
|
),
|
||||||
|
v_taux_tfu,
|
||||||
|
p.id,
|
||||||
|
b.id,
|
||||||
|
NULL,
|
||||||
|
ep.personne_id
|
||||||
|
FROM parcelle p
|
||||||
|
-- Dernière enquête parcelle
|
||||||
|
LEFT JOIN LATERAL (
|
||||||
|
SELECT
|
||||||
|
parcelle_id,
|
||||||
|
superficie,
|
||||||
|
personne_id,
|
||||||
|
numero_titre_foncier,
|
||||||
|
date_enquete,
|
||||||
|
representant_tel,
|
||||||
|
representant_nom,
|
||||||
|
representant_prenom,
|
||||||
|
representant_npi,
|
||||||
|
date_debut_exemption,
|
||||||
|
date_fin_exemption,
|
||||||
|
zone_rfu_id
|
||||||
|
FROM enquete
|
||||||
|
WHERE parcelle_id = p.id
|
||||||
|
ORDER BY date_enquete DESC, id DESC
|
||||||
|
LIMIT 1
|
||||||
|
) ep ON TRUE
|
||||||
|
|
||||||
|
LEFT JOIN personne pers ON pers.id = ep.personne_id
|
||||||
|
|
||||||
|
JOIN quartier q ON q.id = p.quartier_id
|
||||||
|
JOIN arrondissement a ON a.id = q.arrondissement_id
|
||||||
|
JOIN commune c ON c.id = a.commune_id
|
||||||
|
JOIN departement d ON d.id = c.departement_id
|
||||||
|
|
||||||
|
-- Rattachement structure via secteur (DISTINCT ON → LATERAL plus lisible)
|
||||||
|
JOIN LATERAL (
|
||||||
|
SELECT secteur_id
|
||||||
|
FROM secteur_decoupage
|
||||||
|
WHERE quartier_id = q.id
|
||||||
|
ORDER BY quartier_id
|
||||||
|
LIMIT 1
|
||||||
|
) sd ON TRUE
|
||||||
|
JOIN secteur sect ON sect.id = sd.secteur_id
|
||||||
|
JOIN section ses ON ses.id = sect.section_id
|
||||||
|
JOIN "structure" st ON st.id = ses.structure_id
|
||||||
|
|
||||||
|
-- Bâtiments sans unités logement (anti-join via LEFT JOIN … IS NULL)
|
||||||
|
JOIN batiment b ON b.parcelle_id = p.id
|
||||||
|
LEFT JOIN unite_logement ul_filter ON ul_filter.batiment_id = b.id
|
||||||
|
|
||||||
|
-- Dernière enquête bâtiment
|
||||||
|
JOIN LATERAL (
|
||||||
|
SELECT
|
||||||
|
eb2.batiment_id,
|
||||||
|
eb2.superficie_au_sol,
|
||||||
|
eb2.nombre_piscine,
|
||||||
|
eb2.categorie_batiment_id,
|
||||||
|
eb2.date_enquete,
|
||||||
|
eb2.montant_locatif_annuel_declare,
|
||||||
|
eb2.montant_locatif_annuel_calcule,
|
||||||
|
eb2.montant_locatif_annuel_estime,
|
||||||
|
eb2.date_debut_excemption,
|
||||||
|
eb2.date_fin_excemption,
|
||||||
|
eb2.valeur_batiment_reel,
|
||||||
|
eb2.valeur_batiment_calcule,
|
||||||
|
eb2.valeur_batiment_estime,
|
||||||
|
u.categorie_usage
|
||||||
|
FROM enquete_batiment eb2
|
||||||
|
JOIN usage u ON u.id = eb2.usage_id
|
||||||
|
WHERE eb2.batiment_id = b.id
|
||||||
|
ORDER BY eb2.date_enquete DESC, eb2.id DESC
|
||||||
|
LIMIT 1
|
||||||
|
) eb ON TRUE
|
||||||
|
|
||||||
|
JOIN categorie_batiment cb ON cb.id = eb.categorie_batiment_id
|
||||||
|
|
||||||
|
-- Barème RFU bâti (inchangé)
|
||||||
|
JOIN LATERAL (
|
||||||
|
SELECT *
|
||||||
|
FROM barem_rfu_bati br
|
||||||
|
WHERE br.categorie_batiment_id = cb.id
|
||||||
|
AND br.arrondissement_id = a.id
|
||||||
|
AND (br.quartier_id = q.id OR br.quartier_id IS NULL)
|
||||||
|
ORDER BY br.quartier_id DESC NULLS LAST
|
||||||
|
LIMIT 1
|
||||||
|
) brb ON TRUE
|
||||||
|
|
||||||
|
WHERE p.batie = TRUE
|
||||||
|
AND ul_filter.batiment_id IS NULL -- anti-join : pas d'unité logement
|
||||||
|
AND st.id = v_structure_id
|
||||||
|
|
||||||
|
ON CONFLICT DO NOTHING;
|
||||||
|
|
||||||
|
GET DIAGNOSTICS v_rows_inserted = ROW_COUNT;
|
||||||
|
|
||||||
|
RETURN v_rows_inserted;
|
||||||
|
END;
|
||||||
|
$$;
|
||||||
@@ -0,0 +1,855 @@
|
|||||||
|
/*CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_tfu_batie_unite_logement(
|
||||||
|
p_impositions_tfu_id BIGINT,
|
||||||
|
p_user_id BIGINT
|
||||||
|
)
|
||||||
|
RETURNS INTEGER
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS
|
||||||
|
$$
|
||||||
|
DECLARE
|
||||||
|
v_rows_inserted INTEGER;
|
||||||
|
v_annee BIGINT;
|
||||||
|
v_structure_id BIGINT;
|
||||||
|
v_taux_defaut_sup_sol NUMERIC;
|
||||||
|
v_taux_tfu NUMERIC;
|
||||||
|
v_taux_valeur_locat_prof NUMERIC;
|
||||||
|
v_tfu_piscine_unitaire NUMERIC;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
-- récupération de l'année
|
||||||
|
SELECT ex.annee, it.structure_id
|
||||||
|
INTO STRICT v_annee, v_structure_id
|
||||||
|
FROM impositions_tfu it
|
||||||
|
join exercice ex on ex.id =it.exercice_id
|
||||||
|
WHERE it.id = p_impositions_tfu_id;
|
||||||
|
|
||||||
|
|
||||||
|
select value
|
||||||
|
into strict v_taux_defaut_sup_sol
|
||||||
|
from parameters
|
||||||
|
where name ='TAUX_DEFAUT_SUPERFICIE_AU_SOL';
|
||||||
|
|
||||||
|
select value
|
||||||
|
into STRICT v_taux_tfu
|
||||||
|
from parameters
|
||||||
|
where name ='TAUX_TFU';
|
||||||
|
|
||||||
|
RAISE NOTICE 'v_taux_tfu = %', v_taux_tfu;
|
||||||
|
|
||||||
|
select value
|
||||||
|
into STRICT v_taux_valeur_locat_prof
|
||||||
|
from parameters
|
||||||
|
where name ='TAUX_VALEUR_LOCATIVE_PROFESSIONNELLE';
|
||||||
|
|
||||||
|
select value
|
||||||
|
into STRICT v_tfu_piscine_unitaire
|
||||||
|
from parameters
|
||||||
|
where name ='TFU_PAR_PISCINE';
|
||||||
|
|
||||||
|
INSERT INTO donnees_imposition_tfu(
|
||||||
|
annee,
|
||||||
|
code_departement,
|
||||||
|
nom_departement,
|
||||||
|
code_commune,
|
||||||
|
nom_commune,
|
||||||
|
code_arrondissement,
|
||||||
|
nom_arrondissement,
|
||||||
|
code_quartier_village,
|
||||||
|
nom_quartier_village,
|
||||||
|
q,
|
||||||
|
ilot,
|
||||||
|
parcelle,
|
||||||
|
nup,
|
||||||
|
titre_foncier,
|
||||||
|
num_batiment,
|
||||||
|
num_unite_logement,
|
||||||
|
ifu,
|
||||||
|
npi,
|
||||||
|
tel_prop,
|
||||||
|
email_prop,
|
||||||
|
nom_prop,
|
||||||
|
prenom_prop,
|
||||||
|
raison_sociale,
|
||||||
|
adresse_prop,
|
||||||
|
tel_sc,
|
||||||
|
nom_sc,
|
||||||
|
prenom_sc,
|
||||||
|
longitude,
|
||||||
|
latitude,
|
||||||
|
batie,
|
||||||
|
exonere,
|
||||||
|
batiment_exonere,
|
||||||
|
unite_logement_exonere,
|
||||||
|
standing_bat,
|
||||||
|
categorie_bat,
|
||||||
|
nombre_piscine,
|
||||||
|
date_enquete,
|
||||||
|
structure_id,
|
||||||
|
zone_rfu_id,
|
||||||
|
nature_impot,
|
||||||
|
superficie_parc,
|
||||||
|
superficie_au_sol_bat,
|
||||||
|
superficie_au_sol_ulog,
|
||||||
|
valeur_batiment,
|
||||||
|
valeur_locative_adm_metre_carre,
|
||||||
|
montant_loyer_annuel,
|
||||||
|
tfu_metre_carre,
|
||||||
|
tfu_minimum,
|
||||||
|
impositions_tfu_id,
|
||||||
|
deleted,
|
||||||
|
created_at ,
|
||||||
|
created_by ,
|
||||||
|
"source",
|
||||||
|
updated_at ,
|
||||||
|
updated_by,
|
||||||
|
categorie_usage,
|
||||||
|
superficie_au_sol_taux_prop_parc, ---70% de la surperficie au sol de la parcelle
|
||||||
|
valeur_locative_adm_taux_prop_parc,
|
||||||
|
tfu_calcule_taux_prop_parc, ----tfu correspondant au 70%
|
||||||
|
valeur_locative_adm_sup_reel,
|
||||||
|
valeur_locative_adm, ----------valeur locative administrative
|
||||||
|
tfu_superficie_au_sol_reel, ----tfu correspondant à la superficie au sol reelle
|
||||||
|
tfu_piscine,
|
||||||
|
montant_taxe, ----tfu finale
|
||||||
|
taux_tfu, ----taux tfu batie
|
||||||
|
parcelle_id,
|
||||||
|
batiment_id,
|
||||||
|
unite_logement_id
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
v_annee,
|
||||||
|
d.code,
|
||||||
|
d.nom,
|
||||||
|
c.code,
|
||||||
|
c.nom,
|
||||||
|
a.code,
|
||||||
|
a.nom,
|
||||||
|
q.code,
|
||||||
|
q.nom,
|
||||||
|
p.q,
|
||||||
|
p.i,
|
||||||
|
p.p,
|
||||||
|
p.nup,
|
||||||
|
ep.numero_titre_foncier,
|
||||||
|
b.nub,
|
||||||
|
ul.nul,
|
||||||
|
eul.ifu,
|
||||||
|
eul.npi,
|
||||||
|
eul.tel1,
|
||||||
|
eul.email,
|
||||||
|
eul.nom,
|
||||||
|
eul.prenom,
|
||||||
|
eul.raison_sociale,
|
||||||
|
eul.adresse,
|
||||||
|
eul.representant_tel,
|
||||||
|
eul.representant_nom,
|
||||||
|
eul.representant_prenom,
|
||||||
|
p.longitude,
|
||||||
|
p.latitude,
|
||||||
|
TRUE,
|
||||||
|
(
|
||||||
|
CURRENT_DATE >= ep.date_debut_exemption
|
||||||
|
AND CURRENT_DATE <= COALESCE(ep.date_fin_exemption, CURRENT_DATE)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
CURRENT_DATE >= eb.date_debut_excemption
|
||||||
|
AND CURRENT_DATE <= COALESCE(eb.date_fin_excemption, CURRENT_DATE)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
CURRENT_DATE >= eul.date_debut_exemption
|
||||||
|
AND CURRENT_DATE <= COALESCE(eul.date_fin_exemption, CURRENT_DATE)
|
||||||
|
),
|
||||||
|
cb.standing,
|
||||||
|
cb.nom,
|
||||||
|
CASE
|
||||||
|
WHEN eul.nombre_piscine is null then 0
|
||||||
|
else eul.nombre_piscine
|
||||||
|
END,
|
||||||
|
eul.date_enquete,
|
||||||
|
st.id,
|
||||||
|
ep.zone_rfu_id,
|
||||||
|
'TFU',
|
||||||
|
p.superficie,
|
||||||
|
eb.superficie_au_sol,
|
||||||
|
eul.superficie_au_sol,
|
||||||
|
CASE -------valeur_batiment
|
||||||
|
WHEN eul.valeur_unite_logement_reel IS NOT NULL AND eul.valeur_unite_logement_reel <> 0 THEN eul.valeur_unite_logement_reel
|
||||||
|
WHEN eul.valeur_unite_logement_calcule IS NOT NULL AND eul.valeur_unite_logement_calcule <> 0 THEN eul.valeur_unite_logement_calcule
|
||||||
|
WHEN eul.valeur_unite_logement_estime IS NOT NULL AND eul.valeur_unite_logement_estime <> 0 THEN eul.valeur_unite_logement_estime
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
brb.valeur_locative,
|
||||||
|
CASE ----- montant_loyer_annuel
|
||||||
|
WHEN eul.montant_locatif_annuel_declare IS NOT NULL AND eul.montant_locatif_annuel_declare <> 0 THEN eul.montant_locatif_annuel_declare
|
||||||
|
WHEN eul.montant_locatif_annuel_calcule IS NOT NULL AND eul.montant_locatif_annuel_calcule <> 0 THEN eul.montant_locatif_annuel_calcule
|
||||||
|
WHEN eul.montant_locatif_annuel_estime IS NOT NULL AND eul.montant_locatif_annuel_estime <> 0 THEN eul.montant_locatif_annuel_estime
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
brb.tfu_metre_carre,
|
||||||
|
brb.tfu_minimum,
|
||||||
|
p_impositions_tfu_id,
|
||||||
|
false,
|
||||||
|
current_date,
|
||||||
|
p_user_id,
|
||||||
|
'FISCAD',
|
||||||
|
current_date,
|
||||||
|
p_user_id,
|
||||||
|
eul.categorie_usage,
|
||||||
|
p.superficie * v_taux_defaut_sup_sol/100,---superficie_au_sol_70pour100
|
||||||
|
case ----valeur_locative_adm70pour100
|
||||||
|
when eul.categorie_usage = 'HABITATION' then (p.superficie * v_taux_defaut_sup_sol/100) * brb.valeur_locative
|
||||||
|
else 0
|
||||||
|
end,
|
||||||
|
case ----tfu calcule 70 pour 100 superficie parcelle
|
||||||
|
when eul.categorie_usage= 'HABITATION' then (p.superficie * v_taux_defaut_sup_sol/100) * brb.valeur_locative * v_taux_tfu/100
|
||||||
|
else 0
|
||||||
|
end,
|
||||||
|
case -----valeur_locative_adm_sup_reel
|
||||||
|
when eul.categorie_usage='HABITATION' then eul.superficie_au_sol * brb.valeur_locative
|
||||||
|
else 0
|
||||||
|
end,
|
||||||
|
0, ------ valeur_locative_adm : en attente de update
|
||||||
|
case -----tfu_superficie_au_sol_reel
|
||||||
|
when eul.categorie_usage='HABITATION' then eul.superficie_au_sol * brb.valeur_locative * 6/100
|
||||||
|
else 0
|
||||||
|
end,
|
||||||
|
CASE
|
||||||
|
WHEN eul.nombre_piscine is null then 0
|
||||||
|
else eul.nombre_piscine * v_tfu_piscine_unitaire
|
||||||
|
END,
|
||||||
|
0,
|
||||||
|
v_taux_tfu,
|
||||||
|
p.id,
|
||||||
|
b.id,
|
||||||
|
ul.id
|
||||||
|
FROM parcelle p
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT DISTINCT ON (parcelle_id)
|
||||||
|
parcelle_id,
|
||||||
|
superficie,
|
||||||
|
personne_id,
|
||||||
|
numero_titre_foncier,
|
||||||
|
date_enquete,
|
||||||
|
representant_tel,
|
||||||
|
representant_nom,
|
||||||
|
representant_prenom,
|
||||||
|
representant_npi,
|
||||||
|
date_debut_exemption,
|
||||||
|
date_fin_exemption,
|
||||||
|
zone_rfu_id
|
||||||
|
FROM enquete
|
||||||
|
ORDER BY parcelle_id, date_enquete DESC, id DESC
|
||||||
|
) ep ON ep.parcelle_id = p.id
|
||||||
|
LEFT JOIN personne pers
|
||||||
|
ON pers.id = ep.personne_id
|
||||||
|
JOIN quartier q ON q.id = p.quartier_id
|
||||||
|
JOIN arrondissement a ON a.id = q.arrondissement_id
|
||||||
|
JOIN commune c ON c.id = a.commune_id
|
||||||
|
JOIN departement d ON d.id = c.departement_id
|
||||||
|
--JOIN secteur_decoupage sd ON sd.quartier_id = q.id
|
||||||
|
JOIN (
|
||||||
|
SELECT DISTINCT ON (quartier_id)
|
||||||
|
quartier_id,
|
||||||
|
secteur_id
|
||||||
|
FROM secteur_decoupage
|
||||||
|
ORDER BY quartier_id
|
||||||
|
) sd ON sd.quartier_id = q.id
|
||||||
|
JOIN secteur sect ON sect.id = sd.secteur_id
|
||||||
|
JOIN section ses ON ses.id = sect.section_id
|
||||||
|
JOIN "structure" st ON st.id = ses.structure_id
|
||||||
|
JOIN batiment b ON b.parcelle_id = p.id
|
||||||
|
JOIN (
|
||||||
|
SELECT DISTINCT ON (batiment_id)
|
||||||
|
batiment_id,
|
||||||
|
superficie_au_sol,
|
||||||
|
nombre_piscine,
|
||||||
|
categorie_batiment_id,
|
||||||
|
date_enquete,
|
||||||
|
montant_locatif_annuel_declare,
|
||||||
|
montant_locatif_annuel_calcule,
|
||||||
|
montant_locatif_annuel_estime,
|
||||||
|
date_debut_excemption,
|
||||||
|
date_fin_excemption,
|
||||||
|
valeur_batiment_reel,
|
||||||
|
valeur_batiment_calcule,
|
||||||
|
valeur_batiment_estime,
|
||||||
|
u.categorie_usage
|
||||||
|
FROM enquete_batiment eb
|
||||||
|
join usage u on u.id=eb.usage_id
|
||||||
|
ORDER BY batiment_id, date_enquete DESC, eb.id DESC
|
||||||
|
) eb ON eb.batiment_id = b.id
|
||||||
|
JOIN unite_logement ul on ul.batiment_id = b.id
|
||||||
|
JOIN (
|
||||||
|
SELECT DISTINCT ON (eult.unite_logement_id)
|
||||||
|
eult.unite_logement_id,
|
||||||
|
pers1.id,
|
||||||
|
pers1.ifu,
|
||||||
|
pers1.npi,
|
||||||
|
pers1.tel1,
|
||||||
|
pers1.email,
|
||||||
|
pers1.nom,
|
||||||
|
pers1.prenom,
|
||||||
|
pers1.raison_sociale,
|
||||||
|
pers1.adresse,
|
||||||
|
eult.nombre_piscine,
|
||||||
|
eult.categorie_batiment_id,
|
||||||
|
eult.superficie_au_sol,
|
||||||
|
eult.superficie_louee,
|
||||||
|
eult.nbre_piece,
|
||||||
|
eult.date_enquete,
|
||||||
|
eult.montant_locatif_annuel_calcule,
|
||||||
|
eult.montant_locatif_annuel_declare,
|
||||||
|
eult.montant_locatif_annuel_estime,
|
||||||
|
eult.date_debut_exemption,
|
||||||
|
eult.date_fin_exemption,
|
||||||
|
eult.representant_nom,
|
||||||
|
eult.representant_prenom,
|
||||||
|
eult.representant_tel,
|
||||||
|
eult.valeur_unite_logement_reel,
|
||||||
|
eult.valeur_unite_logement_calcule,
|
||||||
|
eult.valeur_unite_logement_estime,
|
||||||
|
u.categorie_usage
|
||||||
|
FROM enquete_unite_logement eult
|
||||||
|
join usage u on u.id=eult.usage_id
|
||||||
|
left join personne pers1 on pers1.id = eult.personne_id
|
||||||
|
ORDER BY unite_logement_id, date_enquete DESC, eult.id DESC
|
||||||
|
) eul ON eul.unite_logement_id = ul.id
|
||||||
|
JOIN categorie_batiment cb
|
||||||
|
ON cb.id = eul.categorie_batiment_id
|
||||||
|
JOIN LATERAL (
|
||||||
|
SELECT *
|
||||||
|
FROM barem_rfu_bati br
|
||||||
|
WHERE br.categorie_batiment_id = cb.id
|
||||||
|
AND br.arrondissement_id = a.id
|
||||||
|
AND (br.quartier_id = q.id OR br.quartier_id IS NULL)
|
||||||
|
ORDER BY br.quartier_id DESC NULLS LAST
|
||||||
|
LIMIT 1
|
||||||
|
) brb ON TRUE
|
||||||
|
WHERE p.batie = TRUE
|
||||||
|
AND EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM unite_logement ul
|
||||||
|
WHERE ul.batiment_id = b.id
|
||||||
|
)
|
||||||
|
AND st.id = v_structure_id
|
||||||
|
ON CONFLICT DO NOTHING;
|
||||||
|
|
||||||
|
GET DIAGNOSTICS v_rows_inserted = ROW_COUNT;
|
||||||
|
|
||||||
|
UPDATE donnees_imposition_tfu dtfu
|
||||||
|
SET
|
||||||
|
valeur_locative_adm =
|
||||||
|
CASE
|
||||||
|
WHEN categorie_usage = 'HABITATION' AND superficie_au_sol_ulog <> 0
|
||||||
|
THEN valeur_locative_adm_sup_reel
|
||||||
|
|
||||||
|
WHEN categorie_usage = 'HABITATION' AND superficie_au_sol_ulog = 0
|
||||||
|
THEN valeur_locative_adm_taux_prop_parc
|
||||||
|
|
||||||
|
WHEN categorie_usage IN ('PROFESSIONNELLE','MIXTE') AND valeur_batiment <> 0
|
||||||
|
THEN valeur_batiment * (v_taux_valeur_locat_prof/100)
|
||||||
|
|
||||||
|
WHEN categorie_usage IN ('PROFESSIONNELLE','MIXTE') AND valeur_batiment = 0
|
||||||
|
THEN montant_loyer_annuel
|
||||||
|
END,
|
||||||
|
|
||||||
|
montant_taxe =
|
||||||
|
CASE
|
||||||
|
WHEN categorie_usage = 'HABITATION' AND superficie_au_sol_ulog <> 0 THEN
|
||||||
|
CASE
|
||||||
|
WHEN tfu_minimum < valeur_locative_adm_sup_reel * (v_taux_tfu/100) + tfu_piscine
|
||||||
|
THEN valeur_locative_adm_sup_reel * (v_taux_tfu/100) + tfu_piscine
|
||||||
|
ELSE tfu_minimum
|
||||||
|
END
|
||||||
|
|
||||||
|
WHEN categorie_usage = 'HABITATION' AND superficie_au_sol_ulog = 0 THEN
|
||||||
|
CASE
|
||||||
|
WHEN tfu_minimum < valeur_locative_adm_taux_prop_parc * (v_taux_tfu/100) + tfu_piscine
|
||||||
|
THEN valeur_locative_adm_taux_prop_parc * (v_taux_tfu/100) + tfu_piscine
|
||||||
|
ELSE tfu_minimum
|
||||||
|
END
|
||||||
|
|
||||||
|
WHEN categorie_usage IN ('PROFESSIONNELLE','MIXTE') AND valeur_batiment <> 0 THEN
|
||||||
|
CASE
|
||||||
|
WHEN tfu_minimum < valeur_batiment * (v_taux_valeur_locat_prof/100) * (v_taux_tfu/100)
|
||||||
|
THEN valeur_batiment * (v_taux_valeur_locat_prof/100) * (v_taux_tfu/100)
|
||||||
|
ELSE tfu_minimum
|
||||||
|
END
|
||||||
|
|
||||||
|
WHEN categorie_usage IN ('PROFESSIONNELLE','MIXTE') AND valeur_batiment = 0 THEN
|
||||||
|
CASE
|
||||||
|
WHEN tfu_minimum < montant_loyer_annuel * (v_taux_tfu/100)
|
||||||
|
THEN montant_loyer_annuel * (v_taux_tfu/100)
|
||||||
|
ELSE tfu_minimum
|
||||||
|
END
|
||||||
|
END
|
||||||
|
WHERE impositions_tfu_id = p_impositions_tfu_id
|
||||||
|
AND batie = TRUE
|
||||||
|
AND EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM unite_logement ul
|
||||||
|
WHERE ul.batiment_id = dtfu.batiment_id
|
||||||
|
);
|
||||||
|
RETURN v_rows_inserted;
|
||||||
|
END;
|
||||||
|
$$;*/
|
||||||
|
CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_tfu_batie_unite_logement(
|
||||||
|
p_impositions_tfu_id BIGINT,
|
||||||
|
p_user_id BIGINT
|
||||||
|
)
|
||||||
|
RETURNS INTEGER
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS $$
|
||||||
|
DECLARE
|
||||||
|
v_rows_inserted INTEGER;
|
||||||
|
v_annee BIGINT;
|
||||||
|
v_structure_id BIGINT;
|
||||||
|
v_taux_defaut_sup_sol NUMERIC;
|
||||||
|
v_taux_tfu NUMERIC;
|
||||||
|
v_taux_tfu_ratio NUMERIC; -- v_taux_tfu / 100 (pré-calculé)
|
||||||
|
v_taux_valeur_locat_prof NUMERIC;
|
||||||
|
v_taux_vlp_ratio NUMERIC; -- v_taux_valeur_locat_prof / 100 (pré-calculé)
|
||||||
|
v_tfu_piscine_unitaire NUMERIC;
|
||||||
|
v_today DATE;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
v_today := CURRENT_DATE;
|
||||||
|
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
-- 1. Récupération de l'année et de la structure (inchangée)
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
SELECT ex.annee, it.structure_id
|
||||||
|
INTO STRICT v_annee, v_structure_id
|
||||||
|
FROM impositions_tfu it
|
||||||
|
JOIN exercice ex ON ex.id = it.exercice_id
|
||||||
|
WHERE it.id = p_impositions_tfu_id;
|
||||||
|
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
-- 2. Récupération des 4 paramètres en UNE seule requête
|
||||||
|
-- (évite 4 accès séquentiels à la table parameters)
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
SELECT
|
||||||
|
MAX(value) FILTER (WHERE name = 'TAUX_DEFAUT_SUPERFICIE_AU_SOL'),
|
||||||
|
MAX(value) FILTER (WHERE name = 'TAUX_TFU'),
|
||||||
|
MAX(value) FILTER (WHERE name = 'TAUX_VALEUR_LOCATIVE_PROFESSIONNELLE'),
|
||||||
|
MAX(value) FILTER (WHERE name = 'TFU_PAR_PISCINE')
|
||||||
|
INTO STRICT
|
||||||
|
v_taux_defaut_sup_sol,
|
||||||
|
v_taux_tfu,
|
||||||
|
v_taux_valeur_locat_prof,
|
||||||
|
v_tfu_piscine_unitaire
|
||||||
|
FROM parameters
|
||||||
|
WHERE name IN (
|
||||||
|
'TAUX_DEFAUT_SUPERFICIE_AU_SOL',
|
||||||
|
'TAUX_TFU',
|
||||||
|
'TAUX_VALEUR_LOCATIVE_PROFESSIONNELLE',
|
||||||
|
'TFU_PAR_PISCINE'
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Ratios pré-calculés pour éviter la division répétée dans le SELECT
|
||||||
|
v_taux_tfu_ratio := v_taux_tfu / 100.0;
|
||||||
|
v_taux_vlp_ratio := v_taux_valeur_locat_prof / 100.0;
|
||||||
|
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
-- 3. INSERT avec calcul complet de valeur_locative_adm et montant_taxe
|
||||||
|
-- → supprime l'UPDATE post-INSERT (économie d'un second scan de table)
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
INSERT INTO donnees_imposition_tfu (
|
||||||
|
annee,
|
||||||
|
code_departement,
|
||||||
|
nom_departement,
|
||||||
|
code_commune,
|
||||||
|
nom_commune,
|
||||||
|
code_arrondissement,
|
||||||
|
nom_arrondissement,
|
||||||
|
code_quartier_village,
|
||||||
|
nom_quartier_village,
|
||||||
|
q,
|
||||||
|
ilot,
|
||||||
|
parcelle,
|
||||||
|
nup,
|
||||||
|
titre_foncier,
|
||||||
|
num_batiment,
|
||||||
|
num_unite_logement,
|
||||||
|
ifu,
|
||||||
|
npi,
|
||||||
|
tel_prop,
|
||||||
|
email_prop,
|
||||||
|
nom_prop,
|
||||||
|
prenom_prop,
|
||||||
|
raison_sociale,
|
||||||
|
adresse_prop,
|
||||||
|
tel_sc,
|
||||||
|
nom_sc,
|
||||||
|
prenom_sc,
|
||||||
|
longitude,
|
||||||
|
latitude,
|
||||||
|
batie,
|
||||||
|
exonere,
|
||||||
|
batiment_exonere,
|
||||||
|
unite_logement_exonere,
|
||||||
|
standing_bat,
|
||||||
|
categorie_bat,
|
||||||
|
nombre_piscine,
|
||||||
|
date_enquete,
|
||||||
|
structure_id,
|
||||||
|
zone_rfu_id,
|
||||||
|
nature_impot,
|
||||||
|
superficie_parc,
|
||||||
|
superficie_au_sol_bat,
|
||||||
|
superficie_au_sol_ulog,
|
||||||
|
valeur_batiment,
|
||||||
|
valeur_locative_adm_metre_carre,
|
||||||
|
montant_loyer_annuel,
|
||||||
|
tfu_metre_carre,
|
||||||
|
tfu_minimum,
|
||||||
|
impositions_tfu_id,
|
||||||
|
deleted,
|
||||||
|
created_at,
|
||||||
|
created_by,
|
||||||
|
"source",
|
||||||
|
updated_at,
|
||||||
|
updated_by,
|
||||||
|
categorie_usage,
|
||||||
|
superficie_au_sol_taux_prop_parc, -- 70 % superficie parcelle
|
||||||
|
valeur_locative_adm_taux_prop_parc,
|
||||||
|
tfu_calcule_taux_prop_parc, -- TFU à 70 %
|
||||||
|
valeur_locative_adm_sup_reel,
|
||||||
|
valeur_locative_adm, -- valeur locative administrative finale
|
||||||
|
tfu_superficie_au_sol_reel,
|
||||||
|
tfu_piscine,
|
||||||
|
montant_taxe, -- TFU finale
|
||||||
|
taux_tfu,
|
||||||
|
parcelle_id,
|
||||||
|
batiment_id,
|
||||||
|
unite_logement_id
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
v_annee,
|
||||||
|
d.code,
|
||||||
|
d.nom,
|
||||||
|
c.code,
|
||||||
|
c.nom,
|
||||||
|
a.code,
|
||||||
|
a.nom,
|
||||||
|
q.code,
|
||||||
|
q.nom,
|
||||||
|
p.q,
|
||||||
|
p.i,
|
||||||
|
p.p,
|
||||||
|
p.nup,
|
||||||
|
ep.numero_titre_foncier,
|
||||||
|
b.nub,
|
||||||
|
ul.nul,
|
||||||
|
eul.ifu,
|
||||||
|
eul.npi,
|
||||||
|
eul.tel1,
|
||||||
|
eul.email,
|
||||||
|
eul.nom,
|
||||||
|
eul.prenom,
|
||||||
|
eul.raison_sociale,
|
||||||
|
eul.adresse,
|
||||||
|
eul.representant_tel,
|
||||||
|
eul.representant_nom,
|
||||||
|
eul.representant_prenom,
|
||||||
|
p.longitude,
|
||||||
|
p.latitude,
|
||||||
|
TRUE,
|
||||||
|
-- exonere parcelle
|
||||||
|
(v_today BETWEEN ep.date_debut_exemption
|
||||||
|
AND COALESCE(ep.date_fin_exemption, v_today)),
|
||||||
|
-- exonere batiment
|
||||||
|
(v_today BETWEEN eb.date_debut_excemption
|
||||||
|
AND COALESCE(eb.date_fin_excemption, v_today)),
|
||||||
|
-- exonere unite logement
|
||||||
|
(v_today BETWEEN eul.date_debut_exemption
|
||||||
|
AND COALESCE(eul.date_fin_exemption, v_today)),
|
||||||
|
cb.standing,
|
||||||
|
cb.nom,
|
||||||
|
COALESCE(eul.nombre_piscine, 0),
|
||||||
|
eul.date_enquete,
|
||||||
|
st.id,
|
||||||
|
ep.zone_rfu_id,
|
||||||
|
'TFU',
|
||||||
|
p.superficie,
|
||||||
|
eb.superficie_au_sol,
|
||||||
|
eul.superficie_au_sol,
|
||||||
|
-- valeur_batiment (unité logement) : première valeur non nulle non zéro
|
||||||
|
COALESCE(
|
||||||
|
NULLIF(eul.valeur_unite_logement_reel, 0),
|
||||||
|
NULLIF(eul.valeur_unite_logement_calcule, 0),
|
||||||
|
NULLIF(eul.valeur_unite_logement_estime, 0),
|
||||||
|
0
|
||||||
|
),
|
||||||
|
brb.valeur_locative,
|
||||||
|
-- montant_loyer_annuel
|
||||||
|
COALESCE(
|
||||||
|
NULLIF(eul.montant_locatif_annuel_declare, 0),
|
||||||
|
NULLIF(eul.montant_locatif_annuel_calcule, 0),
|
||||||
|
NULLIF(eul.montant_locatif_annuel_estime, 0),
|
||||||
|
0
|
||||||
|
),
|
||||||
|
brb.tfu_metre_carre,
|
||||||
|
brb.tfu_minimum,
|
||||||
|
p_impositions_tfu_id,
|
||||||
|
FALSE,
|
||||||
|
v_today,
|
||||||
|
p_user_id,
|
||||||
|
'FISCAD',
|
||||||
|
v_today,
|
||||||
|
p_user_id,
|
||||||
|
eul.categorie_usage,
|
||||||
|
|
||||||
|
-- superficie_au_sol_taux_prop_parc (70 % parcelle)
|
||||||
|
p.superficie * v_taux_defaut_sup_sol / 100.0,
|
||||||
|
|
||||||
|
-- valeur_locative_adm_taux_prop_parc
|
||||||
|
CASE WHEN eul.categorie_usage = 'HABITATION'
|
||||||
|
THEN (p.superficie * v_taux_defaut_sup_sol / 100.0) * brb.valeur_locative
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
|
||||||
|
-- tfu_calcule_taux_prop_parc
|
||||||
|
CASE WHEN eul.categorie_usage = 'HABITATION'
|
||||||
|
THEN (p.superficie * v_taux_defaut_sup_sol / 100.0) * brb.valeur_locative * v_taux_tfu_ratio
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
|
||||||
|
-- valeur_locative_adm_sup_reel
|
||||||
|
CASE WHEN eul.categorie_usage = 'HABITATION'
|
||||||
|
THEN eul.superficie_au_sol * brb.valeur_locative
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
|
||||||
|
-- ---------------------------------------------------------------
|
||||||
|
-- valeur_locative_adm avec tests explicites (corrigée)
|
||||||
|
-- ---------------------------------------------------------------
|
||||||
|
CASE
|
||||||
|
WHEN eul.categorie_usage = 'HABITATION'
|
||||||
|
AND eul.superficie_au_sol <> 0
|
||||||
|
THEN eul.superficie_au_sol * brb.valeur_locative
|
||||||
|
|
||||||
|
WHEN eul.categorie_usage = 'HABITATION'
|
||||||
|
AND eul.superficie_au_sol = 0
|
||||||
|
THEN (p.superficie * v_taux_defaut_sup_sol / 100.0) * brb.valeur_locative
|
||||||
|
|
||||||
|
-- ✅ Test explicite : valeur_unite_logement <> 0
|
||||||
|
WHEN eul.categorie_usage IN ('PROFESSIONNELLE', 'MIXTE')
|
||||||
|
AND COALESCE(NULLIF(eul.valeur_unite_logement_reel, 0),
|
||||||
|
NULLIF(eul.valeur_unite_logement_calcule, 0),
|
||||||
|
NULLIF(eul.valeur_unite_logement_estime, 0), 0) <> 0
|
||||||
|
THEN COALESCE(NULLIF(eul.valeur_unite_logement_reel, 0),
|
||||||
|
NULLIF(eul.valeur_unite_logement_calcule, 0),
|
||||||
|
NULLIF(eul.valeur_unite_logement_estime, 0), 0)
|
||||||
|
* v_taux_vlp_ratio
|
||||||
|
|
||||||
|
-- ✅ Test explicite : valeur_unite_logement = 0
|
||||||
|
WHEN eul.categorie_usage IN ('PROFESSIONNELLE', 'MIXTE')
|
||||||
|
AND COALESCE(NULLIF(eul.valeur_unite_logement_reel, 0),
|
||||||
|
NULLIF(eul.valeur_unite_logement_calcule, 0),
|
||||||
|
NULLIF(eul.valeur_unite_logement_estime, 0), 0) = 0
|
||||||
|
THEN COALESCE(NULLIF(eul.montant_locatif_annuel_declare, 0),
|
||||||
|
NULLIF(eul.montant_locatif_annuel_calcule, 0),
|
||||||
|
NULLIF(eul.montant_locatif_annuel_estime, 0), 0)
|
||||||
|
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
|
||||||
|
-- 🔧 CORRECTION : tfu_superficie_au_sol_reel (était hardcodé à 6/100)
|
||||||
|
CASE WHEN eul.categorie_usage = 'HABITATION'
|
||||||
|
THEN eul.superficie_au_sol * brb.valeur_locative * v_taux_tfu_ratio
|
||||||
|
ELSE 0
|
||||||
|
END,
|
||||||
|
|
||||||
|
-- tfu_piscine
|
||||||
|
COALESCE(eul.nombre_piscine, 0) * v_tfu_piscine_unitaire,
|
||||||
|
|
||||||
|
-- ---------------------------------------------------------------
|
||||||
|
-- montant_taxe ← calculé directement (plus d'UPDATE)
|
||||||
|
-- ---------------------------------------------------------------
|
||||||
|
(
|
||||||
|
WITH calc AS (
|
||||||
|
SELECT
|
||||||
|
COALESCE(NULLIF(eul.valeur_unite_logement_reel, 0),
|
||||||
|
NULLIF(eul.valeur_unite_logement_calcule, 0),
|
||||||
|
NULLIF(eul.valeur_unite_logement_estime, 0), 0) AS valeur_ul,
|
||||||
|
COALESCE(NULLIF(eul.montant_locatif_annuel_declare, 0),
|
||||||
|
NULLIF(eul.montant_locatif_annuel_calcule, 0),
|
||||||
|
NULLIF(eul.montant_locatif_annuel_estime, 0), 0) AS loyer,
|
||||||
|
eul.superficie_au_sol * brb.valeur_locative AS vla_reel,
|
||||||
|
(p.superficie * v_taux_defaut_sup_sol / 100.0)
|
||||||
|
* brb.valeur_locative AS vla_70,
|
||||||
|
COALESCE(eul.nombre_piscine, 0) * v_tfu_piscine_unitaire AS piscine_montant
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
CASE
|
||||||
|
WHEN eul.categorie_usage = 'HABITATION'
|
||||||
|
AND eul.superficie_au_sol <> 0
|
||||||
|
THEN GREATEST(brb.tfu_minimum,
|
||||||
|
calc.vla_reel * v_taux_tfu_ratio
|
||||||
|
+ calc.piscine_montant)
|
||||||
|
|
||||||
|
WHEN eul.categorie_usage = 'HABITATION'
|
||||||
|
AND eul.superficie_au_sol = 0
|
||||||
|
THEN GREATEST(brb.tfu_minimum,
|
||||||
|
calc.vla_70 * v_taux_tfu_ratio
|
||||||
|
+ calc.piscine_montant)
|
||||||
|
|
||||||
|
WHEN eul.categorie_usage IN ('PROFESSIONNELLE', 'MIXTE')
|
||||||
|
AND calc.valeur_ul <> 0
|
||||||
|
THEN GREATEST(brb.tfu_minimum,
|
||||||
|
calc.valeur_ul * v_taux_vlp_ratio * v_taux_tfu_ratio)
|
||||||
|
|
||||||
|
WHEN eul.categorie_usage IN ('PROFESSIONNELLE', 'MIXTE')
|
||||||
|
AND calc.valeur_ul = 0
|
||||||
|
THEN GREATEST(brb.tfu_minimum,
|
||||||
|
calc.loyer * v_taux_tfu_ratio)
|
||||||
|
|
||||||
|
ELSE brb.tfu_minimum
|
||||||
|
END
|
||||||
|
FROM calc
|
||||||
|
),
|
||||||
|
|
||||||
|
v_taux_tfu,
|
||||||
|
p.id,
|
||||||
|
b.id,
|
||||||
|
ul.id
|
||||||
|
|
||||||
|
FROM parcelle p
|
||||||
|
|
||||||
|
-- Dernière enquête parcelle
|
||||||
|
LEFT JOIN LATERAL (
|
||||||
|
SELECT
|
||||||
|
parcelle_id,
|
||||||
|
superficie,
|
||||||
|
personne_id,
|
||||||
|
numero_titre_foncier,
|
||||||
|
date_enquete,
|
||||||
|
representant_tel,
|
||||||
|
representant_nom,
|
||||||
|
representant_prenom,
|
||||||
|
representant_npi,
|
||||||
|
date_debut_exemption,
|
||||||
|
date_fin_exemption,
|
||||||
|
zone_rfu_id
|
||||||
|
FROM enquete
|
||||||
|
WHERE parcelle_id = p.id
|
||||||
|
ORDER BY date_enquete DESC, id DESC
|
||||||
|
LIMIT 1
|
||||||
|
) ep ON TRUE
|
||||||
|
|
||||||
|
LEFT JOIN personne pers ON pers.id = ep.personne_id
|
||||||
|
|
||||||
|
JOIN quartier q ON q.id = p.quartier_id
|
||||||
|
JOIN arrondissement a ON a.id = q.arrondissement_id
|
||||||
|
JOIN commune c ON c.id = a.commune_id
|
||||||
|
JOIN departement d ON d.id = c.departement_id
|
||||||
|
|
||||||
|
-- Rattachement structure via secteur
|
||||||
|
JOIN LATERAL (
|
||||||
|
SELECT secteur_id
|
||||||
|
FROM secteur_decoupage
|
||||||
|
WHERE quartier_id = q.id
|
||||||
|
ORDER BY quartier_id
|
||||||
|
LIMIT 1
|
||||||
|
) sd ON TRUE
|
||||||
|
JOIN secteur sect ON sect.id = sd.secteur_id
|
||||||
|
JOIN section ses ON ses.id = sect.section_id
|
||||||
|
JOIN "structure" st ON st.id = ses.structure_id
|
||||||
|
|
||||||
|
JOIN batiment b ON b.parcelle_id = p.id
|
||||||
|
|
||||||
|
-- Dernière enquête bâtiment
|
||||||
|
JOIN LATERAL (
|
||||||
|
SELECT
|
||||||
|
eb2.batiment_id,
|
||||||
|
eb2.superficie_au_sol,
|
||||||
|
eb2.nombre_piscine,
|
||||||
|
eb2.categorie_batiment_id,
|
||||||
|
eb2.date_enquete,
|
||||||
|
eb2.montant_locatif_annuel_declare,
|
||||||
|
eb2.montant_locatif_annuel_calcule,
|
||||||
|
eb2.montant_locatif_annuel_estime,
|
||||||
|
eb2.date_debut_excemption,
|
||||||
|
eb2.date_fin_excemption,
|
||||||
|
eb2.valeur_batiment_reel,
|
||||||
|
eb2.valeur_batiment_calcule,
|
||||||
|
eb2.valeur_batiment_estime,
|
||||||
|
u.categorie_usage
|
||||||
|
FROM enquete_batiment eb2
|
||||||
|
JOIN usage u ON u.id = eb2.usage_id
|
||||||
|
WHERE eb2.batiment_id = b.id
|
||||||
|
ORDER BY eb2.date_enquete DESC, eb2.id DESC
|
||||||
|
LIMIT 1
|
||||||
|
) eb ON TRUE
|
||||||
|
|
||||||
|
JOIN unite_logement ul ON ul.batiment_id = b.id
|
||||||
|
|
||||||
|
-- Dernière enquête unité logement
|
||||||
|
JOIN LATERAL (
|
||||||
|
SELECT
|
||||||
|
eul2.unite_logement_id,
|
||||||
|
pers1.id,
|
||||||
|
pers1.ifu,
|
||||||
|
pers1.npi,
|
||||||
|
pers1.tel1,
|
||||||
|
pers1.email,
|
||||||
|
pers1.nom,
|
||||||
|
pers1.prenom,
|
||||||
|
pers1.raison_sociale,
|
||||||
|
pers1.adresse,
|
||||||
|
eul2.nombre_piscine,
|
||||||
|
eul2.categorie_batiment_id,
|
||||||
|
eul2.superficie_au_sol,
|
||||||
|
eul2.superficie_louee,
|
||||||
|
eul2.nbre_piece,
|
||||||
|
eul2.date_enquete,
|
||||||
|
eul2.montant_locatif_annuel_calcule,
|
||||||
|
eul2.montant_locatif_annuel_declare,
|
||||||
|
eul2.montant_locatif_annuel_estime,
|
||||||
|
eul2.date_debut_exemption,
|
||||||
|
eul2.date_fin_exemption,
|
||||||
|
eul2.representant_nom,
|
||||||
|
eul2.representant_prenom,
|
||||||
|
eul2.representant_tel,
|
||||||
|
eul2.valeur_unite_logement_reel,
|
||||||
|
eul2.valeur_unite_logement_calcule,
|
||||||
|
eul2.valeur_unite_logement_estime,
|
||||||
|
u.categorie_usage
|
||||||
|
FROM enquete_unite_logement eul2
|
||||||
|
JOIN usage u ON u.id = eul2.usage_id
|
||||||
|
LEFT JOIN personne pers1 ON pers1.id = eul2.personne_id
|
||||||
|
WHERE eul2.unite_logement_id = ul.id
|
||||||
|
ORDER BY eul2.date_enquete DESC, eul2.id DESC
|
||||||
|
LIMIT 1
|
||||||
|
) eul ON TRUE
|
||||||
|
|
||||||
|
JOIN categorie_batiment cb ON cb.id = eul.categorie_batiment_id
|
||||||
|
|
||||||
|
-- Barème RFU bâti (inchangé)
|
||||||
|
JOIN LATERAL (
|
||||||
|
SELECT *
|
||||||
|
FROM barem_rfu_bati br
|
||||||
|
WHERE br.categorie_batiment_id = cb.id
|
||||||
|
AND br.arrondissement_id = a.id
|
||||||
|
AND (br.quartier_id = q.id OR br.quartier_id IS NULL)
|
||||||
|
ORDER BY br.quartier_id DESC NULLS LAST
|
||||||
|
LIMIT 1
|
||||||
|
) brb ON TRUE
|
||||||
|
|
||||||
|
WHERE p.batie = TRUE
|
||||||
|
AND EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM unite_logement ul2
|
||||||
|
WHERE ul2.batiment_id = b.id
|
||||||
|
)
|
||||||
|
AND st.id = v_structure_id
|
||||||
|
|
||||||
|
ON CONFLICT DO NOTHING;
|
||||||
|
|
||||||
|
GET DIAGNOSTICS v_rows_inserted = ROW_COUNT;
|
||||||
|
|
||||||
|
RETURN v_rows_inserted;
|
||||||
|
END;
|
||||||
|
$$;
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user