57 Commits

Author SHA1 Message Date
76f0d34e79 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#109) from features/crud_entites into develop
Reviewed-on: #109
2026-02-18 14:01:25 +00:00
666779ecce Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#107) from features/crud_entites into develop
Reviewed-on: #107
2026-02-16 22:04:26 +00:00
7fcd676fc0 Merge pull request 'features/crud_entites' (#105) from features/crud_entites into develop
Reviewed-on: #105
2026-02-16 20:55:25 +00:00
fffdef7103 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#103) from features/crud_entites into develop
Reviewed-on: #103
2026-02-16 00:15:01 +00:00
95c0dacd1e Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#101) from features/crud_entites into develop
Reviewed-on: #101
2026-02-14 14:08:19 +00:00
7ac6b953d3 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#99) from features/crud_entites into develop
Reviewed-on: #99
2026-02-13 17:54:51 +00:00
e010100472 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#97) from features/crud_entites into develop
Reviewed-on: #97
2026-02-12 21:31:24 +00:00
177a9c7b56 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#95) from features/crud_entites into develop
Reviewed-on: #95
2026-02-12 02:15:05 +00:00
3054930a86 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#93) from features/crud_entites into develop
Reviewed-on: #93
2026-02-11 21:14:57 +00:00
4397abd041 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#91) from features/crud_entites into develop
Reviewed-on: #91
2026-02-11 21:10:08 +00:00
a4b403ca20 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#89) from features/crud_entites into develop
Reviewed-on: #89
2026-02-10 00:10:39 +00:00
ff7b88f9f8 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#87) from features/crud_entites into develop
Reviewed-on: #87
2026-02-09 23:26:42 +00:00
37fdba1d85 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#85) from features/crud_entites into develop
Reviewed-on: #85
2026-02-08 22:23:08 +00:00
f50ed9aa5f Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#83) from features/crud_entites into develop
Reviewed-on: #83
2026-02-04 01:33:32 +00:00
966fd2ca7a Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#81) from features/crud_entites into develop
Reviewed-on: #81
2026-02-03 19:32:06 +00:00
a10253b2e8 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#79) from features/crud_entites into develop
Reviewed-on: #79
2026-02-03 15:08:48 +00:00
08b68f9e08 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#77) from features/crud_entites into develop
Reviewed-on: #77
2026-02-02 23:03:26 +00:00
be487d6a03 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#75) from features/crud_entites into develop
Reviewed-on: #75
2026-02-01 22:49:00 +00:00
3be64e7f44 Merge pull request 'gestion de profil, secteur, section et arbre decoupage' (#73) from features/crud_entites into develop
Reviewed-on: #73
2026-01-27 08:58:32 +00:00
03a661cdc0 Merge pull request 'gestion de profil, secteur, section et arbre decoupage' (#72) from features/crud_entites into develop
Reviewed-on: #72
2026-01-27 08:37:52 +00:00
a68ec444cc Merge pull request 'features/crud_entites' (#70) from features/crud_entites into develop
Reviewed-on: #70
2026-01-13 20:33:17 +00:00
58f517bf31 Merge pull request 'correction creation user par defaut' (#68) from features/crud_entites into develop
Reviewed-on: #68
2025-12-20 19:03:51 +00:00
7f18f22efb Merge pull request 'correction creation user par defaut' (#66) from features/crud_entites into develop
Reviewed-on: #66
2025-12-20 18:55:42 +00:00
af3218412f Merge pull request 'correction creation user par defaut' (#64) from features/crud_entites into develop
Reviewed-on: #64
2025-12-20 17:06:19 +00:00
f35670c72e Merge pull request 'correction creation user par defaut' (#62) from features/crud_entites into develop
Reviewed-on: #62
2025-12-20 15:03:45 +00:00
a77c0e854d Merge pull request 'correction creation user par defaut' (#60) from features/crud_entites into develop
Reviewed-on: #60
2025-12-20 14:48:47 +00:00
e75eff4e20 Merge pull request 'correction lecture de secret chargement' (#58) from features/crud_entites into develop
Reviewed-on: #58
2025-12-20 14:33:59 +00:00
40d078c653 Merge pull request 'correction lecture de secret chargement' (#56) from features/crud_entites into develop
Reviewed-on: #56
2025-12-20 14:14:02 +00:00
31dd11d017 Merge pull request 'correction lecture de secret chargement' (#54) from features/crud_entites into develop
Reviewed-on: #54
2025-12-20 13:10:40 +00:00
6dfd12fae8 Merge pull request 'correction lecture de secret chargement' (#52) from features/crud_entites into develop
Reviewed-on: #52
2025-12-20 12:57:46 +00:00
a4ad0a4556 Merge pull request 'correction lecture de secret chargement' (#50) from features/crud_entites into develop
Reviewed-on: #50
2025-12-20 12:41:09 +00:00
411a6c0c2d Merge pull request 'correction lecture de secret' (#48) from features/crud_entites into develop
Reviewed-on: #48
2025-12-20 12:21:25 +00:00
bed73b2b16 Merge pull request 'correction lecture de secret' (#46) from features/crud_entites into develop
Reviewed-on: #46
2025-12-20 12:10:00 +00:00
5a0814a0ba Merge pull request 'correction lecture de secret' (#44) from features/crud_entites into develop
Reviewed-on: #44
2025-12-20 12:00:12 +00:00
126254ea94 Merge pull request 'correction lecture de secret' (#42) from features/crud_entites into develop
Reviewed-on: #42
2025-12-20 11:43:55 +00:00
f9e4681af4 Merge pull request 'correction lecture de secret' (#40) from features/crud_entites into develop
Reviewed-on: #40
2025-12-20 11:39:40 +00:00
84089d3639 Merge pull request 'correction profil actif' (#38) from features/crud_entites into develop
Reviewed-on: #38
2025-12-20 10:48:01 +00:00
02b0a937b4 Merge pull request 'correction profil actif' (#36) from features/crud_entites into develop
Reviewed-on: #36
2025-12-20 10:02:19 +00:00
c0096457fb Merge pull request 'nouvelle verson ci-cd avec gitea runner natif intallé sur hote' (#34) from features/crud_entites into develop
Reviewed-on: #34
2025-12-19 19:14:24 +00:00
b6062ba4d1 Merge pull request 'nouvelle verson ci-cd avec gitea runner natif intallé sur hote' (#33) from features/crud_entites into develop
Reviewed-on: #33
2025-12-19 10:50:02 +00:00
8dc8c974d3 Merge pull request 'correction docker composer avec les secrets' (#32) from features/crud_entites into develop
Reviewed-on: #32
2025-12-19 10:39:57 +00:00
957416df9e Merge pull request 'correction docker composer avec les secrets' (#30) from features/crud_entites into develop
Reviewed-on: #30
2025-12-18 15:47:21 +00:00
8d8af75108 Merge pull request 'correction docker composer avec les secrets' (#28) from features/crud_entites into develop
Reviewed-on: #28
2025-12-18 15:46:02 +00:00
555f13508e Merge pull request 'correction docker composer avec les secrets' (#26) from features/crud_entites into develop
Reviewed-on: #26
2025-12-18 10:36:10 +00:00
d92a2b2503 Merge pull request 'correction docker composer avec les secrets' (#24) from features/crud_entites into develop
Reviewed-on: #24
2025-12-17 17:13:46 +00:00
5ccfdb6a3f Merge pull request 'correction docker composer avec les secrets' (#22) from features/crud_entites into develop
Reviewed-on: #22
2025-12-17 16:58:50 +00:00
87b3bfbe83 Merge pull request 'correction docker composer avec les secrets' (#20) from features/crud_entites into develop
Reviewed-on: #20
2025-12-17 16:49:15 +00:00
62f25ea726 Merge pull request 'correction docker composer avec les secrets' (#18) from features/crud_entites into develop
Reviewed-on: #18
2025-12-17 16:41:46 +00:00
6125fcbd0b Merge pull request 'correction docker composer' (#16) from features/crud_entites into develop
Reviewed-on: #16
2025-12-17 16:26:17 +00:00
211af6103a Merge pull request 'features/crud_entites' (#14) from features/crud_entites into develop
Reviewed-on: #14
2025-12-17 14:12:53 +00:00
d27b622db8 Merge pull request 'Changement en DB du nom de la colonne personne_id en proprietaire_id dans la table enquete' (#12) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 35s
Reviewed-on: #12
2025-12-16 18:22:48 +00:00
c80b40082c Merge pull request 'Changement en DB du nom de la colonne personne_id en proprietaire_id dans la table enquete' (#10) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 44s
Reviewed-on: #10
2025-12-16 18:06:52 +00:00
4a88af6487 Merge pull request 'Changement en DB du nom de la colonne personne_id en proprietaire_id dans la table enquete' (#8) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 34s
Reviewed-on: #8
2025-12-05 19:24:00 +00:00
966b0af1c2 Merge pull request 'Changement en DB du nom de la colonne personne_id en proprietaire_id dans la table enquete' (#6) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 36s
Reviewed-on: #6
2025-12-05 19:20:57 +00:00
58aa088ac3 Merge pull request 'ajout de ci-cd' (#4) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 39s
Reviewed-on: #4
2025-12-05 19:10:37 +00:00
033b430051 Merge pull request 'ajout de ci-cd' (#2) from features/crud_entites into develop
Some checks failed
CD - Deploy on main / deploy (pull_request) Failing after 39s
Reviewed-on: #2
2025-12-05 19:06:43 +00:00
b8dbc7f625 Merge pull request 'ajout de ci-cd' (#1) from features/crud_entites into develop
Reviewed-on: #1
2025-12-05 17:53:30 +00:00
152 changed files with 818 additions and 11931 deletions

View File

@@ -52,10 +52,8 @@ jobs:
echo "JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV" echo "JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV"
# 4) Checkout du dépôt # 4) Checkout du dépôt
#- name: Checkout repository
# uses: https://gitea.com/actions/checkout@v4 #actions/checkout@v4
- name: Checkout repository - name: Checkout repository
run: git clone ${{ gitea.server_url }}/${{ gitea.repository }} . uses: actions/checkout@v4
# 5) Informations de contexte (sans secrets) # 5) Informations de contexte (sans secrets)
- name: Show context information - name: Show context information

View File

@@ -52,10 +52,8 @@ jobs:
echo "JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV" echo "JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV"
# 4) Checkout du dépôt # 4) Checkout du dépôt
#- name: Checkout repository
# uses: https://gitea.com/actions/checkout@v4 #actions/checkout@v4
- name: Checkout repository - name: Checkout repository
run: git clone ${{ gitea.server_url }}/${{ gitea.repository }} . uses: actions/checkout@v4
# 5) Création des secrets runtime (CI uniquement) # 5) Création des secrets runtime (CI uniquement)
- name: Create runtime secrets - name: Create runtime secrets

View File

@@ -164,10 +164,6 @@
<groupId>com.fasterxml.jackson.datatype</groupId> <groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId> <artifactId>jackson-datatype-jsr310</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
</dependency>
</dependencies> </dependencies>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>

View File

@@ -2,7 +2,6 @@ package io.gmss.fiscad.configuration;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@@ -17,7 +16,6 @@ public class RestTemplateConfig {
public ObjectMapper objectMapper() { public ObjectMapper objectMapper() {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JavaTimeModule()); mapper.registerModule(new JavaTimeModule());
mapper.registerModule(new Jdk8Module());
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
return mapper; return mapper;
} }
@@ -25,7 +23,7 @@ public class RestTemplateConfig {
@Bean @Bean
public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() { public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
return builder -> { return builder -> {
builder.modules(new JavaTimeModule(), new Jdk8Module()); builder.modules(new JavaTimeModule());
builder.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); builder.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
}; };
} }

View File

@@ -315,31 +315,5 @@ public class SecteurController {
} }
@Operation(
summary = "recuperer tous les secteurs d'un departement",
description = "Permet de récuperer l'ensemble des secteurs du departement dont l'ID est fourni en path"
)
@GetMapping("/by-departement-id/{departementId}")
public ResponseEntity<?> getSecteurByDepartementId(@PathVariable Long departementId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurService.getListSecteurByDepartementId(departementId), "Secteur trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
} }

View File

@@ -1,7 +1,6 @@
package io.gmss.fiscad.controllers.decoupage; package io.gmss.fiscad.controllers.decoupage;
import io.gmss.fiscad.entities.decoupage.SecteurDecoupage; import io.gmss.fiscad.entities.decoupage.SecteurDecoupage;
import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.decoupage.SecteurDecoupageService; import io.gmss.fiscad.interfaces.decoupage.SecteurDecoupageService;
import io.gmss.fiscad.interfaces.decoupage.SecteurService; import io.gmss.fiscad.interfaces.decoupage.SecteurService;
@@ -249,221 +248,4 @@ public class SecteurDecoupageController {
} }
@GetMapping("/arbre/enquete-en-cours/user-id/{userId}")
public ResponseEntity<?> getArborescenceEnqueteEncoursByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurDecoupageService.getStatEnqueteDecoupageByUserId(userId, StatutEnquete.EN_COURS.toString()), "SecteurDecoupage trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
e.printStackTrace();
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/arbre/enquete-valide/user-id/{userId}")
public ResponseEntity<?> getArborescenceEnqueteValideByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurDecoupageService.getStatEnqueteDecoupageByUserId(userId, StatutEnquete.VALIDE.toString()), "SecteurDecoupage trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
e.printStackTrace();
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/arbre/enquete-cloture/user-id/{userId}")
public ResponseEntity<?> getArborescenceEnqueteClotureByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurDecoupageService.getStatEnqueteDecoupageByUserId(userId, StatutEnquete.CLOTURE.toString()), "SecteurDecoupage trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
e.printStackTrace();
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/arbre/enquete-batiment-en-cours/user-id/{userId}")
public ResponseEntity<?> getArborescenceEnqueteBatimentEncoursByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurDecoupageService.getStatEnqueteBatimentDecoupageByUserId(userId, StatutEnquete.EN_COURS.toString()), "SecteurDecoupage trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
e.printStackTrace();
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/arbre/enquete-batiment-valide/user-id/{userId}")
public ResponseEntity<?> getArborescenceEnqueteBatimentValideByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurDecoupageService.getStatEnqueteBatimentDecoupageByUserId(userId, StatutEnquete.VALIDE.toString()), "SecteurDecoupage trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
e.printStackTrace();
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/arbre/enquete-batiment-cloture/user-id/{userId}")
public ResponseEntity<?> getArborescenceEnqueteBatimentClotureByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurDecoupageService.getStatEnqueteBatimentDecoupageByUserId(userId, StatutEnquete.CLOTURE.toString()), "SecteurDecoupage trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
e.printStackTrace();
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/arbre/enquete-unitlog-en-cours/user-id/{userId}")
public ResponseEntity<?> getArborescenceEnqueteUniteLogEncoursByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurDecoupageService.getStatEnqueteUniteLogementDecoupageByUserId(userId, StatutEnquete.EN_COURS.toString()), "SecteurDecoupage trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
e.printStackTrace();
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/arbre/enquete-unitlog-valide/user-id/{userId}")
public ResponseEntity<?> getArborescenceEnqueteUniteLogValideByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurDecoupageService.getStatEnqueteUniteLogementDecoupageByUserId(userId, StatutEnquete.VALIDE.toString()), "SecteurDecoupage trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
e.printStackTrace();
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/arbre/enquete-unitlog-cloture/user-id/{userId}")
public ResponseEntity<?> getArborescenceEnqueteUniteLigClotureByUserId(@PathVariable Long userId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurDecoupageService.getStatEnqueteUniteLogementDecoupageByUserId(userId, StatutEnquete.CLOTURE.toString()), "SecteurDecoupage trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
e.printStackTrace();
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
} }

View File

@@ -2,8 +2,6 @@ package io.gmss.fiscad.controllers.infocad.metier;
import io.gmss.fiscad.entities.infocad.metier.Enquete; import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment; import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment;
import io.gmss.fiscad.entities.user.User;
import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.infocad.metier.EnqueteService; import io.gmss.fiscad.interfaces.infocad.metier.EnqueteService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
@@ -12,8 +10,6 @@ import io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb;
import io.gmss.fiscad.paylaods.request.synchronisation.EnquetePayLoad; import io.gmss.fiscad.paylaods.request.synchronisation.EnquetePayLoad;
import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad; import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad;
import io.gmss.fiscad.paylaods.request.FiltreEnquetePayLoad; import io.gmss.fiscad.paylaods.request.FiltreEnquetePayLoad;
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.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@@ -68,8 +64,7 @@ public class EnqueteController {
logger.error(e.getLocalizedMessage()); logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK); return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.error(e.getLocalizedMessage());
// logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK); return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
} }
@@ -124,7 +119,6 @@ public class EnqueteController {
@PutMapping("/rejet") @PutMapping("/rejet")
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, enqueteService.rejeterEnquete(enqueteTraitementPayLoad), "Rejet effectuée avec succès."), new ApiResponse<>(true, enqueteService.rejeterEnquete(enqueteTraitementPayLoad), "Rejet effectuée avec succès."),
HttpStatus.OK HttpStatus.OK
@@ -486,65 +480,5 @@ public class EnqueteController {
@GetMapping("/all-paged/en-cours/by-quartier-id/{quartierId}")
public ResponseEntity<?> getAllEnqueteEncoursByQuartierPaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
if(currentUser==null)
return new ResponseEntity<>(
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
HttpStatus.OK
);
Long userId = currentUser.getUser().getId();
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteService.getEnqueteListByQuartierByStatutPageableToDto(userId,quartierId, StatutEnquete.EN_COURS, pageable), "Liste des enquetes en cours chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}")
public ResponseEntity<?> getAllEnqueteClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
if(currentUser==null)
return new ResponseEntity<>(
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
HttpStatus.OK
);
Long userId = currentUser.getUser().getId();
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteService.getEnqueteListByQuartierByStatutPageableToDto(userId,quartierId, StatutEnquete.CLOTURE, pageable), "Liste des enquetes en cours chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
} }

View File

@@ -51,9 +51,9 @@ public class ParcelleController {
@PostMapping("/create") @PostMapping("/create")
public ResponseEntity<?> createParcelle(@RequestBody @Valid @Validated ParcellePayLoadWeb parcellePayLoadWeb) { public ResponseEntity<?> createParcelle(@RequestBody @Valid @Validated ParcellePayLoadWeb parcellePayLoadWeb) {
try { try {
parcellePayLoadWeb = parcelleService.createParcelle(parcellePayLoadWeb); Parcelle parcelle = parcelleService.createParcelle(parcellePayLoadWeb);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, parcellePayLoadWeb, "parcelle créée avec succès."), new ApiResponse<>(true, parcelle, "parcelle créée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -154,7 +154,7 @@ public class ParcelleController {
); );
Long userId = currentUser.getUser().getId(); Long userId = currentUser.getUser().getId();
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, parcelleService.getParcelleByIdToDto(userId,id), "parcelle trouvée avec succès."), new ApiResponse<>(true, parcelleService.getParcelleByIdToDto(userId,id), "enquete trouvé avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -388,33 +388,6 @@ public class ParcelleController {
@PutMapping("/syncrhonise-etat-batie-parcelle")
public ResponseEntity<?> putSynchroniseEtatBatieParcelle() {
try {
Integer nombreParcelleSync= parcelleService.majParcelleBatieNonbatie();
return new ResponseEntity<>(
new ApiResponse<>(true,nombreParcelleSync , "Parcelle mise à jour avec succes."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}

View File

@@ -20,7 +20,7 @@ import org.springframework.web.multipart.MultipartFile;
@SecurityRequirement(name = "bearer") @SecurityRequirement(name = "bearer")
@Tag(name = "ParcelleGeometrie") @Tag(name = "ParcelleGeometrie")
@CrossOrigin(origins = "*") @CrossOrigin(origins = "*")
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')") @PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
public class ParcelleGeomController { public class ParcelleGeomController {
private final ParcelleGeomService parcelleGeomService; private final ParcelleGeomService parcelleGeomService;
@@ -63,24 +63,6 @@ public class ParcelleGeomController {
); );
} }
@GetMapping("/by-quartier-id/{quartierId}")
public ResponseEntity<?> getParcellesGeomsByQuartierId(@PathVariable Long quartierId) {
return new ResponseEntity<>(
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListByQuatierId(quartierId), "Liste des parcelle chargée avec succès."),
HttpStatus.OK
);
}
@GetMapping("/page/by-quartier-id/{quartierId}")
public ResponseEntity<?> getParcellesGeomsByQuartierIdPaged(@PathVariable Long quartierId,@RequestParam int pageNo, @RequestParam int pageSize) {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListByQuatierIdPaged(quartierId,pageable), "Liste des parcelle chargée avec succès."),
HttpStatus.OK
);
}
@GetMapping("/by-arrondissement/{codeArrondissement}") @GetMapping("/by-arrondissement/{codeArrondissement}")
public ResponseEntity<?> getParcellesGeomsByArrondissement(@PathVariable String codeArrondissement) { public ResponseEntity<?> getParcellesGeomsByArrondissement(@PathVariable String codeArrondissement) {
return new ResponseEntity<>( return new ResponseEntity<>(

View File

@@ -223,52 +223,4 @@ public class BatimentController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK); return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
} }
} }
@GetMapping("/all-paged/by-quartier-id/{quartierId}")
public ResponseEntity<?> getAllBatimentByQuartierPaged(@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, batimentService.getBatimentListByquartierPageable(quartierId,pageable), "Liste des batiments chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all/by-quartier-id/{quartierId}")
public ResponseEntity<?> getAllBatimentByQuartier(@PathVariable Long quartierId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, batimentService.getBatimentListByquartier(quartierId), "Liste des batiments chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
} }

View File

@@ -167,11 +167,11 @@ public class CaracteristiqueBatimentController {
} }
} }
@GetMapping("/by-enquete-batiment-id/{enqueteBatimentId}") @GetMapping("/by-enquete-batiment-id/{batimentId}")
public ResponseEntity<?> getCaracteristiqueBatimentByBatimentId(@PathVariable Long enqueteBatimentId) { public ResponseEntity<?> getCaracteristiqueBatimentByBatimentId(@PathVariable Long enquteBatimentId) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, caracteristiqueBatimentService.getCaracteristiqueBatimentListByEnqueteBatiment(enqueteBatimentId), "Caracteristique du batiment trouvée avec succès."), new ApiResponse<>(true, caracteristiqueBatimentService.getCaracteristiqueBatimentListByEnqueteBatiment(enquteBatimentId), "Caracteristique du batiment trouvée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -190,12 +190,12 @@ public class CaracteristiqueBatimentController {
} }
} }
@GetMapping("/page/by-enquete-batiment-id/{enqueteBatimentId}") @GetMapping("/page/by-enquete-batiment-id/{batimentId}")
public ResponseEntity<?> getCaracteristiqueBatimentByEnqueteBatimentIdPaged(@PathVariable Long enqueteBatimentId,@RequestParam int pageNo, @RequestParam int pageSize) { public ResponseEntity<?> getCaracteristiqueBatimentByEnqueteBatimentIdPaged(@PathVariable Long enquteBatimentId,@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, caracteristiqueBatimentService.getCaracteristiqueBatimentListByEnqueteBatimentPageable(enqueteBatimentId,pageable), "Caracteristique du batiment trouvée avec succès."), new ApiResponse<>(true, caracteristiqueBatimentService.getCaracteristiqueBatimentListByEnqueteBatimentPageable(enquteBatimentId,pageable), "Caracteristique du batiment trouvée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {

View File

@@ -199,7 +199,7 @@ public class CaracteristiqueUniteLogementController {
} }
} }
@GetMapping("/page/by-enquete-ulo-id/{enqueteUloId}") @GetMapping("/page//by-enquete-ulo-id/{enqueteUloId}")
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);

View File

@@ -7,10 +7,7 @@ import io.gmss.fiscad.enums.StatusAvis;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.rfu.metier.DonneesImpositionTfuService; import io.gmss.fiscad.interfaces.rfu.metier.DonneesImpositionTfuService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository;
import io.gmss.fiscad.security.CurrentUser;
import io.gmss.fiscad.security.UserPrincipal;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@@ -120,7 +117,7 @@ public class DonneesImpositionTfuController {
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 caractéristiques chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -144,105 +141,7 @@ public class DonneesImpositionTfuController {
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 caractéristiques chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-page/by-imposition-id/{impositionId}")
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdPageable(impositionId, pageable), "Liste des impositions chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-page/by-imposition-id/non-batie/{impositionId}")
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdNonBatiePaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdNonBatiePageable(impositionId, pageable), "Liste des impositions chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-page/by-imposition-id/batie-batiment/{impositionId}")
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdBatieBatimentPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieBatimentPageable(impositionId, pageable), "Liste des impositions chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-page/by-imposition-id/batie-unite-logement/{impositionId}")
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdBatieUniteLogPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(impositionId, pageable), "Liste des impositions chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -283,91 +182,31 @@ public class DonneesImpositionTfuController {
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);
} }
} }
@Operation(summary = "Générer les données fiscales TFU des parcelle baties") @Operation(summary = "Générer les données fiscales TFU")
@PostMapping("/generer-batie") @PostMapping("/generer")
public ResponseEntity<?> genererDonneesFiscaleBatie(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) { public ResponseEntity<?> genererDonneesFiscale(@RequestBody ImpositionsTfu impositionsTfu) {
try { try {
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId()); Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfu.getId());
if(optionalImpositionsTfu.isEmpty()){ if(optionalImpositionsTfu.isEmpty()){
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(false, null, "L'instance d'imposition n'est pas trouvée."), new ApiResponse<>(false, null, "L'imposition tfu n'est pas trouvée."),
HttpStatus.OK HttpStatus.OK
); );
} }
if(!optionalImpositionsTfu.get().getStatusAvis().equals(StatusAvis.TFU_FNB_GENERE)){ if(!optionalImpositionsTfu.get().getStatusAvis().equals(StatusAvis.CREE)){
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(false, null, "l'état actuel : "+optionalImpositionsTfu.get().getStatusAvis()+" ne permet pas cette opération."), new ApiResponse<>(false, null, "le statut actuel ne permet pas cette opération."),
HttpStatus.OK HttpStatus.OK
); );
} }
if(userPrincipal==null){ optionalImpositionsTfu.get().setStatusAvis(StatusAvis.GENERE);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(false, null, "Vous n'êtes pas autorisé à accéder à cette ressource"), new ApiResponse<>(true, donneesImpositionTfuService.genererDonneesFiscales(optionalImpositionsTfu.get()), "DonneesImpositionTfu trouvée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
}
impositionsTfuPaylaodWeb=donneesImpositionTfuService.genererDonneesFiscalesParcelleBatie(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId());
return new ResponseEntity<>(
new ApiResponse<>(true,impositionsTfuPaylaodWeb, "Données d'imposition des fonciers batis Générées avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@Operation(summary = "Générer les données fiscales TFU des parcelle baties")
@PostMapping("/generer-non-batie")
public ResponseEntity<?> genererDonneesImpositionNonBaties(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
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.genererDonneesFiscalesParcelleNonBatie(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId());
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) { } 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);
@@ -434,79 +273,4 @@ public class DonneesImpositionTfuController {
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-exercice-id/by-structure-id/{exerciceId}/{structureId}")
public ResponseEntity<?> getAllDonneesImpositionTfuByExerciceIdAndStructureIdPaged(@PathVariable Long exerciceId, @PathVariable Long structureId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
System.out.println("NOUS SOMMES ICI");
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByExerciceAndStructureIdPageable(exerciceId,structureId, pageable), "Liste des impositions chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all/by-exercice-id/by-structure-id/by-quartier-id/{exerciceId}/{structureId}/{quartierId}")
public ResponseEntity<?> getAllDonneesImpositionTfuByExerciceIdAndStructureId(@PathVariable Long exerciceId, @PathVariable Long structureId, @PathVariable Long quartierId) {
try {
System.out.println("NOUS SOMMES ICI");
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByExerciceAndStructureId(exerciceId,structureId,quartierId), "Liste des imposition chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all/by-personne-id/{personneId}")
public ResponseEntity<?> getAllDonneesImpositionTfuByPersonneId(@PathVariable Long personneId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByPersonneId(personneId), "Liste des impositions chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
} }

View File

@@ -2,14 +2,10 @@ package io.gmss.fiscad.controllers.rfu.metier;
import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment; import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment;
import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.rfu.metier.EnqueteBatimentService; import io.gmss.fiscad.interfaces.rfu.metier.EnqueteBatimentService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad;
import io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb; import io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb;
import io.gmss.fiscad.security.CurrentUser;
import io.gmss.fiscad.security.UserPrincipal;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@@ -24,8 +20,6 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.HttpClientErrorException;
import java.util.List;
@RestController @RestController
@RequestMapping(value = "api/enquete-batiment", produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "api/enquete-batiment", produces = MediaType.APPLICATION_JSON_VALUE)
@@ -57,7 +51,6 @@ public class EnqueteBatimentController {
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) {
e.printStackTrace();
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) {
@@ -230,159 +223,4 @@ public class EnqueteBatimentController {
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/en-cours/by-quartier-id/{quartierId}")
public ResponseEntity<?> getAllEnqueteBatimentEnCoursByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
if(currentUser==null)
return new ResponseEntity<>(
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
HttpStatus.OK
);
Long userId = currentUser.getUser().getId();
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteBatimentService.getEnqueteBatimentListByQuartierByStatutPageableToDto(userId,quartierId, StatutEnquete.EN_COURS, pageable), "Liste des enquetes en cours chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}")
public ResponseEntity<?> getAllEnqueteBatimentClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
if(currentUser==null)
return new ResponseEntity<>(
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
HttpStatus.OK
);
Long userId = currentUser.getUser().getId();
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteBatimentService.getEnqueteBatimentListByQuartierByStatutPageableToDto(userId,quartierId, StatutEnquete.CLOTURE, pageable), "Liste des enquetes en cours chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/validation")
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteBatimentService.validerEnquete(enqueteTraitementPayLoad), "Validation effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/rejet")
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteBatimentService.rejeterEnquete(enqueteTraitementPayLoad), "Rejet effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/validation-lot")
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteBatimentService.validerEnquete(enqueteTraitementPayLoads), "Validation effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/rejet-lot")
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteBatimentService.rejeterEnquete(enqueteTraitementPayLoads), "Rejet effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
} }

View File

@@ -2,14 +2,10 @@ package io.gmss.fiscad.controllers.rfu.metier;
import io.gmss.fiscad.entities.rfu.metier.EnqueteUniteLogement; import io.gmss.fiscad.entities.rfu.metier.EnqueteUniteLogement;
import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.rfu.metier.EnqueteUniteLogementService; import io.gmss.fiscad.interfaces.rfu.metier.EnqueteUniteLogementService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad;
import io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb; import io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb;
import io.gmss.fiscad.security.CurrentUser;
import io.gmss.fiscad.security.UserPrincipal;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@@ -24,8 +20,6 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.HttpClientErrorException;
import java.util.List;
@RestController @RestController
@RequestMapping(value = "api/enquete-unite-logement", produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "api/enquete-unite-logement", produces = MediaType.APPLICATION_JSON_VALUE)
@@ -229,160 +223,4 @@ public class EnqueteUniteLogementController {
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/en-cours/by-quartier-id/{quartierId}")
public ResponseEntity<?> getAllEnqueteUniteLogementEncoursByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
if(currentUser==null)
return new ResponseEntity<>(
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
HttpStatus.OK
);
Long userId = currentUser.getUser().getId();
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.getEnqueteUniteLogementListByQuartierByStatutPageableToDto(userId,quartierId, StatutEnquete.EN_COURS, pageable), "Liste des enquetes en cours chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-paged/cloture/by-quartier-id/{quartierId}")
public ResponseEntity<?> getAllEnqueteUniteLogementClotureByQuartierPaged(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
if(currentUser==null)
return new ResponseEntity<>(
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
HttpStatus.OK
);
Long userId = currentUser.getUser().getId();
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.getEnqueteUniteLogementListByQuartierByStatutPageableToDto(userId,quartierId, StatutEnquete.CLOTURE, pageable), "Liste des enquetes en cours chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/validation")
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.validerEnquete(enqueteTraitementPayLoad), "Validation effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/rejet")
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.rejeterEnquete(enqueteTraitementPayLoad), "Rejet effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/validation-lot")
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.validerEnquete(enqueteTraitementPayLoads), "Validation effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/rejet-lot")
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.rejeterEnquete(enqueteTraitementPayLoads), "Rejet effectuée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
} }

View File

@@ -2,21 +2,12 @@ package io.gmss.fiscad.controllers.rfu.metier;
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu; import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
import io.gmss.fiscad.entities.user.User;
import io.gmss.fiscad.enums.StatusAvis;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.infocad.metier.EnqueteService;
import io.gmss.fiscad.interfaces.rfu.metier.ImpositionsTfuService; import io.gmss.fiscad.interfaces.rfu.metier.ImpositionsTfuService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
import io.gmss.fiscad.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.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import jakarta.ws.rs.NotAcceptableException;
import lombok.AllArgsConstructor;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
@@ -30,7 +21,6 @@ import org.springframework.web.client.HttpClientErrorException;
@RestController @RestController
@AllArgsConstructor
@RequestMapping(value = "api/impositions-tfu", produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "api/impositions-tfu", produces = MediaType.APPLICATION_JSON_VALUE)
@SecurityRequirement(name = "bearer") @SecurityRequirement(name = "bearer")
@Tag(name = "Impositions TFU") @Tag(name = "Impositions TFU")
@@ -38,32 +28,41 @@ import org.springframework.web.client.HttpClientErrorException;
public class ImpositionsTfuController { public class ImpositionsTfuController {
private final ImpositionsTfuService impositionsTfuService; private final ImpositionsTfuService impositionsTfuService;
private final EnqueteService enqueteService;
private static final Logger logger = LoggerFactory.getLogger(ImpositionsTfuController.class); private static final Logger logger = LoggerFactory.getLogger(ImpositionsTfuController.class);
public ImpositionsTfuController(ImpositionsTfuService impositionsTfuService) {
this.impositionsTfuService = impositionsTfuService;
}
@PostMapping("/create") @PostMapping("/create")
public ResponseEntity<?> createImpositionsTfu(@CurrentUser UserPrincipal currentUser,@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) { public ResponseEntity<?> createImpositionsTfu(@RequestBody @Valid @Validated ImpositionsTfu impositionsTfu) {
try { try {
if(currentUser==null){ impositionsTfu = impositionsTfuService.createImpositionsTfu(impositionsTfu);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(false, null, "Vous n'etes pas autorisé à accéder à cette ressource."), new ApiResponse<>(true, impositionsTfu, "Unite de logement créé avec succès."),
HttpStatus.OK 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);
} }
User user=currentUser.getUser();
if(user.getStructure().getId()!=impositionsTfuPaylaodWeb.getStructureId()){
return new ResponseEntity<>(
new ApiResponse<>(false, null, "Vous n'etes pas autorisé à accéder à cette ressource."),
HttpStatus.OK
);
} }
impositionsTfuPaylaodWeb = impositionsTfuService.createImpositionsTfu(impositionsTfuPaylaodWeb); @PutMapping("/update/{id}")
public ResponseEntity<?> updateImpositionsTfu(@PathVariable Long id, @RequestBody ImpositionsTfu impositionsTfu) {
try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, impositionsTfuPaylaodWeb, "Unite de logement créé avec succès."), new ApiResponse<>(true, impositionsTfuService.updateImpositionsTfu(id, impositionsTfu), "Unite de logement mise à jour avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -83,27 +82,11 @@ public class ImpositionsTfuController {
} }
@PutMapping("/cloturer-enquete") @PutMapping("/valider/{id}")
public ResponseEntity<?> cloturer(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb ) { public ResponseEntity<?> validerImpositionsTfu(@RequestBody ImpositionsTfu impositionsTfu) {
try { try {
if(userPrincipal==null){
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, null, "Accès non autorisé"), new ApiResponse<>(true, impositionsTfuService.validerImpositionsTfu(impositionsTfu), "Unite de logement mise à jour avec succès."),
HttpStatus.NOT_ACCEPTABLE
);
}
User user= userPrincipal.getUser();
if(user.getStructure().getId()!=impositionsTfuPaylaodWeb.getStructureId()){
return new ResponseEntity<>(
new ApiResponse<>(true,null, "Vous n'êtes pas autorisé à cloturer les enquetes du : "+user.getStructure().getNom()),
HttpStatus.OK
);
}
return new ResponseEntity<>(
new ApiResponse<>(true, impositionsTfuService.cloturerImpositionsTfu(impositionsTfuPaylaodWeb), "enquete cloturées avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -122,62 +105,11 @@ public class ImpositionsTfuController {
} }
} }
// @PutMapping("/update/{id}") @PutMapping("/annuler/{id}")
// public ResponseEntity<?> updateImpositionsTfu(@PathVariable Long id, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) { public ResponseEntity<?> annulerImpositionsTfu(@PathVariable Long id, @RequestBody ImpositionsTfu impositionsTfu) {
// try {
// return new ResponseEntity<>(
// new ApiResponse<>(true, impositionsTfuService.updateImpositionsTfu(id, impositionsTfuPaylaodWeb), "Unite de logement mise à jour avec succès."),
// HttpStatus.OK
// );
// } catch (HttpClientErrorException.MethodNotAllowed e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
// } catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
// FileStorageException e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
// } catch (NullPointerException e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
// } catch (Exception e) {
// logger.error(e.getLocalizedMessage());
// return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
// }
// }
@Operation(
summary = "Autoriser la génération des avis d'un centre",
description = "Permet d'autoriser la génération des avis d'un centre pour un exervice données"
)
@PutMapping("/autoriser-generation-avis")
public ResponseEntity<?> autoriserImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, impositionsTfuService.autoriserGenerationImpositionsTfu(impositionsTfuPaylaodWeb), "Unite de logement mise à jour avec succès."), new ApiResponse<>(true, impositionsTfuService.annulerImpositionsTfu(impositionsTfu), "Unite de logement mise à jour avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@PutMapping("/rejeter")
public ResponseEntity<?> annulerImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, impositionsTfuService.rejeterImpositionsTfu(impositionsTfuPaylaodWeb), "Unite de logement mise à jour avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -220,19 +152,11 @@ public class ImpositionsTfuController {
} }
} }
@GetMapping("/all/by-user") @GetMapping("/all")
public ResponseEntity<?> getAllImpositionsTfuList(@CurrentUser UserPrincipal userPrincipal) { public ResponseEntity<?> getAllImpositionsTfuList() {
try { try {
if(userPrincipal==null){
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, null, "Vous n'êtes pas autorisé à acceder à cette ressource"), new ApiResponse<>(true, impositionsTfuService.getImpositionsTfuList(), "Liste des Enquetes des unites Logements chargée avec succès."),
HttpStatus.OK
);
}
User user= userPrincipal.getUser();
return new ResponseEntity<>(
new ApiResponse<>(true, impositionsTfuService.getImpositionsTfuByUserIdIds(user.getId()), "Liste des Enquetes des unites Logements chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {

View File

@@ -224,77 +224,4 @@ public class UniteLogementController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK); return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
} }
} }
@GetMapping("/by-parcelle-id/{id}")
public ResponseEntity<?> getUniteLogementByParcelleId(@PathVariable Long id) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.getUniteLogementListByParcelle(id), "Unite de de logement trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-paged/by-quartier-id/{quartierId}")
public ResponseEntity<?> getAllUniteLogementByQuartierPaged(@PathVariable Long quartierId, @RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.getUniteLogementListByQuartierPageable(quartierId,pageable), "Liste des unites de logements chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all/by-quartier-id/{quartierId}")
public ResponseEntity<?> getAllUniteLogementByQuartier(@PathVariable Long quartierId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, enqueteUniteLogementService.getUniteLogementListByQuartier(quartierId), "Liste des unites de logements chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
} }

View File

@@ -2,9 +2,8 @@ package io.gmss.fiscad.controllers.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati; import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuBatiService; import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@@ -25,20 +24,20 @@ import org.springframework.web.client.HttpClientErrorException;
@SecurityRequirement(name = "bearer") @SecurityRequirement(name = "bearer")
@Tag(name = "Barem Rfu") @Tag(name = "Barem Rfu")
public class BaremRfuController { public class BaremRfuController {
private final BaremRfuBatiService baremRfuBatiService; private final BaremRfuService baremRfuService;
private static final Logger logger = LoggerFactory.getLogger(BaremRfuController.class); private static final Logger logger = LoggerFactory.getLogger(BaremRfuController.class);
public BaremRfuController(BaremRfuBatiService baremRfuBatiService) { public BaremRfuController(BaremRfuService baremRfuService) {
this.baremRfuBatiService = baremRfuBatiService; this.baremRfuService = baremRfuService;
} }
@PostMapping("/create") @PostMapping("/create")
public ResponseEntity<?> createBaremRfu(@RequestBody @Valid @Validated BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) { public ResponseEntity<?> createBaremRfu(@RequestBody @Valid @Validated BaremRfuBati baremRfuBati) {
try { try {
baremRfuBatiPayloadWeb = baremRfuBatiService.createBaremRfu(baremRfuBatiPayloadWeb); baremRfuBati = baremRfuService.createBaremRfu(baremRfuBati);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, baremRfuBatiPayloadWeb, "BaremRfuBati créé avec succès."), new ApiResponse<>(true, baremRfuBati, "BaremRfuBati créé avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -58,10 +57,10 @@ public class BaremRfuController {
} }
@PutMapping("/update/{id}") @PutMapping("/update/{id}")
public ResponseEntity<?> updateBaremRfu(@PathVariable Long id, @RequestBody BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) { public ResponseEntity<?> updateBaremRfu(@PathVariable Long id, @RequestBody BaremRfuBati baremRfuBati) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, baremRfuBatiService.updateBaremRfu(id, baremRfuBatiPayloadWeb), "BaremRfuBati mis à jour avec succès."), new ApiResponse<>(true, baremRfuService.updateBaremRfu(id, baremRfuBati), "BaremRfuBati mis à jour avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -83,7 +82,7 @@ public class BaremRfuController {
@DeleteMapping("/delete/{id}") @DeleteMapping("/delete/{id}")
public ResponseEntity<?> deleteBaremRfur(@PathVariable Long id) { public ResponseEntity<?> deleteBaremRfur(@PathVariable Long id) {
try { try {
baremRfuBatiService.deleteBaremRfu(id); baremRfuService.deleteBaremRfu(id);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, "BaremRfuBati supprimée avec succès."), new ApiResponse<>(true, "BaremRfuBati supprimée avec succès."),
HttpStatus.OK HttpStatus.OK
@@ -108,7 +107,7 @@ public class BaremRfuController {
public ResponseEntity<?> getAllBaremRfuList() { public ResponseEntity<?> getAllBaremRfuList() {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, baremRfuBatiService.getBaremRfuList(), "Liste des baremRfus chargée avec succès."), new ApiResponse<>(true, baremRfuService.getBaremRfuList(), "Liste des baremRfus chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -133,7 +132,7 @@ public class BaremRfuController {
Pageable pageable = PageRequest.of(pageNo, pageSize); Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, baremRfuBatiService.getBaremRfuList(pageable), "Liste des baremRfus chargée avec succès."), new ApiResponse<>(true, baremRfuService.getBaremRfuList(pageable), "Liste des baremRfus chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -156,7 +155,7 @@ public class BaremRfuController {
public ResponseEntity<?> getBaremRfuById(@PathVariable Long id) { public ResponseEntity<?> getBaremRfuById(@PathVariable Long id) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, baremRfuBatiService.getBaremRfuById(id), "BaremRfuBati trouvée avec succès."), new ApiResponse<>(true, baremRfuService.getBaremRfuById(id), "BaremRfuBati trouvée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -175,68 +174,13 @@ public class BaremRfuController {
} }
} }
@GetMapping("/by-categorie-batiment-id/{idCategorieBatiment}") @GetMapping("/categorie-batiment/{idCategorieBatiment}")
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) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, baremRfuBatiService.getBaremRfuByCategorieBatiment(idCategorieBatiment), "Liste des baremRfu par categorie de batiments chargée avec succès."), new ApiResponse<>(true, baremRfuService.getBaremRfuByType(idCategorieBatiment), "Liste des baremRfu par categorie de batiments chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/by-arrondissement-id/by-categorie-batiment-id/{idArrondissement}/{idCategorieBatiment}")
public ResponseEntity<?> getBaremRfuByArrondisementAndCategorie( //@Parameter(description = "ID de la catégorie de bâtiment", required = true)
@PathVariable Long idArrondissement,
@PathVariable Long idCategorieBatiment
) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, baremRfuBatiService.getBaremRfuByArrondissementAndCategorieBatiment(idArrondissement,idCategorieBatiment), "Liste des baremRfu par categorie de batiments chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/by-quartier-id/by-categorie-batiment-id/{idQuartier}/{idCategorieBatiment}")
public ResponseEntity<?> getBaremRfuByQuartierAndCategorie( //@Parameter(description = "ID de la catégorie de bâtiment", required = true)
@PathVariable Long idQuartier,
@PathVariable Long idCategorieBatiment
) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, baremRfuBatiService.getBaremRfuByQuartierAndCategorieBatiment(idQuartier,idCategorieBatiment), "Liste des baremRfu par categorie de batiments chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {

View File

@@ -4,7 +4,6 @@ import io.gmss.fiscad.entities.rfu.parametre.BaremRfuNonBati;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuNonBatiService; import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuNonBatiService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
import io.gmss.fiscad.paylaods.request.crudweb.BaremRfuNonBatiPayloadWeb;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@@ -35,11 +34,11 @@ public class BaremRfuNonBatiController {
@PostMapping("/create") @PostMapping("/create")
public ResponseEntity<?> createBaremRfuNonBati(@RequestBody BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) { public ResponseEntity<?> createBaremRfuNonBati(@RequestBody @Valid @Validated BaremRfuNonBati baremRfuNonBati) {
try { try {
baremRfuNonBatiPayloadWeb = baremRfuNonBatiService.createBaremRfuNonBati(baremRfuNonBatiPayloadWeb); baremRfuNonBati = baremRfuNonBatiService.createBaremRfuNonBati(baremRfuNonBati);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, baremRfuNonBatiPayloadWeb, "BaremRfuNonBati créé avec succès."), new ApiResponse<>(true, baremRfuNonBati, "BaremRfuNonBati créé avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -59,10 +58,10 @@ public class BaremRfuNonBatiController {
} }
@PutMapping("/update/{id}") @PutMapping("/update/{id}")
public ResponseEntity<?> updateBaremRfuNonBati(@PathVariable Long id, @RequestBody BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) { public ResponseEntity<?> updateBaremRfuNonBati(@PathVariable Long id, @RequestBody BaremRfuNonBati baremRfuNonBati) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, baremRfuNonBatiService.updateBaremRfuNonBati(id, baremRfuNonBatiPayloadWeb), "BaremRfuNonBati mis à jour avec succès."), new ApiResponse<>(true, baremRfuNonBatiService.updateBaremRfuNonBati(id, baremRfuNonBati), "BaremRfuNonBati mis à jour avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -157,31 +156,7 @@ public class BaremRfuNonBatiController {
public ResponseEntity<?> getBaremRfuNonBatiById(@PathVariable Long id) { public ResponseEntity<?> getBaremRfuNonBatiById(@PathVariable Long id) {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, baremRfuNonBatiService.getBaremRfuNonBatiById(id).orElse(null), "BaremRfuNonBati trouvée avec succès."), new ApiResponse<>(true, baremRfuNonBatiService.getBaremRfuNonBatiById(id), "BaremRfuNonBati trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/by-commune-id/by-zone-id/{communeId}/{zoneId}")
public ResponseEntity<?> getBaremRfuNonBatiByCommineAndZoneId(@PathVariable Long communeId, Long zoneId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, baremRfuNonBatiService.getBaremRfuNonBatiByCommuneAndZoneId(communeId,zoneId).orElse(null), "BaremRfuNonBati trouvée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {

View File

@@ -1,180 +0,0 @@
package io.gmss.fiscad.controllers.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.Usage;
import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.rfu.parametre.UsageService;
import io.gmss.fiscad.paylaods.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.HttpClientErrorException;
@RestController
@RequestMapping(value = "api/usage", produces = MediaType.APPLICATION_JSON_VALUE)
@SecurityRequirement(name = "bearer")
@Tag(name = "Usage")
public class UsageController {
private final UsageService usageService;
private static final Logger logger = LoggerFactory.getLogger(UsageController.class);
public UsageController(UsageService usageService) {
this.usageService = usageService;
}
@PostMapping("/create")
public ResponseEntity<?> createUsage(@RequestBody @Valid @Validated Usage usage) {
try {
usage = usageService.createUsage(usage);
return new ResponseEntity<>(
new ApiResponse<>(true, usage, "Usage 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}")
public ResponseEntity<?> updateUsage(@PathVariable Long id, @RequestBody Usage usage) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, usageService.updateUsage(id, usage), "Usage mis à 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}")
public ResponseEntity<?> deleteUsager(@PathVariable Long id) {
try {
usageService.deleteUsage(id);
return new ResponseEntity<>(
new ApiResponse<>(true, "Usage 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")
public ResponseEntity<?> getAllUsageList() {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, usageService.getUsageList(), "Liste des usages chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all-paged")
public ResponseEntity<?> getAllUsagePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, usageService.getUsageList(pageable), "Liste des usages 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}")
public ResponseEntity<?> getUsageById(@PathVariable Long id) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, usageService.getUsageById(id), "Usage trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
}

View File

@@ -1,12 +1,9 @@
package io.gmss.fiscad.controllers.statistique; package io.gmss.fiscad.controllers.statistique;
import io.gmss.fiscad.enums.NiveauDecoupage; import io.gmss.fiscad.enums.NiveauDecoupage;
import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.exceptions.*; import io.gmss.fiscad.exceptions.*;
import io.gmss.fiscad.interfaces.statistique.StatistiquesService; import io.gmss.fiscad.interfaces.statistique.StatistiquesService;
import io.gmss.fiscad.paylaods.ApiResponse; import io.gmss.fiscad.paylaods.ApiResponse;
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.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@@ -177,77 +174,4 @@ public class StatistiqueController {
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);
} }
} }
@Operation(
summary = "Statistique des enquetes en cours par object ",
description = "Donnes le nombre d'enquetes en coures par objet"
)
@GetMapping(path = "/nombre-enquete/par-objet/en-cours")
public ResponseEntity<?> getStatistiquesEnqueteEnCoursParObjet(@CurrentUser UserPrincipal currentUser) {
try {
if(currentUser==null)
return new ResponseEntity<>(
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
HttpStatus.OK
);
Long userId = currentUser.getUser().getId();
return new ResponseEntity<>(
new ApiResponse<>(true, statistiquesService.getStatNombreEnqueteParObjetUserConnect(userId,StatutEnquete.EN_COURS.toString()), "Statistique des personne par type."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@Operation(
summary = "Statistique des enquetes en cours par object ",
description = "Donnes le nombre d'enquetes en coures par objet"
)
@GetMapping(path = "/nombre-enquete/par-objet/cloture")
public ResponseEntity<?> getStatistiquesEnqueteClotureParObjet(@CurrentUser UserPrincipal currentUser) {
try {
if(currentUser==null)
return new ResponseEntity<>(
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
HttpStatus.OK
);
Long userId = currentUser.getUser().getId();
return new ResponseEntity<>(
new ApiResponse<>(true, statistiquesService.getStatNombreEnqueteParObjetUserConnect(userId, StatutEnquete.CLOTURE.toString()), "Statistique des personne par type."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
} }

View File

@@ -29,8 +29,6 @@ public class Quartier extends BaseEntity implements Serializable {
@ManyToOne @ManyToOne
private Arrondissement arrondissement; private Arrondissement arrondissement;
private String longitude;
private String latitude;
// @JsonIgnore // @JsonIgnore
// @OneToOne(mappedBy = "quartier") // @OneToOne(mappedBy = "quartier")
// private Bloc bloc; // private Bloc bloc;

View File

@@ -99,9 +99,9 @@ public class Enquete extends BaseEntity implements Serializable {
@ManyToOne @ManyToOne
private Campagne campagne; private Campagne campagne;
// @JsonIgnore @JsonIgnore
// @ManyToOne @ManyToOne
// private Equipe equipe; private Equipe equipe;
// @JsonIgnore // @JsonIgnore
@ManyToOne @ManyToOne
@@ -188,7 +188,6 @@ public class Enquete extends BaseEntity implements Serializable {
private Long montantAnnuelleLocation; private Long montantAnnuelleLocation;
private Long valeurParcelleEstime; private Long valeurParcelleEstime;
private Long valeurParcelleReel; private Long valeurParcelleReel;
private Long valeurParcelleCalcule;
private String ncProprietaire; private String ncProprietaire;
@JsonFormat(pattern = "dd-MM-yyyy") @JsonFormat(pattern = "dd-MM-yyyy")
@@ -198,11 +197,6 @@ public class Enquete extends BaseEntity implements Serializable {
@JsonFormat(pattern = "dd-MM-yyyy") @JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class) @JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateFinExcemption; private LocalDate dateFinExcemption;
private String representantNom;
private String representantPrenom;
private String representantTel;
private String representantNpi;
// //
// @JsonIgnore // @JsonIgnore
// @OneToMany(mappedBy = "enquete") // @OneToMany(mappedBy = "enquete")

View File

@@ -1,15 +1,11 @@
package io.gmss.fiscad.entities.infocad.metier; package io.gmss.fiscad.entities.infocad.metier;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.BaseEntity; import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.decoupage.Quartier; import io.gmss.fiscad.entities.decoupage.Quartier;
import io.gmss.fiscad.entities.infocad.parametre.NatureDomaine; import io.gmss.fiscad.entities.infocad.parametre.NatureDomaine;
import io.gmss.fiscad.entities.infocad.parametre.TypeDomaine; import io.gmss.fiscad.entities.infocad.parametre.TypeDomaine;
import io.gmss.fiscad.entities.rfu.metier.Batiment; import io.gmss.fiscad.entities.rfu.metier.Batiment;
import io.gmss.fiscad.entities.rfu.parametre.Usage;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.*; import lombok.*;
import org.hibernate.annotations.ColumnDefault; import org.hibernate.annotations.ColumnDefault;
@@ -61,7 +57,7 @@ public class Parcelle extends BaseEntity implements Serializable {
@ManyToOne @ManyToOne
private Tpe terminal; private Tpe terminal;
private String autreNumeroTitreFoncier; private String autreNumeroTitreFoncier;
private String numeroProvisoire; private Long numeroProvisoire;
private Long blocId; private Long blocId;
@ColumnDefault("false") @ColumnDefault("false")
private boolean synchronise; private boolean synchronise;
@@ -72,17 +68,6 @@ public class Parcelle extends BaseEntity implements Serializable {
@ManyToOne @ManyToOne
private Rue rue ; private Rue rue ;
private String numeroRue ; private String numeroRue ;
private Boolean batie;
private Integer nombrePiscine;
@ManyToOne
private Usage usage;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateDebutExemption;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateFinExemption;
// private String ncProprietaire ; // private String ncProprietaire ;
// @JsonIgnore // @JsonIgnore
// @OneToMany(mappedBy = "parcelle") // @OneToMany(mappedBy = "parcelle")

View File

@@ -10,7 +10,6 @@ import io.gmss.fiscad.entities.decoupage.Arrondissement;
import io.gmss.fiscad.entities.decoupage.Commune; import io.gmss.fiscad.entities.decoupage.Commune;
import io.gmss.fiscad.entities.decoupage.Departement; import io.gmss.fiscad.entities.decoupage.Departement;
import io.gmss.fiscad.entities.decoupage.Quartier; import io.gmss.fiscad.entities.decoupage.Quartier;
import io.gmss.fiscad.enums.SourceDonnee;
import io.gmss.fiscad.enums.StatutParcelle; import io.gmss.fiscad.enums.StatutParcelle;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@@ -25,7 +24,6 @@ import org.n52.jackson.datatype.jts.GeometryDeserializer;
import org.n52.jackson.datatype.jts.GeometrySerializer; import org.n52.jackson.datatype.jts.GeometrySerializer;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Entity @Entity
@@ -41,63 +39,27 @@ public class ParcelleGeom extends BaseEntity implements Serializable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; private Long id;
private String NomDepartement;
private String NomCommune;
private String NomArrondissement;
private String NomVillageQuartier;
private String codeBloc;
private String q;
private String ilot;
private String zone;
private String p;
@Column(unique = true,nullable = true) @Column(unique = true,nullable = true)
private String nup; private String nup;
@Column(unique = true,nullable = true) @Column(unique = true,nullable = true)
private String nupProvisoire; private String nupProvisoire;
private String longitude; private String longitude;
private String latitude; private String latitude;
private String codeDepartement;
private String nomDepartement;
private String codeCommune;
private String nomCommune;
private String codeArrondissement;
private String nomArrondissement;
private String codeQuartierVillage;
private String nomVillageQuartier;
private String codeBloc;
private String numeroRue;
private String numeroEntreePorte;
private String codeInstad;
private String numeroEtatLieux;
private String numeroTitreFoncier;
private LocalDate dateTitreFoncier;
private Boolean batie ;
private String npi;
private String ifu;
private String nom;
private String prenom;
private String raisonSociale;
private String nomEtPrenoms;
private String telephone;
private String adresse;
private String nomRepresentant;
private String prenomRepresentant;
private String raisonSocialeRepresentant;
private String nomEtPrenomsRepresentant;
private String telephoneRepresentant;
private String adresseRepresentant;
private String q;
private String zone;
private String ilot;
private String p;
private String qLotissement;
private String ilotLotissement;
private String pLotissement;
private String pointsPolygone; private String pointsPolygone;
private Integer superficie; private Integer superficie;
private String nomEtPrenoms;
private String dateCollecte; private String dateCollecte;
@Enumerated(EnumType.STRING) private String sourceDonnees;
private SourceDonnee sourceDonnees;
private String observations; private String observations;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private StatutParcelle statutParcelle; private StatutParcelle statutParcelle;
private Long uploadId; private Long uploadId;
@@ -115,22 +77,35 @@ public class ParcelleGeom extends BaseEntity implements Serializable {
private Arrondissement arrondissement; private Arrondissement arrondissement;
@ManyToOne //(fetch = FetchType.LAZY) @ManyToOne //(fetch = FetchType.LAZY)
@JsonBackReference //@JsonBackReference
private Quartier quartier ; private Quartier quartier ;
@ColumnDefault("0") @ColumnDefault("0")
private Integer geomSrid; private int geomSrid;
@JsonSerialize(using = GeometrySerializer.class) @JsonSerialize(using = GeometrySerializer.class)
@JsonDeserialize(contentUsing = GeometryDeserializer.class) @JsonDeserialize(contentUsing = GeometryDeserializer.class)
@Column(name = "geometry",columnDefinition = "geometry(Polygon,32631)") @Column(name = "geometry",columnDefinition = "geometry(Polygon,32631)")
private Polygon geometry; private Polygon geometry;
@Column(columnDefinition = "TEXT") @Column(columnDefinition = "TEXT")
private String geometryString; private String geometryString;
private String codeInsae;
private String numeroEtatLieux;
private String numeroTitreFoncier;
private String telephone;
//private String codeParcelle;
//private String codeEquipe;
@JsonIgnore //private String elLot;
@ManyToOne //private String elLettreParcelle;
@JsonBackReference //private String rfuQuartierOuZone;
private Parcelle parcelle; //private String rfuIlot;
//private String rfuLettreParcelle;
//private String nomLotissement;
////////////
// @JsonIgnore
// @OneToOne
// private Parcelle parcelle;
// @JsonSerialize(using = GeometrySerializer.class) // @JsonSerialize(using = GeometrySerializer.class)
// @JsonDeserialize(contentUsing = GeometryDeserializer.class) // @JsonDeserialize(contentUsing = GeometryDeserializer.class)
// @Column(name = "geom",columnDefinition = "geometry(Polygon,4326)") // @Column(name = "geom",columnDefinition = "geometry(Polygon,4326)")

View File

@@ -24,7 +24,6 @@ import org.hibernate.annotations.Where;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@@ -89,7 +88,7 @@ public class Piece extends BaseEntity implements Serializable {
@OneToMany(mappedBy = "piece") @OneToMany(mappedBy = "piece")
private List<Upload> uploads=new ArrayList<>(); private List<Upload> uploads;
@JsonIgnore @JsonIgnore
@ManyToOne @ManyToOne
@@ -104,9 +103,4 @@ public class Piece extends BaseEntity implements Serializable {
private boolean synchronise; private boolean synchronise;
private String observation; private String observation;
private Long nombreFichier;
public Long getNombreFichier() {
return uploads==null? 0l:uploads.size() ;
}
} }

View File

@@ -96,7 +96,8 @@ public class Upload extends BaseEntity implements Serializable {
String url = this.serverContext() + fileName; String url = this.serverContext() + fileName;
System.out.println("url = " + url); System.out.println("url = " + url);
// return url != null ? url.toLowerCase().startsWith("https") ? url : url.toLowerCase().replaceFirst("http", "https") : null; // return url != null ? url.toLowerCase().startsWith("https") ? url : url.toLowerCase().replaceFirst("http", "https") : null;
return url != null ? url.toLowerCase().startsWith("https") ? url : url.toLowerCase().replaceFirst("http", "https") : null; return url ;//!= null ? url.toLowerCase().startsWith("https") ? url : url.toLowerCase().replaceFirst("http", "https") : null;
} }
private String serverContext() { private String serverContext() {

View File

@@ -7,14 +7,11 @@ import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.BaseEntity; import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.infocad.metier.Parcelle; 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.rfu.parametre.CategorieBatiment;
import io.gmss.fiscad.entities.rfu.parametre.Usage;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.hibernate.Internal;
import org.hibernate.annotations.Where; import org.hibernate.annotations.Where;
import java.io.Serializable; import java.io.Serializable;
@@ -39,40 +36,15 @@ public class Batiment extends BaseEntity implements Serializable {
private Long idDerniereEnquete; private Long idDerniereEnquete;
private Float superficieLouee; private Float superficieLouee;
private Float superficieAuSol; private Float superficieAuSol;
private Integer nombreEtage;
private Integer nombrePiscine;
private Long montantLocatifAnnuelDeclare;
private Long montantLocatifAnnuelCalcule;
private Long montantLocatifAnnuelEstime;
private Long valeurBatimentEstime;
private Long valeurBatimentReel;
private Long valeurBatimentCalcule;
private Long montantMensuelLocation;
private Integer nbreUniteLogement;
private Integer idToitRfu;
@JsonIgnore @JsonIgnore
@ManyToOne @ManyToOne
private Parcelle parcelle; private Parcelle parcelle;
@ManyToOne
private Usage usage;
@ManyToOne
private CategorieBatiment categorieBatiment ;
@JsonIgnore @JsonIgnore
@ManyToOne @ManyToOne
private Tpe terminal; private Tpe terminal;
// private Long enqueteId; // private Long enqueteId;
private Long mobileDataId; private Long mobileDataId;
private Long parcelleExternalKey; private Long parcelleExternalKey;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateDebutExemption;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateFinExemption;
} }

View File

@@ -47,5 +47,3 @@ public class CaracteristiqueUniteLogement extends BaseEntity implements Serializ
private Long enqueteId; private Long enqueteId;
private Long mobileDataId; private Long mobileDataId;
} }

View File

@@ -8,10 +8,6 @@ import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.infocad.metier.Enquete; import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.infocad.metier.Parcelle; 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.Structure;
import io.gmss.fiscad.entities.rfu.parametre.ZoneRfu;
import io.gmss.fiscad.enums.NatureImpot;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
@@ -74,22 +70,16 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
private String latitude; private String latitude;
private int superficieParc; private int superficieParc;
private Long superficieAuSolBat; private Long superficieAuSolBat;
private Long superficieAuSolLoue;
private Long superficieAuSolUlog; private Long superficieAuSolUlog;
private Boolean batie; private String batieOuiNon;
private Boolean exonere; private String exhonereOuiNon;
private Boolean batimentExonere; private String batimentExhonereOuiNon;
private Boolean uniteLogementExonere; private String uniteLogementExhonereOuiNon;
private Long valeurLocativeAdm; private Long valeurLocativeAdm;
private Long valeurLocativeAdmTauxPropParc;
private Long valeurLocativeAdmSupReel;
private Long superficieAuSolTauxPropParc;
private Long valeurLocativeAdmMetreCarre;
private Long montantLoyerAnnuel; private Long montantLoyerAnnuel;
private Long tfuMetreCarre; private Long tfuMetreCarre;
private Long tfuMinimum; private Long tfuMinimum;
private String standingBat; private String standingBat;
private String categorieUsage;
private String categorieBat; private String categorieBat;
private Long nombrePiscine; private Long nombrePiscine;
private Long nombreUlog; private Long nombreUlog;
@@ -98,53 +88,14 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
@JsonDeserialize(using = LocalDateDeserializer.class) @JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateEnquete; private LocalDate dateEnquete;
private Long enqueteId; private Long enqueteId;
private Long structureId;
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "structure_id")
private Structure structure ;
private Long secteurId; private Long secteurId;
@ManyToOne(fetch = FetchType.LAZY) private Long zoneRfuId;
@JoinColumn(name = "zone_rfu_id")
private ZoneRfu zoneRfu ;
@ColumnDefault("0") @ColumnDefault("0")
private Long valeurAdminParcelleNb; private float tauxParcelleNonBati;
private Float tauxTfu; private Long valeurAdministrativeParcelleNonBati;
private Long tfuPiscine;
private Float montantTaxe;
private Float tfuCalculeTauxPropParc;
private Float tfuSuperficieAuSolReel;
private Long valeurAdminParcelleNbMetreCarre;
@JsonIgnore @JsonIgnore
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "impositions_tfu_id", nullable = false) @JoinColumn(name = "impositions_tfu_id", nullable = false)
private ImpositionsTfu impositionsTfu ; private ImpositionsTfu impositionsTfu;
@Enumerated(EnumType.STRING)
private NatureImpot natureImpot;
private Long valeurBatiment;
private Long valeurParcelle;
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "parcelle_id")
private Parcelle parcelleImposee ;
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "batiment_id")
private Batiment batimentImpose ;
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "unite_logement_id")
private UniteLogement uniteLogementImposee ;
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY)
private Personne personne ;
} }

View File

@@ -12,9 +12,7 @@ import io.gmss.fiscad.entities.infocad.metier.Tpe;
import io.gmss.fiscad.entities.infocad.metier.Upload; import io.gmss.fiscad.entities.infocad.metier.Upload;
import io.gmss.fiscad.entities.infocad.parametre.Personne; import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.rfu.parametre.Caracteristique; import io.gmss.fiscad.entities.rfu.parametre.Caracteristique;
import io.gmss.fiscad.entities.rfu.parametre.CategorieBatiment;
import io.gmss.fiscad.entities.rfu.parametre.Exercice; import io.gmss.fiscad.entities.rfu.parametre.Exercice;
import io.gmss.fiscad.entities.rfu.parametre.Usage;
import io.gmss.fiscad.entities.user.User; import io.gmss.fiscad.entities.user.User;
import io.gmss.fiscad.enums.StatutEnquete; import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.enums.StatutEnregistrement; import io.gmss.fiscad.enums.StatutEnregistrement;
@@ -54,8 +52,6 @@ public class EnqueteBatiment extends BaseEntity implements Serializable {
private Boolean soneb; private Boolean soneb;
private String numCompteurSoneb; private String numCompteurSoneb;
private Integer nbreLotUnite; private Integer nbreLotUnite;
private Integer nbreUniteLogement;
private Integer nbrePiece;
private Integer nbreUniteLocation; private Integer nbreUniteLocation;
private Float superficieLouee; private Float superficieLouee;
private Float superficieAuSol; private Float superficieAuSol;
@@ -63,12 +59,8 @@ public class EnqueteBatiment extends BaseEntity implements Serializable {
private Integer nbreHabitant; private Integer nbreHabitant;
private Long montantMensuelLocation; private Long montantMensuelLocation;
private Long montantLocatifAnnuelDeclare; private Long montantLocatifAnnuelDeclare;
private Long montantLocatifAnnuelEstime;
private Long montantLocatifAnnuelCalcule;
private Long valeurBatimentEstime; private Long valeurBatimentEstime;
private Long valeurBatimentReel; private Long valeurBatimentReel;
private Long valeurBatimentCalcule;
private Integer nombrePiscine;
private Integer nbreMoisLocation; private Integer nbreMoisLocation;
private String autreCaracteristiquePhysique; private String autreCaracteristiquePhysique;
private String observation; private String observation;
@@ -83,14 +75,6 @@ public class EnqueteBatiment extends BaseEntity implements Serializable {
@JsonDeserialize(using = LocalDateDeserializer.class) @JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateEnquete; private LocalDate dateEnquete;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateValidation;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateRejet;
private String descriptionMotifRejet;
@ManyToOne @ManyToOne
private Exercice exercice; private Exercice exercice;
@@ -112,11 +96,6 @@ public class EnqueteBatiment extends BaseEntity implements Serializable {
private Long batimentExternalKey; private Long batimentExternalKey;
private Long nbreEtage; private Long nbreEtage;
private String representantNom;
private String representantPrenom;
private String representantTel;
private String representantNpi;
// @JsonIgnore // @JsonIgnore
// @ManyToOne(fetch = FetchType.LAZY) // @ManyToOne(fetch = FetchType.LAZY)
// @JsonBackReference // @JsonBackReference
@@ -142,9 +121,4 @@ public class EnqueteBatiment extends BaseEntity implements Serializable {
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
@JsonIgnore @JsonIgnore
private StatutEnquete statutEnquete; private StatutEnquete statutEnquete;
@ManyToOne
private CategorieBatiment categorieBatiment ;
@ManyToOne
private Usage usage ;
} }

View File

@@ -11,9 +11,7 @@ import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.infocad.metier.Tpe; import io.gmss.fiscad.entities.infocad.metier.Tpe;
import io.gmss.fiscad.entities.infocad.metier.Upload; import io.gmss.fiscad.entities.infocad.metier.Upload;
import io.gmss.fiscad.entities.infocad.parametre.Personne; import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.rfu.parametre.CategorieBatiment;
import io.gmss.fiscad.entities.rfu.parametre.Exercice; import io.gmss.fiscad.entities.rfu.parametre.Exercice;
import io.gmss.fiscad.entities.rfu.parametre.Usage;
import io.gmss.fiscad.entities.user.User; import io.gmss.fiscad.entities.user.User;
import io.gmss.fiscad.enums.StatutEnquete; import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.enums.StatutEnregistrement; import io.gmss.fiscad.enums.StatutEnregistrement;
@@ -49,15 +47,11 @@ public class EnqueteUniteLogement extends BaseEntity implements Serializable {
private Integer nbreHabitant; private Integer nbreHabitant;
private Integer nbreMenage; private Integer nbreMenage;
private Boolean enLocation; private Boolean enLocation;
private Long montantMensuelLocation; private Float montantMensuelLoyer;
private Integer nbreMoisLocation; private Integer nbreMoisLocation;
private Long montantLocatifAnnuelDeclare; private Float montantLocatifAnnuelDeclare;
private Long montantLocatifAnnuelCalcule;
private Long montantLocatifAnnuelEstime;
private Long valeurUniteLogementEstime; private Long valeurUniteLogementEstime;
private Long valeurUniteLogementReel; private Long valeurUniteLogementReel;
private Long valeurUniteLogementCalcule;
private Integer nombrePiscine;
private Float superficieLouee; private Float superficieLouee;
private Float superficieAuSol; private Float superficieAuSol;
private Boolean sbee; private Boolean sbee;
@@ -70,31 +64,16 @@ public class EnqueteUniteLogement extends BaseEntity implements Serializable {
@JsonFormat(pattern = "dd-MM-yyyy") @JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class) @JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateFinExemption; private LocalDate dateFinExemption;
@JsonFormat(pattern = "dd-MM-yyyy") @JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class) @JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateEnquete; private LocalDate dateEnquete;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateValidation;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateRejet;
private String descriptionMotifRejet;
private String observation; private String observation;
private Long uniteLogementExternalKey; private Long uniteLogementExternalKey;
private String representantNom;
private String representantPrenom;
private String representantTel;
private String representantNpi;
@ManyToOne @ManyToOne
private Exercice exercice; private Exercice exercice;
// @JsonIgnore // @JsonIgnore
// @ManyToOne(fetch = FetchType.LAZY) // @ManyToOne(fetch = FetchType.LAZY)
// @JsonBackReference // @JsonBackReference
@@ -129,8 +108,5 @@ public class EnqueteUniteLogement extends BaseEntity implements Serializable {
@JsonIgnore @JsonIgnore
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private StatutEnquete statutEnquete; private StatutEnquete statutEnquete;
@ManyToOne
private CategorieBatiment categorieBatiment ;
@ManyToOne
private Usage usage ;
} }

View File

@@ -6,7 +6,6 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer; import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.BaseEntity; import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.decoupage.Commune; import io.gmss.fiscad.entities.decoupage.Commune;
import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.entities.rfu.parametre.Exercice; import io.gmss.fiscad.entities.rfu.parametre.Exercice;
import io.gmss.fiscad.entities.rfu.parametre.Participer; import io.gmss.fiscad.entities.rfu.parametre.Participer;
import io.gmss.fiscad.enums.StatusAvis; import io.gmss.fiscad.enums.StatusAvis;
@@ -34,39 +33,24 @@ public class ImpositionsTfu extends BaseEntity implements Serializable {
private Long id; private Long id;
@ManyToOne @ManyToOne
private Exercice exercice; private Exercice exercice;
@ManyToOne @ManyToOne
private Commune commune; private Commune commune;
@ManyToOne
private Structure structure ;
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@JsonDeserialize(using = LocalDateDeserializer.class) @JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateGeneration; private LocalDate dateGeneration;
private String ReferencePieceAdmin;
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateCloture;
private String referencePieceAdmin;
private String datePieceAdmin; private String datePieceAdmin;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private StatusAvis statusAvis; private StatusAvis statusAvis;
private Long nombreAvis;
private Integer nombreAvis;
private Integer nombreAvisFnb;
private Integer nombreAvisBatiment;
private Integer nombreAvisUniteLog;
@Column(columnDefinition = "TEXT") @Column(columnDefinition = "TEXT")
private String motif; private String motif;
@JsonIgnore @JsonIgnore
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "impositions_tfu_id") @JoinColumn(name = "impositions_tfu_id")
private List<DonneesImpositionTfu> donneesImpositionTfus; private List<DonneesImpositionTfu> donneesImpositionTfus;
public Long getNombreAvis(){
return donneesImpositionTfus==null?0l:donneesImpositionTfus.size();
}
} }

View File

@@ -39,6 +39,7 @@ public class SituationFiscaleParcelle extends BaseEntity implements Serializable
private Long montantDu ; private Long montantDu ;
private Long montantPaye ; private Long montantPaye ;
private Long resteAPayer ; private Long resteAPayer ;
private StatutParcelle etatFiscalParcelle ;
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@JsonDeserialize(using = LocalDateDeserializer.class) @JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateSync; private LocalDate dateSync;

View File

@@ -6,8 +6,6 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer; import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.BaseEntity; import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.infocad.metier.Tpe; import io.gmss.fiscad.entities.infocad.metier.Tpe;
import io.gmss.fiscad.entities.rfu.parametre.CategorieBatiment;
import io.gmss.fiscad.entities.rfu.parametre.Usage;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
@@ -41,34 +39,13 @@ public class UniteLogement extends BaseEntity implements Serializable {
private List<EnqueteUniteLogement> enqueteUniteLogements; private List<EnqueteUniteLogement> enqueteUniteLogements;
@ManyToOne @ManyToOne
private Batiment batiment; private Batiment batiment;
@ManyToOne
private Usage usage;
private Long batimentExternalKey; private Long batimentExternalKey;
private Long idDerniereEnquete; private Long idDerniereEnquete;
private Float SuperficieLouee; private Float SuperficieLouee;
private Float SuperficieAuSol; private Float SuperficieAuSol;
private Long montantMensuelLocation;
private Long montantLocatifAnnuelDeclare;
private Long montantLocatifAnnuelCalcule;
private Long valeurUniteLogementEstime;
private Long montantLocatifAnnuelEstime;
private Long valeurUniteLogementReel;
private Long valeurUniteLogementCalcule;
private Integer nombrePiscine;
@JsonIgnore @JsonIgnore
@ManyToOne @ManyToOne
private Tpe terminal; private Tpe terminal;
private Long enqueteId; private Long enqueteId;
private Long mobileDataId; private Long mobileDataId;
@ManyToOne
private CategorieBatiment categorieBatiment ;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateDebutExemption;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateFinExemption;
private Integer idToitRfu;
private Integer nombreEtage;
} }

View File

@@ -2,7 +2,6 @@ package io.gmss.fiscad.entities.rfu.parametre;
import io.gmss.fiscad.entities.BaseEntity; import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.decoupage.Arrondissement; import io.gmss.fiscad.entities.decoupage.Arrondissement;
import io.gmss.fiscad.entities.decoupage.Quartier;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
@@ -29,6 +28,4 @@ public class BaremRfuBati extends BaseEntity implements Serializable {
private CategorieBatiment categorieBatiment; private CategorieBatiment categorieBatiment;
@ManyToOne @ManyToOne
private Arrondissement arrondissement; private Arrondissement arrondissement;
@ManyToOne
private Quartier quartier ;
} }

View File

@@ -23,9 +23,7 @@ public class BaremRfuNonBati extends BaseEntity implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; private Long id;
private Long valeurAdministrative; private Long valeurAdministrative;
private Long valeurAdministrativeMetreCarre; private float taux;
private Boolean auMetreCarre;
private Float taux;
@ManyToOne @ManyToOne
private Commune commune; private Commune commune;
@ManyToOne @ManyToOne

View File

@@ -23,5 +23,4 @@ public class CategorieBatiment extends BaseEntity implements Serializable {
@Column(unique = true) @Column(unique = true)
private String code; private String code;
private String nom; private String nom;
private String standing;
} }

View File

@@ -1,29 +0,0 @@
package io.gmss.fiscad.entities.rfu.parametre;
import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.enums.CategorieUsage;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Where;
import java.io.Serializable;
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Where(clause = " deleted = false")
public class Usage extends BaseEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String code;
private String nom;
@Enumerated(EnumType.STRING)
private CategorieUsage categorieUsage;
}

View File

@@ -1,8 +0,0 @@
package io.gmss.fiscad.enums;
public enum CategorieUsage {
HABITATION,
PROFESSIONNELLE,
MIXTE
}

View File

@@ -1,7 +0,0 @@
package io.gmss.fiscad.enums;
public enum NatureImpot {
TFU,
IRF,
SRTB
}

View File

@@ -12,11 +12,5 @@ public enum ParametersType {
CORPS_RESET_PASSWORD, CORPS_RESET_PASSWORD,
OBJET_CREATE_ACCOUNT, OBJET_CREATE_ACCOUNT,
CORPS_CREATE_ACCOUNT, CORPS_CREATE_ACCOUNT,
TOKEN_IFU_EN_LIGNE, TOKEN_IFU_EN_LIGNE ;
TAUX_TFU,
TAUX_VALEUR_LOCATIVE_PROFESSIONNELLE,
TAUX_DEFAUT_SUPERFICIE_AU_SOL,
TAUX_IRF,
TAXE_SRTB,
TFU_PAR_PISCINE;
} }

View File

@@ -1,7 +0,0 @@
package io.gmss.fiscad.enums;
public enum SourceDonnee {
RFU,
ANDF,
SIGIBE
}

View File

@@ -1,13 +1,8 @@
package io.gmss.fiscad.enums; package io.gmss.fiscad.enums;
public enum StatusAvis { public enum StatusAvis {
EN_COURS, CREE,
GENERE,
CLOTURE, ANNULE,
GENERATION_AUTORISE, VALIDE,
REJETE,
TFU_FNB_GENERE,
GENERE
} }

View File

@@ -1,7 +1,10 @@
package io.gmss.fiscad.enums; package io.gmss.fiscad.enums;
public enum StatutParcelle { public enum StatutParcelle {
NON_ENQUETE, NON_ENQUETER,
AJOUR, ENQUETER_NON_BATIE_AJOUR,
NON_AJOUR; ENQUETER_BATIE_AJOUR,
ENQUETER_NON_BATIE_NON_AJOUR,
ENQUETER_BATIE_NON_AJOUR
} }

View File

@@ -2,18 +2,15 @@ package io.gmss.fiscad.implementations.decoupage;
import io.gmss.fiscad.entities.decoupage.Secteur; import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.entities.decoupage.SecteurDecoupage; import io.gmss.fiscad.entities.decoupage.SecteurDecoupage;
import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.decoupage.SecteurDecoupageService; import io.gmss.fiscad.interfaces.decoupage.SecteurDecoupageService;
import io.gmss.fiscad.interfaces.decoupage.SecteurService; import io.gmss.fiscad.interfaces.decoupage.SecteurService;
import io.gmss.fiscad.paylaods.request.crudweb.SecteurDecoupagePaylaodWeb; import io.gmss.fiscad.paylaods.request.crudweb.SecteurDecoupagePaylaodWeb;
import io.gmss.fiscad.paylaods.response.statistique.ParcelleStatsProjectionUnSecteur; import io.gmss.fiscad.paylaods.request.crudweb.SecteurPaylaodWeb;
import io.gmss.fiscad.paylaods.response.restoration.ParcelleStatsProjectionUnSecteur;
import io.gmss.fiscad.persistence.repositories.decoupage.SecteurDecoupageRepository; import io.gmss.fiscad.persistence.repositories.decoupage.SecteurDecoupageRepository;
import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository;
import io.gmss.fiscad.persistence.repositories.infocad.metier.ParcelleRepository; import io.gmss.fiscad.persistence.repositories.infocad.metier.ParcelleRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService; import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@@ -29,9 +26,6 @@ public class SecteurDecoupageServiceImpl implements SecteurDecoupageService {
private final SecteurDecoupageRepository secteurDecoupageRepository; private final SecteurDecoupageRepository secteurDecoupageRepository;
private final SecteurService secteurService; private final SecteurService secteurService;
private final ParcelleRepository parcelleRepository; private final ParcelleRepository parcelleRepository;
private final EnqueteRepository enqueteRepository;
private final EnqueteBatimentRepository enqueteBatimentRepository;
private final EnqueteUniteLogementRepository enqueteUniteLogementRepository;
private final EntityFromPayLoadService entityFromPayLoadService; private final EntityFromPayLoadService entityFromPayLoadService;
@@ -118,35 +112,4 @@ public class SecteurDecoupageServiceImpl implements SecteurDecoupageService {
return parcelleStatsProjectionUnSecteurs ; return parcelleStatsProjectionUnSecteurs ;
} }
@Override
public List<ParcelleStatsProjectionUnSecteur> getStatEnqueteDecoupageByUserId(Long userId, String statutEnquete) {
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
List<Long> secteurIds = secteurs.stream()
.map(Secteur::getId)
.toList();
System.out.println(statutEnquete);
return enqueteRepository.findStatsEnqueteBySecteurs(secteurIds,statutEnquete);
}
@Override
public List<ParcelleStatsProjectionUnSecteur> getStatEnqueteBatimentDecoupageByUserId(Long userId, String statutEnquete) {
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
List<Long> secteurIds = secteurs.stream()
.map(Secteur::getId)
.toList();
System.out.println(statutEnquete);
return enqueteBatimentRepository.findStatsEnqueteBatimentBySecteurs(secteurIds,statutEnquete);
}
@Override
public List<ParcelleStatsProjectionUnSecteur> getStatEnqueteUniteLogementDecoupageByUserId(Long userId, String statutEnquete) {
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
List<Long> secteurIds = secteurs.stream()
.map(Secteur::getId)
.toList();
return enqueteUniteLogementRepository.findStatsEnqueteBatimentBySecteurs(secteurIds,statutEnquete);
}
} }

View File

@@ -163,15 +163,8 @@ public class SecteurServiceImpl implements SecteurService {
secteurs.addAll(secteurRepository.findDistinctBySection_Id(avoirFonction.getFonction().getSection().getId())); secteurs.addAll(secteurRepository.findDistinctBySection_Id(avoirFonction.getFonction().getSection().getId()));
}else if(avoirFonction.getFonction().getStructure()!=null){ }else if(avoirFonction.getFonction().getStructure()!=null){
secteurs.addAll(secteurRepository.findDistinctBySection_Structure_Id(avoirFonction.getFonction().getStructure().getId())); secteurs.addAll(secteurRepository.findDistinctBySection_Structure_Id(avoirFonction.getFonction().getStructure().getId()));
}else if(avoirFonction.getFonction().getDepartement()!=null){
secteurs.addAll(secteurRepository.findSectionsByDepartement(avoirFonction.getFonction().getDepartement().getId()));
} }
}); });
return secteurs; return secteurs;
} }
@Override
public List<Secteur> getListSecteurByDepartementId(Long departementId) {
return secteurRepository.findSectionsByDepartement(departementId);
}
} }

