fusion maj parcelle,batiment,ulo et leur enquete
All checks were successful
CI - Build & Test (develop) / build-and-test (pull_request) Successful in 33s

This commit is contained in:
2026-03-21 21:26:15 +01:00
parent 14ca79d49e
commit 44827030be
7 changed files with 135 additions and 18 deletions

View File

@@ -120,7 +120,7 @@ public class DonneesImpositionTfuController {
public ResponseEntity<?> getAllDonneesImpositionTfuList() {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(), "Liste des caractéristiques chargée avec succès."),
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(), "Liste des impositions chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -144,7 +144,7 @@ public class DonneesImpositionTfuController {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(pageable), "Liste des caractéristiques chargée avec succès."),
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(pageable), "Liste des impositions chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -169,7 +169,7 @@ public class DonneesImpositionTfuController {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdPageable(impositionId, pageable), "Liste des caractéristiques chargée avec succès."),
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdPageable(impositionId, pageable), "Liste des impositions chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -193,7 +193,7 @@ public class DonneesImpositionTfuController {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdNonBatiePageable(impositionId, pageable), "Liste des caractéristiques chargée avec succès."),
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdNonBatiePageable(impositionId, pageable), "Liste des impositions chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -218,7 +218,7 @@ public class DonneesImpositionTfuController {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieBatimentPageable(impositionId, pageable), "Liste des caractéristiques chargée avec succès."),
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieBatimentPageable(impositionId, pageable), "Liste des impositions chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -242,7 +242,7 @@ public class DonneesImpositionTfuController {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(impositionId, pageable), "Liste des caractéristiques chargée avec succès."),
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(impositionId, pageable), "Liste des impositions chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -442,7 +442,7 @@ public class DonneesImpositionTfuController {
Pageable pageable = PageRequest.of(pageNo, pageSize);
System.out.println("NOUS SOMMES ICI");
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByExerciceAndStructureIdPageable(exerciceId,structureId, pageable), "Liste des caractéristiques chargée avec succès."),
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByExerciceAndStructureIdPageable(exerciceId,structureId, pageable), "Liste des impositions chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -466,7 +466,32 @@ public class DonneesImpositionTfuController {
try {
System.out.println("NOUS SOMMES ICI");
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByExerciceAndStructureId(exerciceId,structureId,quartierId), "Liste des caractéristiques chargée avec succès."),
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByExerciceAndStructureId(exerciceId,structureId,quartierId), "Liste des imposition chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
@GetMapping("/all/by-personne-id/{personneId}")
public ResponseEntity<?> getAllDonneesImpositionTfuByPersonneId(@PathVariable Long personneId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByPersonneId(personneId), "Liste des impositions chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {

View File

@@ -8,6 +8,7 @@ import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
import io.gmss.fiscad.entities.infocad.metier.Tpe;
import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.entities.rfu.parametre.ZoneRfu;
import io.gmss.fiscad.enums.NatureImpot;
@@ -141,4 +142,9 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
private UniteLogement uniteLogementImposee ;
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY)
private Personne personne ;
}

View File

@@ -202,4 +202,9 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureId(Long exerciceId, Long structureId,Long quartierId) {
return donneesImpositionTfuRepository.findAllByExericeIdStructureId(exerciceId,structureId,quartierId);
}
@Override
public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByPersonneId(Long personneId) {
return donneesImpositionTfuRepository.findAllByPersonneId(personneId);
}
}

View File

@@ -45,4 +45,7 @@ public interface DonneesImpositionTfuService {
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureIdPageable(Long exerciceId, Long structureId, Pageable pageable);
List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureId(Long exerciceId, Long structureId,Long quartierId);
List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByPersonneId(Long personneId);
}

View File

@@ -470,7 +470,8 @@ BEGIN
taux_tfu,
parcelle_id,
batiment_id,
unite_logement_id
unite_logement_id,
personne_id
)
SELECT
v_annee,
@@ -657,8 +658,8 @@ BEGIN
v_taux_tfu,
p.id,
b.id,
NULL
NULL,
ep.personne_id
FROM parcelle p
-- Dernière enquête parcelle
@@ -753,7 +754,3 @@ BEGIN
RETURN v_rows_inserted;
END;
$$;
select * from donnees_imposition_tfu
where batie =true;

View File

@@ -228,7 +228,9 @@ BEGIN
taux_tfu,
valeur_admin_parcelle_nb,
valeur_admin_parcelle_nb_metre_carre,
montant_taxe
montant_taxe,
parcelle_id,
personne_id
)
SELECT
v_annee,
@@ -286,9 +288,10 @@ BEGIN
WHEN brnb.au_metre_carre = true
THEN brnb.valeur_administrative_metre_carre * ep.superficie * brnb.taux / 100
ELSE brnb.valeur_administrative * brnb.taux / 100
END
END,
p.id,
ep.personne_id
FROM parcelle p
LEFT JOIN (
SELECT DISTINCT ON (parcelle_id)
parcelle_id,

View File

@@ -722,4 +722,82 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
Long structureId,
Long quartierId
);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.id,
d.annee,
d.codeDepartement,
d.nomDepartement,
d.codeCommune,
d.nomCommune,
d.codeArrondissement,
d.nomArrondissement,
d.codeQuartierVillage,
d.nomQuartierVillage,
d.q,
d.ilot,
d.parcelle,
d.nup,
d.titreFoncier,
d.numBatiment,
d.numUniteLogement,
d.ifu,
d.npi,
d.telProp,
d.emailProp,
d.nomProp,
d.prenomProp,
d.raisonSociale,
d.adresseProp,
d.telSc,
d.emailSc,
d.nomSc,
d.prenomSc,
d.adresseSc,
d.longitude,
d.latitude,
d.superficieParc,
d.superficieAuSolBat,
d.superficieAuSolUlog,
d.batie,
d.exonere,
d.batimentExonere,
d.uniteLogementExonere,
d.valeurLocativeAdm,
d.montantLoyerAnnuel,
d.tfuMetreCarre,
d.tfuMinimum,
d.standingBat,
d.categorieBat,
d.nombrePiscine,
d.nombreUlog,
d.nombreBat,
d.dateEnquete,
s.id,
z.id,
d.valeurAdminParcelleNb,
d.natureImpot,
s.code,
z.nom,
d.valeurBatiment,
d.valeurParcelle,
d.valeurLocativeAdmMetreCarre,
d.valeurAdminParcelleNbMetreCarre,
d.montantTaxe
)
FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu
JOIN d.parcelleImposee parc
JOIN parc.quartier quart
LEFT join d.structure s
LEFT join d.zoneRfu z
WHERE d.personne.id = :personneId
order by d.nomProp,d.nomProp asc
""")
List<DonneesImpositionPaylaodWeb> findAllByPersonneId(
@Param("personneId") Long personneId
);
}