Merge pull request 'gestion processus de traitement des declarations de propriete' (#244) from features/fiche_refonte into develop
Reviewed-on: #244
This commit was merged in pull request #244.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package io.gmss.fiscad.controllers.decoupage;
|
||||
|
||||
import io.gmss.fiscad.entities.decoupage.SecteurDecoupage;
|
||||
import io.gmss.fiscad.enums.StatutEdeclarationPropriete;
|
||||
import io.gmss.fiscad.enums.StatutEnquete;
|
||||
import io.gmss.fiscad.exceptions.*;
|
||||
import io.gmss.fiscad.interfaces.decoupage.SecteurDecoupageService;
|
||||
@@ -283,6 +284,9 @@ public class SecteurDecoupageController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/arbre/enquete-valide/user-id/{userId}")
|
||||
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||
public ResponseEntity<?> getArborescenceEnqueteValideByUserId(@PathVariable Long userId) {
|
||||
@@ -484,4 +488,80 @@ public class SecteurDecoupageController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/arbre/declaration-propiete-en-attente/user-id/{userId}")
|
||||
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||
public ResponseEntity<?> getArborescenceDeclarationProprieteEnAttenteByUserId(@PathVariable Long userId) {
|
||||
try {
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, secteurDecoupageService.getStatDeclarationProprieteByUserId(userId, StatutEdeclarationPropriete.EN_ATTENTE.toString()), "declarations trouvé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) {
|
||||
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/declaration-propiete-en-cours/user-id/{userId}")
|
||||
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||
public ResponseEntity<?> getArborescenceDeclarationProprieteEncoursByUserId(@PathVariable Long userId) {
|
||||
try {
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, secteurDecoupageService.getStatDeclarationProprieteByUserId(userId, StatutEdeclarationPropriete.EN_COURS.toString()), "declarations trouvé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) {
|
||||
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/declaration-propiete/user-id/{userId}")
|
||||
@PreAuthorize("hasAuthority('READ_SECTEUR_DECOUPAGE')")
|
||||
public ResponseEntity<?> getArborescenceDeclarationProprieteByUserId(@PathVariable Long userId) {
|
||||
try {
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, secteurDecoupageService.getStatDeclarationProprieteByUserId(userId), "declarations trouvé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) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,258 @@
|
||||
package io.gmss.fiscad.controllers.rfu.metier;
|
||||
|
||||
|
||||
import io.gmss.fiscad.exceptions.*;
|
||||
import io.gmss.fiscad.interfaces.interface_sigibe.EdeclarationProprieteService;
|
||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||
import io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb;
|
||||
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.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.client.HttpClientErrorException;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "api/declaration-propriete", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@SecurityRequirement(name = "bearer")
|
||||
@Tag(name = "Déclaration propriete")
|
||||
@CrossOrigin(origins = "*")
|
||||
public class EdeclarationProprieteController {
|
||||
|
||||
private final EdeclarationProprieteService edeclarationProprieteService;
|
||||
private static final Logger logger = LoggerFactory.getLogger(EdeclarationProprieteController.class);
|
||||
|
||||
public EdeclarationProprieteController(EdeclarationProprieteService edeclarationProprieteService) {
|
||||
this.edeclarationProprieteService = edeclarationProprieteService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/all")
|
||||
//@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||
public ResponseEntity<?> getAllEdeclarationProprieteList(@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, edeclarationProprieteService.getEdeclarationProprieteList(userId), "Liste des Caracteristiques du batiment chargée avec succès."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||
FileStorageException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||
} catch (NullPointerException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/all-paged")
|
||||
//@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||
public ResponseEntity<?> getAllEdeclarationProprietePaged(@CurrentUser UserPrincipal currentUser,@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, edeclarationProprieteService.getEdeclarationProprieteListPageable(userId,pageable), "Liste des Caracteristiques du batiment chargée avec succès."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||
FileStorageException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||
} catch (NullPointerException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/id/{id}")
|
||||
// @PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||
public ResponseEntity<?> getEdeclarationProprieteById(@CurrentUser UserPrincipal currentUser,@PathVariable Long id) {
|
||||
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, edeclarationProprieteService.getEdeclarationProprieteToDto(userId,id), "Caracteristique du batiment trouvée avec succès."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||
FileStorageException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||
} catch (NullPointerException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/by-quartier-id/{quartierId}")
|
||||
//@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||
public ResponseEntity<?> getEdeclarationProprieteByQuartierId(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId) {
|
||||
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, edeclarationProprieteService.getEdeclarationProprieteListByQuartier(userId,quartierId), "Liste des déclaration du quartier."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||
FileStorageException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||
} catch (NullPointerException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/page/by-quartier-id/{quartierId}")
|
||||
//@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||
public ResponseEntity<?> getEdeclarationProprieteByQuartierIdPaged(@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, edeclarationProprieteService.getEdeclarationProprieteListByQuartierPageable(userId,quartierId,pageable), "Liste des déclaration du quartier."),
|
||||
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-personne-id/{personneId}")
|
||||
//@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||
public ResponseEntity<?> getEdeclarationProprieteByPersonneId(@CurrentUser UserPrincipal currentUser, @PathVariable Long personneId) {
|
||||
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, edeclarationProprieteService.getEdeclarationProprieteListByPersonne(userId,personneId), "Liste des déclaration du contribuable."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||
FileStorageException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||
} catch (NullPointerException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/page/by-personne-id/{personneId}")
|
||||
//@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||
public ResponseEntity<?> getEdeclarationProprieteByPersonneIdPaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long personneId,@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, edeclarationProprieteService.getEdeclarationProprieteListByPersonnePageable(userId,personneId,pageable), "Liste des déclaration du contribuable."),
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import io.gmss.fiscad.entities.infocad.parametre.Bloc;
|
||||
import io.gmss.fiscad.entities.infocad.parametre.ModeAcquisition;
|
||||
import io.gmss.fiscad.entities.infocad.parametre.NatureDomaine;
|
||||
import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
||||
import io.gmss.fiscad.entities.interface_sigibe.EdeclarationPropriete;
|
||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueParcelle;
|
||||
import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment;
|
||||
import io.gmss.fiscad.entities.rfu.metier.EnqueteUniteLogement;
|
||||
@@ -203,7 +204,7 @@ public class Enquete extends BaseEntity implements Serializable {
|
||||
private String representantPrenom;
|
||||
private String representantTel;
|
||||
private String representantNpi;
|
||||
//
|
||||
|
||||
// @JsonIgnore
|
||||
// @OneToMany(mappedBy = "enquete")
|
||||
// @JsonManagedReference
|
||||
@@ -222,6 +223,9 @@ public class Enquete extends BaseEntity implements Serializable {
|
||||
//private StatutEnregistrement statutEnregistrement;
|
||||
|
||||
|
||||
@ManyToOne
|
||||
private EdeclarationPropriete edeclarationPropriete;
|
||||
|
||||
public Long getTerminalId() {
|
||||
if (this.terminal != null) {
|
||||
return this.terminal.getId();
|
||||
|
||||
@@ -6,6 +6,7 @@ import io.gmss.fiscad.deserializer.LocalDateDeserializer;
|
||||
import io.gmss.fiscad.entities.BaseEntity;
|
||||
import io.gmss.fiscad.entities.decoupage.Quartier;
|
||||
import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
||||
import io.gmss.fiscad.enums.StatutEdeclarationPropriete;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -50,7 +51,7 @@ public class EdeclarationPropriete extends BaseEntity implements Serializable {
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateConstruction;
|
||||
private Float superficieSolBat;
|
||||
private Float superficieSolUlot;
|
||||
private Float superficieSolUlo;
|
||||
private Float superficieParcelle;
|
||||
private String usage;
|
||||
private Boolean bati;
|
||||
@@ -58,4 +59,11 @@ public class EdeclarationPropriete extends BaseEntity implements Serializable {
|
||||
private Personne personne;
|
||||
@ManyToOne
|
||||
private Quartier quartier;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private StatutEdeclarationPropriete statutEdeclarationPropriete;
|
||||
|
||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateStatut;
|
||||
|
||||
}
|
||||
@@ -11,6 +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.Upload;
|
||||
import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
||||
import io.gmss.fiscad.entities.interface_sigibe.EdeclarationPropriete;
|
||||
import io.gmss.fiscad.entities.rfu.parametre.Caracteristique;
|
||||
import io.gmss.fiscad.entities.rfu.parametre.CategorieBatiment;
|
||||
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
|
||||
@@ -147,4 +148,6 @@ public class EnqueteBatiment extends BaseEntity implements Serializable {
|
||||
@ManyToOne
|
||||
private Usage usage ;
|
||||
|
||||
@ManyToOne
|
||||
private EdeclarationPropriete edeclarationPropriete;
|
||||
}
|
||||
|
||||
@@ -11,6 +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.Upload;
|
||||
import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
||||
import io.gmss.fiscad.entities.interface_sigibe.EdeclarationPropriete;
|
||||
import io.gmss.fiscad.entities.rfu.parametre.CategorieBatiment;
|
||||
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
|
||||
import io.gmss.fiscad.entities.rfu.parametre.Usage;
|
||||
@@ -133,4 +134,7 @@ public class EnqueteUniteLogement extends BaseEntity implements Serializable {
|
||||
private CategorieBatiment categorieBatiment ;
|
||||
@ManyToOne
|
||||
private Usage usage ;
|
||||
|
||||
@ManyToOne
|
||||
private EdeclarationPropriete edeclarationPropriete;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package io.gmss.fiscad.enums;
|
||||
|
||||
public enum StatutEdeclarationPropriete {
|
||||
EN_ATTENTE,
|
||||
EN_COURS,
|
||||
TRAITE
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import io.gmss.fiscad.paylaods.response.statistique.ParcelleStatsProjectionUnSec
|
||||
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.interface_sigibe.EdeclarationProprieteRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository;
|
||||
import io.gmss.fiscad.service.EntityFromPayLoadService;
|
||||
@@ -30,6 +31,7 @@ public class SecteurDecoupageServiceImpl implements SecteurDecoupageService {
|
||||
private final SecteurService secteurService;
|
||||
private final ParcelleRepository parcelleRepository;
|
||||
private final EnqueteRepository enqueteRepository;
|
||||
private final EdeclarationProprieteRepository edeclarationProprieteRepository;
|
||||
private final EnqueteBatimentRepository enqueteBatimentRepository;
|
||||
private final EnqueteUniteLogementRepository enqueteUniteLogementRepository;
|
||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
||||
@@ -149,5 +151,24 @@ public class SecteurDecoupageServiceImpl implements SecteurDecoupageService {
|
||||
return enqueteUniteLogementRepository.findStatsEnqueteBatimentBySecteurs(secteurIds,statutEnquete);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ParcelleStatsProjectionUnSecteur> getStatDeclarationProprieteByUserId(Long userId, String statutDeclcarationPropriete) {
|
||||
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
|
||||
List<Long> secteurIds = secteurs.stream()
|
||||
.map(Secteur::getId)
|
||||
.toList();
|
||||
return edeclarationProprieteRepository.findStatsDeclarationProprieteBySecteurs(secteurIds,statutDeclcarationPropriete);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<ParcelleStatsProjectionUnSecteur> getStatDeclarationProprieteByUserId(Long userId) {
|
||||
List<Secteur> secteurs= secteurService.getListSecteurUserId(userId);
|
||||
List<Long> secteurIds = secteurs.stream()
|
||||
.map(Secteur::getId)
|
||||
.toList();
|
||||
return edeclarationProprieteRepository.findStatsDeclarationProprieteBySecteurs(secteurIds);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public class SecteurServiceImpl implements SecteurService {
|
||||
}else if(avoirFonction.getFonction().getStructure()!=null){
|
||||
secteurs.addAll(secteurRepository.findDistinctBySection_Structure_Id(avoirFonction.getFonction().getStructure().getId()));
|
||||
}else if(avoirFonction.getFonction().getDepartement()!=null){
|
||||
secteurs.addAll(secteurRepository.findSectionsByDepartement(avoirFonction.getFonction().getDepartement().getId()));
|
||||
secteurs.addAll(secteurRepository.findSecteursByDepartement(avoirFonction.getFonction().getDepartement().getId()));
|
||||
}
|
||||
});
|
||||
return secteurs;
|
||||
@@ -172,6 +172,6 @@ public class SecteurServiceImpl implements SecteurService {
|
||||
|
||||
@Override
|
||||
public List<Secteur> getListSecteurByDepartementId(Long departementId) {
|
||||
return secteurRepository.findSectionsByDepartement(departementId);
|
||||
return secteurRepository.findSecteursByDepartement(departementId);
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import io.gmss.fiscad.entities.rfu.metier.EnqueteUniteLogement;
|
||||
import io.gmss.fiscad.entities.rfu.parametre.Equipe;
|
||||
import io.gmss.fiscad.entities.rfu.parametre.ZoneRfu;
|
||||
import io.gmss.fiscad.entities.user.User;
|
||||
import io.gmss.fiscad.enums.StatutEdeclarationPropriete;
|
||||
import io.gmss.fiscad.enums.StatutEnquete;
|
||||
import io.gmss.fiscad.exceptions.ApplicationException;
|
||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
||||
@@ -18,6 +19,7 @@ import io.gmss.fiscad.interfaces.decoupage.SecteurService;
|
||||
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.interface_sigibe.EdeclarationProprieteService;
|
||||
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueParcelleService;
|
||||
import io.gmss.fiscad.interfaces.rfu.metier.DeclarationNcService;
|
||||
import io.gmss.fiscad.interfaces.user.UserService;
|
||||
@@ -85,6 +87,7 @@ public class EnqueteServiceImpl implements EnqueteService {
|
||||
private final ZoneRfuRepository zoneRfuRepository ;
|
||||
private final EntityFromPayLoadService entityFromPayLoadService ;
|
||||
private final SecteurService secteurService ;
|
||||
private final EdeclarationProprieteService edeclarationProprieteService ;
|
||||
;
|
||||
|
||||
@PersistenceContext
|
||||
@@ -133,6 +136,10 @@ public class EnqueteServiceImpl implements EnqueteService {
|
||||
////enregistrement de l'enquete
|
||||
enquete=enqueteRepository.save(enquete);
|
||||
|
||||
if(enquete.getEdeclarationPropriete()!=null) {
|
||||
edeclarationProprieteService.updateEdeclarationProprieteStatut(enquete.getEdeclarationPropriete().getId(), StatutEdeclarationPropriete.EN_COURS);
|
||||
}
|
||||
|
||||
return enqueteRepository.findEnqueteToDto(enquete.getId()).orElse(null);
|
||||
}
|
||||
|
||||
@@ -375,6 +382,12 @@ public class EnqueteServiceImpl implements EnqueteService {
|
||||
enquete.setSynchronise(true);
|
||||
|
||||
enquete= enqueteRepository.save(enquete);
|
||||
|
||||
|
||||
if(enquete.getEdeclarationPropriete()!=null) {
|
||||
edeclarationProprieteService.updateEdeclarationProprieteStatut(enquete.getEdeclarationPropriete().getId(), StatutEdeclarationPropriete.TRAITE);
|
||||
}
|
||||
|
||||
return enqueteRepository.findEnqueteToDto(enquete.getId()).orElse(null);
|
||||
}
|
||||
|
||||
|
||||
@@ -199,8 +199,8 @@ public class ParcelleServiceImpl implements ParcelleService {
|
||||
return parcelleRepository.updateParcelleBatieTrue()+parcelleRepository.updateParcelleBatieFalse();
|
||||
}
|
||||
|
||||
|
||||
private List<Long> getSecteurIdListForUser(Long userId) {
|
||||
@Override
|
||||
public List<Long> getSecteurIdListForUser(Long userId) {
|
||||
List<Secteur> secteurs = secteurService.getListSecteurUserId(userId);
|
||||
List<Long> secteurIds = secteurs.stream()
|
||||
.map(Secteur::getId)
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
package io.gmss.fiscad.implementations.interface_sigibe;
|
||||
|
||||
import io.gmss.fiscad.entities.interface_sigibe.EdeclarationPropriete;
|
||||
import io.gmss.fiscad.enums.StatutEdeclarationPropriete;
|
||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
||||
import io.gmss.fiscad.interfaces.infocad.metier.ParcelleService;
|
||||
import io.gmss.fiscad.interfaces.interface_sigibe.EdeclarationProprieteService;
|
||||
import io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb;
|
||||
import io.gmss.fiscad.persistence.repositories.interface_sigibe.EdeclarationProprieteRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository;
|
||||
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.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class EdeclarationProprieteServiceImpl implements EdeclarationProprieteService {
|
||||
|
||||
private final EdeclarationProprieteRepository edeclarationProprieteRepository;
|
||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
||||
private final EnqueteBatimentRepository enqueteBatimentRepository;
|
||||
private final ParcelleService parcelleService;
|
||||
|
||||
|
||||
@Override
|
||||
public EdeclarationProprietePayloadWeb createEdeclarationPropriete(EdeclarationProprietePayloadWeb caracteristiqueBatimentPayloadWeb) throws BadRequestException {
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdeclarationProprietePayloadWeb updateEdeclarationPropriete(Long id, EdeclarationProprietePayloadWeb caracteristiqueBatimentPayloadWeb) throws NotFoundException {
|
||||
return null; //edeclarationPropriete.findEdeclarationProprieteToDto(caracteristiqueBatiment.getId()).orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEdeclarationProprieteStatut(Long id, StatutEdeclarationPropriete statutEdeclarationPropriete) throws NotFoundException {
|
||||
EdeclarationPropriete edeclarationPropriete = edeclarationProprieteRepository.findById(id).orElse(null);
|
||||
if(edeclarationPropriete!=null){
|
||||
edeclarationPropriete.setStatutEdeclarationPropriete(statutEdeclarationPropriete);
|
||||
edeclarationPropriete.setDateStatut(LocalDate.now());
|
||||
edeclarationProprieteRepository.save(edeclarationPropriete);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteEdeclarationPropriete(Long id) throws NotFoundException {
|
||||
Optional<EdeclarationPropriete> caracteristiqueBatimentOptional = edeclarationProprieteRepository.findById(id);
|
||||
if (caracteristiqueBatimentOptional.isPresent()) {
|
||||
edeclarationProprieteRepository.deleteById(caracteristiqueBatimentOptional.get().getId());
|
||||
} else {
|
||||
throw new NotFoundException("Impossible de trouver la nouvelle caracteristique de batiment spécifié dans notre base de données.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListPageable(Long userId,Pageable pageable) {
|
||||
List<Long> secteurIds = parcelleService.getSecteurIdListForUser(userId);
|
||||
return edeclarationProprieteRepository.findAllPayloadPageable(secteurIds,pageable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdeclarationProprietePayloadWeb> getEdeclarationProprieteList(Long userId) {
|
||||
List<Long> secteurIds = parcelleService.getSecteurIdListForUser(userId);
|
||||
return edeclarationProprieteRepository.findAllPayload(secteurIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<EdeclarationProprietePayloadWeb> getEdeclarationProprieteToDto(Long userId, Long id) {
|
||||
if (edeclarationProprieteRepository.existsById(id)) {
|
||||
List<Long> secteurIds = parcelleService.getSecteurIdListForUser(userId);
|
||||
return edeclarationProprieteRepository.findPayloadById(id,secteurIds);
|
||||
} else {
|
||||
throw new NotFoundException("Impossible de trouver la caractéristique spécifiée dans la base de données.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByPersonnePageable(Long userId,Long personneId, Pageable pageable) {
|
||||
List<Long> secteurIds = parcelleService.getSecteurIdListForUser(userId);
|
||||
return edeclarationProprieteRepository.findAllPayloadByPersonneIdPageable(personneId,secteurIds,pageable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByPersonne(Long userId, Long personneId) {
|
||||
List<Long> secteurIds = parcelleService.getSecteurIdListForUser(userId);
|
||||
return edeclarationProprieteRepository.findAllPayloadByPersonneId(personneId,secteurIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByQuartierPageable(Long userId, Long quartierId, Pageable pageable) {
|
||||
List<Long> secteurIds = parcelleService.getSecteurIdListForUser(userId);
|
||||
return edeclarationProprieteRepository.findAllPayloadByQuartierIdPageable(quartierId,secteurIds,pageable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByQuartier(Long userId, Long quartierId) {
|
||||
List<Long> secteurIds = parcelleService.getSecteurIdListForUser(userId);
|
||||
return edeclarationProprieteRepository.findAllPayloadByQuartierId(quartierId,secteurIds);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -140,6 +140,7 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
|
||||
|
||||
Integer nbsrtbbt= donneesImpositionTfuRepository.genererDonneesSrtbBatie(impositionsTfuPaylaodWeb.getId(),userId);
|
||||
|
||||
Integer nbMajAcompteRirf= donneesImpositionTfuRepository.majDonneesAcompteRirf(impositionsTfuPaylaodWeb.getId());
|
||||
|
||||
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
||||
impositionsTfu.setStatusAvis(StatusAvis.GENERE);
|
||||
@@ -170,7 +171,7 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
|
||||
|
||||
Integer nbsrtbbt= donneesImpositionTfuRepository.genererDonneesSrtbBatie(impositionsTfuPaylaodWeb.getId(),userId,parcelleId);
|
||||
|
||||
Integer nbMajAcompteRirf= donneesImpositionTfuRepository.majDonneesAcompteRirf(impositionsTfuPaylaodWeb.getId());
|
||||
Integer nbMajAcompteRirf= donneesImpositionTfuRepository.majDonneesAcompteRirfUneParcelle(impositionsTfuPaylaodWeb.getId(),parcelleId);
|
||||
|
||||
|
||||
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
||||
|
||||
@@ -7,10 +7,12 @@ import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
||||
import io.gmss.fiscad.entities.rfu.metier.Batiment;
|
||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
|
||||
import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment;
|
||||
import io.gmss.fiscad.enums.StatutEdeclarationPropriete;
|
||||
import io.gmss.fiscad.enums.StatutEnquete;
|
||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
||||
import io.gmss.fiscad.interfaces.decoupage.SecteurService;
|
||||
import io.gmss.fiscad.interfaces.interface_sigibe.EdeclarationProprieteService;
|
||||
import io.gmss.fiscad.interfaces.rfu.metier.BatimentService;
|
||||
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueBatimentService;
|
||||
import io.gmss.fiscad.interfaces.rfu.metier.EnqueteBatimentService;
|
||||
@@ -22,6 +24,7 @@ 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.UploadRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.infocad.parametre.PersonneRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.interface_sigibe.EdeclarationProprieteRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.BatimentRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository;
|
||||
import io.gmss.fiscad.service.EntityFromPayLoadService;
|
||||
@@ -40,6 +43,7 @@ import java.util.Optional;
|
||||
@Service
|
||||
public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
|
||||
private final EnqueteBatimentRepository enqueteBatimentRepository;
|
||||
private final EdeclarationProprieteService edeclarationProprieteService;
|
||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
||||
private final BatimentRepository batimentRepository;
|
||||
private final BatimentService batimentService;
|
||||
@@ -70,6 +74,11 @@ public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
|
||||
|
||||
enqueteBatiment = entityFromPayLoadService.getEnqueteBatimentFromPayLoadWeb(enqueteBatimentPayloadWeb);
|
||||
enqueteBatiment= enqueteBatimentRepository.save(enqueteBatiment);
|
||||
|
||||
if(enqueteBatiment.getEdeclarationPropriete()!=null) {
|
||||
edeclarationProprieteService.updateEdeclarationProprieteStatut(enqueteBatiment.getEdeclarationPropriete().getId(), StatutEdeclarationPropriete.EN_COURS);
|
||||
}
|
||||
|
||||
enqueteBatimentPayloadWeb= enqueteBatimentRepository.findEnqueteBatimentByIdToDto(enqueteBatiment.getId()).orElse(null);
|
||||
return enqueteBatimentPayloadWeb ;
|
||||
}
|
||||
@@ -196,6 +205,10 @@ public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
|
||||
enqueteBatiment.setDateValidation(LocalDate.now());
|
||||
enqueteBatiment.setStatutEnquete(StatutEnquete.VALIDE);
|
||||
|
||||
if(enqueteBatiment.getEdeclarationPropriete()!=null) {
|
||||
edeclarationProprieteService.updateEdeclarationProprieteStatut(enqueteBatiment.getEdeclarationPropriete().getId(), StatutEdeclarationPropriete.TRAITE);
|
||||
}
|
||||
|
||||
enqueteBatiment= enqueteBatimentRepository.save(enqueteBatiment);
|
||||
return enqueteBatimentRepository.findEnqueteBatimentByIdToDto(enqueteBatiment.getId()).orElse(null);
|
||||
}
|
||||
|
||||
@@ -5,10 +5,12 @@ import io.gmss.fiscad.entities.infocad.metier.Enquete;
|
||||
import io.gmss.fiscad.entities.infocad.metier.Upload;
|
||||
import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
||||
import io.gmss.fiscad.entities.rfu.metier.*;
|
||||
import io.gmss.fiscad.enums.StatutEdeclarationPropriete;
|
||||
import io.gmss.fiscad.enums.StatutEnquete;
|
||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
||||
import io.gmss.fiscad.interfaces.decoupage.SecteurService;
|
||||
import io.gmss.fiscad.interfaces.interface_sigibe.EdeclarationProprieteService;
|
||||
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueUniteLogementService;
|
||||
import io.gmss.fiscad.interfaces.rfu.metier.EnqueteUniteLogementService;
|
||||
import io.gmss.fiscad.interfaces.rfu.metier.UniteLogementService;
|
||||
@@ -42,6 +44,7 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
|
||||
private final UniteLogementRepository uniteLogementRepository ;
|
||||
private final UniteLogementService uniteLogementService ;
|
||||
private final SecteurService secteurService ;
|
||||
private final EdeclarationProprieteService edeclarationProprieteService ;
|
||||
|
||||
|
||||
|
||||
@@ -68,6 +71,11 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
|
||||
|
||||
enqueteUniteLogement = entityFromPayLoadService.getEnqueteUniteLogementFromPayLoadWeb(enqueteUniteLogementPayloadWeb);
|
||||
enqueteUniteLogement= enqueteUniteLogementRepository.save(enqueteUniteLogement);
|
||||
|
||||
if(enqueteUniteLogement.getEdeclarationPropriete()!=null) {
|
||||
edeclarationProprieteService.updateEdeclarationProprieteStatut(enqueteUniteLogement.getEdeclarationPropriete().getId(), StatutEdeclarationPropriete.EN_COURS);
|
||||
}
|
||||
|
||||
enqueteUniteLogementPayloadWeb = enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(enqueteUniteLogement.getId()).orElse(null);
|
||||
return enqueteUniteLogementPayloadWeb ;
|
||||
}
|
||||
@@ -198,6 +206,10 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
|
||||
enqueteUniteLogement.setDateValidation(LocalDate.now());
|
||||
enqueteUniteLogement.setStatutEnquete(StatutEnquete.VALIDE);
|
||||
|
||||
if(enqueteUniteLogement.getEdeclarationPropriete()!=null) {
|
||||
edeclarationProprieteService.updateEdeclarationProprieteStatut(enqueteUniteLogement.getEdeclarationPropriete().getId(), StatutEdeclarationPropriete.TRAITE);
|
||||
}
|
||||
|
||||
enqueteUniteLogement= enqueteUniteLogementRepository.save(enqueteUniteLogement);
|
||||
return enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(enqueteUniteLogement.getId()).orElse(null);
|
||||
}
|
||||
|
||||
@@ -36,4 +36,11 @@ public interface SecteurDecoupageService {
|
||||
List<ParcelleStatsProjectionUnSecteur> getStatEnqueteDecoupageByUserId(Long userId, String statutEnquete) ;
|
||||
List<ParcelleStatsProjectionUnSecteur> getStatEnqueteBatimentDecoupageByUserId(Long userId, String statutEnquete) ;
|
||||
List<ParcelleStatsProjectionUnSecteur> getStatEnqueteUniteLogementDecoupageByUserId(Long userId, String statutEnquete) ;
|
||||
|
||||
|
||||
List<ParcelleStatsProjectionUnSecteur> getStatDeclarationProprieteByUserId(Long userId, String statutDeclcarationPropriete) ;
|
||||
|
||||
|
||||
List<ParcelleStatsProjectionUnSecteur> getStatDeclarationProprieteByUserId(Long userId) ;
|
||||
|
||||
}
|
||||
@@ -33,4 +33,6 @@ public interface ParcelleService {
|
||||
|
||||
Page<ParcellePayLoadWeb> getParcelleByMultiFiltre(Long userId, FiltreParcelle filtreParcelle, Pageable pageable);
|
||||
Integer majParcelleBatieNonbatie();
|
||||
|
||||
public List<Long> getSecteurIdListForUser(Long userId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package io.gmss.fiscad.interfaces.interface_sigibe;
|
||||
|
||||
import io.gmss.fiscad.enums.StatutEdeclarationPropriete;
|
||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
||||
import io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface EdeclarationProprieteService {
|
||||
|
||||
EdeclarationProprietePayloadWeb createEdeclarationPropriete(EdeclarationProprietePayloadWeb edeclarationProprietePayloadWeb) throws BadRequestException;
|
||||
|
||||
EdeclarationProprietePayloadWeb updateEdeclarationPropriete(Long id, EdeclarationProprietePayloadWeb edeclarationProprietePayloadWeb) throws NotFoundException;
|
||||
void updateEdeclarationProprieteStatut(Long id, StatutEdeclarationPropriete statutEdeclarationPropriete) throws NotFoundException;
|
||||
|
||||
void deleteEdeclarationPropriete(Long id) throws NotFoundException;
|
||||
|
||||
Page<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListPageable(Long userId,Pageable pageable);
|
||||
|
||||
List<EdeclarationProprietePayloadWeb> getEdeclarationProprieteList(Long userId);
|
||||
|
||||
Optional<EdeclarationProprietePayloadWeb> getEdeclarationProprieteToDto(Long userId,Long id);
|
||||
|
||||
Page<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByPersonnePageable(Long userId,Long personneId, Pageable pageable);
|
||||
|
||||
List<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByPersonne(Long userId,Long personneId);
|
||||
|
||||
Page<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByQuartierPageable(Long userId,Long quartierId, Pageable pageable);
|
||||
|
||||
List<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByQuartier(Long userId,Long quartierId);
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
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.enums.StatutEdeclarationPropriete;
|
||||
import jakarta.persistence.EnumType;
|
||||
import jakarta.persistence.Enumerated;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class EdeclarationProprietePayloadWeb {
|
||||
private Long id;
|
||||
private Long idImpot ;
|
||||
private String rImpot ;
|
||||
private String ifu ;
|
||||
private String rCommune ;
|
||||
private String rQuartier ;
|
||||
private String qipQuartier;
|
||||
private String qipIlot;
|
||||
private String qipParcelle;
|
||||
private String nup;
|
||||
private String gpsLatitude;
|
||||
private String gpsLongitude;
|
||||
private String commentaire;
|
||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateValidation;
|
||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateInformation;
|
||||
private Long valeurBatiment;
|
||||
private Long nub;
|
||||
private Long nul;
|
||||
private Long montantLocatifAnnuel ;
|
||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateConstruction;
|
||||
private Float superficieSolBat;
|
||||
private Float superficieSolUlo;
|
||||
private Float superficieParcelle;
|
||||
private String usage;
|
||||
private Boolean bati;
|
||||
private Long personneId;
|
||||
private String personneNom;
|
||||
private String personnePrenom;
|
||||
private String personneRaisonSociale;
|
||||
private Long quartierId;
|
||||
private String quartierCode;
|
||||
private String quartierNom;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private StatutEdeclarationPropriete statutEdeclarationPropriete;
|
||||
|
||||
|
||||
public EdeclarationProprietePayloadWeb(Long id, Long idImpot, String rImpot, String ifu, String rCommune, String rQuartier, String qipQuartier, String qipIlot, String qipParcelle, String nup, String gpsLatitude, String gpsLongitude, String commentaire, LocalDate dateValidation, LocalDate dateInformation, Long valeurBatiment, Long nub, Long nul, Long montantLocatifAnnuel, LocalDate dateConstruction, Float superficieSolBat, Float superficieSolUlo, Float superficieParcelle, String usage, Boolean bati, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Long quartierId, String quartierCode, String quartierNom,StatutEdeclarationPropriete statutEdeclarationPropriete) {
|
||||
this.id = id;
|
||||
this.idImpot = idImpot;
|
||||
this.rImpot = rImpot;
|
||||
this.ifu = ifu;
|
||||
this.rCommune = rCommune;
|
||||
this.rQuartier = rQuartier;
|
||||
this.qipQuartier = qipQuartier;
|
||||
this.qipIlot = qipIlot;
|
||||
this.qipParcelle = qipParcelle;
|
||||
this.nup = nup;
|
||||
this.gpsLatitude = gpsLatitude;
|
||||
this.gpsLongitude = gpsLongitude;
|
||||
this.commentaire = commentaire;
|
||||
this.dateValidation = dateValidation;
|
||||
this.dateInformation = dateInformation;
|
||||
this.valeurBatiment = valeurBatiment;
|
||||
this.nub = nub;
|
||||
this.nul = nul;
|
||||
this.montantLocatifAnnuel = montantLocatifAnnuel;
|
||||
this.dateConstruction = dateConstruction;
|
||||
this.superficieSolBat = superficieSolBat;
|
||||
this.superficieSolUlo = superficieSolUlo;
|
||||
this.superficieParcelle = superficieParcelle;
|
||||
this.usage = usage;
|
||||
this.bati = bati;
|
||||
this.personneId = personneId;
|
||||
this.personneNom = personneNom;
|
||||
this.personnePrenom = personnePrenom;
|
||||
this.personneRaisonSociale = personneRaisonSociale;
|
||||
this.quartierId = quartierId;
|
||||
this.quartierCode = quartierCode;
|
||||
this.quartierNom = quartierNom;
|
||||
this.statutEdeclarationPropriete=statutEdeclarationPropriete;
|
||||
}
|
||||
}
|
||||
@@ -75,6 +75,7 @@ public class EnqueteBatimentPayloadWeb {
|
||||
private Long montantLocatifAnnuelEstime;
|
||||
private Long valeurBatimentCalcule;
|
||||
private Integer nbreUniteLogement;
|
||||
private Long eDeclarationPropriete ;
|
||||
|
||||
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,
|
||||
@@ -101,7 +102,8 @@ public class EnqueteBatimentPayloadWeb {
|
||||
String parcelleP,
|
||||
Long montantLocatifAnnuelEstime,
|
||||
Long valeurBatimentCalcule,
|
||||
Integer nbreUniteLogement
|
||||
Integer nbreUniteLogement,
|
||||
Long edeclaration
|
||||
) {
|
||||
this.id = id;
|
||||
this.observation = observation;
|
||||
@@ -161,5 +163,6 @@ public class EnqueteBatimentPayloadWeb {
|
||||
this.montantLocatifAnnuelEstime=montantLocatifAnnuelEstime;
|
||||
this.valeurBatimentCalcule=valeurBatimentCalcule;
|
||||
this.nbreUniteLogement=nbreUniteLogement;
|
||||
this.eDeclarationPropriete=edeclaration;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ public class EnquetePayLoadWeb {
|
||||
private Long typeDomaineId;
|
||||
private String typeDomaineLibelle;
|
||||
private Long rueId;
|
||||
private Long eDeclarationPropriete ;
|
||||
|
||||
|
||||
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,
|
||||
@@ -97,7 +98,8 @@ public class EnquetePayLoadWeb {
|
||||
String natureDomaineLibelle,
|
||||
Long typeDomaineId,
|
||||
String typeDomaineLibelle,
|
||||
Long rueId
|
||||
Long rueId,
|
||||
Long edeclaration
|
||||
) {
|
||||
this.id = id;
|
||||
this.dateEnquete = dateEnquete;
|
||||
@@ -160,5 +162,6 @@ public class EnquetePayLoadWeb {
|
||||
this.typeDomaineId=typeDomaineId;
|
||||
this.typeDomaineLibelle=typeDomaineLibelle;
|
||||
this.rueId=rueId;
|
||||
this.eDeclarationPropriete=edeclaration;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,8 +56,6 @@ public class EnqueteUniteLogementPayloadWeb {
|
||||
private Integer nombrePiscine;
|
||||
private Long usageId;
|
||||
private String usageNom;
|
||||
|
||||
|
||||
private String nul;
|
||||
private String numeroEtage;
|
||||
private String code;
|
||||
@@ -67,6 +65,7 @@ public class EnqueteUniteLogementPayloadWeb {
|
||||
private Long enqueteUniteLogementCourantId;
|
||||
private Long montantLocatifAnnuelEstime;
|
||||
private Long valeurUniteLogementCalcule;
|
||||
private Long eDeclarationPropriete ;
|
||||
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,
|
||||
@@ -87,7 +86,8 @@ public class EnqueteUniteLogementPayloadWeb {
|
||||
String batimentNub,
|
||||
LocalDate dateConstruction,
|
||||
Long montantLocatifAnnuelEstime,
|
||||
Long valeurUniteLogementCalcule
|
||||
Long valeurUniteLogementCalcule,
|
||||
Long eDeclarationPropriete
|
||||
) {
|
||||
this.id = id;
|
||||
this.observation = observation;
|
||||
@@ -142,5 +142,6 @@ public class EnqueteUniteLogementPayloadWeb {
|
||||
this.dateConstruction=dateConstruction;
|
||||
this.montantLocatifAnnuelEstime=montantLocatifAnnuelEstime;
|
||||
this.valeurUniteLogementCalcule=valeurUniteLogementCalcule;
|
||||
this.eDeclarationPropriete=eDeclarationPropriete;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -624,32 +624,32 @@ BEGIN
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from e_paiement_acompte epa
|
||||
where epa.exercice=v_annee-1
|
||||
and epa.id_impot_nature='IRF'
|
||||
epa.id_exercice,
|
||||
sum(epa.montant_paye) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.id_exercice =v_annee-1
|
||||
and epa.id_impot_nature='AIRF'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
epa.id_exercice
|
||||
)tac on tac.ifu=pers.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
LEFT JOIN ( ----------Calcul cumul retenu irf
|
||||
select epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice,
|
||||
sum(epr.montant_payer) as montant_rirf
|
||||
from e_paiement_retenu epr
|
||||
where epr.exercice=v_annee-1
|
||||
epr.id_exercice,
|
||||
sum(epr.montant_paye) as montant_rirf
|
||||
from epaiement_retenue epr
|
||||
where epr.id_exercice=v_annee-1
|
||||
group by epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice
|
||||
epr.id_exercice
|
||||
)trirf on trirf.ifu_retenue=pers.ifu and trirf.r_quartier=q.code and trirf.qip_ilot=p.i and trirf.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
AND ul_filter.batiment_id IS NULL -- anti-join : pas d'unité logement
|
||||
|
||||
@@ -338,32 +338,32 @@ BEGIN
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from e_paiement_acompte epa
|
||||
where epa.exercice=v_annee-1
|
||||
and epa.id_impot_nature='IRF'
|
||||
epa.id_exercice,
|
||||
sum(epa.montant_paye) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.id_exercice=v_annee-1
|
||||
and epa.id_impot_nature='AIRF'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
epa.id_exercice
|
||||
)tac on tac.ifu=pers.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
LEFT JOIN ( ----------Calcul cumul retenu irf
|
||||
select epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice,
|
||||
sum(epr.montant_payer) as montant_rirf
|
||||
from e_paiement_retenu epr
|
||||
where epr.exercice=v_annee-1
|
||||
epr.id_exercice,
|
||||
sum(epr.montant_paye) as montant_rirf
|
||||
from epaiement_retenue epr
|
||||
where epr.id_exercice=v_annee-1
|
||||
group by epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice
|
||||
epr.id_exercice
|
||||
)trirf on trirf.ifu_retenue=pers.ifu and trirf.r_quartier=q.code and trirf.qip_ilot=p.i and trirf.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
AND ul_filter.batiment_id IS NULL -- anti-join : pas d'unité logement
|
||||
|
||||
@@ -637,32 +637,32 @@ BEGIN
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from e_paiement_acompte epa
|
||||
where epa.exercice=v_annee-1
|
||||
and epa.id_impot_nature='IRF'
|
||||
epa.id_exercice,
|
||||
sum(epa.montant_paye) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.id_exercice =v_annee-1
|
||||
and epa.id_impot_nature='AIRF'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
epa.id_exercice
|
||||
)tac on tac.ifu=eul.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
LEFT JOIN ( ----------Calcul cumul retenu irf
|
||||
select epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice,
|
||||
sum(epr.montant_payer) as montant_rirf
|
||||
from e_paiement_retenu epr
|
||||
where epr.exercice=v_annee-1
|
||||
epr.id_exercice,
|
||||
sum(epr.montant_paye) as montant_rirf
|
||||
from epaiement_retenue epr
|
||||
where epr.id_exercice=v_annee-1
|
||||
group by epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice
|
||||
epr.id_exercice
|
||||
)trirf on trirf.ifu_retenue=eul.ifu and trirf.r_quartier=q.code and trirf.qip_ilot=p.i and trirf.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
AND st.id = v_structure_id
|
||||
|
||||
@@ -294,32 +294,32 @@ BEGIN
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from e_paiement_acompte epa
|
||||
where epa.exercice=v_annee-1
|
||||
and epa.id_impot_nature='IRF'
|
||||
epa.id_exercice,
|
||||
sum(epa.montant_paye) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.id_exercice=v_annee-1
|
||||
and epa.id_impot_nature='AIRF'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
epa.id_exercice
|
||||
)tac on tac.ifu=eul.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
LEFT JOIN ( ----------Calcul cumul retenu irf
|
||||
select epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice,
|
||||
sum(epr.montant_payer) as montant_rirf
|
||||
from e_paiement_retenu epr
|
||||
where epr.exercice=v_annee-1
|
||||
epr.id_exercice,
|
||||
sum(epr.montant_paye) as montant_rirf
|
||||
from epaiement_retenue epr
|
||||
where epr.id_exercice=v_annee-1
|
||||
group by epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice
|
||||
epr.id_exercice
|
||||
)trirf on trirf.ifu_retenue=eul.ifu and trirf.r_quartier=q.code and trirf.qip_ilot=p.i and trirf.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
AND st.id = v_structure_id
|
||||
|
||||
@@ -452,17 +452,17 @@ BEGIN
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from e_paiement_acompte epa
|
||||
where epa.exercice=v_annee
|
||||
and epa.id_impot_nature='FB'
|
||||
epa.id_exercice,
|
||||
sum(epa.montant_paye) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.id_exercice=v_annee
|
||||
and epa.id_impot_nature in ('TFU1','TFU2')
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
epa.id_exercice
|
||||
)tac on tac.ifu=pers.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
--AND ul_filter.batiment_id IS NULL -- anti-join : pas d'unité logement
|
||||
|
||||
@@ -453,17 +453,17 @@ BEGIN
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from e_paiement_acompte epa
|
||||
where epa.exercice=v_annee
|
||||
and epa.id_impot_nature='FB'
|
||||
epa.id_exercice,
|
||||
sum(epa.montant_paye) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.id_exercice=v_annee
|
||||
and epa.id_impot_nature IN ('TFU1','TFU2')
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
epa.id_exercice
|
||||
)tac on tac.ifu=pers.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
--AND ul_filter.batiment_id IS NULL -- anti-join : pas d'unité logement
|
||||
|
||||
@@ -430,17 +430,17 @@ BEGIN
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from e_paiement_acompte epa
|
||||
where epa.exercice=v_annee
|
||||
and epa.id_impot_nature='FB'
|
||||
epa.id_exercice,
|
||||
sum(epa.montant_paye) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.id_exercice=v_annee
|
||||
and epa.id_impot_nature IN ('TFU1','TFU2')
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
epa.id_exercice
|
||||
)tac on tac.ifu=eul.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
AND EXISTS (
|
||||
|
||||
@@ -431,17 +431,17 @@ BEGIN
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from e_paiement_acompte epa
|
||||
where epa.exercice=v_annee
|
||||
and epa.id_impot_nature='FB'
|
||||
epa.id_exercice,
|
||||
sum(epa.montant_paye) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.id_exercice=v_annee
|
||||
and epa.id_impot_nature IN ('TFU1','TFU2')
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
epa.id_exercice
|
||||
)tac on tac.ifu=eul.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
AND EXISTS (
|
||||
|
||||
@@ -1,166 +1,3 @@
|
||||
/*CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_tfu_non_batie(
|
||||
p_impositions_tfu_id BIGINT,
|
||||
p_user_id BIGINT
|
||||
)
|
||||
RETURNS INTEGER
|
||||
LANGUAGE plpgsql
|
||||
AS
|
||||
$$
|
||||
DECLARE
|
||||
v_rows_inserted INTEGER;
|
||||
v_annee BIGINT;
|
||||
v_structure_id BIGINT;
|
||||
BEGIN
|
||||
|
||||
-- récupération de l'année
|
||||
SELECT ex.annee, it.structure_id
|
||||
INTO STRICT v_annee, v_structure_id
|
||||
FROM impositions_tfu it
|
||||
join exercice ex on ex.id =it.exercice_id
|
||||
WHERE it.id = p_impositions_tfu_id;
|
||||
|
||||
|
||||
INSERT INTO donnees_imposition_tfu(
|
||||
annee,
|
||||
code_departement,
|
||||
nom_departement,
|
||||
code_commune,
|
||||
nom_commune,
|
||||
code_arrondissement,
|
||||
nom_arrondissement,
|
||||
code_quartier_village,
|
||||
nom_quartier_village,
|
||||
q,
|
||||
ilot,
|
||||
parcelle,
|
||||
nup,
|
||||
titre_foncier,
|
||||
ifu,
|
||||
npi,
|
||||
tel_prop,
|
||||
email_prop,
|
||||
nom_prop,
|
||||
prenom_prop,
|
||||
raison_sociale,
|
||||
adresse_prop,
|
||||
tel_sc,
|
||||
nom_sc,
|
||||
prenom_sc,
|
||||
longitude,
|
||||
latitude,
|
||||
batie,
|
||||
exonere,
|
||||
date_enquete,
|
||||
structure_id,
|
||||
zone_rfu_id,
|
||||
nature_impot,
|
||||
superficie_parc,
|
||||
impositions_tfu_id,
|
||||
deleted,
|
||||
created_at ,
|
||||
created_by ,
|
||||
"source",
|
||||
updated_at ,
|
||||
updated_by,
|
||||
taux_tfu,
|
||||
valeur_admin_parcelle_nb,
|
||||
valeur_admin_parcelle_nb_metre_carre,
|
||||
montant_taxe
|
||||
)
|
||||
SELECT
|
||||
v_annee,
|
||||
d.code,
|
||||
d.nom,
|
||||
c.code,
|
||||
c.nom,
|
||||
a.code,
|
||||
a.nom,
|
||||
q.code,
|
||||
q.nom,
|
||||
p.q,
|
||||
p.i,
|
||||
p.p,
|
||||
p.nup,
|
||||
ep.numero_titre_foncier,
|
||||
pers.ifu,
|
||||
pers.npi,
|
||||
pers.tel1,
|
||||
pers.email,
|
||||
pers.nom,
|
||||
pers.prenom,
|
||||
pers.raison_sociale,
|
||||
pers.adresse,
|
||||
ep.representant_tel,
|
||||
ep.representant_nom,
|
||||
ep.representant_prenom,
|
||||
p.longitude,
|
||||
p.latitude,
|
||||
false batie,
|
||||
(
|
||||
CURRENT_DATE >= ep.date_debut_exemption
|
||||
AND CURRENT_DATE <= COALESCE(ep.date_fin_exemption, CURRENT_DATE)
|
||||
) exonere,
|
||||
ep.date_enquete,
|
||||
st.id,
|
||||
ep.zone_rfu_id,
|
||||
'TFU',
|
||||
p.superficie,
|
||||
p_impositions_tfu_id,
|
||||
false,
|
||||
current_date ,
|
||||
p_user_id ,
|
||||
'FISCAD',
|
||||
current_date ,
|
||||
p_user_id,
|
||||
brnb.taux,
|
||||
case brnb.au_metre_carre
|
||||
when true then brnb.valeur_administrative_metre_carre * ep.superficie
|
||||
else brnb.valeur_administrative
|
||||
end as valeur_administrative,
|
||||
brnb.valeur_administrative_metre_carre,
|
||||
case brnb.au_metre_carre
|
||||
when true then brnb.valeur_administrative_metre_carre * ep.superficie*brnb.taux/100
|
||||
else brnb.valeur_administrative*brnb.taux/100
|
||||
end as montant_taxe
|
||||
FROM parcelle p
|
||||
LEFT JOIN (
|
||||
SELECT DISTINCT ON (parcelle_id)
|
||||
parcelle_id,
|
||||
superficie,
|
||||
personne_id,
|
||||
numero_titre_foncier,
|
||||
date_enquete,
|
||||
representant_tel,
|
||||
representant_nom,
|
||||
representant_prenom,
|
||||
representant_npi,
|
||||
date_debut_exemption,
|
||||
date_fin_exemption,
|
||||
zone_rfu_id
|
||||
FROM enquete
|
||||
ORDER BY parcelle_id, date_enquete DESC
|
||||
) ep ON ep.parcelle_id = p.id
|
||||
LEFT JOIN personne pers
|
||||
ON pers.id = ep.personne_id
|
||||
JOIN quartier q ON q.id = p.quartier_id
|
||||
JOIN arrondissement a ON a.id = q.arrondissement_id
|
||||
JOIN commune c ON c.id = a.commune_id
|
||||
JOIN departement d ON d.id = c.departement_id
|
||||
JOIN secteur_decoupage sd ON sd.quartier_id = q.id
|
||||
JOIN secteur sect ON sect.id = sd.secteur_id
|
||||
JOIN section ses ON ses.id = sect.section_id
|
||||
JOIN "structure" st ON st.id = ses.structure_id
|
||||
left join barem_rfu_non_bati brnb on (brnb.commune_id =c.id and brnb.zone_rfu_id=ep.zone_rfu_id)
|
||||
WHERE p.batie = false
|
||||
AND st.id=v_structure_id
|
||||
ON CONFLICT DO NOTHING;
|
||||
|
||||
GET DIAGNOSTICS v_rows_inserted = ROW_COUNT;
|
||||
|
||||
RETURN v_rows_inserted;
|
||||
END;
|
||||
$$;*/
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_tfu_non_batie(
|
||||
p_impositions_tfu_id BIGINT,
|
||||
p_user_id BIGINT
|
||||
@@ -340,17 +177,17 @@ BEGIN
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from e_paiement_acompte epa
|
||||
where epa.exercice=v_annee
|
||||
and epa.id_impot_nature='FNB'
|
||||
epa.id_exercice,
|
||||
sum(epa.montant_paye) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.id_exercice =v_annee
|
||||
and epa.id_impot_nature IN ('TFU1','TFU2')
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
epa.id_exercice
|
||||
)tac on tac.ifu=pers.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
WHERE p.batie = false
|
||||
AND st.id = v_structure_id
|
||||
|
||||
@@ -178,17 +178,17 @@ BEGIN
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from e_paiement_acompte epa
|
||||
where epa.exercice=v_annee
|
||||
and epa.id_impot_nature='FNB'
|
||||
epa.id_exercice,
|
||||
sum(epa.montant_paye) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.id_exercice=v_annee
|
||||
and epa.id_impot_nature IN ('TFU1','TFU2')
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
epa.id_exercice
|
||||
)tac on tac.ifu=pers.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
WHERE p.batie = false
|
||||
AND st.id = v_structure_id
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
create or replace procedure integrer_edeclaration_propriete_depuis_sigibe()
|
||||
language plpgsql
|
||||
as
|
||||
$$
|
||||
DECLARE
|
||||
v_inserted_count integer;
|
||||
BEGIN
|
||||
|
||||
INSERT INTO public.edeclaration_propriete
|
||||
(
|
||||
created_at,
|
||||
created_by,
|
||||
deleted,
|
||||
enquete_external_key,
|
||||
external_key,
|
||||
source,
|
||||
updated_at,
|
||||
updated_by,
|
||||
|
||||
bati,
|
||||
commentaire,
|
||||
date_construction,
|
||||
date_information,
|
||||
date_validation,
|
||||
gps_latitude,
|
||||
gps_longitude,
|
||||
id_impot,
|
||||
ifu,
|
||||
montant_locatif_annuel,
|
||||
nub,
|
||||
nul,
|
||||
nup,
|
||||
qip_ilot,
|
||||
qip_parcelle,
|
||||
qip_quartier,
|
||||
r_commune,
|
||||
r_impot,
|
||||
r_quartier,
|
||||
superficie_parcelle,
|
||||
superficie_sol_bat,
|
||||
superficie_sol_ulo,
|
||||
usage,
|
||||
valeur_batiment,
|
||||
|
||||
personne_id,
|
||||
quartier_id
|
||||
)
|
||||
SELECT
|
||||
now() AS created_at,
|
||||
NULL::bigint AS created_by,
|
||||
false AS deleted,
|
||||
NULL::bigint AS enquete_external_key,
|
||||
NULL::bigint AS external_key,
|
||||
'SIGIBE' AS source,
|
||||
NULL::timestamp with time zone AS updated_at,
|
||||
NULL::bigint AS updated_by,
|
||||
|
||||
src.bati,
|
||||
src.commentaire,
|
||||
src.date_construction,
|
||||
src.date_information,
|
||||
src.date_validation,
|
||||
src.gps_latitude,
|
||||
src.gps_longitude,
|
||||
src.id_impot,
|
||||
src.ifu,
|
||||
src.montant_locatif_annuel,
|
||||
src.nub,
|
||||
src.nul,
|
||||
src.nup,
|
||||
src.qip_ilot,
|
||||
src.qip_parcelle,
|
||||
src.qip_quartier,
|
||||
src.r_commune,
|
||||
src.r_impot,
|
||||
src.r_quartier,
|
||||
src.superficie_parcelle,
|
||||
src.superficie_sol_bat,
|
||||
src.superficie_sol_ulo,
|
||||
src.usage,
|
||||
src.valeur_batiment,
|
||||
|
||||
p.id AS personne_id,
|
||||
q.id AS quartier_id
|
||||
|
||||
FROM dblink(
|
||||
'host=localhost port=5432 dbname=sigibe_test user=sigibe_test_user password=1234567890',
|
||||
'
|
||||
SELECT
|
||||
bati,
|
||||
commentaire,
|
||||
date_construction,
|
||||
date_information,
|
||||
date_validation,
|
||||
gps_latitude,
|
||||
gps_longitude,
|
||||
id_impot,
|
||||
ifu,
|
||||
montant_locatif_annuel,
|
||||
nub,
|
||||
nul,
|
||||
nup,
|
||||
qip_ilot,
|
||||
qip_parcelle,
|
||||
qip_quartier,
|
||||
r_commune,
|
||||
r_impot,
|
||||
r_quartier,
|
||||
superficie_parcelle,
|
||||
superficie_sol_bat,
|
||||
superficie_sol_ulo,
|
||||
usage,
|
||||
valeur_batiment
|
||||
FROM public.e_declaration_propriete
|
||||
'
|
||||
) AS src
|
||||
(
|
||||
bati boolean,
|
||||
commentaire varchar(255),
|
||||
date_construction date,
|
||||
date_information date,
|
||||
date_validation date,
|
||||
gps_latitude varchar(255),
|
||||
gps_longitude varchar(255),
|
||||
id_impot bigint,
|
||||
ifu varchar(255),
|
||||
montant_locatif_annuel bigint,
|
||||
nub bigint,
|
||||
nul bigint,
|
||||
nup varchar(255),
|
||||
qip_ilot varchar(255),
|
||||
qip_parcelle varchar(255),
|
||||
qip_quartier varchar(255),
|
||||
r_commune varchar(255),
|
||||
r_impot varchar(255),
|
||||
r_quartier varchar(255),
|
||||
superficie_parcelle real,
|
||||
superficie_sol_bat real,
|
||||
superficie_sol_ulo real,
|
||||
usage varchar(255),
|
||||
valeur_batiment bigint
|
||||
)
|
||||
left join personne p on p.ifu=src.ifu
|
||||
left join quartier q on q.code=src.r_quartier;
|
||||
|
||||
GET DIAGNOSTICS v_inserted_count = ROW_COUNT;
|
||||
|
||||
RAISE NOTICE 'Intégration terminée. Nombre de lignes insérées : %', v_inserted_count;
|
||||
|
||||
END;
|
||||
$$;
|
||||
@@ -28,13 +28,13 @@ BEGIN
|
||||
qip_ilot,
|
||||
qip_parcelle,
|
||||
nup,
|
||||
exercice,
|
||||
sum(montant_payer) as cumul_retenu
|
||||
from e_paiement_retenu
|
||||
where exercice = v_annee
|
||||
id_exercice,
|
||||
sum(montant_paye) as cumul_retenu
|
||||
from epaiement_retenue
|
||||
where id_exercice = v_annee
|
||||
group by ifu_retenue, r_commune, r_quartier,
|
||||
qip_quartier, qip_ilot, qip_parcelle,
|
||||
nup, exercice
|
||||
nup, id_exercice
|
||||
)
|
||||
UPDATE donnees_imposition_tfu dimp
|
||||
SET
|
||||
@@ -43,7 +43,7 @@ BEGIN
|
||||
- coalesce(cr.cumul_retenu,0)
|
||||
FROM donnees_imposition_tfu dimp2
|
||||
LEFT JOIN cumulRetenu cr ON (
|
||||
cr.exercice = dimp2.annee
|
||||
cr.id_exercice = dimp2.annee
|
||||
AND cr.r_commune = dimp2.code_commune
|
||||
AND cr.ifu_retenue = dimp2.ifu
|
||||
AND cr.r_quartier = dimp2.code_quartier_village
|
||||
@@ -58,30 +58,50 @@ BEGIN
|
||||
AND dimp.nature_impot ='IRF';
|
||||
|
||||
|
||||
WITH cumulAcompte as (
|
||||
select ifu,
|
||||
WITH cumulAcompte AS (
|
||||
SELECT
|
||||
ifu,
|
||||
r_commune,
|
||||
r_quartier,
|
||||
qip_quartier,
|
||||
qip_ilot,
|
||||
qip_parcelle,
|
||||
nup,
|
||||
exercice,
|
||||
sum(montant_payer) as cumul_acompte
|
||||
from e_paiement_acompte
|
||||
where exercice = v_annee
|
||||
group by ifu, r_commune, r_quartier,
|
||||
qip_quartier, qip_ilot, qip_parcelle,
|
||||
nup, exercice
|
||||
id_exercice,
|
||||
CASE
|
||||
WHEN id_impot_nature IN ('TFU1', 'TFU2') THEN 'TFU'
|
||||
WHEN id_impot_nature = 'AIRF' THEN 'IRF'
|
||||
ELSE id_impot_nature
|
||||
END AS nature_impot,
|
||||
SUM(montant_paye) AS cumul_acompte
|
||||
FROM epaiement_acompte
|
||||
WHERE id_exercice = v_annee
|
||||
GROUP BY
|
||||
ifu,
|
||||
r_commune,
|
||||
r_quartier,
|
||||
qip_quartier,
|
||||
qip_ilot,
|
||||
qip_parcelle,
|
||||
nup,
|
||||
id_exercice,
|
||||
CASE
|
||||
WHEN id_impot_nature IN ('TFU1', 'TFU2') THEN 'TFU'
|
||||
WHEN id_impot_nature = 'AIRF' THEN 'IRF'
|
||||
ELSE id_impot_nature
|
||||
END
|
||||
)
|
||||
|
||||
UPDATE donnees_imposition_tfu dimp
|
||||
SET
|
||||
acompte = coalesce(ac.cumul_acompte,0),
|
||||
montant_restant = dimp.montant_taxe
|
||||
- coalesce(ac.cumul_acompte,0)
|
||||
acompte = COALESCE(ac.cumul_acompte, 0),
|
||||
montant_restant = GREATEST(
|
||||
dimp.montant_taxe - COALESCE(ac.cumul_acompte, 0),
|
||||
0
|
||||
)
|
||||
FROM donnees_imposition_tfu dimp2
|
||||
LEFT JOIN cumulAcompte ac ON (
|
||||
ac.exercice = dimp2.annee
|
||||
LEFT JOIN cumulAcompte ac
|
||||
ON ac.id_exercice = dimp2.annee
|
||||
AND ac.r_commune = dimp2.code_commune
|
||||
AND ac.ifu = dimp2.ifu
|
||||
AND ac.r_quartier = dimp2.code_quartier_village
|
||||
@@ -89,10 +109,15 @@ BEGIN
|
||||
AND ac.qip_ilot = dimp2.ilot
|
||||
AND ac.qip_parcelle = dimp2.parcelle
|
||||
AND ac.nup = dimp2.nup
|
||||
)
|
||||
AND ac.nature_impot =
|
||||
CASE
|
||||
WHEN dimp2.nature_impot IN ('FB', 'FNB') THEN 'TFU'
|
||||
WHEN dimp2.nature_impot = 'IRF' THEN 'IRF'
|
||||
ELSE dimp2.nature_impot
|
||||
END
|
||||
WHERE dimp.id = dimp2.id
|
||||
AND dimp.impositions_tfu_id = p_impositions_tfu_id
|
||||
AND dimp.nature_impot in ('FNB','FB');
|
||||
AND dimp.nature_impot IN ('FB', 'FNB', 'IRF');
|
||||
|
||||
GET DIAGNOSTICS v_rows_inserted = ROW_COUNT;
|
||||
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
- recuperation et cumul des acomptes par exercice, commune, ifu et parcelle
|
||||
- recuperation et cumul des rirf par exercice, commune, ifu et parcelle
|
||||
*/
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.maj_donnees_imposition_tfu_rirf_atfu_une_parcelle(
|
||||
p_impositions_tfu_id BIGINT,
|
||||
p_parcelle_id BIGINT
|
||||
)
|
||||
RETURNS INTEGER
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
DECLARE
|
||||
v_rows_inserted INTEGER;
|
||||
v_annee INTEGER;
|
||||
v_structure_id INTEGER;
|
||||
BEGIN
|
||||
SELECT ex.annee, it.structure_id
|
||||
INTO STRICT v_annee, v_structure_id
|
||||
FROM impositions_tfu it
|
||||
JOIN exercice ex ON ex.id = it.exercice_id
|
||||
WHERE it.id = p_impositions_tfu_id;
|
||||
|
||||
WITH cumulRetenu as (
|
||||
select ifu_retenue,
|
||||
r_commune,
|
||||
r_quartier,
|
||||
qip_quartier,
|
||||
qip_ilot,
|
||||
qip_parcelle,
|
||||
nup,
|
||||
id_exercice,
|
||||
sum(montant_paye) as cumul_retenu
|
||||
from epaiement_retenue
|
||||
where id_exercice = v_annee
|
||||
group by ifu_retenue, r_commune, r_quartier,
|
||||
qip_quartier, qip_ilot, qip_parcelle,
|
||||
nup, id_exercice
|
||||
)
|
||||
UPDATE donnees_imposition_tfu dimp
|
||||
SET
|
||||
retenu_irf = coalesce(cr.cumul_retenu,0),
|
||||
montant_restant = dimp.montant_taxe
|
||||
- coalesce(cr.cumul_retenu,0)
|
||||
FROM donnees_imposition_tfu dimp2
|
||||
LEFT JOIN cumulRetenu cr ON (
|
||||
cr.id_exercice = dimp2.annee
|
||||
AND cr.r_commune = dimp2.code_commune
|
||||
AND cr.ifu_retenue = dimp2.ifu
|
||||
AND cr.r_quartier = dimp2.code_quartier_village
|
||||
AND cr.qip_quartier = dimp2.q
|
||||
AND cr.qip_ilot = dimp2.ilot
|
||||
AND cr.qip_parcelle = dimp2.parcelle
|
||||
AND cr.nup = dimp2.nup
|
||||
AND cr.nup = dimp2.nup
|
||||
)
|
||||
WHERE dimp.id = dimp2.id
|
||||
AND dimp.impositions_tfu_id = p_impositions_tfu_id
|
||||
AND dimp.parcelle_id=p_parcelle_id
|
||||
AND dimp.nature_impot ='IRF';
|
||||
|
||||
|
||||
WITH cumulAcompte AS (
|
||||
SELECT
|
||||
ifu,
|
||||
r_commune,
|
||||
r_quartier,
|
||||
qip_quartier,
|
||||
qip_ilot,
|
||||
qip_parcelle,
|
||||
nup,
|
||||
id_exercice,
|
||||
CASE
|
||||
WHEN id_impot_nature IN ('TFU1', 'TFU2') THEN 'TFU'
|
||||
WHEN id_impot_nature = 'AIRF' THEN 'IRF'
|
||||
ELSE id_impot_nature
|
||||
END AS nature_impot,
|
||||
SUM(montant_paye) AS cumul_acompte
|
||||
FROM epaiement_acompte
|
||||
WHERE id_exercice = v_annee
|
||||
GROUP BY
|
||||
ifu,
|
||||
r_commune,
|
||||
r_quartier,
|
||||
qip_quartier,
|
||||
qip_ilot,
|
||||
qip_parcelle,
|
||||
nup,
|
||||
id_exercice,
|
||||
CASE
|
||||
WHEN id_impot_nature IN ('TFU1', 'TFU2') THEN 'TFU'
|
||||
WHEN id_impot_nature = 'AIRF' THEN 'IRF'
|
||||
ELSE id_impot_nature
|
||||
END
|
||||
)
|
||||
|
||||
UPDATE donnees_imposition_tfu dimp
|
||||
SET
|
||||
acompte = COALESCE(ac.cumul_acompte, 0),
|
||||
montant_restant = GREATEST(
|
||||
dimp.montant_taxe - COALESCE(ac.cumul_acompte, 0),
|
||||
0
|
||||
)
|
||||
FROM donnees_imposition_tfu dimp2
|
||||
LEFT JOIN cumulAcompte ac
|
||||
ON ac.id_exercice = dimp2.annee
|
||||
AND ac.r_commune = dimp2.code_commune
|
||||
AND ac.ifu = dimp2.ifu
|
||||
AND ac.r_quartier = dimp2.code_quartier_village
|
||||
AND ac.qip_quartier = dimp2.q
|
||||
AND ac.qip_ilot = dimp2.ilot
|
||||
AND ac.qip_parcelle = dimp2.parcelle
|
||||
AND ac.nup = dimp2.nup
|
||||
AND ac.nature_impot =
|
||||
CASE
|
||||
WHEN dimp2.nature_impot IN ('FB', 'FNB') THEN 'TFU'
|
||||
WHEN dimp2.nature_impot = 'IRF' THEN 'IRF'
|
||||
ELSE dimp2.nature_impot
|
||||
END
|
||||
WHERE dimp.id = dimp2.id
|
||||
AND dimp.impositions_tfu_id = p_impositions_tfu_id
|
||||
AND dimp.parcelle_id=p_parcelle_id
|
||||
AND dimp.nature_impot IN ('FB', 'FNB', 'IRF');
|
||||
|
||||
GET DIAGNOSTICS v_rows_inserted = ROW_COUNT;
|
||||
|
||||
RETURN v_rows_inserted;
|
||||
END;
|
||||
$$ ;
|
||||
|
||||
|
||||
@@ -200,5 +200,5 @@ public interface SecteurRepository extends JpaRepository<Secteur, Long> {
|
||||
LEFT JOIN com.departement dep
|
||||
WHERE dep.id = :idDepartement
|
||||
""")
|
||||
List<Secteur> findSectionsByDepartement(@Param("idDepartement") Long idDepartement);
|
||||
List<Secteur> findSecteursByDepartement(@Param("idDepartement") Long idDepartement);
|
||||
}
|
||||
@@ -200,7 +200,6 @@ public interface EnqueteRepository extends JpaRepository<Enquete, Long> {
|
||||
" e.nom_proprietaire_parcelle as nomProprietaireParcelle, " +
|
||||
" e.code_equipe as codeEquipe, " +
|
||||
" e.numero_titre_foncier as numeroTitreFoncier " +
|
||||
|
||||
" e.num_enter_parcelle as numEnterParcelle " +
|
||||
" e.num_rue as numRue" +
|
||||
" e.num_nom_rue as nomRue" +
|
||||
@@ -415,7 +414,8 @@ public interface EnqueteRepository extends JpaRepository<Enquete, Long> {
|
||||
nd.libelle,
|
||||
td.id,
|
||||
td.libelle,
|
||||
r.id
|
||||
r.id,
|
||||
e.edeclarationPropriete.id
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
@@ -492,7 +492,8 @@ public interface EnqueteRepository extends JpaRepository<Enquete, Long> {
|
||||
nd.libelle,
|
||||
td.id,
|
||||
td.libelle,
|
||||
r.id
|
||||
r.id,
|
||||
e.edeclarationPropriete.id
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
@@ -572,7 +573,8 @@ public interface EnqueteRepository extends JpaRepository<Enquete, Long> {
|
||||
nd.libelle,
|
||||
td.id,
|
||||
td.libelle,
|
||||
r.id
|
||||
r.id,
|
||||
e.edeclarationPropriete.id
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
@@ -655,7 +657,8 @@ public interface EnqueteRepository extends JpaRepository<Enquete, Long> {
|
||||
nd.libelle,
|
||||
td.id,
|
||||
td.libelle,
|
||||
r.id
|
||||
r.id,
|
||||
e.edeclarationPropriete.id
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
@@ -739,7 +742,8 @@ public interface EnqueteRepository extends JpaRepository<Enquete, Long> {
|
||||
nd.libelle,
|
||||
td.id,
|
||||
td.libelle,
|
||||
r.id
|
||||
r.id,
|
||||
e.edeclarationPropriete.id
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
@@ -828,7 +832,8 @@ public interface EnqueteRepository extends JpaRepository<Enquete, Long> {
|
||||
nd.libelle,
|
||||
td.id,
|
||||
td.libelle,
|
||||
r.id
|
||||
r.id,
|
||||
e.edeclarationPropriete.id
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
@@ -910,7 +915,8 @@ public interface EnqueteRepository extends JpaRepository<Enquete, Long> {
|
||||
nd.libelle,
|
||||
td.id,
|
||||
td.libelle,
|
||||
r.id
|
||||
r.id,
|
||||
e.edeclarationPropriete.id
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
@@ -1002,7 +1008,8 @@ public interface EnqueteRepository extends JpaRepository<Enquete, Long> {
|
||||
nd.libelle,
|
||||
td.id,
|
||||
td.libelle,
|
||||
r.id
|
||||
r.id,
|
||||
e.edeclarationPropriete.id
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
|
||||
@@ -0,0 +1,527 @@
|
||||
package io.gmss.fiscad.persistence.repositories.interface_sigibe;
|
||||
|
||||
import io.gmss.fiscad.entities.interface_sigibe.EdeclarationPropriete;
|
||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
|
||||
import io.gmss.fiscad.paylaods.request.crudweb.CaracteristiqueBatimentPayloadWeb;
|
||||
import io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb;
|
||||
import io.gmss.fiscad.paylaods.response.restoration.CaracateristiqueBatimentPayLoadsRestor;
|
||||
import io.gmss.fiscad.paylaods.response.statistique.ParcelleStatsProjectionUnSecteur;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
public interface EdeclarationProprieteRepository extends JpaRepository<EdeclarationPropriete, Long> {
|
||||
@Query("""
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb(
|
||||
e.id,
|
||||
e.idImpot,
|
||||
e.rImpot,
|
||||
e.ifu,
|
||||
e.rCommune,
|
||||
e.rQuartier,
|
||||
e.qipQuartier,
|
||||
e.qipIlot,
|
||||
e.qipParcelle,
|
||||
e.nup,
|
||||
e.gpsLatitude,
|
||||
e.gpsLongitude,
|
||||
e.commentaire,
|
||||
e.dateValidation,
|
||||
e.dateInformation,
|
||||
e.valeurBatiment,
|
||||
e.nub,
|
||||
e.nul,
|
||||
e.montantLocatifAnnuel,
|
||||
e.dateConstruction,
|
||||
e.superficieSolBat,
|
||||
e.superficieSolUlo,
|
||||
e.superficieParcelle,
|
||||
e.usage,
|
||||
e.bati,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
q.id,
|
||||
q.code,
|
||||
q.nom,
|
||||
e.statutEdeclarationPropriete
|
||||
)
|
||||
FROM EdeclarationPropriete e
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.quartier q
|
||||
INNER JOIN SecteurDecoupage sd on sd.quartier=q
|
||||
WHERE e.id = :id
|
||||
and sd.secteur.id IN (:secteurIds)
|
||||
""")
|
||||
Optional<EdeclarationProprietePayloadWeb> findPayloadById(@Param("id") Long id,
|
||||
@Param("secteurIds") List<Long> secteurIds);
|
||||
@Query("""
|
||||
SELECT DISTINCT new io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb(
|
||||
e.id,
|
||||
e.idImpot,
|
||||
e.rImpot,
|
||||
e.ifu,
|
||||
e.rCommune,
|
||||
e.rQuartier,
|
||||
e.qipQuartier,
|
||||
e.qipIlot,
|
||||
e.qipParcelle,
|
||||
e.nup,
|
||||
e.gpsLatitude,
|
||||
e.gpsLongitude,
|
||||
e.commentaire,
|
||||
e.dateValidation,
|
||||
e.dateInformation,
|
||||
e.valeurBatiment,
|
||||
e.nub,
|
||||
e.nul,
|
||||
e.montantLocatifAnnuel,
|
||||
e.dateConstruction,
|
||||
e.superficieSolBat,
|
||||
e.superficieSolUlo,
|
||||
e.superficieParcelle,
|
||||
e.usage,
|
||||
e.bati,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
q.id,
|
||||
q.code,
|
||||
q.nom,
|
||||
e.statutEdeclarationPropriete
|
||||
)
|
||||
FROM EdeclarationPropriete e
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.quartier q
|
||||
INNER JOIN SecteurDecoupage sd on sd.quartier=q
|
||||
WHERE sd.secteur.id IN (:secteurIds)
|
||||
""")
|
||||
List<EdeclarationProprietePayloadWeb> findAllPayload(
|
||||
@Param("secteurIds") List<Long> secteurIds
|
||||
);
|
||||
|
||||
|
||||
@Query(
|
||||
value = """
|
||||
SELECT DISTINCT new io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb(
|
||||
e.id,
|
||||
e.idImpot,
|
||||
e.rImpot,
|
||||
e.ifu,
|
||||
e.rCommune,
|
||||
e.rQuartier,
|
||||
e.qipQuartier,
|
||||
e.qipIlot,
|
||||
e.qipParcelle,
|
||||
e.nup,
|
||||
e.gpsLatitude,
|
||||
e.gpsLongitude,
|
||||
e.commentaire,
|
||||
e.dateValidation,
|
||||
e.dateInformation,
|
||||
e.valeurBatiment,
|
||||
e.nub,
|
||||
e.nul,
|
||||
e.montantLocatifAnnuel,
|
||||
e.dateConstruction,
|
||||
e.superficieSolBat,
|
||||
e.superficieSolUlo,
|
||||
e.superficieParcelle,
|
||||
e.usage,
|
||||
e.bati,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
q.id,
|
||||
q.code,
|
||||
q.nom,
|
||||
e.statutEdeclarationPropriete
|
||||
)
|
||||
FROM EdeclarationPropriete e
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.quartier q
|
||||
INNER JOIN SecteurDecoupage sd ON sd.quartier = q
|
||||
WHERE sd.secteur.id IN :secteurIds
|
||||
""",
|
||||
countQuery = """
|
||||
SELECT COUNT(DISTINCT e.id)
|
||||
FROM EdeclarationPropriete e
|
||||
LEFT JOIN e.quartier q
|
||||
INNER JOIN SecteurDecoupage sd ON sd.quartier = q
|
||||
WHERE sd.secteur.id IN :secteurIds
|
||||
"""
|
||||
)
|
||||
Page<EdeclarationProprietePayloadWeb> findAllPayloadPageable(
|
||||
@Param("secteurIds") List<Long> secteurIds,
|
||||
Pageable pageable
|
||||
);
|
||||
|
||||
@Query(value = """
|
||||
SELECT DISTINCT new io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb(
|
||||
e.id,
|
||||
e.idImpot,
|
||||
e.rImpot,
|
||||
e.ifu,
|
||||
e.rCommune,
|
||||
e.rQuartier,
|
||||
e.qipQuartier,
|
||||
e.qipIlot,
|
||||
e.qipParcelle,
|
||||
e.nup,
|
||||
e.gpsLatitude,
|
||||
e.gpsLongitude,
|
||||
e.commentaire,
|
||||
e.dateValidation,
|
||||
e.dateInformation,
|
||||
e.valeurBatiment,
|
||||
e.nub,
|
||||
e.nul,
|
||||
e.montantLocatifAnnuel,
|
||||
e.dateConstruction,
|
||||
e.superficieSolBat,
|
||||
e.superficieSolUlo,
|
||||
e.superficieParcelle,
|
||||
e.usage,
|
||||
e.bati,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
q.id,
|
||||
q.code,
|
||||
q.nom,
|
||||
e.statutEdeclarationPropriete
|
||||
)
|
||||
FROM EdeclarationPropriete e
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.quartier q
|
||||
INNER JOIN SecteurDecoupage sd on sd.quartier=q
|
||||
WHERE sd.secteur.id IN (:secteurIds)
|
||||
""",
|
||||
countQuery = """
|
||||
SELECT COUNT(e)
|
||||
FROM EdeclarationPropriete e
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.quartier q
|
||||
INNER JOIN SecteurDecoupage sd on sd.quartier=q
|
||||
WHERE sd.secteur.id IN (:secteurIds)
|
||||
""")
|
||||
Page<EdeclarationProprietePayloadWeb> findAllPayload(Pageable pageable,@Param("secteurIds") List<Long> secteurIds);
|
||||
|
||||
@Query("""
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb(
|
||||
e.id,
|
||||
e.idImpot,
|
||||
e.rImpot,
|
||||
e.ifu,
|
||||
e.rCommune,
|
||||
e.rQuartier,
|
||||
e.qipQuartier,
|
||||
e.qipIlot,
|
||||
e.qipParcelle,
|
||||
e.nup,
|
||||
e.gpsLatitude,
|
||||
e.gpsLongitude,
|
||||
e.commentaire,
|
||||
e.dateValidation,
|
||||
e.dateInformation,
|
||||
e.valeurBatiment,
|
||||
e.nub,
|
||||
e.nul,
|
||||
e.montantLocatifAnnuel,
|
||||
e.dateConstruction,
|
||||
e.superficieSolBat,
|
||||
e.superficieSolUlo,
|
||||
e.superficieParcelle,
|
||||
e.usage,
|
||||
e.bati,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
q.id,
|
||||
q.code,
|
||||
q.nom,
|
||||
e.statutEdeclarationPropriete
|
||||
)
|
||||
FROM EdeclarationPropriete e
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.quartier q
|
||||
INNER JOIN SecteurDecoupage sd on sd.quartier=q
|
||||
WHERE p.id = :personneId
|
||||
AND sd.secteur.id IN (:secteurIds)
|
||||
""")
|
||||
List<EdeclarationProprietePayloadWeb> findAllPayloadByPersonneId(@Param("personneId") Long personneId,
|
||||
@Param("secteurIds") List<Long> secteurIds);
|
||||
|
||||
@Query(value = """
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb(
|
||||
e.id,
|
||||
e.idImpot,
|
||||
e.rImpot,
|
||||
e.ifu,
|
||||
e.rCommune,
|
||||
e.rQuartier,
|
||||
e.qipQuartier,
|
||||
e.qipIlot,
|
||||
e.qipParcelle,
|
||||
e.nup,
|
||||
e.gpsLatitude,
|
||||
e.gpsLongitude,
|
||||
e.commentaire,
|
||||
e.dateValidation,
|
||||
e.dateInformation,
|
||||
e.valeurBatiment,
|
||||
e.nub,
|
||||
e.nul,
|
||||
e.montantLocatifAnnuel,
|
||||
e.dateConstruction,
|
||||
e.superficieSolBat,
|
||||
e.superficieSolUlo,
|
||||
e.superficieParcelle,
|
||||
e.usage,
|
||||
e.bati,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
q.id,
|
||||
q.code,
|
||||
q.nom,
|
||||
e.statutEdeclarationPropriete
|
||||
)
|
||||
FROM EdeclarationPropriete e
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.quartier q
|
||||
INNER JOIN SecteurDecoupage sd on sd.quartier=q
|
||||
WHERE p.id = :personneId
|
||||
AND sd.secteur.id IN (:secteurIds)
|
||||
""",
|
||||
countQuery = """
|
||||
SELECT COUNT(e)
|
||||
FROM EdeclarationPropriete e
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.quartier q
|
||||
INNER JOIN SecteurDecoupage sd on sd.quartier=q
|
||||
WHERE e.personne.id = :personneId
|
||||
AND sd.secteur.id IN (:secteurIds)
|
||||
""")
|
||||
Page<EdeclarationProprietePayloadWeb> findAllPayloadByPersonneIdPageable(
|
||||
@Param("personneId") Long personneId,
|
||||
@Param("secteurIds") List<Long> secteurIds,
|
||||
Pageable pageable);
|
||||
|
||||
|
||||
@Query("""
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb(
|
||||
e.id,
|
||||
e.idImpot,
|
||||
e.rImpot,
|
||||
e.ifu,
|
||||
e.rCommune,
|
||||
e.rQuartier,
|
||||
e.qipQuartier,
|
||||
e.qipIlot,
|
||||
e.qipParcelle,
|
||||
e.nup,
|
||||
e.gpsLatitude,
|
||||
e.gpsLongitude,
|
||||
e.commentaire,
|
||||
e.dateValidation,
|
||||
e.dateInformation,
|
||||
e.valeurBatiment,
|
||||
e.nub,
|
||||
e.nul,
|
||||
e.montantLocatifAnnuel,
|
||||
e.dateConstruction,
|
||||
e.superficieSolBat,
|
||||
e.superficieSolUlo,
|
||||
e.superficieParcelle,
|
||||
e.usage,
|
||||
e.bati,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
q.id,
|
||||
q.code,
|
||||
q.nom,
|
||||
e.statutEdeclarationPropriete
|
||||
)
|
||||
FROM EdeclarationPropriete e
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.quartier q
|
||||
INNER JOIN SecteurDecoupage sd on sd.quartier=q
|
||||
WHERE q.id = :quartierId
|
||||
AND sd.secteur.id IN (:secteurIds)
|
||||
""")
|
||||
List<EdeclarationProprietePayloadWeb> findAllPayloadByQuartierId(@Param("quartierId") Long quartierId,
|
||||
@Param("secteurIds") List<Long> secteurIds);
|
||||
|
||||
@Query(value = """
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb(
|
||||
e.id,
|
||||
e.idImpot,
|
||||
e.rImpot,
|
||||
e.ifu,
|
||||
e.rCommune,
|
||||
e.rQuartier,
|
||||
e.qipQuartier,
|
||||
e.qipIlot,
|
||||
e.qipParcelle,
|
||||
e.nup,
|
||||
e.gpsLatitude,
|
||||
e.gpsLongitude,
|
||||
e.commentaire,
|
||||
e.dateValidation,
|
||||
e.dateInformation,
|
||||
e.valeurBatiment,
|
||||
e.nub,
|
||||
e.nul,
|
||||
e.montantLocatifAnnuel,
|
||||
e.dateConstruction,
|
||||
e.superficieSolBat,
|
||||
e.superficieSolUlo,
|
||||
e.superficieParcelle,
|
||||
e.usage,
|
||||
e.bati,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
q.id,
|
||||
q.code,
|
||||
q.nom,
|
||||
e.statutEdeclarationPropriete
|
||||
)
|
||||
FROM EdeclarationPropriete e
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.quartier q
|
||||
INNER JOIN SecteurDecoupage sd on sd.quartier=q
|
||||
WHERE q.id = :quartierId
|
||||
AND sd.secteur.id IN (:secteurIds)
|
||||
""",
|
||||
countQuery = """
|
||||
SELECT COUNT(e)
|
||||
FROM EdeclarationPropriete e
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.quartier q
|
||||
INNER JOIN SecteurDecoupage sd on sd.quartier=q
|
||||
WHERE q.id = :quartierId
|
||||
AND sd.secteur.id IN (:secteurIds)
|
||||
""")
|
||||
Page<EdeclarationProprietePayloadWeb> findAllPayloadByQuartierIdPageable(
|
||||
@Param("quartierId") Long quartierId,
|
||||
@Param("secteurIds") List<Long> secteurIds,
|
||||
Pageable pageable);
|
||||
|
||||
|
||||
|
||||
@Query(
|
||||
value = """
|
||||
SELECT DISTINCT
|
||||
d.id AS departementId,
|
||||
d.code AS departementCode,
|
||||
d.nom AS departementNom,
|
||||
COUNT(e.id) OVER (PARTITION BY d.id) AS nbParcellesDepartement,
|
||||
|
||||
c.id AS communeId,
|
||||
c.code AS communeCode,
|
||||
c.nom AS communeNom,
|
||||
COUNT(e.id) OVER (PARTITION BY c.id) AS nbParcellesCommune,
|
||||
|
||||
a.id AS arrondissementId,
|
||||
a.code AS arrondissementCode,
|
||||
a.nom AS arrondissementNom,
|
||||
COUNT(e.id) OVER (PARTITION BY a.id) AS nbParcellesArrondissement,
|
||||
|
||||
q.id AS quartierId,
|
||||
q.code AS quartierCode,
|
||||
q.nom AS quartierNom,
|
||||
COUNT(e.id) OVER (PARTITION BY q.id) AS nbParcellesQuartier
|
||||
|
||||
FROM quartier q
|
||||
JOIN arrondissement a ON a.id = q.arrondissement_id
|
||||
JOIN commune c ON c.id = a.commune_id
|
||||
JOIN departement d ON d.id = c.departement_id
|
||||
JOIN parcelle p ON p.quartier_id = q.id
|
||||
|
||||
LEFT JOIN fiscad_db.public.edeclaration_propriete e
|
||||
ON e.quartier_id = q.id
|
||||
AND e.statut_edeclaration_propriete = :statutDeclarationProprieteParam
|
||||
|
||||
WHERE EXISTS (
|
||||
SELECT 1
|
||||
FROM secteur_decoupage sd
|
||||
WHERE sd.quartier_id = q.id
|
||||
AND sd.secteur_id IN (:secteurIds)
|
||||
)
|
||||
|
||||
ORDER BY d.nom, c.nom, a.nom, q.nom
|
||||
""",
|
||||
nativeQuery = true
|
||||
)
|
||||
List<ParcelleStatsProjectionUnSecteur> findStatsDeclarationProprieteBySecteurs(
|
||||
@Param("secteurIds") List<Long> secteurIds,
|
||||
@Param("statutDeclarationProprieteParam") String statutDeclarationProprieteParam
|
||||
);
|
||||
|
||||
|
||||
@Query(
|
||||
value = """
|
||||
SELECT DISTINCT
|
||||
d.id AS departementId,
|
||||
d.code AS departementCode,
|
||||
d.nom AS departementNom,
|
||||
COUNT(e.id) OVER (PARTITION BY d.id) AS nbParcellesDepartement,
|
||||
|
||||
c.id AS communeId,
|
||||
c.code AS communeCode,
|
||||
c.nom AS communeNom,
|
||||
COUNT(e.id) OVER (PARTITION BY c.id) AS nbParcellesCommune,
|
||||
|
||||
a.id AS arrondissementId,
|
||||
a.code AS arrondissementCode,
|
||||
a.nom AS arrondissementNom,
|
||||
COUNT(e.id) OVER (PARTITION BY a.id) AS nbParcellesArrondissement,
|
||||
|
||||
q.id AS quartierId,
|
||||
q.code AS quartierCode,
|
||||
q.nom AS quartierNom,
|
||||
COUNT(e.id) OVER (PARTITION BY q.id) AS nbParcellesQuartier
|
||||
|
||||
FROM quartier q
|
||||
JOIN arrondissement a ON a.id = q.arrondissement_id
|
||||
JOIN commune c ON c.id = a.commune_id
|
||||
JOIN departement d ON d.id = c.departement_id
|
||||
JOIN parcelle p ON p.quartier_id = q.id
|
||||
|
||||
LEFT JOIN fiscad_db.public.edeclaration_propriete e
|
||||
ON e.quartier_id = q.id
|
||||
AND e.statut_edeclaration_propriete = :statutDeclarationProprieteParam
|
||||
|
||||
WHERE EXISTS (
|
||||
SELECT 1
|
||||
FROM secteur_decoupage sd
|
||||
WHERE sd.quartier_id = q.id
|
||||
AND sd.secteur_id IN (:secteurIds)
|
||||
)
|
||||
|
||||
ORDER BY d.nom, c.nom, a.nom, q.nom
|
||||
""",
|
||||
nativeQuery = true
|
||||
)
|
||||
List<ParcelleStatsProjectionUnSecteur> findStatsDeclarationProprieteBySecteurs(
|
||||
@Param("secteurIds") List<Long> secteurIds
|
||||
);
|
||||
}
|
||||
|
||||
@@ -622,6 +622,13 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
|
||||
);
|
||||
|
||||
|
||||
@Query(value = "SELECT maj_donnees_imposition_tfu_rirf_atfu_une_parcelle(:impositionId,:parcelleId)", nativeQuery = true)
|
||||
Integer majDonneesAcompteRirfUneParcelle(
|
||||
@Param("impositionId") Long impositionId,
|
||||
@Param("parcelleId") Long parcelleId
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
@Query(value = """
|
||||
|
||||
@@ -143,7 +143,8 @@ public interface EnqueteBatimentRepository extends JpaRepository<EnqueteBatiment
|
||||
parc.p,
|
||||
b.montantLocatifAnnuelEstime,
|
||||
b.valeurBatimentCalcule,
|
||||
b.nbreUniteLogement
|
||||
b.nbreUniteLogement,
|
||||
eb.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteBatiment eb
|
||||
LEFT JOIN eb.batiment b
|
||||
@@ -219,7 +220,8 @@ public interface EnqueteBatimentRepository extends JpaRepository<EnqueteBatiment
|
||||
parc.p,
|
||||
b.montantLocatifAnnuelEstime,
|
||||
b.valeurBatimentCalcule,
|
||||
b.nbreUniteLogement
|
||||
b.nbreUniteLogement,
|
||||
eb.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteBatiment eb
|
||||
LEFT JOIN eb.batiment b
|
||||
@@ -295,7 +297,8 @@ public interface EnqueteBatimentRepository extends JpaRepository<EnqueteBatiment
|
||||
parc.p,
|
||||
b.montantLocatifAnnuelEstime,
|
||||
b.valeurBatimentCalcule,
|
||||
b.nbreUniteLogement
|
||||
b.nbreUniteLogement,
|
||||
eb.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteBatiment eb
|
||||
LEFT JOIN eb.batiment b
|
||||
@@ -377,7 +380,8 @@ public interface EnqueteBatimentRepository extends JpaRepository<EnqueteBatiment
|
||||
parc.p,
|
||||
b.montantLocatifAnnuelEstime,
|
||||
b.valeurBatimentCalcule,
|
||||
b.nbreUniteLogement
|
||||
b.nbreUniteLogement,
|
||||
eb.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteBatiment eb
|
||||
LEFT JOIN eb.batiment b
|
||||
@@ -456,7 +460,8 @@ public interface EnqueteBatimentRepository extends JpaRepository<EnqueteBatiment
|
||||
parc.p,
|
||||
b.montantLocatifAnnuelEstime,
|
||||
b.valeurBatimentCalcule,
|
||||
b.nbreUniteLogement
|
||||
b.nbreUniteLogement,
|
||||
eb.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteBatiment eb
|
||||
LEFT JOIN eb.batiment b
|
||||
@@ -644,7 +649,8 @@ public interface EnqueteBatimentRepository extends JpaRepository<EnqueteBatiment
|
||||
parc.p,
|
||||
b.montantLocatifAnnuelEstime,
|
||||
b.valeurBatimentCalcule,
|
||||
b.nbreUniteLogement
|
||||
b.nbreUniteLogement,
|
||||
eb.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteBatiment eb
|
||||
LEFT JOIN eb.batiment b
|
||||
|
||||
@@ -129,7 +129,8 @@ public interface EnqueteUniteLogementRepository extends JpaRepository<EnqueteUni
|
||||
b.nub,
|
||||
ul.dateConstruction,
|
||||
ul.montantLocatifAnnuelEstime,
|
||||
ul.valeurUniteLogementCalcule
|
||||
ul.valeurUniteLogementCalcule,
|
||||
eul.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
@@ -200,7 +201,8 @@ public interface EnqueteUniteLogementRepository extends JpaRepository<EnqueteUni
|
||||
b.nub,
|
||||
ul.dateConstruction,
|
||||
ul.montantLocatifAnnuelEstime,
|
||||
ul.valeurUniteLogementCalcule
|
||||
ul.valeurUniteLogementCalcule,
|
||||
eul.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
@@ -272,7 +274,8 @@ public interface EnqueteUniteLogementRepository extends JpaRepository<EnqueteUni
|
||||
b.nub,
|
||||
ul.dateConstruction,
|
||||
ul.montantLocatifAnnuelEstime,
|
||||
ul.valeurUniteLogementCalcule
|
||||
ul.valeurUniteLogementCalcule,
|
||||
eul.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
@@ -350,7 +353,8 @@ public interface EnqueteUniteLogementRepository extends JpaRepository<EnqueteUni
|
||||
b.nub,
|
||||
ul.dateConstruction,
|
||||
ul.montantLocatifAnnuelEstime,
|
||||
ul.valeurUniteLogementCalcule
|
||||
ul.valeurUniteLogementCalcule ,
|
||||
eul.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
@@ -424,7 +428,8 @@ public interface EnqueteUniteLogementRepository extends JpaRepository<EnqueteUni
|
||||
b.nub,
|
||||
ul.dateConstruction,
|
||||
ul.montantLocatifAnnuelEstime,
|
||||
ul.valeurUniteLogementCalcule
|
||||
ul.valeurUniteLogementCalcule,
|
||||
eul.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
@@ -504,7 +509,8 @@ public interface EnqueteUniteLogementRepository extends JpaRepository<EnqueteUni
|
||||
b.nub,
|
||||
ul.dateConstruction,
|
||||
ul.montantLocatifAnnuelEstime,
|
||||
ul.valeurUniteLogementCalcule
|
||||
ul.valeurUniteLogementCalcule,
|
||||
eul.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
@@ -578,7 +584,8 @@ public interface EnqueteUniteLogementRepository extends JpaRepository<EnqueteUni
|
||||
b.nub,
|
||||
ul.dateConstruction,
|
||||
ul.montantLocatifAnnuelEstime,
|
||||
ul.valeurUniteLogementCalcule
|
||||
ul.valeurUniteLogementCalcule,
|
||||
eul.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
@@ -760,7 +767,8 @@ List<ParcelleStatsProjectionUnSecteur> findStatsEnqueteBatimentBySecteurs(
|
||||
b.nub,
|
||||
ul.dateConstruction,
|
||||
ul.montantLocatifAnnuelEstime,
|
||||
ul.valeurUniteLogementCalcule
|
||||
ul.valeurUniteLogementCalcule ,
|
||||
eul.edeclarationPropriete.id
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
JOIN eul.uniteLogement ul
|
||||
|
||||
@@ -6,6 +6,7 @@ import io.gmss.fiscad.entities.frontend.Fonctionnalite;
|
||||
import io.gmss.fiscad.entities.frontend.ModuleApp;
|
||||
import io.gmss.fiscad.entities.infocad.metier.*;
|
||||
import io.gmss.fiscad.entities.infocad.parametre.*;
|
||||
import io.gmss.fiscad.entities.interface_sigibe.EdeclarationPropriete;
|
||||
import io.gmss.fiscad.entities.rfu.metier.*;
|
||||
import io.gmss.fiscad.entities.rfu.parametre.*;
|
||||
import io.gmss.fiscad.entities.user.*;
|
||||
@@ -644,6 +645,12 @@ public class EntityFromPayLoadService {
|
||||
eul.setCategorieBatiment(categorieBatiment);
|
||||
}
|
||||
|
||||
if (enqueteUniteLogementPayloadWeb.getEDeclarationPropriete() != null) {
|
||||
EdeclarationPropriete edeclarationPropriete = new EdeclarationPropriete();
|
||||
edeclarationPropriete.setId(enqueteUniteLogementPayloadWeb.getEDeclarationPropriete());
|
||||
eul.setEdeclarationPropriete(edeclarationPropriete);
|
||||
}
|
||||
|
||||
if (enqueteUniteLogementPayloadWeb.getUsageId() != null) {
|
||||
Usage usage = new Usage();
|
||||
usage.setId(enqueteUniteLogementPayloadWeb.getUsageId());
|
||||
@@ -724,6 +731,13 @@ public class EntityFromPayLoadService {
|
||||
enqueteBatiment.setCategorieBatiment(categorieBatiment);
|
||||
}
|
||||
|
||||
|
||||
if (enqueteBatimentPayloadWeb.getEDeclarationPropriete() != null) {
|
||||
EdeclarationPropriete edeclarationPropriete = new EdeclarationPropriete();
|
||||
edeclarationPropriete.setId(enqueteBatimentPayloadWeb.getEDeclarationPropriete());
|
||||
enqueteBatiment.setEdeclarationPropriete(edeclarationPropriete);
|
||||
}
|
||||
|
||||
if (enqueteBatimentPayloadWeb.getUsageId() != null) {
|
||||
Usage usage = new Usage();
|
||||
usage.setId(enqueteBatimentPayloadWeb.getUsageId());
|
||||
@@ -826,6 +840,11 @@ public class EntityFromPayLoadService {
|
||||
enquete.setModeAcquisition(modeAcquisition);
|
||||
}
|
||||
|
||||
if (enquetePayLoadWeb.getEDeclarationPropriete() != null) {
|
||||
EdeclarationPropriete edeclarationPropriete = new EdeclarationPropriete();
|
||||
edeclarationPropriete.setId(enquetePayLoadWeb.getEDeclarationPropriete());
|
||||
enquete.setEdeclarationPropriete(edeclarationPropriete);
|
||||
}
|
||||
|
||||
|
||||
// ======================
|
||||
|
||||
@@ -2,16 +2,16 @@ server.port=8282
|
||||
io.gmss.fiscad.profile=test
|
||||
|
||||
# LOCAL ENV TEST
|
||||
#spring.datasource.url=jdbc:postgresql://localhost:5432/fiscad_dgi
|
||||
#spring.datasource.username=infocad_user
|
||||
#spring.datasource.password=W5fwD({9*q53
|
||||
|
||||
|
||||
spring.datasource.url=jdbc:postgresql://193.181.208.4:5432/fiscad_db
|
||||
spring.datasource.username=fiscad_user
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/fiscad_dgi
|
||||
spring.datasource.username=infocad_user
|
||||
spring.datasource.password=W5fwD({9*q53
|
||||
|
||||
|
||||
#spring.datasource.url=jdbc:postgresql://193.181.208.4:5432/fiscad_db
|
||||
#spring.datasource.username=fiscad_user
|
||||
#spring.datasource.password=W5fwD({9*q53
|
||||
|
||||
|
||||
app.default-user.username=fiscad_admin
|
||||
app.default-user.password=1234567890
|
||||
|
||||
|
||||
Reference in New Issue
Block a user