View File

@@ -1,6 +1,5 @@
package io.gmss.fiscad.implementations.infocad.metier; package io.gmss.fiscad.implementations.infocad.metier;
import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.entities.infocad.metier.*; import io.gmss.fiscad.entities.infocad.metier.*;
import io.gmss.fiscad.entities.infocad.parametre.Personne; import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueParcelle; import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueParcelle;
@@ -14,9 +13,7 @@ import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.exceptions.ApplicationException; import io.gmss.fiscad.exceptions.ApplicationException;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.decoupage.SecteurService;
import io.gmss.fiscad.interfaces.infocad.metier.EnqueteService; import io.gmss.fiscad.interfaces.infocad.metier.EnqueteService;
import io.gmss.fiscad.interfaces.infocad.metier.ParcelleService;
import io.gmss.fiscad.interfaces.infocad.metier.PieceService; import io.gmss.fiscad.interfaces.infocad.metier.PieceService;
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueParcelleService; import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueParcelleService;
import io.gmss.fiscad.interfaces.rfu.metier.DeclarationNcService; import io.gmss.fiscad.interfaces.rfu.metier.DeclarationNcService;
@@ -26,7 +23,6 @@ import io.gmss.fiscad.interfaces.user.UserService;
import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad; import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad;
import io.gmss.fiscad.paylaods.request.FiltreEnquetePayLoad; import io.gmss.fiscad.paylaods.request.FiltreEnquetePayLoad;
import io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb; import io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb;
import io.gmss.fiscad.paylaods.request.crudweb.ParcellePayLoadWeb;
import io.gmss.fiscad.paylaods.response.* ; import io.gmss.fiscad.paylaods.response.* ;
import io.gmss.fiscad.paylaods.response.FicheResponse.* ; import io.gmss.fiscad.paylaods.response.FicheResponse.* ;
import io.gmss.fiscad.paylaods.response.synchronisation.EnqueteNonSyncResponse; import io.gmss.fiscad.paylaods.response.synchronisation.EnqueteNonSyncResponse;
@@ -47,8 +43,6 @@ import io.gmss.fiscad.service.EntityFromPayLoadService;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContext;
import jakarta.persistence.Query; import jakarta.persistence.Query;
import jakarta.transaction.Transactional;
import jakarta.ws.rs.NotAcceptableException;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.modelmapper.ModelMapper; import org.modelmapper.ModelMapper;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@@ -83,9 +77,13 @@ public class EnqueteServiceImpl implements EnqueteService {
private final ParcelleServiceImpl parcelleService; private final ParcelleServiceImpl parcelleService;
private final PersonneRepository personneRepository; private final PersonneRepository personneRepository;
private final ZoneRfuRepository zoneRfuRepository ; private final ZoneRfuRepository zoneRfuRepository ;
private final EquipeRepository equipeRepository ;
private final RueRepository rueRepository ;
private final CaracteristiqueParcelleService caracteristiqueParcelleService ;
private final PieceService pieceService ;
private final UploadRepository uploadRepository ;
private final DeclarationNcService declarationNcService ;
private final EntityFromPayLoadService entityFromPayLoadService ; private final EntityFromPayLoadService entityFromPayLoadService ;
private final SecteurService secteurService ;
;
@PersistenceContext @PersistenceContext
private final EntityManager em; private final EntityManager em;
@@ -93,73 +91,67 @@ public class EnqueteServiceImpl implements EnqueteService {
@Override @Override
@Transactional
public EnquetePayLoadWeb createEnquete(EnquetePayLoadWeb enquetePayLoadWeb) throws BadRequestException { public EnquetePayLoadWeb createEnquete(EnquetePayLoadWeb enquetePayLoadWeb) throws BadRequestException {
Optional<User> optionalUser = userRepository.findById(enquetePayLoadWeb.getEnqueteurId()); Optional<User> optionalUser = userRepository.findById(enquetePayLoadWeb.getEnqueteurId());
if (!optionalUser.isPresent()) { if (!optionalUser.isPresent()) {
throw new BadRequestException("Echec de l'enregistrement : Enquêteur inexistant"); throw new BadRequestException("Echec de l'enregistrement : Enquêteur inexistant");
} }
Optional<Personne> optionalPersonne = personneRepository.findById(enquetePayLoadWeb.getPersonneId()); Optional<Personne> optionalPersonne = personneRepository.findById(enquetePayLoadWeb.getPersonneId());
if (!optionalPersonne.isPresent()) { if (!optionalPersonne.isPresent()) {
throw new BadRequestException("Echec de l'enregistrement : Propriétaire inexistant"); throw new BadRequestException("Echec de l'enregistrement : Propriétaire inexistant");
} }
if(enquetePayLoadWeb.getParcelleId()!=null) {
Optional<Parcelle> optionalParcelle = parcelleRepository.findById(enquetePayLoadWeb.getParcelleId()); Optional<Parcelle> optionalParcelle = parcelleRepository.findById(enquetePayLoadWeb.getParcelleId());
if (!optionalParcelle.isPresent()) { if (!optionalParcelle.isPresent()) {
throw new BadRequestException("Echec de l'enregistrement : Parcelle inexistante"); throw new BadRequestException("Echec de l'enregistrement : Parcelle inexistante");
} }
}
Optional<ZoneRfu> optionalZoneRfu = zoneRfuRepository.findById(enquetePayLoadWeb.getZoneRfuId()); Optional<ZoneRfu> optionalZoneRfu = zoneRfuRepository.findById(enquetePayLoadWeb.getZoneRfuId());
if (!optionalZoneRfu.isPresent()) { if (!optionalZoneRfu.isPresent()) {
throw new BadRequestException("Echec de l'enregistrement : zone inexistante"); throw new BadRequestException("Echec de l'enregistrement : zone inexistante");
} }
ParcellePayLoadWeb parcellePayLoadWeb= getParcellePayloadFromEnquetePl(enquetePayLoadWeb); if (enquetePayLoadWeb.getParcelleId() == null) {
throw new ApplicationException("Echec de l'enregistrement : La parcelle non renseignée.");
if(parcellePayLoadWeb.getId()==null){
parcellePayLoadWeb=parcelleService.createParcelle(parcellePayLoadWeb);
}else{
parcellePayLoadWeb=parcelleService.updateParcelle(parcellePayLoadWeb.getId(),parcellePayLoadWeb);
} }
enquetePayLoadWeb.setParcelleId(parcellePayLoadWeb.getId());
Enquete enquete = entityFromPayLoadService.getEnqueteFromPayLoadWeb(enquetePayLoadWeb); Enquete enquete = entityFromPayLoadService.getEnqueteFromPayLoadWeb(enquetePayLoadWeb);
////enregistrement de l'enquete ////enregistrement de l'enquete
enquete=enqueteRepository.save(enquete); enquete=enqueteRepository.save(enquete);
return enqueteRepository.findEnqueteToDto(enquete.getId()).orElse(null); //////Enregistrement des caractéristiques parcelle
} // enquetePayLoadWeb.getCaracteristiqueParcellePayloadWebs().forEach(caracteristiqueParcellePayloadWeb -> {
// caracteristiqueParcellePayloadWeb.setEnqueteId(finalEnquete.getId());
// CaracteristiqueParcelle caracteristiqueParcelle=entityFromPayLoadService.getCaracteristiqueParcelleFromPayLoadWeb(caracteristiqueParcellePayloadWeb);
// caracteristiqueParcelleService.createCaracteristiqueParcelle(caracteristiqueParcelle);
// });
private ParcellePayLoadWeb getParcellePayloadFromEnquetePl(EnquetePayLoadWeb enquetePayLoadWeb) { /////Enregistrement des pièce de parcelles
ParcellePayLoadWeb parcellePayLoadWeb=new ParcellePayLoadWeb(); // enquetePayLoadWeb.getPiecePayLoadWebs().forEach(piecePayLoadWeb -> {
parcellePayLoadWeb.setId(enquetePayLoadWeb.getParcelleId()); // piecePayLoadWeb.setEnqueteId(finalEnquete.getId());
parcellePayLoadWeb.setQ(enquetePayLoadWeb.getParcelleQ()); // //Piece piece=entityFromPayLoadService.getPieceFromPayLoadWeb(piecePayLoadWeb);
parcellePayLoadWeb.setI(enquetePayLoadWeb.getParcelleI()); // Piece piecefinal = pieceService.createPiece(entityFromPayLoadService.getPieceFromPayLoadWeb(piecePayLoadWeb));
parcellePayLoadWeb.setP(enquetePayLoadWeb.getParcelleP()); // piecePayLoadWeb.getUploadPayLoadWebs().forEach(uploadPayLoadWeb -> {
parcellePayLoadWeb.setNup(enquetePayLoadWeb.getParcelleNup()); // uploadPayLoadWeb.setEnqueteId(finalEnquete.getId());
parcellePayLoadWeb.setNupProvisoire(enquetePayLoadWeb.getNupProvisoire()); // Upload upload=entityFromPayLoadService.getUploadFromPayLoadWeb(uploadPayLoadWeb);
parcellePayLoadWeb.setNumTitreFoncier(enquetePayLoadWeb.getNumeroTitreFoncier()); // upload.setPiece(piecefinal);
parcellePayLoadWeb.setLongitude(enquetePayLoadWeb.getLongitude()); // uploadRepository.save(upload);
parcellePayLoadWeb.setLatitude(enquetePayLoadWeb.getLatitude()); // });
parcellePayLoadWeb.setAltitude(enquetePayLoadWeb.getAltitude()); // });
parcellePayLoadWeb.setSuperficie(enquetePayLoadWeb.getSuperficie());
parcellePayLoadWeb.setObservation(enquetePayLoadWeb.getObservation()); /////Enregistrement des pièce de parcelles
parcellePayLoadWeb.setSituationGeographique(enquetePayLoadWeb.getSituationGeographique()); // enquetePayLoadWeb.getDeclarationNcPayloadWebs().forEach(declarationNcPayloadWeb -> {
parcellePayLoadWeb.setNumEntreeParcelle(enquetePayLoadWeb.getNumEntreeParcelle()); // declarationNcPayloadWeb.setEnqueteId(finalEnquete.getId());
parcellePayLoadWeb.setQuartierId(enquetePayLoadWeb.getQuartierId()); // DeclarationNc declarationNcfinal=declarationNcService.createDeclarationNc(entityFromPayLoadService.getDeclarationNcFromPayLoadWeb(declarationNcPayloadWeb));
parcellePayLoadWeb.setNatureDomaineId(enquetePayLoadWeb.getNatureDomaineId()); // declarationNcPayloadWeb.getUploadPayLoadWebs().forEach(uploadPayLoadWeb -> {
parcellePayLoadWeb.setTypeDomaineId(enquetePayLoadWeb.getTypeDomaineId()); // uploadPayLoadWeb.setEnqueteId(finalEnquete.getId());
parcellePayLoadWeb.setRueId(enquetePayLoadWeb.getRueId()); // Upload upload=entityFromPayLoadService.getUploadFromPayLoadWeb(uploadPayLoadWeb);
parcellePayLoadWeb.setProprietaireId(enquetePayLoadWeb.getPersonneId()); // upload.setDeclarationNc(declarationNcfinal);
parcellePayLoadWeb.setNatureDomaineId(enquetePayLoadWeb.getNatureDomaineId()); // uploadRepository.save(upload);
parcellePayLoadWeb.setNatureDomaineId(enquetePayLoadWeb.getNatureDomaineId()); // });
return parcellePayLoadWeb; // });
return enqueteRepository.findEnqueteToDto(enquete.getId()).orElse(null);
} }
@Override @Override
@@ -175,6 +167,8 @@ public class EnqueteServiceImpl implements EnqueteService {
throw new BadRequestException("Impossible d'enregistrer une enquête avec une parcelle inexistante"); throw new BadRequestException("Impossible d'enregistrer une enquête avec une parcelle inexistante");
} }
Optional<Parcelle> optionalParcelle=Optional.empty();
Long rueId;
Optional<User> optionalUser = userRepository.findById(enquetePayLoadWeb.getEnqueteurId()); Optional<User> optionalUser = userRepository.findById(enquetePayLoadWeb.getEnqueteurId());
if (!optionalUser.isPresent()) { if (!optionalUser.isPresent()) {
throw new BadRequestException("Echec de l'enregistrement : Enquêteur inexistant"); throw new BadRequestException("Echec de l'enregistrement : Enquêteur inexistant");
@@ -188,25 +182,12 @@ public class EnqueteServiceImpl implements EnqueteService {
if (!optionalZoneRfu.isPresent()) { if (!optionalZoneRfu.isPresent()) {
throw new BadRequestException("Echec de l'enregistrement : zone inexistante"); throw new BadRequestException("Echec de l'enregistrement : zone inexistante");
} }
///enregistrement de la pacelle
if(enquetePayLoadWeb.getParcelleId()!=null) { if (enquetePayLoadWeb.getParcelleId() == null) {
Optional<Parcelle> optionalParcelle = parcelleRepository.findById(enquetePayLoadWeb.getParcelleId()); throw new ApplicationException("Echec de l'enregistrement : La parcelle non renseignée.");
if (!optionalParcelle.isPresent()) { } else {
throw new BadRequestException("Echec de l'enregistrement : Parcelle inexistante"); optionalParcelle = parcelleService.getParcelleById(enquetePayLoadWeb.getParcelleId());
} }
}
ParcellePayLoadWeb parcellePayLoadWeb= getParcellePayloadFromEnquetePl(enquetePayLoadWeb);
if(parcellePayLoadWeb.getId()==null){
parcellePayLoadWeb=parcelleService.createParcelle(parcellePayLoadWeb);
}else{
parcellePayLoadWeb=parcelleService.updateParcelle(parcellePayLoadWeb.getId(),parcellePayLoadWeb);
}
enquetePayLoadWeb.setParcelleId(parcellePayLoadWeb.getId());
Enquete enquete = entityFromPayLoadService.getEnqueteFromPayLoadWeb(enquetePayLoadWeb); Enquete enquete = entityFromPayLoadService.getEnqueteFromPayLoadWeb(enquetePayLoadWeb);
enquete=enqueteRepository.save(enquete); enquete=enqueteRepository.save(enquete);
@@ -356,7 +337,7 @@ public class EnqueteServiceImpl implements EnqueteService {
} }
@Override @Override
public EnquetePayLoadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public Enquete validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
if (enqueteTraitementPayLoad == null) { if (enqueteTraitementPayLoad == null) {
throw new BadRequestException("Impossible de valider une enquête ayant un id null."); throw new BadRequestException("Impossible de valider une enquête ayant un id null.");
} }
@@ -364,22 +345,15 @@ public class EnqueteServiceImpl implements EnqueteService {
if (!optionalEnquete.isPresent()) { if (!optionalEnquete.isPresent()) {
throw new NotFoundException("Impossible de trouver l'enquête que vous désirez valider."); throw new NotFoundException("Impossible de trouver l'enquête que vous désirez valider.");
} }
if(optionalEnquete.get().getStatutEnquete()==StatutEnquete.CLOTURE ||
optionalEnquete.get().getStatutEnquete()==StatutEnquete.REJETE ){
throw new NotAcceptableException("Impossible de valider : Le statut actuel "+optionalEnquete.get().getStatutEnquete()+" ne le permet pas.");
}
Enquete enquete = optionalEnquete.get(); Enquete enquete = optionalEnquete.get();
enquete.setDateValidation(LocalDate.now()); enquete.setDateValidation(LocalDate.now());
enquete.setStatutEnquete(StatutEnquete.VALIDE); enquete.setStatutEnquete(StatutEnquete.VALIDE);
enquete.setSynchronise(true); enquete.setSynchronise(false);
return enqueteRepository.save(enquete);
enquete= enqueteRepository.save(enquete);
return enqueteRepository.findEnqueteToDto(enquete.getId()).orElse(null);
} }
@Override @Override
public EnquetePayLoadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) { public Enquete rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
if (enqueteTraitementPayLoad.getIdBackend() == null) { if (enqueteTraitementPayLoad.getIdBackend() == null) {
throw new BadRequestException("Impossible de rejeter une enquête ayant un id null."); throw new BadRequestException("Impossible de rejeter une enquête ayant un id null.");
} }
@@ -387,43 +361,38 @@ public class EnqueteServiceImpl implements EnqueteService {
if (!optionalEnquete.isPresent()) { if (!optionalEnquete.isPresent()) {
throw new NotFoundException("Impossible de trouver l'enquête que vous désirez rejeter."); throw new NotFoundException("Impossible de trouver l'enquête que vous désirez rejeter.");
} }
if(optionalEnquete.get().getStatutEnquete()==StatutEnquete.CLOTURE ||
optionalEnquete.get().getStatutEnquete()==StatutEnquete.VALIDE ){
throw new NotAcceptableException("Impossible de rejeter : Le statut actuel "+optionalEnquete.get().getStatutEnquete()+" ne le permet pas.");
}
Enquete enquete = optionalEnquete.get(); Enquete enquete = optionalEnquete.get();
enquete.setDateRejet(LocalDate.now()); enquete.setDateRejet(LocalDate.now());
enquete.setDescriptionMotifRejet(enqueteTraitementPayLoad.getMotifRejet()); enquete.setDescriptionMotifRejet(enqueteTraitementPayLoad.getMotifRejet());
enquete.setStatutEnquete(StatutEnquete.REJETE); enquete.setStatutEnquete(StatutEnquete.REJETE);
enquete.setSynchronise(false); enquete.setSynchronise(false);
enquete= enqueteRepository.save(enquete); return enqueteRepository.save(enquete);
return enqueteRepository.findEnqueteToDto(enquete.getId()).orElse(null);
} }
@Override @Override
public List<EnquetePayLoadWeb> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) { public List<Enquete> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
List<EnquetePayLoadWeb> enquetePayLoadWebs = new ArrayList<>(); List<Enquete> enquetes = new ArrayList<>();
try { try {
for (EnqueteTraitementPayLoad enqueteTraitementPayLoad : enqueteTraitementPayLoads) { for (EnqueteTraitementPayLoad enqueteTraitementPayLoad : enqueteTraitementPayLoads) {
enquetePayLoadWebs.add(validerEnquete(enqueteTraitementPayLoad)); enquetes.add(validerEnquete(enqueteTraitementPayLoad));
} }
} catch (Exception e) { } catch (Exception e) {
enquetePayLoadWebs.add(null); enquetes.add(null);
} }
return enquetePayLoadWebs; return enquetes;
} }
@Override @Override
public List<EnquetePayLoadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) { public List<Enquete> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
List<EnquetePayLoadWeb> enquetePayLoadWebs = new ArrayList<>(); List<Enquete> enquetes = new ArrayList<>();
try { try {
for (EnqueteTraitementPayLoad enqueteTraitementPayLoad : enqueteTraitementPayLoads) { for (EnqueteTraitementPayLoad enqueteTraitementPayLoad : enqueteTraitementPayLoads) {
enquetePayLoadWebs.add(rejeterEnquete(enqueteTraitementPayLoad)); enquetes.add(rejeterEnquete(enqueteTraitementPayLoad));
} }
} catch (Exception e) { } catch (Exception e) {
enquetePayLoadWebs.add(null); enquetes.add(null);
} }
return enquetePayLoadWebs; return enquetes;
} }
@Override @Override
@@ -572,36 +541,4 @@ public class EnqueteServiceImpl implements EnqueteService {
} }
@Override
@Transactional
public int cloturerEnqueteParcelleBatimentUniteLogementByUserIdAndExerciceId(Long userId,Long exerciceId) {
Optional<User> optionalUser= userRepository.findById(userId);
int nbreEnquete=0;
if(optionalUser.isPresent() && optionalUser.get().getStructure()!=null){
Long structureId=optionalUser.get().getStructure().getId();
nbreEnquete=cloturerEnqueteParcelleBatimentUniteLogementByStructureIdAndExerciceId(structureId,exerciceId);
}
return nbreEnquete;
}
@Override
public Page<EnquetePayLoadWeb> getEnqueteListByQuartierByStatutPageableToDto(Long userId, Long quartierId, StatutEnquete statutEnquete, Pageable pageable) {
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
List<Long> secteurIds = secteurs.stream()
.map(Secteur::getId)
.toList();
return enqueteRepository.findAllEnqueteByQuartierByStatutToDtoPageable(quartierId,secteurIds,statutEnquete,pageable);
}
@Override
@Transactional
public int cloturerEnqueteParcelleBatimentUniteLogementByStructureIdAndExerciceId(Long structureId,Long exerciceId) {
Integer nombreParcelleImpacte=enqueteRepository.clotureEnqueteParcelle(structureId,exerciceId);
Integer nombreBatiment=enqueteBatimentRepository.clotureEnqueteBatiment(structureId,exerciceId);
Integer nombreUniteLogement=enqueteUniteLogementRepository.clotureEnqueteUniteLogement(structureId,exerciceId);
return nombreParcelleImpacte;
}
} }

