2 Commits

Author SHA1 Message Date
705af14b4e Merge pull request 'fusion maj parcelle,batiment,ulo et leur enquete' (#181) from features/fiche_refonte into develop
Reviewed-on: #181
2026-03-20 13:39:00 +00:00
bfe7b319c2 fusion maj parcelle,batiment,ulo et leur enquete
All checks were successful
CI - Build & Test (develop) / build-and-test (pull_request) Successful in 34s
2026-03-20 14:38:30 +01:00
19 changed files with 330 additions and 25 deletions

View File

@@ -154,7 +154,7 @@ public class ParcelleController {
); );
Long userId = currentUser.getUser().getId(); Long userId = currentUser.getUser().getId();
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, parcelleService.getParcelleByIdToDto(userId,id), "enquete trouvé avec succès."), new ApiResponse<>(true, parcelleService.getParcelleByIdToDto(userId,id), "parcelle trouvée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {

View File

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

View File

@@ -434,4 +434,30 @@ public class DonneesImpositionTfuController {
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK); return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
} }
} }
@GetMapping("/all-page/by-exercice-id/by-structure-id/{exerciceId}/{structureId}")
public ResponseEntity<?> getAllDonneesImpositionTfuByExerciceIdAndStructureIdPaged(@PathVariable Long exerciceId, @PathVariable Long structureId,@RequestParam int pageNo, @RequestParam int pageSize) {
try {
Pageable pageable = PageRequest.of(pageNo, pageSize);
System.out.println("NOUS SOMMES ICI");
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByExerciceAndStructureIdPageable(exerciceId,structureId, pageable), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
FileStorageException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
} catch (NullPointerException e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
}
}
} }

View File

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

View File

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

View File

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

View File

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

View File

@@ -164,4 +164,9 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable) { public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable) {
return donneesImpositionTfuRepository.findAllByImpositionTfuIdBatieUniteLogPageable(impositionsTfuId,pageable); return donneesImpositionTfuRepository.findAllByImpositionTfuIdBatieUniteLogPageable(impositionsTfuId,pageable);
} }
@Override
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureIdPageable(Long exerciceId, Long structureId, Pageable pageable) {
return donneesImpositionTfuRepository.findAllByExericeIdStructureIdPageable(exerciceId,structureId,pageable);
}
} }

View File

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

View File

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

View File

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

View File

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

View File

@@ -35,7 +35,6 @@ public interface DonneesImpositionTfuService {
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdNonBatiePageable(Long impositionsTfuId, Pageable pageable); Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdNonBatiePageable(Long impositionsTfuId, Pageable pageable);
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdBatieBatimentPageable(Long impositionsTfuId, Pageable pageable); Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdBatieBatimentPageable(Long impositionsTfuId, Pageable pageable);
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable); Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable);
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureIdPageable(Long exerciceId, Long structureId, Pageable pageable);
} }

View File

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

View File

@@ -300,4 +300,67 @@ public interface BatimentRepository extends JpaRepository<Batiment, Long> {
Pageable pageable Pageable pageable
); );
@Query(
value = """
SELECT new io.gmss.fiscad.paylaods.request.crudweb.BatimentPaylaodWeb(
b.id,
b.nub,
b.code,
b.dateConstruction,
p.id,
p.nup,
p.q,
p.i,
p.p,
per.id,
per.nom,
per.prenom,
per.raisonSociale,
eb.superficieAuSol,
eb.superficieLouee,
eb.id,
cb.id,
cb.code,
cb.standing,
eb.nombrePiscine,
eb.montantLocatifAnnuelDeclare,
eb.montantLocatifAnnuelCalcule,
eb.valeurBatimentEstime,
eb.valeurBatimentReel,
eb.montantMensuelLocation,
us.id,
us.nom ,
eb.montantLocatifAnnuelEstime,
eb.valeurBatimentCalcule,
eb.nbreUniteLogement
)
FROM Batiment b
JOIN b.parcelle p
JOIN p.quartier q
LEFT JOIN b.categorieBatiment cb
LEFT JOIN EnqueteBatiment eb
ON eb.batiment = b
AND eb.dateEnquete = (
SELECT MAX(eb2.dateEnquete)
FROM EnqueteBatiment eb2
WHERE eb2.batiment = b
)
LEFT JOIN eb.personne per
LEFT JOIN eb.usage us
WHERE q.id = :quartierId
""",
countQuery = """
SELECT COUNT(b)
FROM Batiment b
join b.parcelle p
join p.quartier q
WHERE q.id = :quartierId
"""
)
Page<BatimentPaylaodWeb> findAllBatimentsAvecOccupantCourantByQuartierToDtoPageble(
@Param("quartierId") Long quartierId,
Pageable pageable
);
} }