View File

@@ -8,7 +8,6 @@ import io.gmss.fiscad.entities.infocad.metier.Upload;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.infocad.metier.ParcelleGeomService; import io.gmss.fiscad.interfaces.infocad.metier.ParcelleGeomService;
import io.gmss.fiscad.paylaods.request.crudweb.ParcelleGeomPaylaodWeb;
import io.gmss.fiscad.paylaods.response.EnqueteCheckResponse; import io.gmss.fiscad.paylaods.response.EnqueteCheckResponse;
import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository; import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository;
import io.gmss.fiscad.persistence.repositories.infocad.metier.ParcelleGeomRepository; import io.gmss.fiscad.persistence.repositories.infocad.metier.ParcelleGeomRepository;
@@ -80,7 +79,6 @@ public class ParcelleGeomServiceImpl implements ParcelleGeomService {
return n; return n;
} }
private Upload saveGeoJsonUpload(MultipartFile file,String reference,String desc) { private Upload saveGeoJsonUpload(MultipartFile file,String reference,String desc) {
Upload upload = new Upload(); Upload upload = new Upload();
String fileName = fileStorageService.storeFile(file); String fileName = fileStorageService.storeFile(file);
@@ -178,16 +176,6 @@ public class ParcelleGeomServiceImpl implements ParcelleGeomService {
return parcelleGeomRepository.findAllByQuartier_Code(codeQuartier); return parcelleGeomRepository.findAllByQuartier_Code(codeQuartier);
} }
@Override
public List<ParcelleGeomPaylaodWeb> getParcelleGeomListByQuatierId(Long quartierId) {
return parcelleGeomRepository.findAllByQuartierId(quartierId);
}
@Override
public Page<ParcelleGeomPaylaodWeb> getParcelleGeomListByQuatierIdPaged(Long quartierId, Pageable pageable) {
return parcelleGeomRepository.findAllByQuartierIdPageable(quartierId,pageable);
}
@Override @Override
public List<ParcelleGeom> getParcelleGeomListUnArrondissement(String codeArrondissement) { public List<ParcelleGeom> getParcelleGeomListUnArrondissement(String codeArrondissement) {
return parcelleGeomRepository.findAllByQuartier_Arrondissement_Code(codeArrondissement); return parcelleGeomRepository.findAllByQuartier_Arrondissement_Code(codeArrondissement);
@@ -274,9 +262,4 @@ public class ParcelleGeomServiceImpl implements ParcelleGeomService {
} }
@Override
public int createParcelleGeomFromGeoJsonApi() throws BadRequestException {
return 0;
}
} }

View File

@@ -2,12 +2,10 @@ package io.gmss.fiscad.implementations.infocad.metier;
import io.gmss.fiscad.entities.decoupage.Quartier; import io.gmss.fiscad.entities.decoupage.Quartier;
import io.gmss.fiscad.entities.decoupage.Secteur; import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.infocad.metier.EnqueteFiltreResponse; import io.gmss.fiscad.entities.infocad.metier.EnqueteFiltreResponse;
import io.gmss.fiscad.entities.infocad.metier.Parcelle; import io.gmss.fiscad.entities.infocad.metier.Parcelle;
import io.gmss.fiscad.entities.infocad.metier.Rue; import io.gmss.fiscad.entities.infocad.metier.Rue;
import io.gmss.fiscad.entities.infocad.parametre.NatureDomaine; import io.gmss.fiscad.entities.infocad.parametre.NatureDomaine;
import io.gmss.fiscad.entities.infocad.parametre.TypeDomaine;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.decoupage.SecteurService; import io.gmss.fiscad.interfaces.decoupage.SecteurService;
@@ -21,12 +19,9 @@ import io.gmss.fiscad.persistence.repositories.infocad.metier.ParcelleRepository
import io.gmss.fiscad.persistence.repositories.infocad.metier.RueRepository; import io.gmss.fiscad.persistence.repositories.infocad.metier.RueRepository;
import io.gmss.fiscad.persistence.repositories.infocad.parametre.NatureDomaineRepository; import io.gmss.fiscad.persistence.repositories.infocad.parametre.NatureDomaineRepository;
import io.gmss.fiscad.persistence.repositories.infocad.parametre.SituationGeographiqueRepository; import io.gmss.fiscad.persistence.repositories.infocad.parametre.SituationGeographiqueRepository;
import io.gmss.fiscad.persistence.repositories.infocad.parametre.TypeDomaineRepository;
import io.gmss.fiscad.persistence.specification.ParcelleSpecification; import io.gmss.fiscad.persistence.specification.ParcelleSpecification;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import io.gmss.fiscad.service.GeometryService; import io.gmss.fiscad.service.GeometryService;
import jakarta.persistence.Query; import jakarta.persistence.Query;
import jakarta.transaction.Transactional;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.*; import org.springframework.data.domain.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -43,8 +38,6 @@ public class ParcelleServiceImpl implements ParcelleService {
private final RueRepository rueRepository; private final RueRepository rueRepository;
private final GeometryService geometryService; private final GeometryService geometryService;
private final SecteurService secteurService; private final SecteurService secteurService;
private final TypeDomaineRepository typeDomaineRepository;
private final EntityFromPayLoadService entityFromPayLoadService;
// @Value("${infocad.geom.srid}") // @Value("${infocad.geom.srid}")
// private String defaultSrid32631; // private String defaultSrid32631;
@@ -55,7 +48,7 @@ public class ParcelleServiceImpl implements ParcelleService {
@Override @Override
public ParcellePayLoadWeb createParcelle(ParcellePayLoadWeb parcellePayLoadWeb) throws BadRequestException { public Parcelle createParcelle(ParcellePayLoadWeb parcellePayLoadWeb) throws BadRequestException {
Optional<NatureDomaine> optionalNatureDomaine = natureDomaineRepository.findById(parcellePayLoadWeb.getNatureDomaineId()); Optional<NatureDomaine> optionalNatureDomaine = natureDomaineRepository.findById(parcellePayLoadWeb.getNatureDomaineId());
if (!optionalNatureDomaine.isPresent()) { if (!optionalNatureDomaine.isPresent()) {
throw new BadRequestException("Impossible d'enregistrer une parcelle avec une nature de domaine inexistant"); throw new BadRequestException("Impossible d'enregistrer une parcelle avec une nature de domaine inexistant");
@@ -64,31 +57,36 @@ public class ParcelleServiceImpl implements ParcelleService {
if (!optionalQuartier.isPresent()) { if (!optionalQuartier.isPresent()) {
throw new BadRequestException("Impossible d'enregistrer une parcelle avec un quartier/village inexistant"); throw new BadRequestException("Impossible d'enregistrer une parcelle avec un quartier/village inexistant");
} }
Optional<TypeDomaine> optionalTypeDomaine = typeDomaineRepository.findById(parcellePayLoadWeb.getTypeDomaineId());
if (!optionalTypeDomaine.isPresent()) {
throw new BadRequestException("Veuillez préciser le type de domaine");
}
Parcelle parcelle = new Parcelle(); Parcelle parcelle = new Parcelle();
parcelle = entityFromPayLoadService.getParcelleFromPayload(parcellePayLoadWeb); parcelle.setNatureDomaine(optionalNatureDomaine.orElse(null));
parcelle= parcelleRepository.save(parcelle); parcelle.setQuartier(optionalQuartier.orElse(null));
return parcelleRepository.findParcelleToDtoById(parcelle.getId()).orElse(null); parcelle = getParcelleFromPayload(parcelle, parcellePayLoadWeb);
return parcelleRepository.save(parcelle);
} }
@Override @Override
public ParcellePayLoadWeb updateParcelle(Long id, ParcellePayLoadWeb parcellePayLoadWeb) throws NotFoundException { public Parcelle updateParcelle(Long id, ParcellePayLoadWeb parcellePayLoadWeb) throws NotFoundException {
if(parcellePayLoadWeb.getId()!=null) {
Optional<Parcelle> optionalParcelle = parcelleRepository.findById(parcellePayLoadWeb.getId()); Optional<Parcelle> optionalParcelle = parcelleRepository.findById(parcellePayLoadWeb.getId());
if (!optionalParcelle.isPresent()) { if (!optionalParcelle.isPresent()) {
throw new NotFoundException("Impossible de trouver la parcelle que vous désirer modifier"); throw new NotFoundException("Impossible de trouver la parcelle que vous désirer modifier");
} }
Optional<NatureDomaine> optionalNatureDomaine = natureDomaineRepository.findById(parcellePayLoadWeb.getNatureDomaineId());
if (!optionalNatureDomaine.isPresent()) {
throw new BadRequestException("Impossible d'enregistrer une parcelle avec une nature de domaine inexistante");
} }
Optional<Quartier> optionalQuartier = quartierRepository.findById(parcellePayLoadWeb.getQuartierId());
Parcelle parcelle = new Parcelle(); if (!optionalQuartier.isPresent()) {
parcelle = entityFromPayLoadService.getParcelleFromPayload(parcellePayLoadWeb); throw new BadRequestException("Impossible d'enregistrer une parcelle avec un quartier/village inexistant");
parcelle= parcelleRepository.save(parcelle); }
return parcelleRepository.findParcelleToDtoById(parcelle.getId()).orElse(null); // Optional<SituationGeographique> optionalSituationGeographique = situationGeographiqueRepository.findById(parcellePayLoadWeb.getSituationGeographiqueId());
// if (!optionalSituationGeographique.isPresent()) {
// throw new BadRequestException("Impossible d'enregistrer une parcelle avec une situation géographique inexistant");
// }
Parcelle parcelle=optionalParcelle.get();
parcelle.setNatureDomaine(optionalNatureDomaine.orElse(null));
parcelle.setQuartier(optionalQuartier.orElse(null));
parcelle = getParcelleFromPayload(optionalParcelle.get(), parcellePayLoadWeb);
return parcelleRepository.save(parcelle);
} }
@Override @Override
@@ -193,13 +191,6 @@ public class ParcelleServiceImpl implements ParcelleService {
} }
@Override
@Transactional
public Integer majParcelleBatieNonbatie() {
return parcelleRepository.updateParcelleBatieTrue()+parcelleRepository.updateParcelleBatieFalse();
}
private List<Long> getSecteurIdListForUser(Long userId) { private List<Long> getSecteurIdListForUser(Long userId) {
List<Secteur> secteurs = secteurService.getListSecteurUserId(userId); List<Secteur> secteurs = secteurService.getListSecteurUserId(userId);
List<Long> secteurIds = secteurs.stream() List<Long> secteurIds = secteurs.stream()
@@ -209,6 +200,28 @@ public class ParcelleServiceImpl implements ParcelleService {
} }
private Parcelle getParcelleFromPayload(Parcelle parcelle, ParcellePayLoadWeb parcellePayLoadWeb) {
if(parcellePayLoadWeb.getRueId()!=null) {
Optional<Rue> optionalRue = rueRepository.findById(parcellePayLoadWeb.getRueId());
parcelle.setRue(optionalRue.orElse(null));
}
parcelle.setP(parcellePayLoadWeb.getP());
parcelle.setI(parcellePayLoadWeb.getI());
parcelle.setQ(parcellePayLoadWeb.getQ());
parcelle.setNup(parcellePayLoadWeb.getNup());
parcelle.setLatitude(parcellePayLoadWeb.getLatitude());
parcelle.setLongitude(parcellePayLoadWeb.getLongitude());
parcelle.setAltitude(parcellePayLoadWeb.getAltitude());
parcelle.setSituationGeographique(parcellePayLoadWeb.getSituationGeographique());
parcelle.setNupProvisoire(parcellePayLoadWeb.getNupProvisoire());
parcelle.setAutreNumeroTitreFoncier(parcellePayLoadWeb.getNumTitreFoncier());
parcelle.setObservation(parcellePayLoadWeb.getObservation());
parcelle.setSuperficie(parcellePayLoadWeb.getSuperficie());
return parcelle;
}
// private Parcelle getParcelle(Parcelle parcelle, ParcellePayLoadWeb parcellePayLoadWeb, Optional<SituationGeographique> optionalSituationGeographique, Optional<NatureDomaine> optionalNatureDomaine) { // private Parcelle getParcelle(Parcelle parcelle, ParcellePayLoadWeb parcellePayLoadWeb, Optional<SituationGeographique> optionalSituationGeographique, Optional<NatureDomaine> optionalNatureDomaine) {
// StringBuilder coordonnees = new StringBuilder(); // StringBuilder coordonnees = new StringBuilder();
// parcelle.setP(parcellePayLoadWeb.getP()); // parcelle.setP(parcellePayLoadWeb.getP());

View File

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

View File

@@ -1,25 +1,20 @@
package io.gmss.fiscad.implementations.infocad.parametre; package io.gmss.fiscad.implementations.infocad.parametre;
import io.gmss.fiscad.entities.decoupage.Commune; import io.gmss.fiscad.entities.decoupage.Commune;
import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.entities.decoupage.Section; import io.gmss.fiscad.entities.decoupage.Section;
import io.gmss.fiscad.entities.infocad.parametre.Structure; import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.entities.user.AvoirFonction;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.infocad.parametre.StructureService; import io.gmss.fiscad.interfaces.infocad.parametre.StructureService;
import io.gmss.fiscad.paylaods.request.crudweb.StructurePaylaodWeb; import io.gmss.fiscad.paylaods.request.crudweb.StructurePaylaodWeb;
import io.gmss.fiscad.paylaods.response.StructureResponse; import io.gmss.fiscad.paylaods.response.StructureResponse;
import io.gmss.fiscad.persistence.repositories.infocad.parametre.StructureRepository; import io.gmss.fiscad.persistence.repositories.infocad.parametre.StructureRepository;
import io.gmss.fiscad.persistence.repositories.user.AvoirFonctionRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService; import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@AllArgsConstructor @AllArgsConstructor
@@ -28,7 +23,6 @@ public class StructureServiceImpl implements StructureService {
private final StructureRepository structureRepository; private final StructureRepository structureRepository;
private final EntityFromPayLoadService entityFromPayLoadService; private final EntityFromPayLoadService entityFromPayLoadService;
private final AvoirFonctionRepository avoirFonctionRepository;
@Override @Override
public StructurePaylaodWeb createStructure(StructurePaylaodWeb structurePaylaodWeb) throws BadRequestException { public StructurePaylaodWeb createStructure(StructurePaylaodWeb structurePaylaodWeb) throws BadRequestException {
@@ -95,29 +89,5 @@ public class StructureServiceImpl implements StructureService {
return structureRepository.findStructureToDtoById(id); return structureRepository.findStructureToDtoById(id);
} }
@Override
public List<Structure> getListStructureUserId(Long userId) {
List<AvoirFonction> avoirFonctions= avoirFonctionRepository.findAvoirFonctionByUser_Id(userId);
List<Structure> structures = new ArrayList<>();
avoirFonctions.stream()
.filter(af -> af.getDateFin() == null || af.getDateFin().isAfter(LocalDate.now()))
.forEach(avoirFonction -> {
if(avoirFonction.getFonction().getStructure()!=null){
structures.addAll(List.of(avoirFonction.getFonction().getStructure()));
}else if (avoirFonction.getFonction().getDepartement()!=null){
structures.addAll(structureRepository.findDistinctByCommune_Departement_Id(avoirFonction.getFonction().getDepartement().getId()));
}
});
return structures;
}
// public List<Long> getStructureIdListForUser(Long userId) {
// List<Structure> structures = secteurService.getListSecteurUserId(userId);
// List<Long> secteurIds = secteurs.stream()
// .map(Secteur::getId)
// .toList();
// return secteurIds;
// }
} }

View File

@@ -1,15 +1,11 @@
package io.gmss.fiscad.implementations.rfu.metier; package io.gmss.fiscad.implementations.rfu.metier;
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
import io.gmss.fiscad.entities.rfu.metier.Batiment; import io.gmss.fiscad.entities.rfu.metier.Batiment;
import io.gmss.fiscad.entities.rfu.parametre.CategorieBatiment;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.rfu.metier.BatimentService; import io.gmss.fiscad.interfaces.rfu.metier.BatimentService;
import io.gmss.fiscad.paylaods.request.crudweb.BatimentPaylaodWeb; import io.gmss.fiscad.paylaods.request.crudweb.BatimentPaylaodWeb;
import io.gmss.fiscad.persistence.repositories.infocad.metier.ParcelleRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.BatimentRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.BatimentRepository;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.CategorieBatimentRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService; import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@@ -23,8 +19,6 @@ import java.util.Optional;
public class BatimentServiceImpl implements BatimentService { public class BatimentServiceImpl implements BatimentService {
private final BatimentRepository batimentRepository; private final BatimentRepository batimentRepository;
private final ParcelleRepository parcelleRepository;
private final CategorieBatimentRepository categorieBatimentRepository;
private final EntityFromPayLoadService entityFromPayLoadService; private final EntityFromPayLoadService entityFromPayLoadService;
@@ -33,22 +27,8 @@ public class BatimentServiceImpl implements BatimentService {
if (batimentPaylaodWeb.getId() != null) { if (batimentPaylaodWeb.getId() != null) {
throw new BadRequestException("Impossible de créer un nouveau batiment ayant un id non null."); throw new BadRequestException("Impossible de créer un nouveau batiment ayant un id non null.");
} }
if (batimentPaylaodWeb.getParcelleId() == null) {
throw new BadRequestException("Impossible de créer un nouveau batiment: La parcelle doit être précisée.");
}else {
if(!parcelleRepository.existsById(batimentPaylaodWeb.getParcelleId()))
throw new BadRequestException("Impossible de créer un nouveau batiment: La parcelle doit être précisée.");
}
if (batimentPaylaodWeb.getCategorieBatimentId() == null) {
throw new BadRequestException("Impossible de créer un nouveau batiment: La catégorie doit être précisée.");
}else {
if(!categorieBatimentRepository.existsById(batimentPaylaodWeb.getCategorieBatimentId()))
throw new BadRequestException("Impossible de créer un nouveau batiment: La catégorie doit être précisée.");
}
Batiment batiment= entityFromPayLoadService.getBatimentFromPayLoadWeb(batimentPaylaodWeb); Batiment batiment= entityFromPayLoadService.getBatimentFromPayLoadWeb(batimentPaylaodWeb);
batiment= batimentRepository.save(batiment); batiment= batimentRepository.save(batiment);
System.out.println(batiment.getId());
return batimentRepository.findBatimentAvecOccupantCourantToDto(batiment.getId()).orElse(null); return batimentRepository.findBatimentAvecOccupantCourantToDto(batiment.getId()).orElse(null);
} }
@@ -60,19 +40,6 @@ public class BatimentServiceImpl implements BatimentService {
if (!batimentRepository.existsById(batimentPaylaodWeb.getId())) { if (!batimentRepository.existsById(batimentPaylaodWeb.getId())) {
throw new NotFoundException("Impossible de trouver le batiment spécifié dans notre base de données."); throw new NotFoundException("Impossible de trouver le batiment spécifié dans notre base de données.");
} }
if (batimentPaylaodWeb.getParcelleId() == null) {
throw new BadRequestException("Impossible de créer un nouveau batiment: La parcelle doit être précisée.");
}else {
if(!parcelleRepository.existsById(batimentPaylaodWeb.getParcelleId()))
throw new BadRequestException("Impossible de créer un nouveau batiment: La parcelle doit être précisée.");
}
if (batimentPaylaodWeb.getCategorieBatimentId() == null) {
throw new BadRequestException("Impossible de créer un nouveau batiment: La catégorie doit être précisée.");
}else {
if(!categorieBatimentRepository.existsById(batimentPaylaodWeb.getCategorieBatimentId()))
throw new BadRequestException("Impossible de créer un nouveau batiment: La catégorie doit être précisée.");
}
Batiment batiment= entityFromPayLoadService.getBatimentFromPayLoadWeb(batimentPaylaodWeb); Batiment batiment= entityFromPayLoadService.getBatimentFromPayLoadWeb(batimentPaylaodWeb);
batiment= batimentRepository.save(batiment); batiment= batimentRepository.save(batiment);
return batimentRepository.findBatimentAvecOccupantCourantToDto(batiment.getId()).orElse(null); return batimentRepository.findBatimentAvecOccupantCourantToDto(batiment.getId()).orElse(null);
@@ -118,14 +85,4 @@ public class BatimentServiceImpl implements BatimentService {
} }
} }
@Override
public Page<BatimentPaylaodWeb> getBatimentListByquartierPageable(Long quartierId, Pageable pageable) {
return batimentRepository.findAllBatimentsAvecOccupantCourantByQuartierToDtoPageble(quartierId,pageable);
}
@Override
public List<BatimentPaylaodWeb> getBatimentListByquartier(Long quartierId) {
return batimentRepository.findAllBatimentsAvecOccupantCourantByQuartierToDto(quartierId);
}
} }

View File

@@ -73,6 +73,7 @@ public class CaracteristiqueBatimentServiceImpl implements CaracteristiqueBatime
return caracteristiqueBatimentRepository.findAllCaracteristiqueBatimentToDto(); return caracteristiqueBatimentRepository.findAllCaracteristiqueBatimentToDto();
} }
@Override @Override
public Optional<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentToDto(Long id) { public Optional<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentToDto(Long id) {
if (caracteristiqueBatimentRepository.existsById(id)) { if (caracteristiqueBatimentRepository.existsById(id)) {

View File

@@ -4,12 +4,9 @@ import io.gmss.fiscad.entities.decoupage.Arrondissement;
import io.gmss.fiscad.entities.rfu.metier.DonneesImpositionTfu; import io.gmss.fiscad.entities.rfu.metier.DonneesImpositionTfu;
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu; import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuNonBati; import io.gmss.fiscad.entities.rfu.parametre.BaremRfuNonBati;
import io.gmss.fiscad.enums.StatusAvis;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.rfu.metier.DonneesImpositionTfuService; import io.gmss.fiscad.interfaces.rfu.metier.DonneesImpositionTfuService;
import io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb;
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
import io.gmss.fiscad.paylaods.response.DonneesImpositionTfuResponse; import io.gmss.fiscad.paylaods.response.DonneesImpositionTfuResponse;
import io.gmss.fiscad.persistence.repositories.decoupage.ArrondissementRepository; import io.gmss.fiscad.persistence.repositories.decoupage.ArrondissementRepository;
import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository; import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository;
@@ -18,7 +15,6 @@ import io.gmss.fiscad.persistence.repositories.rfu.metier.DonneesImpositionTfuRe
import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuNonBatiRepository; import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuNonBatiRepository;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.ExerciceRepository; import io.gmss.fiscad.persistence.repositories.rfu.parametre.ExerciceRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import jakarta.transaction.Transactional; import jakarta.transaction.Transactional;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.dao.DataIntegrityViolationException; import org.springframework.dao.DataIntegrityViolationException;
@@ -40,7 +36,6 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
private final BaremRfuNonBatiRepository baremRfuNonBatiRepository; private final BaremRfuNonBatiRepository baremRfuNonBatiRepository;
private final ExerciceRepository exerciceRepository; private final ExerciceRepository exerciceRepository;
private final ArrondissementRepository arrondissementRepository; private final ArrondissementRepository arrondissementRepository;
private final EntityFromPayLoadService entityFromPayLoadService;
@@ -96,51 +91,91 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
@Override @Override
@Transactional @Transactional
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleNonBatie(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId) { public Long genererDonneesFiscales(ImpositionsTfu impositionsTfu) {
Integer nb= donneesImpositionTfuRepository.genererDonneesTfuNonBatie(impositionsTfuPaylaodWeb.getId(),userId); List<DonneesImpositionTfuResponse> donneesImpositionTfuResponses= donneesImpositionTfuRepository.findAllDonneesImpositionTfu(impositionsTfu.getCommune().getId(),impositionsTfu.getExercice().getAnnee());
Long n=0l;
for (DonneesImpositionTfuResponse donneesImpositionTfuResponse: donneesImpositionTfuResponses){
DonneesImpositionTfu donneesImpositionTfu=new DonneesImpositionTfu();
donneesImpositionTfu.setImpositionsTfu(impositionsTfu);
donneesImpositionTfu.setZoneRfuId(donneesImpositionTfuResponse.getZoneRfuId());
donneesImpositionTfu.setCodeQuartierVillage(donneesImpositionTfuResponse.getCodeQuartierVillage());
donneesImpositionTfu.setNomQuartierVillage(donneesImpositionTfuResponse.getNomQuartierVillage());
donneesImpositionTfu.setCodeArrondissement(donneesImpositionTfuResponse.getCodeArrondissement());
donneesImpositionTfu.setNomArrondissement(donneesImpositionTfuResponse.getNomArrondissement());
donneesImpositionTfu.setCodeCommune(donneesImpositionTfuResponse.getCodeCommune());
donneesImpositionTfu.setNomCommune(donneesImpositionTfuResponse.getNomCommune());
donneesImpositionTfu.setCodeDepartement(donneesImpositionTfuResponse.getCodeDepartement());
donneesImpositionTfu.setNomDepartement(donneesImpositionTfuResponse.getNomDepartement());
donneesImpositionTfu.setQ(donneesImpositionTfuResponse.getQ());
donneesImpositionTfu.setIlot(donneesImpositionTfuResponse.getIlot());
donneesImpositionTfu.setParcelle(donneesImpositionTfuResponse.getParcelle());
donneesImpositionTfu.setLatitude(donneesImpositionTfuResponse.getLatitude());
donneesImpositionTfu.setLongitude(donneesImpositionTfuResponse.getLongitude());
donneesImpositionTfu.setNup(donneesImpositionTfuResponse.getNup());
donneesImpositionTfu.setNupProvisoire(donneesImpositionTfuResponse.getNupProvisoire());
donneesImpositionTfu.setSuperficieParc(donneesImpositionTfuResponse.getSuperficieParc());
donneesImpositionTfu.setAdresseProp(donneesImpositionTfuResponse.getAdresseProp());
donneesImpositionTfu.setAnnee(donneesImpositionTfuResponse.getAnnee());
donneesImpositionTfu.setAdresseSc(donneesImpositionTfuResponse.getAdresseSc());
donneesImpositionTfu.setBatieOuiNon(donneesImpositionTfuResponse.getBatieOuiNon());
donneesImpositionTfu.setTfuMinimum(donneesImpositionTfuResponse.getTfuMinimum());
donneesImpositionTfu.setCategorieBat(donneesImpositionTfuResponse.getCategorieBat());
donneesImpositionTfu.setDateEnquete(donneesImpositionTfuResponse.getDateEnquete());
donneesImpositionTfu.setEmailProp(donneesImpositionTfuResponse.getEmailProp());
donneesImpositionTfu.setEmailSc(donneesImpositionTfuResponse.getEmailSc());
donneesImpositionTfu.setMontantLoyerAnnuel(donneesImpositionTfuResponse.getMontantLoyerAnnuel());
donneesImpositionTfu.setEnqueteId(donneesImpositionTfuResponse.getEnqueteId());
donneesImpositionTfu.setExhonereOuiNon(donneesImpositionTfuResponse.getExhonereOuiNon());
donneesImpositionTfu.setIfu(donneesImpositionTfuResponse.getIfu());
donneesImpositionTfu.setNombreBat(donneesImpositionTfuResponse.getNombreBat());
donneesImpositionTfu.setNombrePiscine(donneesImpositionTfuResponse.getNombrePiscine());
donneesImpositionTfu.setNombreUlog(donneesImpositionTfuResponse.getNombreUlog());
donneesImpositionTfu.setNomProp(donneesImpositionTfuResponse.getNomProp());
donneesImpositionTfu.setNomSc(donneesImpositionTfuResponse.getNomSc());
donneesImpositionTfu.setNpi(donneesImpositionTfuResponse.getNpi());
donneesImpositionTfu.setNumBatiment(donneesImpositionTfuResponse.getNumBatiment()==null?"":donneesImpositionTfuResponse.getNumBatiment());
donneesImpositionTfu.setNumUniteLogement(donneesImpositionTfuResponse.getNumUniteLogement()==null?"":donneesImpositionTfuResponse.getNumUniteLogement());
donneesImpositionTfu.setPrenomProp(donneesImpositionTfuResponse.getPrenomProp());
donneesImpositionTfu.setPrenomSc(donneesImpositionTfuResponse.getPrenomSc());
donneesImpositionTfu.setRaisonSociale(donneesImpositionTfuResponse.getRaisonSociale());
donneesImpositionTfu.setSecteurId(donneesImpositionTfuResponse.getSecteurId());
donneesImpositionTfu.setStandingBat(donneesImpositionTfuResponse.getStandingBat());
donneesImpositionTfu.setStructureId(donneesImpositionTfuResponse.getStructureId());
donneesImpositionTfu.setSuperficieAuSolBat(donneesImpositionTfuResponse.getSuperficieAuSolBat());
donneesImpositionTfu.setSuperficieAuSolUlog(donneesImpositionTfuResponse.getSuperficieAuSolUlog());
donneesImpositionTfu.setTelProp(donneesImpositionTfuResponse.getTelProp());
donneesImpositionTfu.setTelSc(donneesImpositionTfuResponse.getTelSc());
donneesImpositionTfu.setTfuMetreCarre(donneesImpositionTfuResponse.getTfuMetreCarre());
donneesImpositionTfu.setTitreFoncier(donneesImpositionTfuResponse.getTitreFoncier());
donneesImpositionTfu.setValeurLocativeAdm(donneesImpositionTfuResponse.getValeurLocativeAdm());
donneesImpositionTfu.setBatimentExhonereOuiNon(donneesImpositionTfuResponse.getBatimentExhonereOuiNon());
donneesImpositionTfu.setUniteLogementExhonereOuiNon(donneesImpositionTfuResponse.getUniteLogementExhonereOuiNon());
try {
Optional<BaremRfuNonBati> baremRfuNonBatiOptional=baremRfuNonBatiRepository.findAllByCommune_IdAndZoneRfu_Id(impositionsTfu.getCommune().getId(),donneesImpositionTfu.getZoneRfuId());
if(baremRfuNonBatiOptional.isPresent()){
donneesImpositionTfu.setValeurAdministrativeParcelleNonBati(baremRfuNonBatiOptional.get().getValeurAdministrative());
donneesImpositionTfu.setTauxParcelleNonBati(baremRfuNonBatiOptional.get().getTaux());
}
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
impositionsTfu.setStatusAvis(StatusAvis.TFU_FNB_GENERE);
impositionsTfu.setNombreAvisFnb(nb);
donneesImpositionTfuRepository.save(donneesImpositionTfu);
n++;
}catch (DataIntegrityViolationException e) {
if (e.getCause() instanceof org.hibernate.exception.ConstraintViolationException constraintEx &&
constraintEx.getSQLException().getSQLState().equals("23505")) {
System.out.println("Doublon détecté (clé unique) !");
} else {
throw e;
}
}
}
impositionsTfuRepository.save(impositionsTfu); impositionsTfuRepository.save(impositionsTfu);
return n;
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
} }
@Override @Override
@Transactional public List<DonneesImpositionTfu> getDonneesFiscalesByImposition(Long impositionsId) {
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleBatie(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId) { return donneesImpositionTfuRepository.findAllByImpositionsTfu_Id(impositionsId);
Integer nbb= donneesImpositionTfuRepository.genererDonneesTfuBatie(impositionsTfuPaylaodWeb.getId(),userId);
Integer nbulo= donneesImpositionTfuRepository.genererDonneesTfuBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId);
// Integer nbirfbt= donneesImpositionTfuRepository.genererDonneesIrfBatie(impositionsTfuPaylaodWeb.getId(),userId);
//
// Integer nbirfulo= donneesImpositionTfuRepository.genererDonneesIrfBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId);
//
// Integer nbsrtbbt= donneesImpositionTfuRepository.genererDonneesSrtbBatie(impositionsTfuPaylaodWeb.getId(),userId);
//
// 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
public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImposition(Long impositionsId) {
return donneesImpositionTfuRepository.findAllByImpositionTfuId(impositionsId);
} }
@Override @Override
@@ -152,59 +187,4 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
return null; return null;
} }
} }
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdPageable(Long impositionsTfuId, Pageable pageable) {
return donneesImpositionTfuRepository.findAllByImpositionTfuIdPageable(impositionsTfuId,pageable);
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdNonBatiePageable(Long impositionsTfuId, Pageable pageable) {
return donneesImpositionTfuRepository.findAllByImpositionTfuIdNonBatiePageable(impositionsTfuId,pageable);
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdBatieBatimentPageable(Long impositionsTfuId, Pageable pageable) {
return donneesImpositionTfuRepository.findAllByImpositionTfuIdBatieBatimentPageable(impositionsTfuId,pageable);
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable) {
return donneesImpositionTfuRepository.findAllByImpositionTfuIdBatieUniteLogPageable(impositionsTfuId,pageable);
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionIrfIdBatieBatimentPageable(Long impositionsTfuId, Pageable pageable) {
return null;
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionIrfIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable) {
return null;
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionSrtbIdBatieBatimentPageable(Long impositionsTfuId, Pageable pageable) {
return null;
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionSrtbIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable) {
return null;
}
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureIdPageable(Long exerciceId, Long structureId, Pageable pageable) {
return donneesImpositionTfuRepository.findAllByExericeIdStructureIdPageable(exerciceId,structureId,pageable);
}
@Override
public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureId(Long exerciceId, Long structureId,Long quartierId) {
return donneesImpositionTfuRepository.findAllByExericeIdStructureId(exerciceId,structureId,quartierId);
}
@Override
public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByPersonneId(Long personneId) {
return donneesImpositionTfuRepository.findAllByPersonneId(personneId);
}
} }

View File

@@ -1,103 +1,59 @@
package io.gmss.fiscad.implementations.rfu.metier; package io.gmss.fiscad.implementations.rfu.metier;
import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.entities.infocad.metier.Enquete; import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.infocad.metier.Upload; import io.gmss.fiscad.entities.infocad.metier.Upload;
import io.gmss.fiscad.entities.infocad.parametre.Personne; import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.rfu.metier.Batiment; import io.gmss.fiscad.entities.rfu.metier.Batiment;
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment; import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment; import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment;
import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.decoupage.SecteurService;
import io.gmss.fiscad.interfaces.rfu.metier.BatimentService; import io.gmss.fiscad.interfaces.rfu.metier.BatimentService;
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueBatimentService; import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueBatimentService;
import io.gmss.fiscad.interfaces.rfu.metier.EnqueteBatimentService; import io.gmss.fiscad.interfaces.rfu.metier.EnqueteBatimentService;
import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad;
import io.gmss.fiscad.paylaods.request.crudweb.BaremRfuNonBatiPayloadWeb;
import io.gmss.fiscad.paylaods.request.crudweb.BatimentPaylaodWeb;
import io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb; import io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb;
import io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb;
import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository; import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository;
import io.gmss.fiscad.persistence.repositories.infocad.metier.UploadRepository; import io.gmss.fiscad.persistence.repositories.infocad.metier.UploadRepository;
import io.gmss.fiscad.persistence.repositories.infocad.parametre.PersonneRepository; import io.gmss.fiscad.persistence.repositories.infocad.parametre.PersonneRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.BatimentRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.BatimentRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService; import io.gmss.fiscad.service.EntityFromPayLoadService;
import jakarta.transaction.Transactional;
import jakarta.ws.rs.NotAcceptableException;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@AllArgsConstructor @AllArgsConstructor
@Service @Service
public class EnqueteBatimentServiceImpl implements EnqueteBatimentService { public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
private final EnqueteBatimentRepository enqueteBatimentRepository; private final EnqueteBatimentRepository enqueteBatimentRepository;
private final EntityFromPayLoadService entityFromPayLoadService;
private final BatimentRepository batimentRepository;
private final BatimentService batimentService; private final BatimentService batimentService;
private final SecteurService secteurService; private final EnqueteRepository enqueteRepository;
private final PersonneRepository personneRepository;
private final EntityFromPayLoadService entityFromPayLoadService;
private final CaracteristiqueBatimentService caracteristiqueBatimentService;
private final UploadRepository uploadRepository;
private final BatimentRepository batimentRepository;
@Override @Override
@Transactional
public EnqueteBatimentPayloadWeb createEnqueteBatiment(EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) throws BadRequestException { public EnqueteBatimentPayloadWeb createEnqueteBatiment(EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) throws BadRequestException {
EnqueteBatiment enqueteBatiment=new EnqueteBatiment(); EnqueteBatiment enqueteBatiment=new EnqueteBatiment();
if(enqueteBatimentPayloadWeb.getBatimentId()!=null) {
if (!batimentRepository.existsById(enqueteBatimentPayloadWeb.getBatimentId())) { if (!batimentRepository.existsById(enqueteBatimentPayloadWeb.getBatimentId())) {
throw new NotFoundException("Impossible d'enregistrer sans le batiment."); throw new NotFoundException("Impossible d'enregistrer sans le batiment.");
} }
}
BatimentPaylaodWeb batimentPaylaodWeb= getBatimentPayloadFromEnqueteBat(enqueteBatimentPayloadWeb);
if(batimentPaylaodWeb.getId()==null){
batimentPaylaodWeb=batimentService.createBatiment(batimentPaylaodWeb);
}else{
batimentPaylaodWeb=batimentService.updateBatiment(batimentPaylaodWeb.getId(),batimentPaylaodWeb);
}
enqueteBatimentPayloadWeb.setBatimentId(batimentPaylaodWeb.getId());
enqueteBatiment = entityFromPayLoadService.getEnqueteBatimentFromPayLoadWeb(enqueteBatimentPayloadWeb); enqueteBatiment = entityFromPayLoadService.getEnqueteBatimentFromPayLoadWeb(enqueteBatimentPayloadWeb);
enqueteBatiment= enqueteBatimentRepository.save(enqueteBatiment); enqueteBatiment= enqueteBatimentRepository.save(enqueteBatiment);
enqueteBatimentPayloadWeb= enqueteBatimentRepository.findEnqueteBatimentByIdToDto(enqueteBatiment.getId()).orElse(null); enqueteBatimentPayloadWeb= enqueteBatimentRepository.findEnqueteBatimentByIdToDto(enqueteBatiment.getId()).orElse(null);
return enqueteBatimentPayloadWeb ; return enqueteBatimentPayloadWeb ;
} }
private BatimentPaylaodWeb getBatimentPayloadFromEnqueteBat(EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) {
BatimentPaylaodWeb batimentPaylaodWeb= new BatimentPaylaodWeb();
batimentPaylaodWeb.setId(enqueteBatimentPayloadWeb.getBatimentId());
batimentPaylaodWeb.setNub(enqueteBatimentPayloadWeb.getNub());
batimentPaylaodWeb.setCode(enqueteBatimentPayloadWeb.getCode());
batimentPaylaodWeb.setDateConstruction(enqueteBatimentPayloadWeb.getDateConstruction());
batimentPaylaodWeb.setParcelleId(enqueteBatimentPayloadWeb.getParcelleId());
batimentPaylaodWeb.setPersonneId(enqueteBatimentPayloadWeb.getPersonneId());
batimentPaylaodWeb.setSuperficieAuSol(enqueteBatimentPayloadWeb.getSuperficieAuSol());
batimentPaylaodWeb.setSuperficieLouee(enqueteBatimentPayloadWeb.getSuperficieLouee());
batimentPaylaodWeb.setCategorieBatimentId(enqueteBatimentPayloadWeb.getCategorieBatimentId());
batimentPaylaodWeb.setNombrePiscine(enqueteBatimentPayloadWeb.getNombrePiscine());
batimentPaylaodWeb.setMontantLocatifAnnuelDeclare(enqueteBatimentPayloadWeb.getMontantLocatifAnnuelDeclare());
batimentPaylaodWeb.setMontantLocatifAnnuelEstime(enqueteBatimentPayloadWeb.getMontantLocatifAnnuelEstime());
batimentPaylaodWeb.setValeurBatimentEstime(enqueteBatimentPayloadWeb.getValeurBatimentEstime());
batimentPaylaodWeb.setValeurBatimentReel(enqueteBatimentPayloadWeb.getValeurBatimentReel());
batimentPaylaodWeb.setMontantMensuelLocation(enqueteBatimentPayloadWeb.getMontantMensuelLocation());
batimentPaylaodWeb.setUsageId(enqueteBatimentPayloadWeb.getUsageId());
batimentPaylaodWeb.setNbreUniteLogement(enqueteBatimentPayloadWeb.getNbreUniteLogement());
return batimentPaylaodWeb;
}
@Override @Override
@Transactional
public EnqueteBatimentPayloadWeb updateEnqueteBatiment(Long id, EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) throws NotFoundException { public EnqueteBatimentPayloadWeb updateEnqueteBatiment(Long id, EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) throws NotFoundException {
if (enqueteBatimentPayloadWeb.getId() == null) { if (enqueteBatimentPayloadWeb.getId() == null) {
throw new BadRequestException("Impossible de mettre à jour une nouvelle enquete de batiment ayant un id null."); throw new BadRequestException("Impossible de mettre à jour une nouvelle enquete de batiment ayant un id null.");
@@ -108,18 +64,6 @@ public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
if (!batimentRepository.existsById(enqueteBatimentPayloadWeb.getBatimentId())) { if (!batimentRepository.existsById(enqueteBatimentPayloadWeb.getBatimentId())) {
throw new NotFoundException("Impossible d'enregistrer sans le batiment."); throw new NotFoundException("Impossible d'enregistrer sans le batiment.");
} }
BatimentPaylaodWeb batimentPaylaodWeb= getBatimentPayloadFromEnqueteBat(enqueteBatimentPayloadWeb);
if(batimentPaylaodWeb.getId()==null){
batimentPaylaodWeb=batimentService.createBatiment(batimentPaylaodWeb);
}else{
batimentPaylaodWeb=batimentService.updateBatiment(batimentPaylaodWeb.getId(),batimentPaylaodWeb);
}
enqueteBatimentPayloadWeb.setBatimentId(batimentPaylaodWeb.getId());
EnqueteBatiment enqueteBatiment = entityFromPayLoadService.getEnqueteBatimentFromPayLoadWeb(enqueteBatimentPayloadWeb); EnqueteBatiment enqueteBatiment = entityFromPayLoadService.getEnqueteBatimentFromPayLoadWeb(enqueteBatimentPayloadWeb);
enqueteBatiment= enqueteBatimentRepository.save(enqueteBatiment); enqueteBatiment= enqueteBatimentRepository.save(enqueteBatiment);
enqueteBatimentPayloadWeb= enqueteBatimentRepository.findEnqueteBatimentByIdToDto(enqueteBatiment.getId()).orElse(null); enqueteBatimentPayloadWeb= enqueteBatimentRepository.findEnqueteBatimentByIdToDto(enqueteBatiment.getId()).orElse(null);
@@ -166,84 +110,4 @@ public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
public List<EnqueteBatimentPayloadWeb> getEnqueteBatimentByBatimentList(Long batimentId) { public List<EnqueteBatimentPayloadWeb> getEnqueteBatimentByBatimentList(Long batimentId) {
return enqueteBatimentRepository.findAllByBatimentToDto(batimentId); return enqueteBatimentRepository.findAllByBatimentToDto(batimentId);
} }
@Override
public Page<EnqueteBatimentPayloadWeb> getEnqueteBatimentListByQuartierByStatutPageableToDto(Long userId, Long quartierId, StatutEnquete statutEnquete, Pageable pageable) {
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
List<Long> secteurIds = secteurs.stream()
.map(Secteur::getId)
.toList();
return enqueteBatimentRepository.findAllEnqueteBatimentByQuartierByStatutToDtoPageable(quartierId,secteurIds,statutEnquete,pageable);
}
@Override
public EnqueteBatimentPayloadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
if (enqueteTraitementPayLoad == null || enqueteTraitementPayLoad.getIdBackend()==null) {
throw new BadRequestException("Impossible de valider une enquête ayant un id null.");
}
Optional<EnqueteBatiment> optionalEnqueteBatiment = enqueteBatimentRepository.findById(enqueteTraitementPayLoad.getIdBackend());
if (!optionalEnqueteBatiment.isPresent()) {
throw new NotFoundException("Impossible de trouver l'enquête que vous désirez valider.");
}
if(optionalEnqueteBatiment.get().getStatutEnquete()==StatutEnquete.CLOTURE ||
optionalEnqueteBatiment.get().getStatutEnquete()==StatutEnquete.REJETE ){
throw new NotAcceptableException("Impossible de valider : Le statut actuel "+optionalEnqueteBatiment.get().getStatutEnquete()+" ne le permet pas.");
}
EnqueteBatiment enqueteBatiment = optionalEnqueteBatiment.get();
enqueteBatiment.setDateValidation(LocalDate.now());
enqueteBatiment.setStatutEnquete(StatutEnquete.VALIDE);
enqueteBatiment= enqueteBatimentRepository.save(enqueteBatiment);
return enqueteBatimentRepository.findEnqueteBatimentByIdToDto(enqueteBatiment.getId()).orElse(null);
}
@Override
public EnqueteBatimentPayloadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
if (enqueteTraitementPayLoad == null || enqueteTraitementPayLoad.getIdBackend()==null) {
throw new BadRequestException("Impossible de rejeter une enquête ayant un id null.");
}
Optional<EnqueteBatiment> optionalEnqueteBatiment = enqueteBatimentRepository.findById(enqueteTraitementPayLoad.getIdBackend());
if (!optionalEnqueteBatiment.isPresent()) {
throw new NotFoundException("Impossible de trouver l'enquête que vous désirez rejeter.");
}
if(optionalEnqueteBatiment.get().getStatutEnquete()==StatutEnquete.CLOTURE ||
optionalEnqueteBatiment.get().getStatutEnquete()==StatutEnquete.VALIDE ){
throw new NotAcceptableException("Impossible de rejeter : Le statut actuel "+optionalEnqueteBatiment.get().getStatutEnquete()+" ne le permet pas.");
}
EnqueteBatiment enqueteBatiment = optionalEnqueteBatiment.get();
enqueteBatiment.setDateRejet(LocalDate.now());
enqueteBatiment.setDescriptionMotifRejet(enqueteTraitementPayLoad.getMotifRejet());
enqueteBatiment.setStatutEnquete(StatutEnquete.REJETE);
enqueteBatiment= enqueteBatimentRepository.save(enqueteBatiment);
return enqueteBatimentRepository.findEnqueteBatimentByIdToDto(enqueteBatiment.getId()).orElse(null);
}
@Override
public List<EnqueteBatimentPayloadWeb> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
List<EnqueteBatimentPayloadWeb> enqueteBatimentPayloadWebs = new ArrayList<>();
try {
for (EnqueteTraitementPayLoad enqueteTraitementPayLoad : enqueteTraitementPayLoads) {
enqueteBatimentPayloadWebs.add(validerEnquete(enqueteTraitementPayLoad));
}
} catch (Exception e) {
enqueteBatimentPayloadWebs.add(null);
}
return enqueteBatimentPayloadWebs;
}
@Override
public List<EnqueteBatimentPayloadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
List<EnqueteBatimentPayloadWeb> enqueteBatimentPayloadWebs = new ArrayList<>();
try {
for (EnqueteTraitementPayLoad enqueteTraitementPayLoad : enqueteTraitementPayLoads) {
enqueteBatimentPayloadWebs.add(rejeterEnquete(enqueteTraitementPayLoad));
}
} catch (Exception e) {
enqueteBatimentPayloadWebs.add(null);
}
return enqueteBatimentPayloadWebs;
}
} }

View File

@@ -1,36 +1,26 @@
package io.gmss.fiscad.implementations.rfu.metier; package io.gmss.fiscad.implementations.rfu.metier;
import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.entities.infocad.metier.Enquete; import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.infocad.metier.Upload; import io.gmss.fiscad.entities.infocad.metier.Upload;
import io.gmss.fiscad.entities.infocad.parametre.Personne; import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.rfu.metier.*; import io.gmss.fiscad.entities.rfu.metier.*;
import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.decoupage.SecteurService;
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueUniteLogementService; import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueUniteLogementService;
import io.gmss.fiscad.interfaces.rfu.metier.EnqueteUniteLogementService; import io.gmss.fiscad.interfaces.rfu.metier.EnqueteUniteLogementService;
import io.gmss.fiscad.interfaces.rfu.metier.UniteLogementService; import io.gmss.fiscad.interfaces.rfu.metier.UniteLogementService;
import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad;
import io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb;
import io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb; import io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb;
import io.gmss.fiscad.paylaods.request.crudweb.UniteLogementPaylaodWeb;
import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository; import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository;
import io.gmss.fiscad.persistence.repositories.infocad.metier.UploadRepository; import io.gmss.fiscad.persistence.repositories.infocad.metier.UploadRepository;
import io.gmss.fiscad.persistence.repositories.infocad.parametre.PersonneRepository; import io.gmss.fiscad.persistence.repositories.infocad.parametre.PersonneRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.UniteLogementRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.UniteLogementRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService; import io.gmss.fiscad.service.EntityFromPayLoadService;
import jakarta.transaction.Transactional;
import jakarta.ws.rs.NotAcceptableException;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@AllArgsConstructor @AllArgsConstructor
@@ -38,65 +28,31 @@ import java.util.Optional;
public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementService { public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementService {
private final EnqueteUniteLogementRepository enqueteUniteLogementRepository; private final EnqueteUniteLogementRepository enqueteUniteLogementRepository;
private final UniteLogementService uniteLogementService;
private final EntityFromPayLoadService entityFromPayLoadService ; private final EntityFromPayLoadService entityFromPayLoadService ;
private final PersonneRepository personneRepository ;
private final EnqueteRepository enqueteRepository ;
private final UploadRepository uploadRepository ;
private final UniteLogementRepository uniteLogementRepository ; private final UniteLogementRepository uniteLogementRepository ;
private final UniteLogementService uniteLogementService ; private final CaracteristiqueUniteLogementService caracteristiqueUniteLogementService ;
private final SecteurService secteurService ;
@Transactional
@Override @Override
public EnqueteUniteLogementPayloadWeb createEnqueteUniteLogement(EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) throws BadRequestException { public EnqueteUniteLogementPayloadWeb createEnqueteUniteLogement(EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) throws BadRequestException {
EnqueteUniteLogement enqueteUniteLogement=new EnqueteUniteLogement(); EnqueteUniteLogement enqueteUniteLogement=new EnqueteUniteLogement();
Optional<UniteLogement> optionalUniteLogement= Optional.empty(); Optional<UniteLogement> optionalUniteLogement= Optional.empty();
if(enqueteUniteLogementPayloadWeb.getUniteLogementId()!=null) { if (enqueteUniteLogementPayloadWeb.getUniteLogementId() == null) {
if (!uniteLogementRepository.existsById(enqueteUniteLogementPayloadWeb.getUniteLogementId())) { throw new BadRequestException("Impossible d'enregistrer une nouvelle enquete d'unité de logement sans l'unité de logement.");
throw new NotFoundException("Unité de logement inexistant.");
} }
}
UniteLogementPaylaodWeb uniteLogementPaylaodWeb=getUniteLogementPayloadFromEnqueteUl(enqueteUniteLogementPayloadWeb);
if(uniteLogementPaylaodWeb.getId()==null){
uniteLogementPaylaodWeb= uniteLogementService.createUniteLogement(uniteLogementPaylaodWeb);
}else{
uniteLogementPaylaodWeb= uniteLogementService.updateUniteLogement(uniteLogementPaylaodWeb.getId(),uniteLogementPaylaodWeb);
}
enqueteUniteLogementPayloadWeb.setUniteLogementId(uniteLogementPaylaodWeb.getId());
enqueteUniteLogement = entityFromPayLoadService.getEnqueteUniteLogementFromPayLoadWeb(enqueteUniteLogementPayloadWeb); enqueteUniteLogement = entityFromPayLoadService.getEnqueteUniteLogementFromPayLoadWeb(enqueteUniteLogementPayloadWeb);
enqueteUniteLogement= enqueteUniteLogementRepository.save(enqueteUniteLogement); enqueteUniteLogement= enqueteUniteLogementRepository.save(enqueteUniteLogement);
enqueteUniteLogementPayloadWeb = enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(enqueteUniteLogement.getId()).orElse(null); enqueteUniteLogementPayloadWeb = enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(enqueteUniteLogement.getId()).orElse(null);
return enqueteUniteLogementPayloadWeb ; return enqueteUniteLogementPayloadWeb ;
} }
private UniteLogementPaylaodWeb getUniteLogementPayloadFromEnqueteUl(EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) {
UniteLogementPaylaodWeb uniteLogementPaylaodWeb=new UniteLogementPaylaodWeb();
uniteLogementPaylaodWeb.setId(enqueteUniteLogementPayloadWeb.getUniteLogementId());
uniteLogementPaylaodWeb.setNul(enqueteUniteLogementPayloadWeb.getNul());
uniteLogementPaylaodWeb.setNumeroEtage(enqueteUniteLogementPayloadWeb.getNumeroEtage());
uniteLogementPaylaodWeb.setCode(enqueteUniteLogementPayloadWeb.getCode());
uniteLogementPaylaodWeb.setBatimentId(enqueteUniteLogementPayloadWeb.getBatimentId());
uniteLogementPaylaodWeb.setSuperficieAuSol(enqueteUniteLogementPayloadWeb.getSuperficieAuSol());
uniteLogementPaylaodWeb.setSuperficieLouee(enqueteUniteLogementPayloadWeb.getSuperficieLouee());
uniteLogementPaylaodWeb.setObservation(enqueteUniteLogementPayloadWeb.getObservation());
uniteLogementPaylaodWeb.setDateConstruction(enqueteUniteLogementPayloadWeb.getDateConstruction());
uniteLogementPaylaodWeb.setPersonneId(enqueteUniteLogementPayloadWeb.getPersonneId());
uniteLogementPaylaodWeb.setCategorieBatimentId(enqueteUniteLogementPayloadWeb.getCategorieBatimentId());
uniteLogementPaylaodWeb.setMontantLocatifAnnuelDeclare(enqueteUniteLogementPayloadWeb.getMontantLocatifAnnuelDeclare());
uniteLogementPaylaodWeb.setMontantLocatifAnnuelEstime(enqueteUniteLogementPayloadWeb.getMontantLocatifAnnuelEstime());
uniteLogementPaylaodWeb.setMontantMensuelLocation(enqueteUniteLogementPayloadWeb.getMontantMensuelLocation());
uniteLogementPaylaodWeb.setValeurUniteLogementReel(enqueteUniteLogementPayloadWeb.getValeurUniteLogementReel());
uniteLogementPaylaodWeb.setValeurUniteLogementEstime(enqueteUniteLogementPayloadWeb.getValeurUniteLogementEstime());
uniteLogementPaylaodWeb.setNombrePiscine(enqueteUniteLogementPayloadWeb.getNombrePiscine());
uniteLogementPaylaodWeb.setUsageId(enqueteUniteLogementPayloadWeb.getUsageId());
return uniteLogementPaylaodWeb;
}
@Override @Override
@Transactional
public EnqueteUniteLogementPayloadWeb updateEnqueteUniteLogement(Long id, EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) throws NotFoundException { public EnqueteUniteLogementPayloadWeb updateEnqueteUniteLogement(Long id, EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) throws NotFoundException {
if (enqueteUniteLogementPayloadWeb.getId() == null) { if (enqueteUniteLogementPayloadWeb.getId() == null) {
throw new BadRequestException("Impossible de mettre à jour une nouvelle enquete d'unité de logement ayant un id null."); throw new BadRequestException("Impossible de mettre à jour une nouvelle enquete d'unité de logement ayant un id null.");
@@ -112,16 +68,6 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
EnqueteUniteLogement enqueteUniteLogement= new EnqueteUniteLogement(); EnqueteUniteLogement enqueteUniteLogement= new EnqueteUniteLogement();
UniteLogementPaylaodWeb uniteLogementPaylaodWeb=getUniteLogementPayloadFromEnqueteUl(enqueteUniteLogementPayloadWeb);
if(uniteLogementPaylaodWeb.getId()==null){
uniteLogementPaylaodWeb= uniteLogementService.createUniteLogement(uniteLogementPaylaodWeb);
}else{
uniteLogementPaylaodWeb= uniteLogementService.updateUniteLogement(uniteLogementPaylaodWeb.getId(),uniteLogementPaylaodWeb);
}
enqueteUniteLogementPayloadWeb.setUniteLogementId(uniteLogementPaylaodWeb.getId());
enqueteUniteLogement = entityFromPayLoadService.getEnqueteUniteLogementFromPayLoadWeb(enqueteUniteLogementPayloadWeb); enqueteUniteLogement = entityFromPayLoadService.getEnqueteUniteLogementFromPayLoadWeb(enqueteUniteLogementPayloadWeb);
enqueteUniteLogement= enqueteUniteLogementRepository.save(enqueteUniteLogement); enqueteUniteLogement= enqueteUniteLogementRepository.save(enqueteUniteLogement);
enqueteUniteLogementPayloadWeb = enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(enqueteUniteLogement.getId()).orElse(null); enqueteUniteLogementPayloadWeb = enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(enqueteUniteLogement.getId()).orElse(null);
@@ -168,84 +114,4 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
} }
} }
@Override
public Page<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementListByQuartierByStatutPageableToDto(Long userId, Long quartierId, StatutEnquete statutEnquete, Pageable pageable) {
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
List<Long> secteurIds = secteurs.stream()
.map(Secteur::getId)
.toList();
return enqueteUniteLogementRepository.findAllEnqueteUniteLogementByQuartierByStatutToDtoPageable(quartierId,secteurIds,statutEnquete,pageable);
}
@Override
public EnqueteUniteLogementPayloadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
if (enqueteTraitementPayLoad == null || enqueteTraitementPayLoad.getIdBackend()==null) {
throw new BadRequestException("Impossible de valider une enquête ayant un id null.");
}
Optional<EnqueteUniteLogement> optionalEnqueteUniteLogement = enqueteUniteLogementRepository.findById(enqueteTraitementPayLoad.getIdBackend());
if (!optionalEnqueteUniteLogement.isPresent()) {
throw new NotFoundException("Impossible de trouver l'enquête que vous désirez valider.");
}
if(optionalEnqueteUniteLogement.get().getStatutEnquete()==StatutEnquete.CLOTURE ||
optionalEnqueteUniteLogement.get().getStatutEnquete()==StatutEnquete.REJETE ){
throw new NotAcceptableException("Impossible de valider : Le statut actuel "+optionalEnqueteUniteLogement.get().getStatutEnquete()+" ne le permet pas.");
}
EnqueteUniteLogement enqueteUniteLogement = optionalEnqueteUniteLogement.get();
enqueteUniteLogement.setDateValidation(LocalDate.now());
enqueteUniteLogement.setStatutEnquete(StatutEnquete.VALIDE);
enqueteUniteLogement= enqueteUniteLogementRepository.save(enqueteUniteLogement);
return enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(enqueteUniteLogement.getId()).orElse(null);
}
@Override
public EnqueteUniteLogementPayloadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
if (enqueteTraitementPayLoad == null || enqueteTraitementPayLoad.getIdBackend()==null) {
throw new BadRequestException("Impossible de rejeter une enquête ayant un id null.");
}
Optional<EnqueteUniteLogement> optionalEnqueteUniteLogement = enqueteUniteLogementRepository.findById(enqueteTraitementPayLoad.getIdBackend());
if (!optionalEnqueteUniteLogement.isPresent()) {
throw new NotFoundException("Impossible de trouver l'enquête que vous désirez rejeter.");
}
if(optionalEnqueteUniteLogement.get().getStatutEnquete()==StatutEnquete.CLOTURE ||
optionalEnqueteUniteLogement.get().getStatutEnquete()==StatutEnquete.VALIDE ){
throw new NotAcceptableException("Impossible de rejeter : Le statut actuel "+optionalEnqueteUniteLogement.get().getStatutEnquete()+" ne le permet pas.");
}
EnqueteUniteLogement enqueteUniteLogement = optionalEnqueteUniteLogement.get();
enqueteUniteLogement.setDateRejet(LocalDate.now());
enqueteUniteLogement.setDescriptionMotifRejet(enqueteTraitementPayLoad.getMotifRejet());
enqueteUniteLogement.setStatutEnquete(StatutEnquete.REJETE);
enqueteUniteLogement= enqueteUniteLogementRepository.save(enqueteUniteLogement);
return enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(enqueteUniteLogement.getId()).orElse(null);
}
@Override
public List<EnqueteUniteLogementPayloadWeb> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
List<EnqueteUniteLogementPayloadWeb> enqueteUniteLogementPayloadWebs = new ArrayList<>();
try {
for (EnqueteTraitementPayLoad enqueteTraitementPayLoad : enqueteTraitementPayLoads) {
enqueteUniteLogementPayloadWebs.add(validerEnquete(enqueteTraitementPayLoad));
}
} catch (Exception e) {
enqueteUniteLogementPayloadWebs.add(null);
}
return enqueteUniteLogementPayloadWebs;
}
@Override
public List<EnqueteUniteLogementPayloadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
List<EnqueteUniteLogementPayloadWeb> enqueteUniteLogementPayloadWebs = new ArrayList<>();
try {
for (EnqueteTraitementPayLoad enqueteTraitementPayLoad : enqueteTraitementPayLoads) {
enqueteUniteLogementPayloadWebs.add(rejeterEnquete(enqueteTraitementPayLoad));
}
} catch (Exception e) {
enqueteUniteLogementPayloadWebs.add(null);
}
return enqueteUniteLogementPayloadWebs;
}
} }