View File

@@ -530,4 +530,81 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
@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
LEFT join d.structure s
LEFT join d.zoneRfu z
WHERE itfu.exercice.id = :exerciceId
and s.id= :structureId
order by d.nomProp,d.nomProp asc
""")
Page<DonneesImpositionPaylaodWeb> findAllByExericeIdStructureIdPageable(
Long exerciceId,
Long structureId,
Pageable pageable
);
} }

View File

@@ -133,7 +133,7 @@ public interface EnqueteUniteLogementRepository extends JpaRepository<EnqueteUni
) )
FROM EnqueteUniteLogement eul FROM EnqueteUniteLogement eul
LEFT JOIN eul.uniteLogement ul LEFT JOIN eul.uniteLogement ul
LEFT JOIN Batiment b LEFT JOIN ul.batiment b
LEFT JOIN eul.personne p LEFT JOIN eul.personne p
LEFT JOIN eul.user u LEFT JOIN eul.user u
LEFT JOIN eul.exercice ex LEFT JOIN eul.exercice ex

View File

@@ -348,4 +348,68 @@ public interface UniteLogementRepository extends JpaRepository<UniteLogement, Lo
""") """)
List<UniteLogementPaylaodWeb> findAllUnitesLogementAvecOccupantCourantByParcelleToDto(@Param("parcelleId") Long parcelleId); List<UniteLogementPaylaodWeb> findAllUnitesLogementAvecOccupantCourantByParcelleToDto(@Param("parcelleId") Long parcelleId);
@Query(
value = """
SELECT new io.gmss.fiscad.paylaods.request.crudweb.UniteLogementPaylaodWeb(
ul.id,
ul.nul,
ul.numeroEtage,
ul.code,
b.id,
eul.superficieAuSol,
eul.superficieLouee,
b.nub,
eul.observation,
ul.dateConstruction,
per.id,
per.nom,
per.prenom,
per.raisonSociale,
eul.id,
cb.id,
cb.code,
cb.standing,
eul.montantMensuelLocation,
eul.montantLocatifAnnuelDeclare,
eul.montantLocatifAnnuelCalcule,
eul.valeurUniteLogementEstime,
eul.valeurUniteLogementReel,
eul.nombrePiscine ,
us.id,
us.nom ,
eul.montantLocatifAnnuelEstime ,
eul.valeurUniteLogementCalcule
)
FROM UniteLogement ul
JOIN ul.batiment b
JOIN b.parcelle p
JOIN p.quartier q
LEFT JOIN ul.categorieBatiment cb
LEFT JOIN EnqueteUniteLogement eul
ON eul.uniteLogement = ul
AND eul.dateEnquete = (
SELECT MAX(eul2.dateEnquete)
FROM EnqueteUniteLogement eul2
WHERE eul2.uniteLogement = ul
)
LEFT JOIN eul.personne per
LEFT JOIN eul.usage us
WHERE q.id = :quartierId
""",
countQuery = """
SELECT COUNT(ul)
FROM UniteLogement ul
JOIN ul.batiment b
JOIN b.parcelle p
JOIN p.quartier q
WHERE q.id = :quartierId
"""
)
Page<UniteLogementPaylaodWeb> findUnitesLogementAvecOccupantCourantByQuartierToDtoPageable(
@Param("quartierId") Long quartierId,
Pageable pageable
);
} }

View File

@@ -1,6 +1,6 @@
spring.profiles.active=${SPRING_PROFILES_ACTIVE} #spring.profiles.active=${SPRING_PROFILES_ACTIVE}
#spring.profiles.active=abomey #spring.profiles.active=abomey
#spring.profiles.active=test spring.profiles.active=test
spring.jpa.properties.hibernate.id.new_generator_mappings=false spring.jpa.properties.hibernate.id.new_generator_mappings=false
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
spring.jpa.open-in-view=false spring.jpa.open-in-view=false