View File

@@ -1,154 +1,81 @@
package io.gmss.fiscad.implementations.rfu.metier; package io.gmss.fiscad.implementations.rfu.metier;
import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu; import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
import io.gmss.fiscad.enums.StatusAvis; import io.gmss.fiscad.enums.StatusAvis;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.infocad.metier.EnqueteService;
import io.gmss.fiscad.interfaces.infocad.parametre.StructureService;
import io.gmss.fiscad.interfaces.rfu.metier.ImpositionsTfuService; import io.gmss.fiscad.interfaces.rfu.metier.ImpositionsTfuService;
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import jakarta.transaction.Transactional;
import jakarta.ws.rs.NotAcceptableException;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@AllArgsConstructor
@Service @Service
public class ImpositionsTfuServiceImpl implements ImpositionsTfuService { public class ImpositionsTfuServiceImpl implements ImpositionsTfuService {
private final ImpositionsTfuRepository impositionsTfuRepository; private final ImpositionsTfuRepository impositionsTfuRepository;
private final StructureService structureService;
private final EntityFromPayLoadService entityFromPayLoadService;
private final EnqueteService enqueteService;
public ImpositionsTfuServiceImpl(ImpositionsTfuRepository impositionsTfuRepository) {
this.impositionsTfuRepository = impositionsTfuRepository;
}
/**
* Permet de créer pour un centre la synthèse de l'imposition de l'année en prélude de la
* génération des avis d'imposition
* @param impositionsTfuPaylaodWeb
* @return
* @throws BadRequestException
*/
@Override @Override
@Transactional public ImpositionsTfu createImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException {
public ImpositionsTfuPaylaodWeb createImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException { if (impositionsTfu.getId() != null) {
if (impositionsTfuPaylaodWeb.getId() != null) {
throw new BadRequestException("Impossible de créer une nouvelle unité de logement ayant un id non null."); throw new BadRequestException("Impossible de créer une nouvelle unité de logement ayant un id non null.");
} }
List<ImpositionsTfu> impositionsTfus=impositionsTfuRepository.getImpositionsTfuByStructureAndExercice(impositionsTfuPaylaodWeb.getStructureId(), impositionsTfuPaylaodWeb.getExerciceId()); List<ImpositionsTfu> impositionsTfus=impositionsTfuRepository.getImpositionsTfuByCommuneAndExercice(impositionsTfu.getCommune().getCode(),impositionsTfu.getExercice().getAnnee());
if (!impositionsTfus.isEmpty()) { if (!impositionsTfus.isEmpty()) {
throw new BadRequestException("Une Imposition non annulée existe déjà"); throw new BadRequestException("Une Imposition non annulée existe déjà");
} }
List<StatusAvis> statusAvis= new ArrayList<>(); impositionsTfu.setStatusAvis(StatusAvis.CREE);
statusAvis.add(StatusAvis.EN_COURS); impositionsTfu.setDateGeneration(LocalDate.now());
statusAvis.add(StatusAvis.CLOTURE); return impositionsTfuRepository.save(impositionsTfu);
statusAvis.add(StatusAvis.GENERATION_AUTORISE);
Optional<ImpositionsTfu> optionalImpositionsTfu= impositionsTfuRepository.findDistinctByStructure_IdAndExercice_IdAndStatusAvisIn(impositionsTfuPaylaodWeb.getStructureId(),impositionsTfuPaylaodWeb.getExerciceId(),statusAvis);
if(optionalImpositionsTfu.isPresent()){
throw new BadRequestException("Une Imposition est déjà dans le workflow");
}
ImpositionsTfu impositionsTfu=entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
impositionsTfu.setStatusAvis(StatusAvis.EN_COURS);
impositionsTfu =impositionsTfuRepository.save(impositionsTfu);
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
} }
@Override @Override
public ImpositionsTfuPaylaodWeb rejeterImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException { public ImpositionsTfu annulerImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException {
if (impositionsTfuPaylaodWeb.getId() == null) { if (impositionsTfu.getId() == null) {
throw new BadRequestException("Impossible d'annuler une imposition ayant un id null."); throw new BadRequestException("Impossible d'annuler une imposition ayant un id null.");
} }
if (!impositionsTfuRepository.existsById(impositionsTfuPaylaodWeb.getId())) { if (!impositionsTfuRepository.existsById(impositionsTfu.getId())) {
throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données."); throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données.");
} }
ImpositionsTfu impositionsTfu= entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb); impositionsTfu.setStatusAvis(StatusAvis.ANNULE);
if(!impositionsTfu.getStatusAvis().equals(StatusAvis.CLOTURE)){ return impositionsTfuRepository.save(impositionsTfu);
throw new NotAcceptableException("L'état actuel :"+impositionsTfu.getStatusAvis()+"Ne permet pas de passer au l'état rejete");
}
impositionsTfu.setStatusAvis(StatusAvis.REJETE);
impositionsTfu =impositionsTfuRepository.save(impositionsTfu);
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
}
@Override
@Transactional
public ImpositionsTfuPaylaodWeb cloturerImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException {
if (impositionsTfuPaylaodWeb.getId() == null) {
throw new BadRequestException("Impossible de cloturer une imposition ayant un id null.");
}
if (!impositionsTfuRepository.existsById(impositionsTfuPaylaodWeb.getId())) {
throw new NotFoundException("Impossible de trouver l'imposition spécifiée dans notre base de données.");
}
ImpositionsTfu impositionsTfu= entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
if(!impositionsTfu.getStatusAvis().equals(StatusAvis.EN_COURS) && !impositionsTfu.getStatusAvis().equals(StatusAvis.REJETE)){
throw new NotAcceptableException("L'état actuel :"+impositionsTfu.getStatusAvis()+"Ne permet pas de passer au l'état rejete");
}
impositionsTfu.setDateCloture(LocalDate.now());
enqueteService.cloturerEnqueteParcelleBatimentUniteLogementByStructureIdAndExerciceId(impositionsTfu.getStructure().getId(),impositionsTfu.getExercice().getId());
impositionsTfu.setStatusAvis(StatusAvis.CLOTURE);
impositionsTfu =impositionsTfuRepository.save(impositionsTfu);
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
} }
@Override @Override
public ImpositionsTfuPaylaodWeb autoriserGenerationImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException { public ImpositionsTfu validerImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException {
if (impositionsTfuPaylaodWeb.getId() == null) { if (impositionsTfu.getId() == null) {
throw new BadRequestException("Impossible de valider une imposition ayant un id null."); throw new BadRequestException("Impossible de valider une imposition ayant un id null.");
} }
if (!impositionsTfuRepository.existsById(impositionsTfuPaylaodWeb.getId())) { if (!impositionsTfuRepository.existsById(impositionsTfu.getId())) {
throw new NotFoundException("Impossible de trouver l'imposition spécifiée dans notre base de données."); throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données.");
} }
impositionsTfu.setStatusAvis(StatusAvis.VALIDE);
ImpositionsTfu impositionsTfu= entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb); return impositionsTfuRepository.save(impositionsTfu);
if(!impositionsTfu.getStatusAvis().equals(StatusAvis.CLOTURE)){
throw new NotFoundException("L'état actuel : "+impositionsTfu.getStatusAvis()+ " ne permet pas de passer à l'état Autorisé");
}
impositionsTfu.setDateGeneration(LocalDate.now());
impositionsTfu.setStatusAvis(StatusAvis.GENERATION_AUTORISE);
impositionsTfu =impositionsTfuRepository.save(impositionsTfu);
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
} }
@Override @Override
public ImpositionsTfuPaylaodWeb updateImpositionsTfu(Long id, ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws NotFoundException { public ImpositionsTfu updateImpositionsTfu(Long id, ImpositionsTfu impositionsTfu) throws NotFoundException {
// if (impositionsTfu.getId() == null) { if (impositionsTfu.getId() == null) {
// throw new BadRequestException("Impossible de mettre à jour une nouvelle unité de logement ayant un id null."); throw new BadRequestException("Impossible de mettre à jour une nouvelle unité de logement ayant un id null.");
// } }
// if (!impositionsTfuRepository.existsById(impositionsTfu.getId())) { if (!impositionsTfuRepository.existsById(impositionsTfu.getId())) {
// throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données."); throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données.");
// } }
return null; // impositionsTfuRepository.save(impositionsTfu); return impositionsTfuRepository.save(impositionsTfu);
} }
@Override @Override
public void deleteImpositionsTfu(Long id) throws NotFoundException { public void deleteImpositionsTfu(Long id) throws NotFoundException {
Optional<ImpositionsTfu> impositionsTfuOptional = impositionsTfuRepository.findById(id); Optional<ImpositionsTfu> impositionsTfuOptional = impositionsTfuRepository.findById(id);
if (impositionsTfuOptional.isPresent()) { if (impositionsTfuOptional.isPresent()) {
if(!impositionsTfuOptional.get().getStatusAvis().equals(StatusAvis.EN_COURS)){
throw new NotFoundException("L'état actuel : "+impositionsTfuOptional.get().getStatusAvis()+ " ne permet pas de supprimer");
}
impositionsTfuRepository.deleteById(impositionsTfuOptional.get().getId()); impositionsTfuRepository.deleteById(impositionsTfuOptional.get().getId());
} else { } else {
throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données."); throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données.");
@@ -167,22 +94,11 @@ public class ImpositionsTfuServiceImpl implements ImpositionsTfuService {
@Override @Override
public Optional<ImpositionsTfuPaylaodWeb> getImpositionsTfuById(Long id) { public Optional<ImpositionsTfu> getImpositionsTfuById(Long id) {
if (impositionsTfuRepository.existsById(id)) { if (impositionsTfuRepository.existsById(id)) {
return impositionsTfuRepository.findByIdToDto(id); return impositionsTfuRepository.findById(id);
} else { } else {
throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans la base de données."); throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans la base de données.");
} }
} }
@Override
public List<ImpositionsTfuPaylaodWeb> getImpositionsTfuByUserIdIds(Long userId) {
System.out.println(userId);
List<Structure> structures = structureService.getListStructureUserId(userId);
List<Long> structureIds = structures.stream()
.map(Structure::getId)
.toList();
System.out.println(structureIds.get(0));
return impositionsTfuRepository.findByStructureIdsToDto(structureIds);
}
} }

View File

@@ -5,10 +5,7 @@ import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.rfu.metier.UniteLogementService; import io.gmss.fiscad.interfaces.rfu.metier.UniteLogementService;
import io.gmss.fiscad.paylaods.request.crudweb.UniteLogementPaylaodWeb; import io.gmss.fiscad.paylaods.request.crudweb.UniteLogementPaylaodWeb;
import io.gmss.fiscad.persistence.repositories.rfu.metier.BatimentRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.UniteLogementRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.UniteLogementRepository;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuNonBatiRepository;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.CategorieBatimentRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService; import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@@ -23,8 +20,6 @@ public class UniteLogementServiceImpl implements UniteLogementService {
private final UniteLogementRepository uniteLogementRepository; private final UniteLogementRepository uniteLogementRepository;
private final EntityFromPayLoadService entityFromPayLoadService; private final EntityFromPayLoadService entityFromPayLoadService;
private final BatimentRepository batimentRepository;
private final CategorieBatimentRepository categorieBatimentRepository;
@@ -33,21 +28,6 @@ public class UniteLogementServiceImpl implements UniteLogementService {
if (uniteLogementPaylaodWeb.getId() != null) { if (uniteLogementPaylaodWeb.getId() != null) {
throw new BadRequestException("Impossible de créer une nouvelle unité de logement ayant un id non null."); throw new BadRequestException("Impossible de créer une nouvelle unité de logement ayant un id non null.");
} }
if (uniteLogementPaylaodWeb.getBatimentId() == null) {
throw new BadRequestException("Impossible de créer l'unité de logement: Le batiment doit être précisé.");
}else {
if(!batimentRepository.existsById(uniteLogementPaylaodWeb.getBatimentId()))
throw new BadRequestException("Impossible de créer l'unite de logement: L'unité de logement doit être précisée.");
}
if (uniteLogementPaylaodWeb.getCategorieBatimentId() == null) {
throw new BadRequestException("Impossible de créer l'unite de logement: La catégorie doit être précisée.");
}else {
if(!categorieBatimentRepository.existsById(uniteLogementPaylaodWeb.getCategorieBatimentId()))
throw new BadRequestException("Impossible de créer l'unite de logement: La catégorie doit être précisée.");
}
UniteLogement uniteLogement = entityFromPayLoadService.getUniteLogementFromPayLoadWeb(uniteLogementPaylaodWeb); UniteLogement uniteLogement = entityFromPayLoadService.getUniteLogementFromPayLoadWeb(uniteLogementPaylaodWeb);
uniteLogement = uniteLogementRepository.save(uniteLogement); uniteLogement = uniteLogementRepository.save(uniteLogement);
return uniteLogementRepository.findUniteLogementAvecOccupantCourantToDto(uniteLogement.getId()).orElse(null); return uniteLogementRepository.findUniteLogementAvecOccupantCourantToDto(uniteLogement.getId()).orElse(null);
@@ -106,19 +86,4 @@ public class UniteLogementServiceImpl implements UniteLogementService {
public List<UniteLogementPaylaodWeb> getUniteLogementListByBatiment(Long batimentId) { public List<UniteLogementPaylaodWeb> getUniteLogementListByBatiment(Long batimentId) {
return uniteLogementRepository.findUnitesLogementAvecOccupantCourantByBatimentToDto(batimentId); return uniteLogementRepository.findUnitesLogementAvecOccupantCourantByBatimentToDto(batimentId);
} }
@Override
public List<UniteLogementPaylaodWeb> getUniteLogementListByParcelle(Long parcelleId) {
return uniteLogementRepository.findAllUnitesLogementAvecOccupantCourantByParcelleToDto(parcelleId);
}
@Override
public Page<UniteLogementPaylaodWeb> getUniteLogementListByQuartierPageable(Long quartierId, Pageable pageable) {
return uniteLogementRepository.findUnitesLogementAvecOccupantCourantByQuartierToDtoPageable(quartierId,pageable);
}
@Override
public List<UniteLogementPaylaodWeb> getUniteLogementListByQuartier(Long quartierId) {
return uniteLogementRepository.findUnitesLogementAvecOccupantCourantByQuartierToDto(quartierId);
}
} }

View File

@@ -1,92 +0,0 @@
package io.gmss.fiscad.implementations.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuBatiService;
import io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@AllArgsConstructor
@Service
public class BaremRfuBatiServiceImpl implements BaremRfuBatiService {
private final BaremRfuRepository baremRfuRepository;
private final EntityFromPayLoadService entityFromPayLoadService;
@Override
public BaremRfuBatiPayloadWeb createBaremRfu(BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) throws BadRequestException {
if (baremRfuBatiPayloadWeb.getId() != null) {
throw new BadRequestException("Impossible de créer un nouvel bareme rfu ayant un id non null.");
}
BaremRfuBati baremRfuBati = entityFromPayLoadService.getBaremRfuBatiFromPayLoadWeb(baremRfuBatiPayloadWeb);
baremRfuBati = baremRfuRepository.save(baremRfuBati);
return baremRfuRepository.findByBaremRfuBatieId(baremRfuBati.getId()).orElse(null);
}
@Override
public BaremRfuBatiPayloadWeb updateBaremRfu(Long id, BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) throws NotFoundException {
if (baremRfuBatiPayloadWeb.getId() == null) {
throw new BadRequestException("Impossible de mettre à jour une nouvel bareme rfu ayant un id null.");
}
if (!baremRfuRepository.existsById(baremRfuBatiPayloadWeb.getId())) {
throw new NotFoundException("Impossible de trouver le bareme spécifiée dans notre base de données.");
}
BaremRfuBati baremRfuBati = entityFromPayLoadService.getBaremRfuBatiFromPayLoadWeb(baremRfuBatiPayloadWeb);
baremRfuBati = baremRfuRepository.save(baremRfuBati);
return baremRfuRepository.findByBaremRfuBatieId(baremRfuBati.getId()).orElse(null);
}
@Override
public void deleteBaremRfu(Long id) throws NotFoundException {
Optional<BaremRfuBati> baremRfuOptional = baremRfuRepository.findById(id);
if (baremRfuOptional.isPresent()) {
baremRfuRepository.deleteById(baremRfuOptional.get().getId());
} else {
throw new NotFoundException("Impossible de trouver le Bareme spécifié dans notre base de données.");
}
}
@Override
public Page<BaremRfuBatiPayloadWeb> getBaremRfuList(Pageable pageable) {
return baremRfuRepository.findAllPayloadPaged(pageable);
}
@Override
public List<BaremRfuBatiPayloadWeb> getBaremRfuList() {
return baremRfuRepository.findAllPayload();
}
@Override
public List<BaremRfuBatiPayloadWeb> getBaremRfuByCategorieBatiment(Long idCategorieBatiment) {
return baremRfuRepository.findByCategorieBatiment(idCategorieBatiment);
}
@Override
public List<BaremRfuBatiPayloadWeb> getBaremRfuByArrondissement(Long idArrondissement) {
return baremRfuRepository.findByArrondissementId(idArrondissement);
}
@Override
public List<BaremRfuBatiPayloadWeb> getBaremRfuByArrondissementAndCategorieBatiment(Long IdArrondissement, Long IdCategorieBatiment) {
return baremRfuRepository.findByArrondissementAndCategorieBatiment(IdArrondissement,IdCategorieBatiment);
}
@Override
public List<BaremRfuBatiPayloadWeb> getBaremRfuByQuartierAndCategorieBatiment(Long idQuartier, Long IdCategorieBatiment) {
return baremRfuRepository.findByQuartierAndCategorieBatiment(idQuartier,IdCategorieBatiment);
}
@Override
public BaremRfuBatiPayloadWeb getBaremRfuById(Long id) {
return baremRfuRepository.findByBaremRfuBatieId(id).orElse(null);
}
}

View File

@@ -4,42 +4,38 @@ import io.gmss.fiscad.entities.rfu.parametre.BaremRfuNonBati;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuNonBatiService; import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuNonBatiService;
import io.gmss.fiscad.paylaods.request.crudweb.BaremRfuNonBatiPayloadWeb;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuNonBatiRepository; import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuNonBatiRepository;
import io.gmss.fiscad.service.EntityFromPayLoadService;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@AllArgsConstructor
@Service @Service
public class BaremRfuNonBatiServiceImpl implements BaremRfuNonBatiService { public class BaremRfuNonBatiServiceImpl implements BaremRfuNonBatiService {
private final BaremRfuNonBatiRepository baremRfuNonBatiRepository; private final BaremRfuNonBatiRepository baremRfuNonBatiRepository;
private final EntityFromPayLoadService entityFromPayLoadService;
public BaremRfuNonBatiServiceImpl(BaremRfuNonBatiRepository baremRfuNonBatiRepository) {
this.baremRfuNonBatiRepository = baremRfuNonBatiRepository;
}
@Override @Override
public BaremRfuNonBatiPayloadWeb createBaremRfuNonBati(BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) throws BadRequestException { public BaremRfuNonBati createBaremRfuNonBati(BaremRfuNonBati baremRfuNonBati) throws BadRequestException {
if (baremRfuNonBatiPayloadWeb.getId() != null) { if (baremRfuNonBati.getId() != null) {
throw new BadRequestException("Impossible de créer une nouvelle campgne ayant un id non null."); throw new BadRequestException("Impossible de créer une nouvelle campgne ayant un id non null.");
} }
BaremRfuNonBati baremRfuNonBati= entityFromPayLoadService.getBaremRfuNonBatiFromPayLoadWeb(baremRfuNonBatiPayloadWeb); return baremRfuNonBatiRepository.save(baremRfuNonBati);
baremRfuNonBati=baremRfuNonBatiRepository.save(baremRfuNonBati);
return baremRfuNonBatiRepository.findByIdToDto(baremRfuNonBati.getId()).orElse(null);
} }
@Override @Override
public BaremRfuNonBatiPayloadWeb updateBaremRfuNonBati(Long id, BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) throws NotFoundException { public BaremRfuNonBati updateBaremRfuNonBati(Long id, BaremRfuNonBati baremRfuNonBati) throws NotFoundException {
if (baremRfuNonBatiPayloadWeb.getId() == null) { if (baremRfuNonBati.getId() == null) {
throw new BadRequestException("Impossible de mettre à jour une nouvelle baremRfuNonBati ayant un id null."); throw new BadRequestException("Impossible de mettre à jour une nouvelle baremRfuNonBati ayant un id null.");
} }
if (!baremRfuNonBatiRepository.existsById(baremRfuNonBatiPayloadWeb.getId())) { if (!baremRfuNonBatiRepository.existsById(baremRfuNonBati.getId())) {
throw new NotFoundException("Impossible de trouver la baremRfuNonBati spécifiée dans notre base de données."); throw new NotFoundException("Impossible de trouver la baremRfuNonBati spécifiée dans notre base de données.");
} }
BaremRfuNonBati baremRfuNonBati= entityFromPayLoadService.getBaremRfuNonBatiFromPayLoadWeb(baremRfuNonBatiPayloadWeb); return baremRfuNonBatiRepository.save(baremRfuNonBati);
baremRfuNonBati=baremRfuNonBatiRepository.save(baremRfuNonBati);
return baremRfuNonBatiRepository.findByIdToDto(baremRfuNonBati.getId()).orElse(null);
} }
@Override @Override
@@ -52,27 +48,20 @@ public class BaremRfuNonBatiServiceImpl implements BaremRfuNonBatiService {
} }
} }
@Override @Override
public Page<BaremRfuNonBatiPayloadWeb> getBaremRfuNonBatiList(Pageable pageable) { public Page<BaremRfuNonBati> getBaremRfuNonBatiList(Pageable pageable) {
return baremRfuNonBatiRepository.findAllPayloadToDtoPaged(pageable); return baremRfuNonBatiRepository.findAll(pageable);
} }
@Override @Override
public List<BaremRfuNonBatiPayloadWeb> getBaremRfuNonBatiList() { public List<BaremRfuNonBati> getBaremRfuNonBatiList() {
return baremRfuNonBatiRepository.findAllPayloadToDto(); return baremRfuNonBatiRepository.findAll();
} }
@Override @Override
public Optional<BaremRfuNonBatiPayloadWeb> getBaremRfuNonBatiById(Long id) { public Optional<BaremRfuNonBati> getBaremRfuNonBatiById(Long id) {
return baremRfuNonBatiRepository.findByIdToDto(id); return baremRfuNonBatiRepository.findById(id);
} }
@Override
public Optional<BaremRfuNonBatiPayloadWeb> getBaremRfuNonBatiByCommuneAndZoneId(Long communeId,Long zoneId) {
return baremRfuNonBatiRepository.findByCommuneAndZoneToDto(communeId,zoneId);
}
} }

View File

@@ -0,0 +1,70 @@
package io.gmss.fiscad.implementations.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuService;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuRepository;
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;
@Service
public class BaremRfuServiceImpl implements BaremRfuService {
private final BaremRfuRepository baremRfuRepository;
public BaremRfuServiceImpl(BaremRfuRepository baremRfuRepository) {
this.baremRfuRepository = baremRfuRepository;
}
@Override
public BaremRfuBati createBaremRfu(BaremRfuBati baremRfuBati) throws BadRequestException {
if (baremRfuBati.getId() != null) {
throw new BadRequestException("Impossible de créer un nouvel bareme rfu ayant un id non null.");
}
return baremRfuRepository.save(baremRfuBati);
}
@Override
public BaremRfuBati updateBaremRfu(Long id, BaremRfuBati baremRfuBati) throws NotFoundException {
if (baremRfuBati.getId() == null) {
throw new BadRequestException("Impossible de mettre à jour une nouvel bareme rfu ayant un id null.");
}
if (!baremRfuRepository.existsById(baremRfuBati.getId())) {
throw new NotFoundException("Impossible de trouver le bareme spécifiée dans notre base de données.");
}
return baremRfuRepository.save(baremRfuBati);
}
@Override
public void deleteBaremRfu(Long id) throws NotFoundException {
Optional<BaremRfuBati> baremRfuOptional = baremRfuRepository.findById(id);
if (baremRfuOptional.isPresent()) {
baremRfuRepository.deleteById(baremRfuOptional.get().getId());
} else {
throw new NotFoundException("Impossible de trouver le Bareme spécifié dans notre base de données.");
}
}
@Override
public Page<BaremRfuBati> getBaremRfuList(Pageable pageable) {
return baremRfuRepository.findAll(pageable);
}
@Override
public List<BaremRfuBati> getBaremRfuList() {
return baremRfuRepository.findAll();
}
@Override
public List<BaremRfuBati> getBaremRfuByType(Long idCategorieBatiment) {
return baremRfuRepository.findAllByCategorieBatiment_Id(idCategorieBatiment);
}
@Override
public Optional<BaremRfuBati> getBaremRfuById(Long id) {
return baremRfuRepository.findById(id);
}
}

View File

@@ -1,67 +0,0 @@
package io.gmss.fiscad.implementations.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.Usage;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.interfaces.rfu.parametre.UsageService;
import io.gmss.fiscad.persistence.repositories.rfu.parametre.UsageRepository;
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;
@Service
public class UsageServiceImpl implements UsageService {
private final UsageRepository usageRepository;
public UsageServiceImpl(UsageRepository usageRepository) {
this.usageRepository = usageRepository;
}
@Override
public Usage createUsage(Usage usage) throws BadRequestException {
if (usage.getId() != null) {
throw new BadRequestException("Impossible de créer une nouvelle campgne ayant un id non null.");
}
return usageRepository.save(usage);
}
@Override
public Usage updateUsage(Long id, Usage usage) throws NotFoundException {
if (usage.getId() == null) {
throw new BadRequestException("Impossible de mettre à jour une nouvelle usage ayant un id null.");
}
if (!usageRepository.existsById(usage.getId())) {
throw new NotFoundException("Impossible de trouver la usage spécifiée dans notre base de données.");
}
return usageRepository.save(usage);
}
@Override
public void deleteUsage(Long id) throws NotFoundException {
Optional<Usage> usageOptional = usageRepository.findById(id);
if (usageOptional.isPresent()) {
usageRepository.deleteById(usageOptional.get().getId());
} else {
throw new NotFoundException("Impossible de trouver la usage spécifiée dans notre base de données.");
}
}
@Override
public Page<Usage> getUsageList(Pageable pageable) {
return usageRepository.findAll(pageable);
}
@Override
public List<Usage> getUsageList() {
return usageRepository.findAll();
}
@Override
public Optional<Usage> getUsageById(Long id) {
return usageRepository.findById(id);
}
}

View File

@@ -1,23 +1,14 @@
package io.gmss.fiscad.implementations.statistiques; package io.gmss.fiscad.implementations.statistiques;
import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.entities.user.User; import io.gmss.fiscad.entities.user.User;
import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.interfaces.decoupage.SecteurService;
import io.gmss.fiscad.interfaces.statistique.StatistiquesService; import io.gmss.fiscad.interfaces.statistique.StatistiquesService;
import io.gmss.fiscad.interfaces.user.UserService; import io.gmss.fiscad.interfaces.user.UserService;
import io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb;
import io.gmss.fiscad.paylaods.response.statistique.*; import io.gmss.fiscad.paylaods.response.statistique.*;
import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository; import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository;
import io.gmss.fiscad.persistence.repositories.infocad.metier.ParcelleRepository; 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.PersonneRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.BatimentRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.BatimentRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository;
import io.gmss.fiscad.persistence.repositories.rfu.metier.UniteLogementRepository; import io.gmss.fiscad.persistence.repositories.rfu.metier.UniteLogementRepository;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -34,20 +25,14 @@ public class StatistiquesServiceImpl implements StatistiquesService {
private final BatimentRepository batimentRepository; private final BatimentRepository batimentRepository;
private final UniteLogementRepository uniteLogementRepository; private final UniteLogementRepository uniteLogementRepository;
private final PersonneRepository personneRepository; private final PersonneRepository personneRepository;
private final SecteurService secteurService;
private final EnqueteBatimentRepository enqueteBatimentRepository;
private final EnqueteUniteLogementRepository enqueteUniteLogementRepository;
public StatistiquesServiceImpl(UserService userService, EnqueteRepository enqueteRepository, ParcelleRepository parcelleRepository, BatimentRepository batimentRepository, UniteLogementRepository uniteLogementRepository, PersonneRepository personneRepository, SecteurService secteurService, EnqueteBatimentRepository enqueteBatimentRepository, EnqueteUniteLogementRepository enqueteUniteLogementRepository) { public StatistiquesServiceImpl(UserService userService, EnqueteRepository enqueteRepository, ParcelleRepository parcelleRepository, BatimentRepository batimentRepository, UniteLogementRepository uniteLogementRepository, PersonneRepository personneRepository) {
this.userService = userService; this.userService = userService;
this.enqueteRepository = enqueteRepository; this.enqueteRepository = enqueteRepository;
this.parcelleRepository = parcelleRepository; this.parcelleRepository = parcelleRepository;
this.batimentRepository = batimentRepository; this.batimentRepository = batimentRepository;
this.uniteLogementRepository = uniteLogementRepository; this.uniteLogementRepository = uniteLogementRepository;
this.personneRepository = personneRepository; this.personneRepository = personneRepository;
this.secteurService = secteurService;
this.enqueteBatimentRepository = enqueteBatimentRepository;
this.enqueteUniteLogementRepository = enqueteUniteLogementRepository;
} }
@@ -113,20 +98,4 @@ public class StatistiquesServiceImpl implements StatistiquesService {
public List<StatistiqueTypeNombreResponse> getStatNombrePersonneParCategorie() { public List<StatistiqueTypeNombreResponse> getStatNombrePersonneParCategorie() {
return personneRepository.getNombrePersonnesResponse(); return personneRepository.getNombrePersonnesResponse();
} }
@Override
public NombreEnquetesParObjet getStatNombreEnqueteParObjetUserConnect(Long userId, String statutEnquete) {
NombreEnquetesParObjet nombreEnquetesParObjet= new NombreEnquetesParObjet();
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
List<Long> secteurIds = secteurs.stream()
.map(Secteur::getId)
.toList();
nombreEnquetesParObjet.setNombreEnqueteUniteLogement(enqueteUniteLogementRepository.getNombreEnqueteUniteLogementByUserConnecte(secteurIds,statutEnquete));
nombreEnquetesParObjet.setNombreEnqueteParcelle(enqueteRepository.getNombreEnqueteByUserConnecte(secteurIds,statutEnquete));
nombreEnquetesParObjet.setNombreEnqueteBatiment(enqueteBatimentRepository.getNombreEnqueteBatimentByUserConnecte(secteurIds,statutEnquete));
return nombreEnquetesParObjet;
}
} }

View File

@@ -1,11 +1,11 @@
package io.gmss.fiscad.interfaces.decoupage; package io.gmss.fiscad.interfaces.decoupage;
import io.gmss.fiscad.entities.decoupage.SecteurDecoupage; import io.gmss.fiscad.entities.decoupage.SecteurDecoupage;
import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.SecteurDecoupagePaylaodWeb; import io.gmss.fiscad.paylaods.request.crudweb.SecteurDecoupagePaylaodWeb;
import io.gmss.fiscad.paylaods.response.statistique.ParcelleStatsProjectionUnSecteur; import io.gmss.fiscad.paylaods.request.crudweb.SecteurPaylaodWeb;
import io.gmss.fiscad.paylaods.response.restoration.ParcelleStatsProjectionUnSecteur;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -33,7 +33,4 @@ public interface SecteurDecoupageService {
List<ParcelleStatsProjectionUnSecteur> getStatParcelleDecoupageUnSecteur(Long secteurId) ; List<ParcelleStatsProjectionUnSecteur> getStatParcelleDecoupageUnSecteur(Long secteurId) ;
List<ParcelleStatsProjectionUnSecteur> getStatParcelleDecoupageByUserId(Long userId) ; List<ParcelleStatsProjectionUnSecteur> getStatParcelleDecoupageByUserId(Long userId) ;
List<ParcelleStatsProjectionUnSecteur> getStatEnqueteDecoupageByUserId(Long userId, String statutEnquete) ;
List<ParcelleStatsProjectionUnSecteur> getStatEnqueteBatimentDecoupageByUserId(Long userId, String statutEnquete) ;
List<ParcelleStatsProjectionUnSecteur> getStatEnqueteUniteLogementDecoupageByUserId(Long userId, String statutEnquete) ;
} }

View File

@@ -4,6 +4,8 @@ import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.SecteurPaylaodWeb; import io.gmss.fiscad.paylaods.request.crudweb.SecteurPaylaodWeb;
import io.gmss.fiscad.paylaods.request.synchronisation.SecteurPayload;
import io.gmss.fiscad.paylaods.response.restoration.ParcelleStatsProjectionUnSecteur;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -30,5 +32,4 @@ public interface SecteurService {
Optional<SecteurPaylaodWeb> getSecteurById(Long id); Optional<SecteurPaylaodWeb> getSecteurById(Long id);
List<Secteur> getListSecteurUserId(Long userId) ; List<Secteur> getListSecteurUserId(Long userId) ;
List<Secteur> getListSecteurByDepartementId(Long departementId) ;
} }

View File

@@ -2,13 +2,11 @@ package io.gmss.fiscad.interfaces.infocad.metier;
import io.gmss.fiscad.entities.infocad.metier.Enquete; import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.infocad.metier.EnqueteFiltreResponse; import io.gmss.fiscad.entities.infocad.metier.EnqueteFiltreResponse;
import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad; import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad;
import io.gmss.fiscad.paylaods.request.FiltreEnquetePayLoad; import io.gmss.fiscad.paylaods.request.FiltreEnquetePayLoad;
import io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb; import io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb;
import io.gmss.fiscad.paylaods.request.crudweb.ParcellePayLoadWeb;
import io.gmss.fiscad.paylaods.response.synchronisation.EnqueteNonSyncResponse; import io.gmss.fiscad.paylaods.response.synchronisation.EnqueteNonSyncResponse;
import io.gmss.fiscad.paylaods.response.EnqueteResponse; import io.gmss.fiscad.paylaods.response.EnqueteResponse;
import io.gmss.fiscad.paylaods.response.FicheResponse.FicheEnqueteResponse; import io.gmss.fiscad.paylaods.response.FicheResponse.FicheEnqueteResponse;
@@ -40,13 +38,13 @@ public interface EnqueteService {
Optional<EnquetePayLoadWeb> getEnqueteById(Long id); Optional<EnquetePayLoadWeb> getEnqueteById(Long id);
EnquetePayLoadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad); Enquete validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
EnquetePayLoadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad); Enquete rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
List<EnquetePayLoadWeb> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads); List<Enquete> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
List<EnquetePayLoadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads); List<Enquete> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
Enquete finaliserEnquete(Long enqueteId); Enquete finaliserEnquete(Long enqueteId);
@@ -60,10 +58,5 @@ public interface EnqueteService {
public List<EnqueteNonSyncResponse> getEnqueteValideNonSynch(Long terminalId); public List<EnqueteNonSyncResponse> getEnqueteValideNonSynch(Long terminalId);
int cloturerEnqueteParcelleBatimentUniteLogementByStructureIdAndExerciceId(Long strucutreId,Long exerciceId);
int cloturerEnqueteParcelleBatimentUniteLogementByUserIdAndExerciceId(Long userId,Long exerciceId);
Page<EnquetePayLoadWeb> getEnqueteListByQuartierByStatutPageableToDto(Long userId, Long quartierId, StatutEnquete statutEnquete, Pageable pageable);
} }

View File

@@ -6,7 +6,6 @@ import io.gmss.fiscad.entities.infocad.metier.ParcelleGeom;
import io.gmss.fiscad.entities.infocad.metier.Upload; import io.gmss.fiscad.entities.infocad.metier.Upload;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.ParcelleGeomPaylaodWeb;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@@ -16,15 +15,12 @@ import java.util.Optional;
public interface ParcelleGeomService { public interface ParcelleGeomService {
int createParcelleFromGeoJsonFile(MultipartFile file,String reference,String description) throws BadRequestException; int createParcelleFromGeoJsonFile(MultipartFile file,String reference,String description) throws BadRequestException;
int createParcelleGeomFromGeoJsonApi() throws BadRequestException;
ParcelleGeom createOnParcelleFromGeoJson(JsonNode jsonNode, Upload upload) throws BadRequestException; ParcelleGeom createOnParcelleFromGeoJson(JsonNode jsonNode, Upload upload) throws BadRequestException;
ParcelleGeom updateParcelleGeom(MultipartFile file) throws NotFoundException; ParcelleGeom updateParcelleGeom(MultipartFile file) throws NotFoundException;
void deleteParcelle(Long id) throws NotFoundException; void deleteParcelle(Long id) throws NotFoundException;
Page<ParcelleGeom> getParcelleGeomList(Pageable pageable); Page<ParcelleGeom> getParcelleGeomList(Pageable pageable);
List<ParcelleGeom> getParcelleGeomList(); List<ParcelleGeom> getParcelleGeomList();
List<ParcelleGeom> getParcelleGeomListUnQuatier(String codeQuartier); List<ParcelleGeom> getParcelleGeomListUnQuatier(String codeQuartier);
List<ParcelleGeomPaylaodWeb> getParcelleGeomListByQuatierId(Long quartierId);
Page<ParcelleGeomPaylaodWeb> getParcelleGeomListByQuatierIdPaged(Long quartierId,Pageable pageable);
public List<ParcelleGeom> getParcelleGeomListUnArrondissement(String codeArrondissement); public List<ParcelleGeom> getParcelleGeomListUnArrondissement(String codeArrondissement);
Optional<ParcelleGeom> getParcelleGeomById(Long id); Optional<ParcelleGeom> getParcelleGeomById(Long id);

View File

@@ -4,7 +4,10 @@ import io.gmss.fiscad.entities.infocad.metier.Parcelle;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.FiltreParcelle; import io.gmss.fiscad.paylaods.FiltreParcelle;
import io.gmss.fiscad.paylaods.request.FiltreParcellePayLoad;
import io.gmss.fiscad.paylaods.request.crudweb.ParcellePayLoadWeb; import io.gmss.fiscad.paylaods.request.crudweb.ParcellePayLoadWeb;
import io.gmss.fiscad.paylaods.response.dataTableResponse.ParcelleDataTableResponse;
import io.gmss.fiscad.paylaods.response.restoration.ParcelleStatsProjectionUnSecteur;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -14,9 +17,9 @@ import java.util.Optional;
public interface ParcelleService { public interface ParcelleService {
ParcellePayLoadWeb createParcelle(ParcellePayLoadWeb parcellePayLoadWeb) throws BadRequestException; Parcelle createParcelle(ParcellePayLoadWeb parcellePayLoadWeb) throws BadRequestException;
ParcellePayLoadWeb updateParcelle(Long id,ParcellePayLoadWeb parcellePayLoadWeb) throws NotFoundException; Parcelle updateParcelle(Long id,ParcellePayLoadWeb parcellePayLoadWeb) throws NotFoundException;
void deleteParcelle(Long id) throws NotFoundException; void deleteParcelle(Long id) throws NotFoundException;
Optional<Parcelle> getParcelleById(Long id); Optional<Parcelle> getParcelleById(Long id);
@@ -32,5 +35,4 @@ public interface ParcelleService {
Page<ParcellePayLoadWeb> getParcelleListByRuePageableToDto(Long userId,Long rueId,Pageable pageable); Page<ParcellePayLoadWeb> getParcelleListByRuePageableToDto(Long userId,Long rueId,Pageable pageable);
Page<ParcellePayLoadWeb> getParcelleByMultiFiltre(Long userId, FiltreParcelle filtreParcelle, Pageable pageable); Page<ParcellePayLoadWeb> getParcelleByMultiFiltre(Long userId, FiltreParcelle filtreParcelle, Pageable pageable);
Integer majParcelleBatieNonbatie();
} }

View File

@@ -1,8 +1,6 @@
package io.gmss.fiscad.interfaces.infocad.parametre; package io.gmss.fiscad.interfaces.infocad.parametre;
import io.gmss.fiscad.entities.decoupage.Secteur;
import io.gmss.fiscad.entities.infocad.parametre.Structure; import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.entities.user.AvoirFonction;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.StructurePaylaodWeb; import io.gmss.fiscad.paylaods.request.crudweb.StructurePaylaodWeb;
@@ -10,8 +8,6 @@ import io.gmss.fiscad.paylaods.response.StructureResponse;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@@ -35,6 +31,4 @@ public interface StructureService {
//List<StructureResponse> getStructuresByArrondissement(Long arrondissementID); //List<StructureResponse> getStructuresByArrondissement(Long arrondissementID);
public List<Structure> getListStructureUserId(Long userId) ;
} }

View File

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

View File

@@ -4,8 +4,6 @@ import io.gmss.fiscad.entities.rfu.metier.DonneesImpositionTfu;
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu; import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb;
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -13,6 +11,8 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
public interface DonneesImpositionTfuService { public interface DonneesImpositionTfuService {
DonneesImpositionTfu createDonneesImpositionTfu(DonneesImpositionTfu donneesImpositionTfu) throws BadRequestException; DonneesImpositionTfu createDonneesImpositionTfu(DonneesImpositionTfu donneesImpositionTfu) throws BadRequestException;
DonneesImpositionTfu updateDonneesImpositionTfu(Long id, DonneesImpositionTfu donneesImpositionTfu) throws NotFoundException; DonneesImpositionTfu updateDonneesImpositionTfu(Long id, DonneesImpositionTfu donneesImpositionTfu) throws NotFoundException;
@@ -25,27 +25,7 @@ public interface DonneesImpositionTfuService {
Optional<DonneesImpositionTfu> getDonneesImpositionTfuById(Long id); Optional<DonneesImpositionTfu> getDonneesImpositionTfuById(Long id);
ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleBatie(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb,Long userId); Long genererDonneesFiscales(ImpositionsTfu impositionsTfu);
ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleNonBatie(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb,Long userId); List<DonneesImpositionTfu> 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> getDonneesFiscalesByImpositionTfuIdNonBatiePageable(Long impositionsTfuId, Pageable pageable);
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdBatieBatimentPageable(Long impositionsTfuId, Pageable pageable);
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable);
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionIrfIdBatieBatimentPageable(Long impositionsTfuId, Pageable pageable);
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionIrfIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable);
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionSrtbIdBatieBatimentPageable(Long impositionsTfuId, Pageable pageable);
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionSrtbIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable);
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureIdPageable(Long exerciceId, Long structureId, Pageable pageable);
List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureId(Long exerciceId, Long structureId,Long quartierId);
List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByPersonneId(Long personneId);
} }

View File

@@ -1,12 +1,9 @@
package io.gmss.fiscad.interfaces.rfu.metier; package io.gmss.fiscad.interfaces.rfu.metier;
import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment; import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment;
import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad;
import io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb; import io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb;
import io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -29,15 +26,4 @@ public interface EnqueteBatimentService {
Page<EnqueteBatimentPayloadWeb> getEnqueteBatimentByBatimentListPageable(Long batimentId, Pageable pageable); Page<EnqueteBatimentPayloadWeb> getEnqueteBatimentByBatimentListPageable(Long batimentId, Pageable pageable);
List<EnqueteBatimentPayloadWeb> getEnqueteBatimentByBatimentList(Long batimentId); List<EnqueteBatimentPayloadWeb> getEnqueteBatimentByBatimentList(Long batimentId);
Page<EnqueteBatimentPayloadWeb> getEnqueteBatimentListByQuartierByStatutPageableToDto(Long userId, Long quartierId, StatutEnquete statutEnquete, Pageable pageable);
EnqueteBatimentPayloadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
EnqueteBatimentPayloadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
List<EnqueteBatimentPayloadWeb> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
List<EnqueteBatimentPayloadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
} }

View File

@@ -1,11 +1,8 @@
package io.gmss.fiscad.interfaces.rfu.metier; package io.gmss.fiscad.interfaces.rfu.metier;
import io.gmss.fiscad.entities.rfu.metier.EnqueteUniteLogement; import io.gmss.fiscad.entities.rfu.metier.EnqueteUniteLogement;
import io.gmss.fiscad.enums.StatutEnquete;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad;
import io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb;
import io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb; import io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -30,14 +27,4 @@ public interface EnqueteUniteLogementService {
List<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementUniteLogementList(Long uniteLogementId); List<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementUniteLogementList(Long uniteLogementId);
Optional<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementById(Long enqueteUniteLogement); Optional<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementById(Long enqueteUniteLogement);
Page<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementListByQuartierByStatutPageableToDto(Long userId, Long quartierId, StatutEnquete statutEnquete, Pageable pageable);
EnqueteUniteLogementPayloadWeb validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
EnqueteUniteLogementPayloadWeb rejeterEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
List<EnqueteUniteLogementPayloadWeb> validerEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
List<EnqueteUniteLogementPayloadWeb> rejeterEnquete(List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads);
} }

View File

@@ -3,7 +3,6 @@ package io.gmss.fiscad.interfaces.rfu.metier;
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu; import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -12,12 +11,11 @@ import java.util.Optional;
public interface ImpositionsTfuService { public interface ImpositionsTfuService {
ImpositionsTfuPaylaodWeb createImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException; ImpositionsTfu createImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException;
ImpositionsTfuPaylaodWeb rejeterImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException; ImpositionsTfu annulerImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException;
ImpositionsTfuPaylaodWeb cloturerImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException; ImpositionsTfu validerImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException;
ImpositionsTfuPaylaodWeb autoriserGenerationImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException;
ImpositionsTfuPaylaodWeb updateImpositionsTfu(Long id, ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws NotFoundException; ImpositionsTfu updateImpositionsTfu(Long id, ImpositionsTfu impositionsTfu) throws NotFoundException;
void deleteImpositionsTfu(Long id) throws NotFoundException; void deleteImpositionsTfu(Long id) throws NotFoundException;
@@ -25,6 +23,5 @@ public interface ImpositionsTfuService {
List<ImpositionsTfu> getImpositionsTfuList(); List<ImpositionsTfu> getImpositionsTfuList();
Optional<ImpositionsTfuPaylaodWeb> getImpositionsTfuById(Long id); Optional<ImpositionsTfu> getImpositionsTfuById(Long id);
List<ImpositionsTfuPaylaodWeb> getImpositionsTfuByUserIdIds(Long userId);
} }

View File

@@ -28,11 +28,4 @@ public interface UniteLogementService {
Page<UniteLogementPaylaodWeb> getUniteLogementListByBatimentPageable(Long batimentId, Pageable pageable); Page<UniteLogementPaylaodWeb> getUniteLogementListByBatimentPageable(Long batimentId, Pageable pageable);
List<UniteLogementPaylaodWeb> getUniteLogementListByBatiment(Long batimentId); List<UniteLogementPaylaodWeb> getUniteLogementListByBatiment(Long batimentId);
List<UniteLogementPaylaodWeb> getUniteLogementListByParcelle(Long parcelleId);
Page<UniteLogementPaylaodWeb> getUniteLogementListByQuartierPageable(Long quartierId, Pageable pageable);
List<UniteLogementPaylaodWeb> getUniteLogementListByQuartier(Long quartierId);
} }

View File

@@ -1,32 +0,0 @@
package io.gmss.fiscad.interfaces.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Optional;
public interface BaremRfuBatiService {
BaremRfuBatiPayloadWeb createBaremRfu(BaremRfuBatiPayloadWeb baremRfuBati) throws BadRequestException;
BaremRfuBatiPayloadWeb updateBaremRfu(Long id, BaremRfuBatiPayloadWeb baremRfuBati) throws NotFoundException;
void deleteBaremRfu(Long id) throws NotFoundException;
Page<BaremRfuBatiPayloadWeb> getBaremRfuList(Pageable pageable);
List<BaremRfuBatiPayloadWeb> getBaremRfuList();
List<BaremRfuBatiPayloadWeb> getBaremRfuByCategorieBatiment(Long IdCategorieBatiment);
List<BaremRfuBatiPayloadWeb> getBaremRfuByArrondissement(Long IdArrondissement);
List<BaremRfuBatiPayloadWeb> getBaremRfuByArrondissementAndCategorieBatiment(Long IdArrondissement,Long IdCategorieBatiment);
List<BaremRfuBatiPayloadWeb> getBaremRfuByQuartierAndCategorieBatiment(Long idQuartier,Long IdCategorieBatiment);
BaremRfuBatiPayloadWeb getBaremRfuById(Long id);
}

View File

@@ -3,7 +3,6 @@ package io.gmss.fiscad.interfaces.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuNonBati; import io.gmss.fiscad.entities.rfu.parametre.BaremRfuNonBati;
import io.gmss.fiscad.exceptions.BadRequestException; import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException; import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.crudweb.BaremRfuNonBatiPayloadWeb;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@@ -12,18 +11,17 @@ import java.util.Optional;
public interface BaremRfuNonBatiService { public interface BaremRfuNonBatiService {
BaremRfuNonBatiPayloadWeb createBaremRfuNonBati(BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) throws BadRequestException; BaremRfuNonBati createBaremRfuNonBati(BaremRfuNonBati baremRfuNonBati) throws BadRequestException;
BaremRfuNonBatiPayloadWeb updateBaremRfuNonBati(Long id, BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) throws NotFoundException; BaremRfuNonBati updateBaremRfuNonBati(Long id, BaremRfuNonBati baremRfuNonBati) throws NotFoundException;
void deleteBaremRfuNonBati(Long id) throws NotFoundException; void deleteBaremRfuNonBati(Long id) throws NotFoundException;
Page<BaremRfuNonBatiPayloadWeb> getBaremRfuNonBatiList(Pageable pageable); Page<BaremRfuNonBati> getBaremRfuNonBatiList(Pageable pageable);
List<BaremRfuNonBatiPayloadWeb> getBaremRfuNonBatiList(); List<BaremRfuNonBati> getBaremRfuNonBatiList();
Optional<BaremRfuNonBatiPayloadWeb> getBaremRfuNonBatiById(Long id); Optional<BaremRfuNonBati> getBaremRfuNonBatiById(Long id);
Optional<BaremRfuNonBatiPayloadWeb> getBaremRfuNonBatiByCommuneAndZoneId(Long communeId,Long zoneId);
} }

View File

@@ -0,0 +1,28 @@
package io.gmss.fiscad.interfaces.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Optional;
public interface BaremRfuService {
BaremRfuBati createBaremRfu(BaremRfuBati baremRfuBati) throws BadRequestException;
BaremRfuBati updateBaremRfu(Long id, BaremRfuBati baremRfuBati) throws NotFoundException;
void deleteBaremRfu(Long id) throws NotFoundException;
Page<BaremRfuBati> getBaremRfuList(Pageable pageable);
List<BaremRfuBati> getBaremRfuList();
List<BaremRfuBati> getBaremRfuByType(Long IdCategorieBatiment);
Optional<BaremRfuBati> getBaremRfuById(Long id);
}

View File

@@ -1,27 +0,0 @@
package io.gmss.fiscad.interfaces.rfu.parametre;
import io.gmss.fiscad.entities.rfu.parametre.Usage;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Optional;
public interface UsageService {
Usage createUsage(Usage usage) throws BadRequestException;
Usage updateUsage(Long id, Usage usage) throws NotFoundException;
void deleteUsage(Long id) throws NotFoundException;
Page<Usage> getUsageList(Pageable pageable);
List<Usage> getUsageList();
Optional<Usage> getUsageById(Long id);
}

View File

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

View File

@@ -1,9 +1,7 @@
package io.gmss.fiscad.paylaods.request.crudweb; package io.gmss.fiscad.paylaods.request.crudweb;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@Data @Data
public class ArrondissementPaylaodWeb { public class ArrondissementPaylaodWeb {
private Long id; private Long id;

View File

@@ -7,10 +7,9 @@ import io.gmss.fiscad.enums.Titre;
import jakarta.persistence.EnumType; import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated; import jakarta.persistence.Enumerated;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate; import java.time.LocalDate;
@NoArgsConstructor
@Data @Data
public class AvoirFonctionPaylaodWeb { public class AvoirFonctionPaylaodWeb {
private Long id; private Long id;

View File

@@ -1,56 +0,0 @@
package io.gmss.fiscad.paylaods.request.crudweb;
import io.gmss.fiscad.entities.decoupage.Arrondissement;
import io.gmss.fiscad.entities.rfu.parametre.CategorieBatiment;
import jakarta.persistence.ManyToOne;
import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@Data
public class BaremRfuBatiPayloadWeb {
private Long id;
private Long valeurLocative;
private Double tfuMetreCarre;
private Long tfuMinimum;
private Long categorieBatimentId;
private String categorieBatimentNom;
private String categorieBatimentStanding;
private Long arrondissementId;
private String arrondissementCode;
private String arrondissementNom;
private Long quartierId;
private String quartierCode;
private String quartierNom;
private Long communeId;
private String communeCode;
private String communeNom;
public BaremRfuBatiPayloadWeb(Long id, Long valeurLocative, Double tfuMetreCarre, Long tfuMinimum, Long categorieBatimentId, String categorieBatimentNom, String categorieBatimentStanding, Long arrondissementId, String arrondissementCode, String arrondissementNom,
Long quartierId,
String quartierCode,
String quartierNom,
Long communeId,
String communeCode,
String communeNom
) {
this.id = id;
this.valeurLocative = valeurLocative;
this.tfuMetreCarre = tfuMetreCarre;
this.tfuMinimum = tfuMinimum;
this.categorieBatimentId = categorieBatimentId;
this.categorieBatimentNom = categorieBatimentNom;
this.categorieBatimentStanding = categorieBatimentStanding;
this.arrondissementId = arrondissementId;
this.arrondissementCode = arrondissementCode;
this.arrondissementNom = arrondissementNom;
this.quartierId = quartierId;
this.quartierCode = quartierCode;
this.quartierNom = quartierNom;
this.communeId = communeId;
this.communeCode = communeCode;
this.communeNom = communeNom;
}
}

View File

@@ -1,47 +0,0 @@
package io.gmss.fiscad.paylaods.request.crudweb;
import io.gmss.fiscad.entities.decoupage.Commune;
import io.gmss.fiscad.entities.rfu.parametre.ZoneRfu;
import jakarta.persistence.ManyToOne;
import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@Data
public class BaremRfuNonBatiPayloadWeb {
private Long id;
private Long valeurAdministrative;
private float taux;
private Long communeId;
private String communeCode;
private String communeNom;
private Long zoneRfuId;
private String zoneRfuCode;
private String zoneRfuNom;
private Long valeurAdministrativeMetreCarre;
private Boolean auMetreCarre;
public BaremRfuNonBatiPayloadWeb(Long id,
Long valeurAdministrative,
Float taux,
Long communeId,
String communeCode,
String communeNom,
Long zoneRfuId,
String zoneRfuCode,
String zoneRfuNom,
Long valeurAdministrativeMetreCarre,
Boolean auMetreCarre) {
this.id = id;
this.valeurAdministrative = valeurAdministrative;
this.taux = taux;
this.communeId = communeId;
this.communeCode = communeCode;
this.communeNom = communeNom;
this.zoneRfuId = zoneRfuId;
this.zoneRfuCode = zoneRfuCode;
this.zoneRfuNom = zoneRfuNom;
this.valeurAdministrativeMetreCarre = valeurAdministrativeMetreCarre;
this.auMetreCarre = auMetreCarre;
}
}

View File

@@ -1,10 +1,9 @@
package io.gmss.fiscad.paylaods.request.crudweb; package io.gmss.fiscad.paylaods.request.crudweb;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate; import java.time.LocalDate;
@NoArgsConstructor
@Data @Data
public class BatimentPaylaodWeb { public class BatimentPaylaodWeb {
private Long id; private Long id;
@@ -20,55 +19,11 @@ public class BatimentPaylaodWeb {
private String personneNom; private String personneNom;
private String personnePrenom; private String personnePrenom;
private String personneRaisonSociale; private String personneRaisonSociale;
private Float superficieAuSol; private Float superficieSol;
private Float superficieLouee; private Float superficieLouee;
private Long enqueteBatiementCourantId; private Long enqueteBatiementCourantId;
private Long categorieBatimentId;
private String categorieBatimentCode;
private String categorieBatimentStanding;
private Integer nombrePiscine;
private Long montantLocatifAnnuelDeclare;
private Long montantLocatifAnnuelCalcule;
private Long montantLocatifAnnuelEstime;
private Long valeurBatimentEstime;
private Long valeurBatimentReel;
private Long valeurBatimentCalcule;
private Long montantMensuelLocation;
private Long usageId;
private String usageNom;
private Integer nbreUniteLogement;
public BatimentPaylaodWeb(Long id, public BatimentPaylaodWeb(Long id, String nub, String code, LocalDate dateConstruction, Long parcelleId, String parcelleNup, String parcelleQ, String parcelleI, String parcelleP, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Float superficieSol, Float superficieLouee,Long enqueteBatiementCourantId) {
String nub,
String code,
LocalDate dateConstruction,
Long parcelleId,
String parcelleNup,
String parcelleQ,
String parcelleI,
String parcelleP,
Long personneId,
String personneNom,
String personnePrenom,
String personneRaisonSociale,
Float superficieAuSol,
Float superficieLouee,
Long enqueteBatiementCourantId,
Long categorieBatimentId,
String categorieBatimentCode,
String categorieBatimentStanding,
Integer nombrePiscine,
Long montantLocatifAnnuelDeclare,
Long montantLocatifAnnuelCalcule,
Long valeurBatimentEstime,
Long valeurBatimentReel,
Long montantMensuelLocation,
Long usageId,
String usageNom,
Long montantLocatifAnnuelEstime,
Long valeurBatimentCalcule,
Integer nbreUniteLogement
) {
this.id = id; this.id = id;
this.nub = nub; this.nub = nub;
this.code = code; this.code = code;
@@ -82,23 +37,8 @@ public class BatimentPaylaodWeb {
this.personneNom = personneNom; this.personneNom = personneNom;
this.personnePrenom = personnePrenom; this.personnePrenom = personnePrenom;
this.personneRaisonSociale = personneRaisonSociale; this.personneRaisonSociale = personneRaisonSociale;
this.superficieAuSol = superficieAuSol ; this.superficieSol = superficieSol ;
this.superficieLouee = superficieLouee ; this.superficieLouee = superficieLouee ;
this.enqueteBatiementCourantId = enqueteBatiementCourantId ; this.enqueteBatiementCourantId = enqueteBatiementCourantId ;
this.categorieBatimentId = categorieBatimentId ;
this.categorieBatimentCode = categorieBatimentCode ;
this.categorieBatimentStanding = categorieBatimentStanding ;
this.nombrePiscine = nombrePiscine ;
this.montantLocatifAnnuelDeclare = montantLocatifAnnuelDeclare ;
this.montantLocatifAnnuelCalcule = montantLocatifAnnuelCalcule ;
this.valeurBatimentEstime = valeurBatimentEstime ;
this.valeurBatimentReel = valeurBatimentReel ;
this.montantMensuelLocation = montantMensuelLocation ;
this.usageId = usageId ;
this.usageNom = usageNom ;
this.montantLocatifAnnuelEstime = montantLocatifAnnuelEstime ;
this.valeurBatimentCalcule = valeurBatimentCalcule ;
this.nbreUniteLogement = nbreUniteLogement ;
} }
} }

View File

@@ -1,10 +1,9 @@
package io.gmss.fiscad.paylaods.request.crudweb; package io.gmss.fiscad.paylaods.request.crudweb;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate; import java.time.LocalDate;
@NoArgsConstructor
@Data @Data
public class CaracteristiqueBatimentPayloadWeb { public class CaracteristiqueBatimentPayloadWeb {
private Long id; private Long id;
@@ -16,12 +15,8 @@ public class CaracteristiqueBatimentPayloadWeb {
private String caracteristiqueLibelle; private String caracteristiqueLibelle;
private String valeur; private String valeur;
private String observation; private String observation;
private Long typeCaracteristiqueId;
private String typeCaracteristiqueLibelle;
public CaracteristiqueBatimentPayloadWeb(Long id, Long enqueteBatimentId, LocalDate enqueteBatimentDateEnquete, Integer enqueteBatimentAnnee, Long caracteristiqueId, String caracteristiqueCode, String caracteristiqueLibelle, String valeur, String observation, public CaracteristiqueBatimentPayloadWeb(Long id, Long enqueteBatimentId, LocalDate enqueteBatimentDateEnquete, Integer enqueteBatimentAnnee, Long caracteristiqueId, String caracteristiqueCode, String caracteristiqueLibelle, String valeur, String observation) {
Long typeCaracteristiqueId,
String typeCaracteristiqueLibelle) {
this.id = id; this.id = id;
this.enqueteBatimentId = enqueteBatimentId; this.enqueteBatimentId = enqueteBatimentId;
this.enqueteBatimentDateEnquete = enqueteBatimentDateEnquete; this.enqueteBatimentDateEnquete = enqueteBatimentDateEnquete;
@@ -31,8 +26,5 @@ public class CaracteristiqueBatimentPayloadWeb {
this.caracteristiqueLibelle = caracteristiqueLibelle; this.caracteristiqueLibelle = caracteristiqueLibelle;
this.valeur = valeur; this.valeur = valeur;
this.observation = observation; this.observation = observation;
this.typeCaracteristiqueId = typeCaracteristiqueId;
this.typeCaracteristiqueLibelle = typeCaracteristiqueLibelle;
} }
} }

View File

@@ -1,10 +1,9 @@
package io.gmss.fiscad.paylaods.request.crudweb; package io.gmss.fiscad.paylaods.request.crudweb;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate; import java.time.LocalDate;
@NoArgsConstructor
@Data @Data
public class CaracteristiqueParcellePayloadWeb { public class CaracteristiqueParcellePayloadWeb {
private Long id; private Long id;
@@ -16,12 +15,8 @@ public class CaracteristiqueParcellePayloadWeb {
private String caracteristiqueLibelle; private String caracteristiqueLibelle;
private String valeur; private String valeur;
private String observation; private String observation;
private Long typeCaracteristiqueId;
private String typeCaracteristiqueLibelle;
public CaracteristiqueParcellePayloadWeb(Long id, Long enqueteId, LocalDate enqueteDateEnquete, Integer enqueteAnnee, Long caracteristiqueId, String caracteristiqueCode, String caracteristiqueLibelle, String valeur, String observation, public CaracteristiqueParcellePayloadWeb(Long id, Long enqueteId, LocalDate enqueteDateEnquete, Integer enqueteAnnee, Long caracteristiqueId, String caracteristiqueCode, String caracteristiqueLibelle, String valeur, String observation) {
Long typeCaracteristiqueId,
String typeCaracteristiqueLibelle) {
this.id = id; this.id = id;
this.enqueteId = enqueteId; this.enqueteId = enqueteId;
this.enqueteDateEnquete = enqueteDateEnquete; this.enqueteDateEnquete = enqueteDateEnquete;
@@ -31,7 +26,5 @@ public class CaracteristiqueParcellePayloadWeb {
this.caracteristiqueLibelle = caracteristiqueLibelle; this.caracteristiqueLibelle = caracteristiqueLibelle;
this.valeur = valeur; this.valeur = valeur;
this.observation = observation; this.observation = observation;
this.typeCaracteristiqueId = typeCaracteristiqueId;
this.typeCaracteristiqueLibelle = typeCaracteristiqueLibelle;
} }
} }

View File

@@ -1,10 +1,9 @@
package io.gmss.fiscad.paylaods.request.crudweb; package io.gmss.fiscad.paylaods.request.crudweb;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate; import java.time.LocalDate;
@NoArgsConstructor
@Data @Data
public class CaracteristiqueUniteLogementPayloadWeb { public class CaracteristiqueUniteLogementPayloadWeb {
private Long id; private Long id;
@@ -16,12 +15,8 @@ public class CaracteristiqueUniteLogementPayloadWeb {
private String caracteristiqueLibelle; private String caracteristiqueLibelle;
private String valeur; private String valeur;
private String observation; private String observation;
private Long typeCaracteristiqueId;
private String typeCaracteristiqueLibelle;
public CaracteristiqueUniteLogementPayloadWeb(Long id, Long enqueteUniteLogementId, LocalDate enqueteUniteLogementDateEnquete, Integer enqueteUniteLogementAnnee, Long caracteristiqueId, String caracteristiqueCode, String caracteristiqueLibelle, String valeur, String observation, public CaracteristiqueUniteLogementPayloadWeb(Long id, Long enqueteUniteLogementId, LocalDate enqueteUniteLogementDateEnquete, Integer enqueteUniteLogementAnnee, Long caracteristiqueId, String caracteristiqueCode, String caracteristiqueLibelle, String valeur, String observation) {
Long typeCaracteristiqueId,
String typeCaracteristiqueLibelle) {
this.id = id; this.id = id;
this.enqueteUniteLogementId = enqueteUniteLogementId; this.enqueteUniteLogementId = enqueteUniteLogementId;
this.enqueteUniteLogementDateEnquete = enqueteUniteLogementDateEnquete; this.enqueteUniteLogementDateEnquete = enqueteUniteLogementDateEnquete;
@@ -31,7 +26,5 @@ public class CaracteristiqueUniteLogementPayloadWeb {
this.caracteristiqueLibelle = caracteristiqueLibelle; this.caracteristiqueLibelle = caracteristiqueLibelle;
this.valeur = valeur; this.valeur = valeur;
this.observation = observation; this.observation = observation;
this.typeCaracteristiqueId = typeCaracteristiqueId;
this.typeCaracteristiqueLibelle = typeCaracteristiqueLibelle;
} }
} }

View File

@@ -1,9 +1,7 @@
package io.gmss.fiscad.paylaods.request.crudweb; package io.gmss.fiscad.paylaods.request.crudweb;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@Data @Data
public class CommunePaylaodWeb { public class CommunePaylaodWeb {
private Long id; private Long id;

View File

@@ -4,11 +4,10 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer; import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List; import java.util.List;
@NoArgsConstructor
@Data @Data
public class DeclarationNcPayloadWeb { public class DeclarationNcPayloadWeb {
private Long id; private Long id;

View File

@@ -1,10 +1,9 @@
package io.gmss.fiscad.paylaods.request.crudweb; package io.gmss.fiscad.paylaods.request.crudweb;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate; import java.time.LocalDate;
@NoArgsConstructor
@Data @Data
public class DepartementPaylaodWeb { public class DepartementPaylaodWeb {
private Long id; private Long id;

View File

@@ -1,201 +0,0 @@
package io.gmss.fiscad.paylaods.request.crudweb;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.gmss.fiscad.enums.NatureImpot;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDate;
@NoArgsConstructor
@Data
public class DonneesImpositionPaylaodWeb {
private Long id;
private Long annee;
private String codeDepartement;
private String nomDepartement;
private String codeCommune;
private String nomCommune;
private String codeArrondissement;
private String nomArrondissement;
private String codeQuartierVillage;
private String nomQuartierVillage;
private String q;
private String ilot;
private String parcelle;
private String nup;
private String titreFoncier;
private String numBatiment;
private String numUniteLogement;
private String ifu;
private String npi;
private String telProp;
private String emailProp;
private String nomProp;
private String prenomProp;
private String raisonSociale;
private String adresseProp;
private String telRep;
private String emailRep;
private String nomRep;
private String prenomRep;
private String adresseRep;
private String longitude;
private String latitude;
private Integer superficieParc;
private Long superficieAuSolBat;
private Long superficieAuSolUlog;
private Boolean batie;
private Boolean exonere;
private Boolean batimentExonere;
private Boolean uniteLogementExonere;
private Long valeurLocativeAdm;
private Long valeurBatiment;
private Long valeurParcelle;
private Long montantLoyerAnnuel;
private Long tfuMetreCarre;
private Long tfuMinimum;
private String standingBat;
private String categorieBat;
private Long nombrePiscine;
private Long nombreUlog;
private Long nombreBat;
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate dateEnquete;
private Long serviceId;
private String serviceCode;
private Long zoneRfuId;
private String zoneRfuNom;
private Float tauxTfu;
private Long valeurAdminParcelleNb;
@Enumerated(EnumType.STRING)
private NatureImpot natureImpot;
private Long valeurLocativeAdmMetreCarre;
private Long valeurAdminParcelleNbMetreCarre;
private Float montantTaxe;
public DonneesImpositionPaylaodWeb(Long id,
Long annee,
String codeDepartement,
String nomDepartement,
String codeCommune,
String nomCommune,
String codeArrondissement,
String nomArrondissement,
String codeQuartierVillage,
String nomQuartierVillage,
String q, String ilot,
String parcelle,
String nup,
String titreFoncier,
String numBatiment,
String numUniteLogement,
String ifu,
String npi,
String telProp,
String emailProp,
String nomProp,
String prenomProp,
String raisonSociale,
String adresseProp,
String telRep,
String emailRep,
String nomRep,
String prenomRep,
String adresseRep,
String longitude,
String latitude,
Integer superficieParc,
Long superficieAuSolBat,
Long superficieAuSolUlog,
Boolean batie,
Boolean exonere,
Boolean batimentExonere,
Boolean uniteLogementExonere,
Long valeurLocativeAdm,
Long montantLoyerAnnuel,
Long tfuMetreCarre,
Long tfuMinimum,
String standingBat,
String categorieBat,
Long nombrePiscine,
Long nombreUlog,
Long nombreBat,
LocalDate dateEnquete,
Long serviceId,
Long zoneRfuId,
Long valeurAdministrativeParcelleNonBati,
NatureImpot natureImpot,
String serviceCode,
String zoneRfuNom,
Long valeurBatiment,
Long valeurParcelle,
Long valeurLocativeAdmMetreCarre,
Long valeurAdministrativeParcelleNonBatiAuMetreCarre,
Float montantTaxe
) {
this.id = id;
this.annee = annee;
this.codeDepartement = codeDepartement;
this.nomDepartement = nomDepartement;
this.codeCommune = codeCommune;
this.nomCommune = nomCommune;
this.codeArrondissement = codeArrondissement;
this.nomArrondissement = nomArrondissement;
this.codeQuartierVillage = codeQuartierVillage;
this.nomQuartierVillage = nomQuartierVillage;
this.q = q;
this.ilot = ilot;
this.parcelle = parcelle;
this.nup = nup;
this.titreFoncier = titreFoncier;
this.numBatiment = numBatiment;
this.numUniteLogement = numUniteLogement;
this.ifu = ifu;
this.npi = npi;
this.telProp = telProp;
this.emailProp = emailProp;
this.nomProp = nomProp;
this.prenomProp = prenomProp;
this.raisonSociale = raisonSociale;
this.adresseProp = adresseProp;
this.telRep = telRep;
this.emailRep = emailRep;
this.nomRep = nomRep;
this.prenomRep = prenomRep;
this.adresseRep = adresseRep;
this.longitude = longitude;
this.latitude = latitude;
this.superficieParc = superficieParc;
this.superficieAuSolBat = superficieAuSolBat;
this.superficieAuSolUlog = superficieAuSolUlog;
this.batie = batie;
this.exonere = exonere;
this.batimentExonere = batimentExonere;
this.uniteLogementExonere = uniteLogementExonere;
this.valeurLocativeAdm = valeurLocativeAdm;
this.montantLoyerAnnuel = montantLoyerAnnuel;
this.tfuMetreCarre = tfuMetreCarre;
this.tfuMinimum = tfuMinimum;
this.standingBat = standingBat;
this.categorieBat = categorieBat;
this.nombrePiscine = nombrePiscine;
this.nombreUlog = nombreUlog;
this.nombreBat = nombreBat;
this.dateEnquete = dateEnquete;
this.serviceId = serviceId;
this.zoneRfuId = zoneRfuId;
this.valeurAdminParcelleNb = valeurAdministrativeParcelleNonBati;
this.natureImpot = natureImpot;
this.serviceCode = serviceCode;
this.zoneRfuNom = zoneRfuNom;
this.valeurBatiment = valeurBatiment;
this.valeurParcelle = valeurParcelle;
this.valeurLocativeAdmMetreCarre = valeurLocativeAdmMetreCarre;
this.valeurAdminParcelleNbMetreCarre = valeurAdministrativeParcelleNonBatiAuMetreCarre;
this.montantTaxe = montantTaxe;
}
}

View File

@@ -1,11 +1,10 @@
package io.gmss.fiscad.paylaods.request.crudweb; package io.gmss.fiscad.paylaods.request.crudweb;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List; import java.util.List;
@NoArgsConstructor
@Data @Data
public class EnqueteActivitePayLoadWeb { public class EnqueteActivitePayLoadWeb {
private Long id; private Long id;

View File

@@ -7,14 +7,16 @@ import io.gmss.fiscad.enums.StatutEnquete;
import jakarta.persistence.EnumType; import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated; import jakarta.persistence.Enumerated;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List; import java.util.List;
@NoArgsConstructor
@Data @Data
public class EnqueteBatimentPayloadWeb { public class EnqueteBatimentPayloadWeb {
private Long id; private Long id;
// private BatimentPaylaodWeb batimentPaylaodWeb ;
// private List<CaracteristiqueBatimentPayloadWeb> caracteristiqueBatimentPayloadWebs;
// private List<UploadPayLoadWeb> uploadPayLoadWebs;
private String observation; private String observation;
private String autreMenuisierie; private String autreMenuisierie;
private String autreMur; private String autreMur;
@@ -49,60 +51,15 @@ public class EnqueteBatimentPayloadWeb {
private String enqueteurNom; private String enqueteurNom;
private String enqueteurPrenom; private String enqueteurPrenom;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
@JsonIgnore
private StatutEnquete statutEnquete; private StatutEnquete statutEnquete;
private Long exerciceId; private Long exerciceId;
private Integer exerciceAnnee; private Integer exerciceAnnee;
private String representantNom;
private String representantPrenom;
private String representantTel;
private String representantNpi;
private Long categorieBatimentId;
private String categorieBatimentCode;
private String categorieBatimentStanding;
private Integer nombrePiscine;
private Long montantLocatifAnnuelCalcule;
private Long usageId;
private String usageNom;
private String nub;
private String code;
private LocalDate dateConstruction;
private Long parcelleId;
private String parcelleNup;
private String parcelleQ;
private String parcelleI;
private String parcelleP;
private Long montantLocatifAnnuelEstime;
private Long valeurBatimentCalcule;
private Integer nbreUniteLogement;
public EnqueteBatimentPayloadWeb(Long id, String observation, String autreMenuisierie, String autreMur, boolean sbee, String numCompteurSbee, boolean soneb, String numCompteurSoneb, int nbreLotUnite, int nbreUniteLocation, Float superficieLouee, Float superficieAuSol, LocalDate dateEnquete, int nbreMenage, int nbreHabitant, Long montantMensuelLocation, Long montantLocatifAnnuelDeclare, Long nbreEtage, Long valeurBatimentEstime, Long valeurBatimentReel, int nbreMoisLocation, String autreCaracteristiquePhysique, LocalDate dateDebutExcemption, LocalDate dateFinExcemption, Long batimentId, String batimentNub, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Long enqueteurId, String enqueteurNom, String enqueteurPrenom, public EnqueteBatimentPayloadWeb(Long id, String observation, String autreMenuisierie, String autreMur, boolean sbee, String numCompteurSbee, boolean soneb, String numCompteurSoneb, int nbreLotUnite, int nbreUniteLocation, Float superficieLouee, Float superficieAuSol, LocalDate dateEnquete, int nbreMenage, int nbreHabitant, Long montantMensuelLocation, Long montantLocatifAnnuelDeclare, Long nbreEtage, Long valeurBatimentEstime, Long valeurBatimentReel, int nbreMoisLocation, String autreCaracteristiquePhysique, LocalDate dateDebutExcemption, LocalDate dateFinExcemption, Long batimentId, String batimentNub, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Long enqueteurId, String enqueteurNom, String enqueteurPrenom,
StatutEnquete statutEnquete, StatutEnquete statutEnquete,
Long exerciceId, Long exerciceId,
Integer exerciceAnnee, Integer exerciceAnnee) {
String representantNom,
String representantPrenom,
String representantTel,
String representantNpi,
Long categorieBatimentId,
String categorieBatimentCode,
String categorieBatimentStanding,
Integer nombrePiscine,
Long montantLocatifAnnuelCalcule,
Long usageId,
String usageNom,
String nub,
String code,
LocalDate dateConstruction,
Long parcelleId,
String parcelleNup,
String parcelleQ,
String parcelleI,
String parcelleP,
Long montantLocatifAnnuelEstime,
Long valeurBatimentCalcule,
Integer nbreUniteLogement
) {
this.id = id; this.id = id;
this.observation = observation; this.observation = observation;
this.autreMenuisierie = autreMenuisierie; this.autreMenuisierie = autreMenuisierie;
@@ -139,27 +96,5 @@ public class EnqueteBatimentPayloadWeb {
this.statutEnquete = statutEnquete; this.statutEnquete = statutEnquete;
this.exerciceId = exerciceId; this.exerciceId = exerciceId;
this.exerciceAnnee = exerciceAnnee; this.exerciceAnnee = exerciceAnnee;
this.representantNom = representantNom;
this.representantPrenom = representantPrenom;
this.representantTel = representantTel;
this.representantNpi = representantNpi;
this.categorieBatimentId = categorieBatimentId;
this.categorieBatimentCode = categorieBatimentCode;
this.categorieBatimentStanding = categorieBatimentStanding;
this.nombrePiscine = nombrePiscine;
this.montantLocatifAnnuelCalcule = montantLocatifAnnuelCalcule;
this.usageId = usageId ;
this.usageNom = usageNom ;
this.nub=nub;
this.code=code;
this.dateConstruction=dateConstruction;
this.parcelleId=parcelleId;
this.parcelleNup=parcelleNup;
this.parcelleQ=parcelleQ;
this.parcelleI=parcelleI;
this.parcelleP=parcelleP;
this.montantLocatifAnnuelEstime=montantLocatifAnnuelEstime;
this.valeurBatimentCalcule=valeurBatimentCalcule;
this.nbreUniteLogement=nbreUniteLogement;
} }
} }

View File

@@ -4,21 +4,29 @@ import io.gmss.fiscad.enums.StatutEnquete;
import jakarta.persistence.EnumType; import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated; import jakarta.persistence.Enumerated;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List;
@NoArgsConstructor
@Data @Data
public class EnquetePayLoadWeb { public class EnquetePayLoadWeb {
private Long id; private Long id;
private LocalDate dateEnquete; private LocalDate dateEnquete;
private LocalDate dateFinalisation; private LocalDate dateFinalisation;
private Boolean litige; private Boolean litige;
// private ParcellePayLoadWeb parcellePayLoadWeb;
// private List<CaracteristiqueParcellePayloadWeb> caracteristiqueParcellePayloadWebs;
// private List<DeclarationNcPayloadWeb> declarationNcPayloadWebs;
// private List<PiecePayLoadWeb> piecePayLoadWebs;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private StatutEnquete statutEnquete; private StatutEnquete statutEnquete;
private String descriptionMotifRejet; private String descriptionMotifRejet;
private String observation; private String observation;
private String numeroTitreFoncier;
private LocalDate dateTitreFoncier;
private String numEntreeParcelle;
private String numRue;
private String nomRue;
private Float precision; private Float precision;
private Integer nbreCoProprietaire; private Integer nbreCoProprietaire;
private Integer nbreIndivisiaire; private Integer nbreIndivisiaire;
@@ -42,63 +50,18 @@ public class EnquetePayLoadWeb {
private Long enqueteurId; private Long enqueteurId;
private String enqueteurNom; private String enqueteurNom;
private String enqueteurPrenom; private String enqueteurPrenom;
private Long exerciceId;
private Integer exerciceAnnee;
private Long modeAcquisitionId;
private String modeAcquisitionLibelle;
private String representantNom;
private String representantPrenom;
private String representantTel;
private String representantNpi;
private Long parcelleId; private Long parcelleId;
private String parcelleNup; private String parcelleNup;
private String parcelleQ; private String parcelleQ;
private String parcelleI; private String parcelleI;
private String parcelleP; private String parcelleP;
private Long exerviceId;
private Integer exerviceAnnee;
private Long modeAcquisitionId;
private String modeAcquisitionLibelle;
private String numeroTitreFoncier; public EnquetePayLoadWeb(Long id, LocalDate dateEnquete, LocalDate dateFinalisation, Boolean litige, StatutEnquete statutEnquete, String descriptionMotifRejet, String observation, String numeroTitreFoncier, LocalDate dateTitreFoncier, String numEntreeParcelle, String numRue, String nomRue, Float precision, Integer nbreCoProprietaire, Integer nbreIndivisiaire, String autreAdresse, Float superficie, Integer nbreBatiment, Integer nbrePiscine, LocalDate dateDebutExemption, LocalDate dateFinExemption, String autreNumeroTitreFoncier, Long montantMensuelleLocation, Long montantAnnuelleLocation, Long valeurParcelleEstime, Long valeurParcelleReel, Long zoneRfuId, String zoneRfuNom, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Long enqueteurId, String enqueteurNom, String enqueteurPrenom,Long parcelleId, String parcelleNup, String parcelleQ, String parcelleI, String parcelleP, Long exerviceId, Integer exerviceAnnee,
private LocalDate dateTitreFoncier; Long modeAcquisitionId,String modeAcquisitionLibelle) {
private String numEntreeParcelle;
private String numRue;
private String nomRue;
private String nupProvisoire;
private String longitude;
private String latitude;
private String altitude;
private String situationGeographique;
private Long quartierId;
private String quartierCode;
private String quartierNom;
private Long natureDomaineId;
private String natureDomaineLibelle;
private Long typeDomaineId;
private String typeDomaineLibelle;
private Long rueId;
public EnquetePayLoadWeb(Long id, LocalDate dateEnquete, LocalDate dateFinalisation, Boolean litige, StatutEnquete statutEnquete, String descriptionMotifRejet, String observation, String numeroTitreFoncier, LocalDate dateTitreFoncier, String numEntreeParcelle, String numRue, String nomRue, Float precision, Integer nbreCoProprietaire, Integer nbreIndivisiaire, String autreAdresse, Float superficie, Integer nbreBatiment, Integer nbrePiscine, LocalDate dateDebutExemption, LocalDate dateFinExemption, String autreNumeroTitreFoncier, Long montantMensuelleLocation, Long montantAnnuelleLocation, Long valeurParcelleEstime, Long valeurParcelleReel, Long zoneRfuId, String zoneRfuNom, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Long enqueteurId, String enqueteurNom, String enqueteurPrenom,Long parcelleId, String parcelleNup, String parcelleQ, String parcelleI, String parcelleP, Long exerciceId, Integer exerciceAnnee,
Long modeAcquisitionId,
String modeAcquisitionLibelle,
String representantNom,
String representantPrenom,
String representantTel,
String representantNpi,
String nupProvisoire,
String longitude,
String latitude,
String altitude,
String situationGeographique,
Long quartierId,
String quartierCode,
String quartierNom,
Long natureDomaineId,
String natureDomaineLibelle,
Long typeDomaineId,
String typeDomaineLibelle,
Long rueId
) {
this.id = id; this.id = id;
this.dateEnquete = dateEnquete; this.dateEnquete = dateEnquete;
this.dateFinalisation = dateFinalisation; this.dateFinalisation = dateFinalisation;
@@ -139,26 +102,9 @@ public class EnquetePayLoadWeb {
this.parcelleQ = parcelleQ; this.parcelleQ = parcelleQ;
this.parcelleI = parcelleI; this.parcelleI = parcelleI;
this.parcelleP = parcelleP; this.parcelleP = parcelleP;
this.exerciceId = exerciceId; this.exerviceId = exerviceId;
this.exerciceAnnee = exerciceAnnee; this.exerviceAnnee = exerviceAnnee;
this.modeAcquisitionId = modeAcquisitionId; this.modeAcquisitionId = modeAcquisitionId;
this.modeAcquisitionLibelle = modeAcquisitionLibelle; this.modeAcquisitionLibelle = modeAcquisitionLibelle;
this.representantNom = representantNom;
this.representantTel = representantTel;
this.representantPrenom = representantPrenom;
this.representantNpi = representantNpi;
this.nupProvisoire=nupProvisoire;
this.longitude=longitude;
this.latitude=latitude;
this.altitude=altitude;
this.situationGeographique=situationGeographique;
this.quartierId=quartierId;
this.quartierCode=quartierCode;
this.quartierNom=quartierNom;
this.natureDomaineId=natureDomaineId;
this.natureDomaineLibelle=natureDomaineLibelle;
this.typeDomaineId=typeDomaineId;
this.typeDomaineLibelle=typeDomaineLibelle;
this.rueId=rueId;
} }
} }

View File

@@ -4,11 +4,10 @@ import io.gmss.fiscad.enums.StatutEnquete;
import jakarta.persistence.EnumType; import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated; import jakarta.persistence.Enumerated;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List; import java.util.List;
@NoArgsConstructor
@Data @Data
public class EnqueteUniteLogementPayloadWeb { public class EnqueteUniteLogementPayloadWeb {
private Long id; private Long id;
@@ -18,8 +17,8 @@ public class EnqueteUniteLogementPayloadWeb {
private Integer nbreMenage; private Integer nbreMenage;
private Boolean enLocation; private Boolean enLocation;
private Integer nbreMoisLocation; private Integer nbreMoisLocation;
private Long montantMensuelLocation; private Float montantMensuelLoyer;
private Long montantLocatifAnnuelDeclare; private Float montantLocatifAnnuelDeclare;
private Long valeurUniteLogementEstime; private Long valeurUniteLogementEstime;
private Long valeurUniteLogementReel; private Long valeurUniteLogementReel;
private Float superficieLouee; private Float superficieLouee;
@@ -45,50 +44,9 @@ public class EnqueteUniteLogementPayloadWeb {
private Integer exerciceAnnee; private Integer exerciceAnnee;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private StatutEnquete statutEnquete; private StatutEnquete statutEnquete;
private String representantNom;
private String representantPrenom;
private String representantTel;
private String representantNpi;
private Long categorieBatimentId;
private String categorieBatimentCode;
private String categorieBatimentStanding;
private Long montantLocatifAnnuelCalcule;
private Integer nombrePiscine;
private Long usageId;
private String usageNom;
public EnqueteUniteLogementPayloadWeb(Long id, String observation, Integer nbrePiece, Integer nbreHabitant, Integer nbreMenage, Boolean enLocation, Integer nbreMoisLocation, Float montantMensuelLoyer, Float montantLocatifAnnuelDeclare, Long valeurUniteLogementEstime, Long valeurUniteLogementReel, Float superficieLouee, Float superficieAuSol, LocalDate dateEnquete, Boolean sbee, Boolean soneb, String numCompteurSbee, String numCompteurSoneb, LocalDate dateDebutExemption, LocalDate dateFinExemption, Long uniteLogementId, String uniteLogementNumeroEtage, String uniteLogementNul, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Long enqueteurId, String enqueteurNom, String enqueteurPrenom, Long exerciceId, Integer exerciceAnnee,
private String nul; StatutEnquete statutEnquete) {
private String numeroEtage;
private String code;
private Long batimentId;
private String batimentNub;
private LocalDate dateConstruction;
private Long enqueteUniteLogementCourantId;
private Long montantLocatifAnnuelEstime;
private Long valeurUniteLogementCalcule;
public EnqueteUniteLogementPayloadWeb(Long id, String observation, Integer nbrePiece, Integer nbreHabitant, Integer nbreMenage, Boolean enLocation, Integer nbreMoisLocation, Long montantMensuelLocation, Long montantLocatifAnnuelDeclare, Long valeurUniteLogementEstime, Long valeurUniteLogementReel, Float superficieLouee, Float superficieAuSol, LocalDate dateEnquete, Boolean sbee, Boolean soneb, String numCompteurSbee, String numCompteurSoneb, LocalDate dateDebutExemption, LocalDate dateFinExemption, Long uniteLogementId, String uniteLogementNumeroEtage, String uniteLogementNul, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Long enqueteurId, String enqueteurNom, String enqueteurPrenom, Long exerciceId, Integer exerciceAnnee,
StatutEnquete statutEnquete,
String representantNom,
String representantPrenom,
String representantTel,
String representantNpi,
Long categorieBatimentId,
String categorieBatimentCode,
String categorieBatimentStanding,
Integer nombrePiscine,
Long montantLocatifAnnuelCalcule,
Long usageId,
String usageNom,
String nul,
String numeroEtage,
String code,
Long batimentId,
String batimentNub,
LocalDate dateConstruction,
Long montantLocatifAnnuelEstime,
Long valeurUniteLogementCalcule
) {
this.id = id; this.id = id;
this.observation = observation; this.observation = observation;
this.nbrePiece = nbrePiece; this.nbrePiece = nbrePiece;
@@ -96,7 +54,7 @@ public class EnqueteUniteLogementPayloadWeb {
this.nbreMenage = nbreMenage; this.nbreMenage = nbreMenage;
this.enLocation = enLocation; this.enLocation = enLocation;
this.nbreMoisLocation = nbreMoisLocation; this.nbreMoisLocation = nbreMoisLocation;
this.montantMensuelLocation = montantMensuelLocation; this.montantMensuelLoyer = montantMensuelLoyer;
this.montantLocatifAnnuelDeclare = montantLocatifAnnuelDeclare; this.montantLocatifAnnuelDeclare = montantLocatifAnnuelDeclare;
this.valeurUniteLogementEstime = valeurUniteLogementEstime; this.valeurUniteLogementEstime = valeurUniteLogementEstime;
this.valeurUniteLogementReel = valeurUniteLogementReel; this.valeurUniteLogementReel = valeurUniteLogementReel;
@@ -122,25 +80,5 @@ public class EnqueteUniteLogementPayloadWeb {
this.exerciceId = exerciceId; this.exerciceId = exerciceId;
this.exerciceAnnee = exerciceAnnee; this.exerciceAnnee = exerciceAnnee;
this.statutEnquete = statutEnquete; this.statutEnquete = statutEnquete;
this.representantNom = representantNom;
this.representantPrenom = representantPrenom;
this.representantTel = representantTel;
this.representantNpi = representantNpi;
this.categorieBatimentId = categorieBatimentId;
this.categorieBatimentCode = categorieBatimentCode;
this.categorieBatimentStanding = categorieBatimentStanding;
this.nombrePiscine = nombrePiscine;
this.montantLocatifAnnuelCalcule = montantLocatifAnnuelCalcule;
this.usageId = usageId ;
this.usageNom = usageNom ;
this.nul=nul;
this.numeroEtage=numeroEtage;
this.code=code;
this.batimentId=batimentId;
this.batimentNub=batimentNub;
this.dateConstruction=dateConstruction;
this.montantLocatifAnnuelEstime=montantLocatifAnnuelEstime;
this.valeurUniteLogementCalcule=valeurUniteLogementCalcule;
} }
} }

View File

@@ -9,11 +9,10 @@ import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated; import jakarta.persistence.Enumerated;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull; import lombok.NonNull;
import java.time.LocalDate; import java.time.LocalDate;
@NoArgsConstructor
@Data @Data
public class FonctionPaylaodWeb { public class FonctionPaylaodWeb {
private Long id; private Long id;

View File

@@ -1,64 +0,0 @@
package io.gmss.fiscad.paylaods.request.crudweb;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
import io.gmss.fiscad.entities.decoupage.Commune;
import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
import io.gmss.fiscad.enums.NatureImpot;
import io.gmss.fiscad.enums.StatusAvis;
import jakarta.persistence.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
@NoArgsConstructor
@Data
public class ImpositionsTfuPaylaodWeb {
private Long id;
private LocalDate dateGeneration;
private LocalDate dateCloture;
private String referencePieceAdmin;
private String datePieceAdmin;
@Enumerated(EnumType.STRING)
private StatusAvis statusAvis;
private Integer nombreAvis;
private Integer nombreAvisFnb;
private Integer nombreAvisBatiment;
private Integer nombreAvisUniteLog;
@Column(columnDefinition = "TEXT")
private String motif;
private Long exerciceId;
private Integer exerciceAnnee;
private Long communeId;
private String communeCode;
private String communeNom;
private Long structureId ;
private String structureNom ;
public ImpositionsTfuPaylaodWeb(Long id, LocalDate dateGeneration, LocalDate dateCloture, String referencePieceAdmin, String datePieceAdmin, StatusAvis statusAvis, Integer nombreAvis, String motif, Long exerciceId, Integer exerciceAnnee, Long communeId, String communeCode, String communeNom, Long structureId, String structureNom,
Integer nombreAvisFnb,
Integer nombreAvisBatiment,
Integer nombreAvisUniteLog
) {
this.id = id;
this.dateGeneration = dateGeneration;
this.dateCloture = dateCloture;
this.referencePieceAdmin = referencePieceAdmin;
this.datePieceAdmin = datePieceAdmin;
this.statusAvis = statusAvis;
this.nombreAvis = nombreAvis;
this.motif = motif;
this.exerciceId = exerciceId;
this.exerciceAnnee = exerciceAnnee;
this.communeId = communeId;
this.communeCode = communeCode;
this.communeNom = communeNom;
this.structureId = structureId;
this.structureNom = structureNom;
this.nombreAvisFnb = nombreAvisFnb;
this.nombreAvisBatiment = nombreAvisBatiment;
this.nombreAvisUniteLog = nombreAvisUniteLog;
}
}

View File

@@ -1,160 +0,0 @@
package io.gmss.fiscad.paylaods.request.crudweb;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.gmss.fiscad.entities.decoupage.Arrondissement;
import io.gmss.fiscad.entities.decoupage.Commune;
import io.gmss.fiscad.entities.decoupage.Departement;
import io.gmss.fiscad.entities.decoupage.Quartier;
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
import io.gmss.fiscad.enums.SourceDonnee;
import io.gmss.fiscad.enums.StatutParcelle;
import jakarta.persistence.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.ColumnDefault;
import org.locationtech.jts.geom.Polygon;
import org.n52.jackson.datatype.jts.GeometryDeserializer;
import org.n52.jackson.datatype.jts.GeometrySerializer;
import java.time.LocalDate;
@NoArgsConstructor
@Data
public class ParcelleGeomPaylaodWeb {
private Long id;
private String nup;
private String nupProvisoire;
private String longitude;
private String latitude;
private String numeroRue;
private String numeroEntreePorte;
private String codeInstad;
private String numeroEtatLieux;
private String numeroTitreFoncier;
private LocalDate dateTitreFoncier;
private Boolean batie ;
private String npi;
private String ifu;
private String nom;
private String prenom;
private String raisonSociale;
private String nomEtPrenoms;
private String telephone;
private String adresse;
private String nomRepresentant;
private String prenomRepresentant;
private String raisonSocialeRepresentant;
private String nomEtPrenomsRepresentant;
private String telephoneRepresentant;
private String adresseRepresentant;
private String q;
private String zone;
private String ilot;
private String p;
private String qLotissement;
private String ilotLotissement;
private String pLotissement;
private String pointsPolygone;
private Integer superficie;
private String dateCollecte;
@Enumerated(EnumType.STRING)
private SourceDonnee sourceDonnees;
private String observations;
@Enumerated(EnumType.STRING)
private StatutParcelle statutParcelle;
private Long departementId;
private String departementCode;
private String departementNom;
private Long communeId;
private String communeCode;
private String communeNom;
private Long arrondissementId;
private String arrondissementCode;
private String arrondissementNom;
private Long quartierId ;
private String quartierCode ;
private String quartierNom ;
private Integer geomSrid;
@JsonSerialize(using = GeometrySerializer.class)
@JsonDeserialize(contentUsing = GeometryDeserializer.class)
//@Column(name = "geometry",columnDefinition = "geometry(Polygon,32631)")
private Polygon geometry;
//@Column(columnDefinition = "TEXT")
private String geometryString;
private Long parcelleId;
public ParcelleGeomPaylaodWeb(Long id, String nup, String nupProvisoire, String longitude, String latitude, String numeroRue, String numeroEntreePorte, String codeInstad, String numeroEtatLieux, String numeroTitreFoncier, LocalDate dateTitreFoncier, Boolean batie, String npi, String ifu, String nom, String prenom, String raisonSociale, String nomEtPrenoms, String telephone, String adresse, String nomRepresentant, String prenomRepresentant, String raisonSocialeRepresentant, String nomEtPrenomsRepresentant, String telephoneRepresentant, String adresseRepresentant, String q, String zone, String ilot, String p, String qLotissement, String ilotLotissement, String pLotissement, String pointsPolygone, Integer superficie, String dateCollecte, SourceDonnee sourceDonnees, String observations, StatutParcelle statutParcelle, Long departementId, String departementCode, String departementNom, Long communeId, String communeCode, String communeNom, Long arrondissementId, String arrondissementCode, String arrondissementNom, Long quartierId, String quartierCode, String quartierNom, Integer geomSrid, Polygon geometry, String geometryString, Long parcelleId) {
this.id = id;
this.nup = nup;
this.nupProvisoire = nupProvisoire;
this.longitude = longitude;
this.latitude = latitude;
this.numeroRue = numeroRue;
this.numeroEntreePorte = numeroEntreePorte;
this.codeInstad = codeInstad;
this.numeroEtatLieux = numeroEtatLieux;
this.numeroTitreFoncier = numeroTitreFoncier;
this.dateTitreFoncier = dateTitreFoncier;
this.batie = batie;
this.npi = npi;
this.ifu = ifu;
this.nom = nom;
this.prenom = prenom;
this.raisonSociale = raisonSociale;
this.nomEtPrenoms = nomEtPrenoms;
this.telephone = telephone;
this.adresse = adresse;
this.nomRepresentant = nomRepresentant;
this.prenomRepresentant = prenomRepresentant;
this.raisonSocialeRepresentant = raisonSocialeRepresentant;
this.nomEtPrenomsRepresentant = nomEtPrenomsRepresentant;
this.telephoneRepresentant = telephoneRepresentant;
this.adresseRepresentant = adresseRepresentant;
this.q = q;
this.zone = zone;
this.ilot = ilot;
this.p = p;
this.qLotissement = qLotissement;
this.ilotLotissement = ilotLotissement;
this.pLotissement = pLotissement;
this.pointsPolygone = pointsPolygone;
this.superficie = superficie;
this.dateCollecte = dateCollecte;
this.sourceDonnees = sourceDonnees;
this.observations = observations;
this.statutParcelle = statutParcelle;
this.departementId = departementId;
this.departementCode = departementCode;
this.departementNom = departementNom;
this.communeId = communeId;
this.communeCode = communeCode;
this.communeNom = communeNom;
this.arrondissementId = arrondissementId;
this.arrondissementCode = arrondissementCode;
this.arrondissementNom = arrondissementNom;
this.quartierId = quartierId;
this.quartierCode = quartierCode;
this.quartierNom = quartierNom;
this.geomSrid = geomSrid;
this.geometry = geometry;
this.geometryString = geometryString;
this.parcelleId = parcelleId;
}
}

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