Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#91) from features/crud_entites into develop
Reviewed-on: #91
This commit was merged in pull request #91.
This commit is contained in:
@@ -39,9 +39,9 @@ public class BatimentController {
|
||||
@PostMapping("/create")
|
||||
public ResponseEntity<?> createBatiment(@RequestBody @Valid @Validated BatimentPaylaodWeb batimentPaylaodWeb) {
|
||||
try {
|
||||
Batiment batiment = batimentService.createBatiment(batimentPaylaodWeb);
|
||||
batimentPaylaodWeb = batimentService.createBatiment(batimentPaylaodWeb);
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, batiment, "Batiment créé avec succès."),
|
||||
new ApiResponse<>(true, batimentPaylaodWeb, "Batiment créé avec succès."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
|
||||
@@ -38,9 +38,9 @@ public class EnqueteBatimentController {
|
||||
@PostMapping("/create")
|
||||
public ResponseEntity<?> createEnqueteBatiment(@RequestBody @Valid @Validated EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) {
|
||||
try {
|
||||
EnqueteBatiment enqueteBatiment = enqueteBatimentService.createEnqueteBatiment(enqueteBatimentPayloadWeb);
|
||||
enqueteBatimentPayloadWeb = enqueteBatimentService.createEnqueteBatiment(enqueteBatimentPayloadWeb);
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, enqueteBatiment, "Enquete batiment créé avec succès."),
|
||||
new ApiResponse<>(true, enqueteBatimentPayloadWeb, "Enquete batiment créé avec succès."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
@@ -176,4 +176,51 @@ public class EnqueteBatimentController {
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/by-batiment-id/{batimentId}")
|
||||
public ResponseEntity<?> getEnqueteBatimentByBatimentId(@PathVariable Long batimentId) {
|
||||
try {
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, enqueteBatimentService.getEnqueteBatimentByBatimentList(batimentId), "Enquete 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("/page/by-batiment-id/{batimentId}")
|
||||
public ResponseEntity<?> getEnqueteBatimentByBatimentIdPaged(@PathVariable Long batimentId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||
try {
|
||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, enqueteBatimentService.getEnqueteBatimentByBatimentListPageable(batimentId,pageable), "Enquete 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@ public class EnqueteUniteLogementController {
|
||||
@PostMapping("/create")
|
||||
public ResponseEntity<?> createEnqueteUniteLogement(@RequestBody @Valid @Validated EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) {
|
||||
try {
|
||||
EnqueteUniteLogement enqueteUniteLogement = enqueteUniteLogementService.createEnqueteUniteLogement(enqueteUniteLogementPayloadWeb);
|
||||
enqueteUniteLogementPayloadWeb = enqueteUniteLogementService.createEnqueteUniteLogement(enqueteUniteLogementPayloadWeb);
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, enqueteUniteLogement, "Enquete unite logement créé avec succès."),
|
||||
new ApiResponse<>(true, enqueteUniteLogementPayloadWeb, "Enquete unite logement créé avec succès."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
@@ -176,4 +176,51 @@ public class EnqueteUniteLogementController {
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/by-unite-logement-id/{uniteLogementId}")
|
||||
public ResponseEntity<?> getEnqueteUniteLogementByUniteLogement(@PathVariable Long uniteLogementId) {
|
||||
try {
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, enqueteUniteLogementService.getEnqueteUniteLogementUniteLogementList(uniteLogementId), "Enquete unite de logement trouvée avec succès."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||
FileStorageException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||
} catch (NullPointerException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/page/by-unite-logement-id/{uniteLogementId}")
|
||||
public ResponseEntity<?> getEnqueteUniteLogementByUniteLogementPaged(@PathVariable Long uniteLogementId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
||||
try {
|
||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, enqueteUniteLogementService.getEnqueteUniteLogementByUniteLogementListPageable(uniteLogementId,pageable), "Enquete unite de logement trouvée avec succès."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||
FileStorageException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||
} catch (NullPointerException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.gmss.fiscad.entities.rfu.metier.UniteLogement;
|
||||
import io.gmss.fiscad.exceptions.*;
|
||||
import io.gmss.fiscad.interfaces.rfu.metier.UniteLogementService;
|
||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||
import io.gmss.fiscad.paylaods.request.crudweb.UniteLogementPaylaodWeb;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
@@ -35,11 +36,11 @@ public class UniteLogementController {
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
public ResponseEntity<?> createUniteLogement(@RequestBody @Valid @Validated UniteLogement enqueteUniteLogement) {
|
||||
public ResponseEntity<?> createUniteLogement(@RequestBody @Valid @Validated UniteLogementPaylaodWeb enqueteUniteLogementPaylaodWeb) {
|
||||
try {
|
||||
enqueteUniteLogement = enqueteUniteLogementService.createUniteLogement(enqueteUniteLogement);
|
||||
enqueteUniteLogementPaylaodWeb = enqueteUniteLogementService.createUniteLogement(enqueteUniteLogementPaylaodWeb);
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, enqueteUniteLogement, "Unite de logement créé avec succès."),
|
||||
new ApiResponse<>(true, enqueteUniteLogementPaylaodWeb, "Unite de logement créé avec succès."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
@@ -59,10 +60,10 @@ public class UniteLogementController {
|
||||
}
|
||||
|
||||
@PutMapping("/update/{id}")
|
||||
public ResponseEntity<?> updateUniteLogement(@PathVariable Long id, @RequestBody UniteLogement enqueteUniteLogement) {
|
||||
public ResponseEntity<?> updateUniteLogement(@PathVariable Long id, @RequestBody UniteLogementPaylaodWeb enqueteUniteLogementPaylaodWeb) {
|
||||
try {
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, enqueteUniteLogementService.updateUniteLogement(id, enqueteUniteLogement), "Unite de logement mise à jour avec succès."),
|
||||
new ApiResponse<>(true, enqueteUniteLogementService.updateUniteLogement(id, enqueteUniteLogementPaylaodWeb), "Unite de logement mise à jour avec succès."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||
|
||||
@@ -54,13 +54,23 @@ public class Enquete extends BaseEntity implements Serializable {
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateEnquete;
|
||||
|
||||
private boolean litige;
|
||||
|
||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateDebutExemption;
|
||||
|
||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateFinExemption;
|
||||
|
||||
|
||||
private Boolean litige;
|
||||
|
||||
|
||||
@ManyToOne
|
||||
private User user;
|
||||
|
||||
@JsonIgnore
|
||||
//@JsonIgnore
|
||||
@ManyToOne
|
||||
private Exercice exercice;
|
||||
|
||||
@@ -116,7 +126,7 @@ public class Enquete extends BaseEntity implements Serializable {
|
||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateSynchronisation;
|
||||
private boolean synchronise;
|
||||
private Boolean synchronise;
|
||||
private String observationParticuliere;
|
||||
@Transient
|
||||
private String nomPrenomEnqueteur;
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@@ -50,7 +51,8 @@ public class Parcelle extends BaseEntity implements Serializable {
|
||||
private String i;
|
||||
private String p;
|
||||
private String observation;
|
||||
private String numTitreFoncier;
|
||||
private String numeroTitreFoncier;
|
||||
private LocalDate dateTitreFoncier ;
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
private Tpe terminal;
|
||||
|
||||
@@ -34,16 +34,17 @@ public class Batiment extends BaseEntity implements Serializable {
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateConstruction;
|
||||
private Long idDerniereEnquete;
|
||||
private Float superficieLouee;
|
||||
private Float superficieAuSol;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
private Parcelle parcelle;
|
||||
|
||||
private Long parcelleExternalKey;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
private Tpe terminal;
|
||||
private Long enqueteId;
|
||||
// private Long enqueteId;
|
||||
private Long mobileDataId;
|
||||
private Long parcelleExternalKey;
|
||||
}
|
||||
|
||||
@@ -41,9 +41,10 @@ public class DeclarationNc extends BaseEntity implements Serializable {
|
||||
@OneToOne
|
||||
private Structure structure;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
private Enquete enquete;
|
||||
// @JsonIgnore
|
||||
// @ManyToOne
|
||||
// private Enquete enquete;
|
||||
|
||||
private Long enqueteExternalKey;
|
||||
|
||||
@JsonIgnore
|
||||
|
||||
@@ -62,10 +62,10 @@ public class EnqueteActivite extends BaseEntity implements Serializable {
|
||||
|
||||
@ManyToOne
|
||||
private Batiment batiment;
|
||||
private Long batimentExternalKey;
|
||||
|
||||
@OneToOne
|
||||
private Parcelle parcelle;
|
||||
|
||||
private Long parcelleExternalKey;
|
||||
|
||||
|
||||
@@ -74,11 +74,12 @@ public class EnqueteActivite extends BaseEntity implements Serializable {
|
||||
|
||||
@OneToOne
|
||||
private UniteLogement uniteLogement ;
|
||||
private Long uniteLogementExternalKey;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
private Enquete enquete;
|
||||
|
||||
|
||||
// @JsonIgnore
|
||||
// @ManyToOne
|
||||
// private Enquete enquete;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@@ -90,6 +91,12 @@ public class EnqueteActivite extends BaseEntity implements Serializable {
|
||||
|
||||
private Long mobileDataId;
|
||||
|
||||
|
||||
private Long batimentExternalKey;
|
||||
|
||||
private Long uniteLogementExternalKey;
|
||||
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@JsonIgnore
|
||||
private StatutEnregistrement statutEnregistrement;
|
||||
|
||||
@@ -12,6 +12,7 @@ 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.rfu.parametre.Caracteristique;
|
||||
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
|
||||
import io.gmss.fiscad.entities.user.User;
|
||||
import io.gmss.fiscad.enums.StatutEnregistrement;
|
||||
import jakarta.persistence.*;
|
||||
@@ -42,24 +43,26 @@ public class EnqueteBatiment extends BaseEntity implements Serializable {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private Float surfaceAuSol;
|
||||
// private Float surfaceAuSol;
|
||||
private String autreMenuisierie;
|
||||
private String autreMur;
|
||||
private boolean sbee;
|
||||
private Boolean sbee;
|
||||
private String numCompteurSbee;
|
||||
private boolean soneb;
|
||||
private Boolean soneb;
|
||||
private String numCompteurSoneb;
|
||||
private int nbreLotUnite;
|
||||
private int nbreUniteLocation;
|
||||
private float surfaceLouee;
|
||||
private int nbreMenage;
|
||||
private int nbreHabitant;
|
||||
private Integer nbreLotUnite;
|
||||
private Integer nbreUniteLocation;
|
||||
private Float superficieLouee;
|
||||
private Float superficieAuSol;
|
||||
private Integer nbreMenage;
|
||||
private Integer nbreHabitant;
|
||||
private Long montantMensuelLocation;
|
||||
private Long montantLocatifAnnuelDeclare;
|
||||
private Long valeurBatimentEstime;
|
||||
private Long valeurBatimentReel;
|
||||
private int nbreMoisLocation;
|
||||
private Integer nbreMoisLocation;
|
||||
private String autreCaracteristiquePhysique;
|
||||
private String observation;
|
||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateDebutExcemption;
|
||||
@@ -71,6 +74,9 @@ public class EnqueteBatiment extends BaseEntity implements Serializable {
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateEnquete;
|
||||
|
||||
@ManyToOne
|
||||
private Exercice exercice;
|
||||
|
||||
//@JsonIgnore
|
||||
@ManyToOne
|
||||
private Personne personne;
|
||||
|
||||
@@ -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.rfu.parametre.Exercice;
|
||||
import io.gmss.fiscad.entities.user.User;
|
||||
import io.gmss.fiscad.enums.StatutEnregistrement;
|
||||
import jakarta.persistence.*;
|
||||
@@ -41,32 +42,36 @@ public class EnqueteUniteLogement extends BaseEntity implements Serializable {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private int nbrePiece;
|
||||
private int nbreHabitant;
|
||||
private int nbreMenage;
|
||||
private boolean enLocation;
|
||||
private float montantMensuelLoyer;
|
||||
private int nbreMoisLocation;
|
||||
private float montantLocatifAnnuelDeclare;
|
||||
private Integer nbrePiece;
|
||||
private Integer nbreHabitant;
|
||||
private Integer nbreMenage;
|
||||
private Boolean enLocation;
|
||||
private Float montantMensuelLoyer;
|
||||
private Integer nbreMoisLocation;
|
||||
private Float montantLocatifAnnuelDeclare;
|
||||
private Long valeurUniteLogementEstime;
|
||||
private Long valeurUniteLogementReel;
|
||||
private float surfaceLouee;
|
||||
private float SurfaceAuSol;
|
||||
private boolean sbee;
|
||||
private boolean soneb;
|
||||
private Float superficieLouee;
|
||||
private Float superficieAuSol;
|
||||
private Boolean sbee;
|
||||
private Boolean soneb;
|
||||
private String numCompteurSbee;
|
||||
private String numCompteurSoneb;
|
||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateDebutExcemption;
|
||||
private LocalDate dateDebutExemption;
|
||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateFinExcemption;
|
||||
private LocalDate dateFinExemption;
|
||||
|
||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateEnquete;
|
||||
private String observation;
|
||||
private Long uniteLogementExternalKey;
|
||||
|
||||
@ManyToOne
|
||||
private Exercice exercice;
|
||||
|
||||
// @JsonIgnore
|
||||
// @ManyToOne(fetch = FetchType.LAZY)
|
||||
@@ -77,11 +82,15 @@ public class EnqueteUniteLogement extends BaseEntity implements Serializable {
|
||||
@ManyToOne
|
||||
private UniteLogement uniteLogement;
|
||||
|
||||
|
||||
private Long uniteLogementExternalKey;
|
||||
|
||||
@OneToOne
|
||||
private Personne personne;
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
private Tpe terminal;
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
private User user;
|
||||
|
||||
|
||||
private Long personneExternalKey;
|
||||
private Long mobileDataId;
|
||||
@@ -90,16 +99,13 @@ public class EnqueteUniteLogement extends BaseEntity implements Serializable {
|
||||
@JsonManagedReference
|
||||
private List<CaracteristiqueUniteLogement> caracteristiqueUniteLogements;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
private Tpe terminal;
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
private User user;
|
||||
|
||||
|
||||
//@JsonIgnore
|
||||
@OneToMany(mappedBy = "enqueteUniteLogement")
|
||||
private List<Upload> uploads;
|
||||
@JsonIgnore
|
||||
@Enumerated(EnumType.STRING)
|
||||
private StatutEnregistrement statutEnregistrement;
|
||||
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ public class UniteLogement extends BaseEntity implements Serializable {
|
||||
private Batiment batiment;
|
||||
private Long batimentExternalKey;
|
||||
private Long idDerniereEnquete;
|
||||
private Float SuperficieLouee;
|
||||
private Float SuperficieAuSol;
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
private Tpe terminal;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class Exercice extends BaseEntity implements Serializable {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private int annee;
|
||||
private Integer annee;
|
||||
private boolean estGenerer;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
|
||||
@@ -92,14 +92,14 @@ public class EnqueteServiceImpl implements EnqueteService {
|
||||
|
||||
@Override
|
||||
public Enquete createEnquete(EnquetePayLoadWeb enquetePayLoadWeb) throws BadRequestException {
|
||||
Parcelle parcelle=new Parcelle();
|
||||
Optional<Parcelle> optionalParcelle=Optional.empty();
|
||||
Long rueId;
|
||||
Optional<User> optionalUser = userRepository.findById(enquetePayLoadWeb.getEnqueteurId());
|
||||
if (!optionalUser.isPresent()) {
|
||||
throw new BadRequestException("Echec de l'enregistrement : Enquêteur inexistant");
|
||||
}
|
||||
Optional<Personne> optionalProprietaire = personneRepository.findById(enquetePayLoadWeb.getProprietaireId());
|
||||
if (!optionalProprietaire.isPresent()) {
|
||||
Optional<Personne> optionalPersonne = personneRepository.findById(enquetePayLoadWeb.getPersonneId());
|
||||
if (!optionalPersonne.isPresent()) {
|
||||
throw new BadRequestException("Echec de l'enregistrement : Propriétaire inexistant");
|
||||
}
|
||||
|
||||
@@ -108,43 +108,25 @@ public class EnqueteServiceImpl implements EnqueteService {
|
||||
throw new BadRequestException("Echec de l'enregistrement : zone inexistante");
|
||||
}
|
||||
|
||||
if(enquetePayLoadWeb.getZoneRfuId()!=null) {
|
||||
Optional<Rue> optionalRue = rueRepository.findById(enquetePayLoadWeb.getZoneRfuId());
|
||||
|
||||
if (optionalRue.isPresent()) {
|
||||
rueId = optionalRue.get().getId();
|
||||
enquetePayLoadWeb.getParcellePayLoadWeb().setRueId(rueId);
|
||||
}
|
||||
}
|
||||
|
||||
//Optional<Equipe> optionalEquipe = equipeRepository.findById(enquetePayLoadWeb.getEquipeId());
|
||||
|
||||
///enregistrement de la pacelle
|
||||
try {
|
||||
if (enquetePayLoadWeb.getParcellePayLoadWeb().getId() == null) {
|
||||
parcelle = parcelleService.createParcelle(enquetePayLoadWeb.getParcellePayLoadWeb());
|
||||
if (enquetePayLoadWeb.getParcelleId() == null) {
|
||||
throw new ApplicationException("Echec de l'enregistrement : La parcelle non renseignée.");
|
||||
} else {
|
||||
parcelle = parcelleService.updateParcelle(enquetePayLoadWeb.getParcellePayLoadWeb().getId(),enquetePayLoadWeb.getParcellePayLoadWeb());
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new ApplicationException("Echec de l'enregistrement : La parcelle non enregistrée.");
|
||||
optionalParcelle = parcelleService.getParcelleById(enquetePayLoadWeb.getParcelleId());
|
||||
}
|
||||
|
||||
////enregistrement de l'enquete
|
||||
Enquete enquete = new Enquete();
|
||||
enquete.setDateEnquete(LocalDate.now());
|
||||
//enquete.setBloc(optionalBloc.get());
|
||||
enquete.setUser(optionalUser.get());
|
||||
enquete.setParcelle(parcelle);
|
||||
enquete.setLitige(enquetePayLoadWeb.isLitige());
|
||||
enquete.setParcelle(optionalParcelle.get());
|
||||
enquete.setLitige(enquetePayLoadWeb.getLitige());
|
||||
enquete.setStatutEnquete(StatutEnquete.EN_COURS);
|
||||
enquete.setObservationParticuliere(enquetePayLoadWeb.getObservation());
|
||||
enquete.setPersonne(optionalProprietaire.orElse(null));
|
||||
enquete.setPersonne(optionalPersonne.orElse(null));
|
||||
enquete.setZoneRfu(optionalZoneRfu.orElse(null));
|
||||
enquete.setAutreAdresse(enquetePayLoadWeb.getAutreAdresse());
|
||||
enquete.setAutreNumeroTitreFoncier(enquetePayLoadWeb.getAutreNumeroTitreFoncier());
|
||||
enquete.setNumeroTitreFoncier(enquetePayLoadWeb.getNumeroTitreFoncier());
|
||||
//enquete.setEquipe(optionalEquipe.orElse(null));
|
||||
enquete.setDateDebutExcemption(enquetePayLoadWeb.getDateDebutExemption());
|
||||
enquete.setDateFinExcemption(enquetePayLoadWeb.getDateFinExemption());
|
||||
enquete.setNbreBatiment(enquetePayLoadWeb.getNbreBatiment());
|
||||
@@ -159,39 +141,39 @@ public class EnqueteServiceImpl implements EnqueteService {
|
||||
enquete.setMontantAnnuelleLocation(enquetePayLoadWeb.getMontantAnnuelleLocation());
|
||||
enquete.setValeurParcelleEstime(enquetePayLoadWeb.getValeurParcelleEstime());
|
||||
enquete.setValeurParcelleReel(enquetePayLoadWeb.getValeurParcelleReel());
|
||||
Enquete finalEnquete=enqueteRepository.save(enquete);
|
||||
enquete=enqueteRepository.save(enquete);
|
||||
|
||||
//////Enregistrement des caractéristiques parcelle
|
||||
enquetePayLoadWeb.getCaracteristiqueParcellePayloadWebs().forEach(caracteristiqueParcellePayloadWeb -> {
|
||||
caracteristiqueParcellePayloadWeb.setEnqueteId(finalEnquete.getId());
|
||||
CaracteristiqueParcelle caracteristiqueParcelle=entityFromPayLoadService.getCaracteristiqueParcelleFromPayLoadWeb(caracteristiqueParcellePayloadWeb);
|
||||
caracteristiqueParcelleService.createCaracteristiqueParcelle(caracteristiqueParcelle);
|
||||
});
|
||||
// enquetePayLoadWeb.getCaracteristiqueParcellePayloadWebs().forEach(caracteristiqueParcellePayloadWeb -> {
|
||||
// caracteristiqueParcellePayloadWeb.setEnqueteId(finalEnquete.getId());
|
||||
// CaracteristiqueParcelle caracteristiqueParcelle=entityFromPayLoadService.getCaracteristiqueParcelleFromPayLoadWeb(caracteristiqueParcellePayloadWeb);
|
||||
// caracteristiqueParcelleService.createCaracteristiqueParcelle(caracteristiqueParcelle);
|
||||
// });
|
||||
|
||||
/////Enregistrement des pièce de parcelles
|
||||
enquetePayLoadWeb.getPiecePayLoadWebs().forEach(piecePayLoadWeb -> {
|
||||
piecePayLoadWeb.setEnqueteId(finalEnquete.getId());
|
||||
//Piece piece=entityFromPayLoadService.getPieceFromPayLoadWeb(piecePayLoadWeb);
|
||||
Piece piecefinal = pieceService.createPiece(entityFromPayLoadService.getPieceFromPayLoadWeb(piecePayLoadWeb));
|
||||
piecePayLoadWeb.getUploadPayLoadWebs().forEach(uploadPayLoadWeb -> {
|
||||
uploadPayLoadWeb.setEnqueteId(finalEnquete.getId());
|
||||
Upload upload=entityFromPayLoadService.getUploadFromPayLoadWeb(uploadPayLoadWeb);
|
||||
upload.setPiece(piecefinal);
|
||||
uploadRepository.save(upload);
|
||||
});
|
||||
});
|
||||
// enquetePayLoadWeb.getPiecePayLoadWebs().forEach(piecePayLoadWeb -> {
|
||||
// piecePayLoadWeb.setEnqueteId(finalEnquete.getId());
|
||||
// //Piece piece=entityFromPayLoadService.getPieceFromPayLoadWeb(piecePayLoadWeb);
|
||||
// Piece piecefinal = pieceService.createPiece(entityFromPayLoadService.getPieceFromPayLoadWeb(piecePayLoadWeb));
|
||||
// piecePayLoadWeb.getUploadPayLoadWebs().forEach(uploadPayLoadWeb -> {
|
||||
// uploadPayLoadWeb.setEnqueteId(finalEnquete.getId());
|
||||
// Upload upload=entityFromPayLoadService.getUploadFromPayLoadWeb(uploadPayLoadWeb);
|
||||
// upload.setPiece(piecefinal);
|
||||
// uploadRepository.save(upload);
|
||||
// });
|
||||
// });
|
||||
|
||||
/////Enregistrement des pièce de parcelles
|
||||
enquetePayLoadWeb.getDeclarationNcPayloadWebs().forEach(declarationNcPayloadWeb -> {
|
||||
declarationNcPayloadWeb.setEnqueteId(finalEnquete.getId());
|
||||
DeclarationNc declarationNcfinal=declarationNcService.createDeclarationNc(entityFromPayLoadService.getDeclarationNcFromPayLoadWeb(declarationNcPayloadWeb));
|
||||
declarationNcPayloadWeb.getUploadPayLoadWebs().forEach(uploadPayLoadWeb -> {
|
||||
uploadPayLoadWeb.setEnqueteId(finalEnquete.getId());
|
||||
Upload upload=entityFromPayLoadService.getUploadFromPayLoadWeb(uploadPayLoadWeb);
|
||||
upload.setDeclarationNc(declarationNcfinal);
|
||||
uploadRepository.save(upload);
|
||||
});
|
||||
});
|
||||
// enquetePayLoadWeb.getDeclarationNcPayloadWebs().forEach(declarationNcPayloadWeb -> {
|
||||
// declarationNcPayloadWeb.setEnqueteId(finalEnquete.getId());
|
||||
// DeclarationNc declarationNcfinal=declarationNcService.createDeclarationNc(entityFromPayLoadService.getDeclarationNcFromPayLoadWeb(declarationNcPayloadWeb));
|
||||
// declarationNcPayloadWeb.getUploadPayLoadWebs().forEach(uploadPayLoadWeb -> {
|
||||
// uploadPayLoadWeb.setEnqueteId(finalEnquete.getId());
|
||||
// Upload upload=entityFromPayLoadService.getUploadFromPayLoadWeb(uploadPayLoadWeb);
|
||||
// upload.setDeclarationNc(declarationNcfinal);
|
||||
// uploadRepository.save(upload);
|
||||
// });
|
||||
// });
|
||||
|
||||
return enquete;
|
||||
}
|
||||
@@ -205,17 +187,17 @@ public class EnqueteServiceImpl implements EnqueteService {
|
||||
throw new NotFoundException("Impossible de trouver l'enquête que vous désirez modifier.");
|
||||
}
|
||||
|
||||
if (enquetePayLoadWeb.getParcellePayLoadWeb()==null) {
|
||||
if (enquetePayLoadWeb.getParcelleId()==null) {
|
||||
throw new BadRequestException("Impossible d'enregistrer une enquête avec une parcelle inexistante");
|
||||
}
|
||||
|
||||
Parcelle parcelle=new Parcelle();
|
||||
Optional<Parcelle> optionalParcelle=Optional.empty();
|
||||
Long rueId;
|
||||
Optional<User> optionalUser = userRepository.findById(enquetePayLoadWeb.getEnqueteurId());
|
||||
if (!optionalUser.isPresent()) {
|
||||
throw new BadRequestException("Echec de l'enregistrement : Enquêteur inexistant");
|
||||
}
|
||||
Optional<Personne> optionalProprietaire = personneRepository.findById(enquetePayLoadWeb.getProprietaireId());
|
||||
Optional<Personne> optionalProprietaire = personneRepository.findById(enquetePayLoadWeb.getPersonneId());
|
||||
if (!optionalProprietaire.isPresent()) {
|
||||
throw new BadRequestException("Echec de l'enregistrement : Propriétaire inexistant");
|
||||
}
|
||||
@@ -225,32 +207,28 @@ public class EnqueteServiceImpl implements EnqueteService {
|
||||
throw new BadRequestException("Echec de l'enregistrement : zone inexistante");
|
||||
}
|
||||
|
||||
Optional<Rue> optionalRue = rueRepository.findById(enquetePayLoadWeb.getZoneRfuId());
|
||||
//Optional<Rue> optionalRue = rueRepository.findById(enquetePayLoadWeb.getZoneRfuId());
|
||||
|
||||
if (optionalRue.isPresent()) {
|
||||
rueId=optionalRue.get().getId();
|
||||
enquetePayLoadWeb.getParcellePayLoadWeb().setRueId(rueId);
|
||||
}
|
||||
// if (optionalRue.isPresent()) {
|
||||
// rueId=optionalRue.get().getId();
|
||||
// enquetePayLoadWeb.getParcellePayLoadWeb().setRueId(rueId);
|
||||
// }
|
||||
|
||||
//Optional<Equipe> optionalEquipe = equipeRepository.findById(enquetePayLoadWeb.getEquipeId());
|
||||
|
||||
///enregistrement de la pacelle
|
||||
try {
|
||||
if (enquetePayLoadWeb.getParcellePayLoadWeb().getId() == null) {
|
||||
parcelle = parcelleService.createParcelle(enquetePayLoadWeb.getParcellePayLoadWeb());
|
||||
if (enquetePayLoadWeb.getParcelleId() == null) {
|
||||
throw new ApplicationException("Echec de l'enregistrement : La parcelle non renseignée.");
|
||||
} else {
|
||||
parcelle = parcelleService.updateParcelle(enquetePayLoadWeb.getParcellePayLoadWeb().getId(),enquetePayLoadWeb.getParcellePayLoadWeb());
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new ApplicationException("Echec de l'enregistrement : La parcelle non enregistrée.");
|
||||
optionalParcelle = parcelleService.getParcelleById(enquetePayLoadWeb.getParcelleId());
|
||||
}
|
||||
|
||||
////enregistrement de l'enquete
|
||||
Enquete enquete = new Enquete();
|
||||
enquete.setDateEnquete(LocalDate.now());
|
||||
//enquete.setBloc(optionalBloc.get());
|
||||
enquete.setUser(optionalUser.get());
|
||||
enquete.setParcelle(parcelle);
|
||||
enquete.setLitige(enquetePayLoadWeb.isLitige());
|
||||
enquete.setParcelle(optionalParcelle.get());
|
||||
enquete.setLitige(enquetePayLoadWeb.getLitige());
|
||||
enquete.setStatutEnquete(StatutEnquete.EN_COURS);
|
||||
enquete.setObservationParticuliere(enquetePayLoadWeb.getObservation());
|
||||
enquete.setPersonne(optionalProprietaire.orElse(null));
|
||||
@@ -258,7 +236,6 @@ public class EnqueteServiceImpl implements EnqueteService {
|
||||
enquete.setAutreAdresse(enquetePayLoadWeb.getAutreAdresse());
|
||||
enquete.setAutreNumeroTitreFoncier(enquetePayLoadWeb.getAutreNumeroTitreFoncier());
|
||||
enquete.setNumeroTitreFoncier(enquetePayLoadWeb.getNumeroTitreFoncier());
|
||||
// enquete.setEquipe(optionalEquipe.orElse(null));
|
||||
enquete.setDateDebutExcemption(enquetePayLoadWeb.getDateDebutExemption());
|
||||
enquete.setDateFinExcemption(enquetePayLoadWeb.getDateFinExemption());
|
||||
enquete.setNbreBatiment(enquetePayLoadWeb.getNbreBatiment());
|
||||
|
||||
@@ -23,17 +23,17 @@ public class BatimentServiceImpl implements BatimentService {
|
||||
|
||||
|
||||
@Override
|
||||
public Batiment createBatiment(BatimentPaylaodWeb batimentPaylaodWeb) throws BadRequestException {
|
||||
public BatimentPaylaodWeb createBatiment(BatimentPaylaodWeb batimentPaylaodWeb) throws BadRequestException {
|
||||
if (batimentPaylaodWeb.getId() != null) {
|
||||
throw new BadRequestException("Impossible de créer un nouveau batiment ayant un id non null.");
|
||||
}
|
||||
Batiment batiment= entityFromPayLoadService.getBatimentFromPayLoadWeb(batimentPaylaodWeb);
|
||||
|
||||
return batimentRepository.save(batiment);
|
||||
batiment= batimentRepository.save(batiment);
|
||||
return batimentRepository.findBatimentAvecOccupantCourantToDto(batiment.getId()).orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Batiment updateBatiment(Long id,BatimentPaylaodWeb batimentPaylaodWeb) throws NotFoundException {
|
||||
public BatimentPaylaodWeb updateBatiment(Long id,BatimentPaylaodWeb batimentPaylaodWeb) throws NotFoundException {
|
||||
if (batimentPaylaodWeb.getId() == null) {
|
||||
throw new BadRequestException("Impossible de mettre à jour un nouveau batiment ayant un id null.");
|
||||
}
|
||||
@@ -41,8 +41,8 @@ public class BatimentServiceImpl implements BatimentService {
|
||||
throw new NotFoundException("Impossible de trouver le batiment spécifié dans notre base de données.");
|
||||
}
|
||||
Batiment batiment= entityFromPayLoadService.getBatimentFromPayLoadWeb(batimentPaylaodWeb);
|
||||
|
||||
return batimentRepository.save(batiment);
|
||||
batiment= batimentRepository.save(batiment);
|
||||
return batimentRepository.findBatimentAvecOccupantCourantToDto(batiment.getId()).orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,6 +15,7 @@ import io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb;
|
||||
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.rfu.metier.BatimentRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository;
|
||||
import io.gmss.fiscad.service.EntityFromPayLoadService;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -35,127 +36,38 @@ public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
|
||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
||||
private final CaracteristiqueBatimentService caracteristiqueBatimentService;
|
||||
private final UploadRepository uploadRepository;
|
||||
private final BatimentRepository batimentRepository;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public EnqueteBatiment createEnqueteBatiment(EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) throws BadRequestException {
|
||||
public EnqueteBatimentPayloadWeb createEnqueteBatiment(EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) throws BadRequestException {
|
||||
EnqueteBatiment enqueteBatiment=new EnqueteBatiment();
|
||||
Batiment batiment=new Batiment();
|
||||
//Enquete enquete=new Enquete();
|
||||
if(enqueteBatimentPayloadWeb.getBatimentPaylaodWeb().getId()==null){
|
||||
batiment= batimentService.createBatiment(enqueteBatimentPayloadWeb.getBatimentPaylaodWeb());//entityFromPayLoadService.getBatimentFromPayLoadWeb(enqueteBatimentPayloadWeb.getBatimentPaylaodWeb()));
|
||||
}else{
|
||||
batiment= batimentService.updateBatiment(enqueteBatimentPayloadWeb.getBatimentPaylaodWeb().getId(),enqueteBatimentPayloadWeb.getBatimentPaylaodWeb());//entityFromPayLoadService.getBatimentFromPayLoadWeb(enqueteBatimentPayloadWeb.getBatimentPaylaodWeb()));
|
||||
if (!batimentRepository.existsById(enqueteBatimentPayloadWeb.getBatimentId())) {
|
||||
throw new NotFoundException("Impossible d'enregistrer sans le batiment.");
|
||||
}
|
||||
|
||||
// if(enqueteBatimentPayloadWeb.getEnqueteId()==null){
|
||||
// throw new BadRequestException("Impossible de poursuivre l'enregistrement sans la précision de l'enquête");
|
||||
// }
|
||||
Optional<Personne> optionalPersonne=Optional.empty();
|
||||
if(enqueteBatimentPayloadWeb.getPersonneId()!=null){
|
||||
optionalPersonne=personneRepository.findById(enqueteBatimentPayloadWeb.getPersonneId());
|
||||
}
|
||||
|
||||
|
||||
//Optional<Enquete> optionalEnquete = enqueteRepository.findById(enqueteBatimentPayloadWeb.getEnqueteId());
|
||||
//enqueteBatiment.setEnquete(optionalEnquete.orElse(null));
|
||||
enqueteBatiment.setBatiment(batiment);
|
||||
enqueteBatiment.setPersonne(optionalPersonne.orElse(null));
|
||||
enqueteBatiment.setAutreCaracteristiquePhysique(enqueteBatimentPayloadWeb.getAutreCaracteristiquePhysique());
|
||||
enqueteBatiment.setAutreMur(enqueteBatimentPayloadWeb.getAutreMur());
|
||||
enqueteBatiment.setAutreMenuisierie(enqueteBatimentPayloadWeb.getAutreMenuisierie());
|
||||
enqueteBatiment.setDateDebutExcemption(enqueteBatimentPayloadWeb.getDateDebutExcemption());
|
||||
enqueteBatiment.setDateFinExcemption(enqueteBatimentPayloadWeb.getDateFinExcemption());
|
||||
enqueteBatiment.setNbreHabitant(enqueteBatimentPayloadWeb.getNbreHabitant());
|
||||
enqueteBatiment.setNbreLotUnite(enqueteBatimentPayloadWeb.getNbreLotUnite());
|
||||
enqueteBatiment.setNbreMenage(enqueteBatimentPayloadWeb.getNbreMenage());
|
||||
enqueteBatiment.setNbreMoisLocation(enqueteBatimentPayloadWeb.getNbreMoisLocation());
|
||||
enqueteBatiment.setNbreUniteLocation(enqueteBatimentPayloadWeb.getNbreUniteLocation());
|
||||
enqueteBatiment.setNumCompteurSbee(enqueteBatimentPayloadWeb.getNumCompteurSbee());
|
||||
enqueteBatiment.setNumCompteurSoneb(enqueteBatimentPayloadWeb.getNumCompteurSoneb());
|
||||
enqueteBatiment.setSbee(enqueteBatimentPayloadWeb.isSbee());
|
||||
enqueteBatiment.setSoneb(enqueteBatimentPayloadWeb.isSoneb());
|
||||
enqueteBatiment.setSurfaceAuSol(enqueteBatimentPayloadWeb.getSurfaceAuSol());
|
||||
enqueteBatiment.setSurfaceLouee(enqueteBatimentPayloadWeb.getSurfaceLouee());
|
||||
enqueteBatiment.setMontantMensuelLocation(enqueteBatimentPayloadWeb.getMontantMensuelLocation());
|
||||
enqueteBatiment.setValeurBatimentReel(enqueteBatimentPayloadWeb.getValeurBatimentReel());
|
||||
enqueteBatiment.setValeurBatimentEstime(enqueteBatimentPayloadWeb.getValeurBatimentEstime());
|
||||
enqueteBatiment.setMontantLocatifAnnuelDeclare(enqueteBatimentPayloadWeb.getMontantLocatifAnnuelDeclare());
|
||||
enqueteBatiment.setNbreEtage(enqueteBatimentPayloadWeb.getNbreEtage());
|
||||
enqueteBatiment = entityFromPayLoadService.getEnqueteBatimentFromPayLoadWeb(enqueteBatimentPayloadWeb);
|
||||
enqueteBatiment= enqueteBatimentRepository.save(enqueteBatiment);
|
||||
|
||||
//////Enregistrement des caractéristiques batiment
|
||||
Long enqueteBatimentId = enqueteBatiment.getId();
|
||||
enqueteBatimentPayloadWeb.getCaracteristiqueBatimentPayloadWebs().forEach(caracteristiqueBatimentPayloadWeb -> {
|
||||
caracteristiqueBatimentPayloadWeb.setEnqueteBatimentId(enqueteBatimentId);
|
||||
CaracteristiqueBatiment caracteristiqueBatiment=entityFromPayLoadService.getCaracteristiqueBatimentFromPayLoadWeb(caracteristiqueBatimentPayloadWeb);
|
||||
caracteristiqueBatimentService.createCaracteristiqueBatiment(caracteristiqueBatiment);
|
||||
});
|
||||
|
||||
EnqueteBatiment finalEnqueteBatiment = enqueteBatiment;
|
||||
enqueteBatimentPayloadWeb.getUploadPayLoadWebs().forEach(uploadPayLoadWeb -> {
|
||||
//optionalEnquete.ifPresent(value -> uploadPayLoadWeb.setEnqueteId(value.getId()));
|
||||
Upload upload=entityFromPayLoadService.getUploadFromPayLoadWeb(uploadPayLoadWeb);
|
||||
upload.setEnqueteBatiment(finalEnqueteBatiment);
|
||||
uploadRepository.save(upload);
|
||||
});
|
||||
|
||||
return enqueteBatiment ;
|
||||
enqueteBatimentPayloadWeb= enqueteBatimentRepository.findEnqueteBatimentByIdToDto(enqueteBatiment.getId()).orElse(null);
|
||||
return enqueteBatimentPayloadWeb ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnqueteBatiment updateEnqueteBatiment(Long id, EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) throws NotFoundException {
|
||||
public EnqueteBatimentPayloadWeb updateEnqueteBatiment(Long id, EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) throws NotFoundException {
|
||||
if (enqueteBatimentPayloadWeb.getId() == null) {
|
||||
throw new BadRequestException("Impossible de mettre à jour une nouvelle enquete de batiment ayant un id null.");
|
||||
}
|
||||
if (!enqueteBatimentRepository.existsById(enqueteBatimentPayloadWeb.getId())) {
|
||||
throw new NotFoundException("Impossible de trouver la nouvelle enquete de batiment spécifiée dans notre base de données.");
|
||||
}
|
||||
// if(enqueteBatimentPayloadWeb.getEnqueteId()==null){
|
||||
// throw new BadRequestException("Impossible de poursuivre l'enregistrement sans la précision de l'enquête");
|
||||
// }
|
||||
// Optional<Enquete> optionalEnquete = enqueteRepository.findById(enqueteBatimentPayloadWeb.getEnqueteId());
|
||||
|
||||
EnqueteBatiment enqueteBatiment=new EnqueteBatiment();
|
||||
Batiment batiment=new Batiment();
|
||||
|
||||
if(enqueteBatimentPayloadWeb.getBatimentPaylaodWeb().getId()==null){
|
||||
batiment= batimentService.createBatiment(enqueteBatimentPayloadWeb.getBatimentPaylaodWeb());//entityFromPayLoadService.getBatimentFromPayLoadWeb(enqueteBatimentPayloadWeb.getBatimentPaylaodWeb()));
|
||||
}else{
|
||||
batiment= batimentService.updateBatiment(id,enqueteBatimentPayloadWeb.getBatimentPaylaodWeb());//entityFromPayLoadService.getBatimentFromPayLoadWeb(enqueteBatimentPayloadWeb.getBatimentPaylaodWeb()));
|
||||
if (!batimentRepository.existsById(enqueteBatimentPayloadWeb.getBatimentId())) {
|
||||
throw new NotFoundException("Impossible d'enregistrer sans le batiment.");
|
||||
}
|
||||
|
||||
|
||||
Optional<Personne> optionalPersonne=Optional.empty();
|
||||
if(enqueteBatimentPayloadWeb.getPersonneId()!=null){
|
||||
optionalPersonne=personneRepository.findById(enqueteBatimentPayloadWeb.getPersonneId());
|
||||
}
|
||||
//enqueteBatiment.setEnquete(optionalEnquete.orElse(null));
|
||||
enqueteBatiment.setBatiment(batiment);
|
||||
enqueteBatiment.setPersonne(optionalPersonne.orElse(null));
|
||||
enqueteBatiment.setAutreCaracteristiquePhysique(enqueteBatimentPayloadWeb.getAutreCaracteristiquePhysique());
|
||||
enqueteBatiment.setAutreMur(enqueteBatimentPayloadWeb.getAutreMur());
|
||||
enqueteBatiment.setAutreMenuisierie(enqueteBatimentPayloadWeb.getAutreMenuisierie());
|
||||
enqueteBatiment.setDateDebutExcemption(enqueteBatimentPayloadWeb.getDateDebutExcemption());
|
||||
enqueteBatiment.setDateFinExcemption(enqueteBatimentPayloadWeb.getDateFinExcemption());
|
||||
enqueteBatiment.setNbreHabitant(enqueteBatimentPayloadWeb.getNbreHabitant());
|
||||
enqueteBatiment.setNbreLotUnite(enqueteBatimentPayloadWeb.getNbreLotUnite());
|
||||
enqueteBatiment.setNbreMenage(enqueteBatimentPayloadWeb.getNbreMenage());
|
||||
enqueteBatiment.setNbreMoisLocation(enqueteBatimentPayloadWeb.getNbreMoisLocation());
|
||||
enqueteBatiment.setNbreUniteLocation(enqueteBatimentPayloadWeb.getNbreUniteLocation());
|
||||
enqueteBatiment.setNumCompteurSbee(enqueteBatimentPayloadWeb.getNumCompteurSbee());
|
||||
enqueteBatiment.setNumCompteurSoneb(enqueteBatimentPayloadWeb.getNumCompteurSoneb());
|
||||
enqueteBatiment.setSbee(enqueteBatimentPayloadWeb.isSbee());
|
||||
enqueteBatiment.setSoneb(enqueteBatimentPayloadWeb.isSoneb());
|
||||
enqueteBatiment.setSurfaceAuSol(enqueteBatimentPayloadWeb.getSurfaceAuSol());
|
||||
enqueteBatiment.setSurfaceLouee(enqueteBatimentPayloadWeb.getSurfaceLouee());
|
||||
enqueteBatiment.setMontantMensuelLocation(enqueteBatimentPayloadWeb.getMontantMensuelLocation());
|
||||
enqueteBatiment.setValeurBatimentReel(enqueteBatimentPayloadWeb.getValeurBatimentReel());
|
||||
enqueteBatiment.setValeurBatimentEstime(enqueteBatimentPayloadWeb.getValeurBatimentEstime());
|
||||
enqueteBatiment.setMontantLocatifAnnuelDeclare(enqueteBatimentPayloadWeb.getMontantLocatifAnnuelDeclare());
|
||||
EnqueteBatiment enqueteBatiment = entityFromPayLoadService.getEnqueteBatimentFromPayLoadWeb(enqueteBatimentPayloadWeb);
|
||||
enqueteBatiment= enqueteBatimentRepository.save(enqueteBatiment);
|
||||
return enqueteBatimentRepository.save(enqueteBatiment);
|
||||
enqueteBatimentPayloadWeb= enqueteBatimentRepository.findEnqueteBatimentByIdToDto(enqueteBatiment.getId()).orElse(null);
|
||||
return enqueteBatimentPayloadWeb ;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -169,23 +81,33 @@ public class EnqueteBatimentServiceImpl implements EnqueteBatimentService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<EnqueteBatiment> getEnqueteBatimentList(Pageable pageable) {
|
||||
return enqueteBatimentRepository.findAll(pageable);
|
||||
public Page<EnqueteBatimentPayloadWeb> getEnqueteBatimentList(Pageable pageable) {
|
||||
return enqueteBatimentRepository.findAllEnqueteBatimentToDtoPageable(pageable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnqueteBatiment> getEnqueteBatimentList() {
|
||||
return enqueteBatimentRepository.findAll();
|
||||
public List<EnqueteBatimentPayloadWeb> getEnqueteBatimentList() {
|
||||
return enqueteBatimentRepository.findAllEnqueteBatimentToDto();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Optional<EnqueteBatiment> getEnqueteBatimentById(Long id) {
|
||||
public Optional<EnqueteBatimentPayloadWeb> getEnqueteBatimentById(Long id) {
|
||||
if (enqueteBatimentRepository.existsById(id)) {
|
||||
return enqueteBatimentRepository.findById(id);
|
||||
return enqueteBatimentRepository.findEnqueteBatimentByIdToDto(id);
|
||||
} else {
|
||||
throw new NotFoundException("Impossible de trouver la nouvelle enquete de batiment spécifiée dans la base de données.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<EnqueteBatimentPayloadWeb> getEnqueteBatimentByBatimentListPageable(Long batimentId, Pageable pageable) {
|
||||
return enqueteBatimentRepository.findAllByBatimentToDtoPageable(batimentId,pageable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnqueteBatimentPayloadWeb> getEnqueteBatimentByBatimentList(Long batimentId) {
|
||||
return enqueteBatimentRepository.findAllByBatimentToDto(batimentId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ 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.rfu.metier.EnqueteUniteLogementRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.UniteLogementRepository;
|
||||
import io.gmss.fiscad.service.EntityFromPayLoadService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -32,75 +33,27 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
|
||||
private final PersonneRepository personneRepository ;
|
||||
private final EnqueteRepository enqueteRepository ;
|
||||
private final UploadRepository uploadRepository ;
|
||||
private final UniteLogementRepository uniteLogementRepository ;
|
||||
private final CaracteristiqueUniteLogementService caracteristiqueUniteLogementService ;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public EnqueteUniteLogement createEnqueteUniteLogement(EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) throws BadRequestException {
|
||||
public EnqueteUniteLogementPayloadWeb createEnqueteUniteLogement(EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) throws BadRequestException {
|
||||
EnqueteUniteLogement enqueteUniteLogement=new EnqueteUniteLogement();
|
||||
UniteLogement uniteLogement=new UniteLogement();
|
||||
Enquete enquete=new Enquete();
|
||||
if(enqueteUniteLogementPayloadWeb.getUniteLogementPaylaodWeb().getId()==null){
|
||||
uniteLogement = uniteLogementService.createUniteLogement(entityFromPayLoadService.getUniteLogementFromPayLoadWeb(enqueteUniteLogementPayloadWeb.getUniteLogementPaylaodWeb()));
|
||||
}else{
|
||||
uniteLogement = uniteLogementService.updateUniteLogement(enqueteUniteLogementPayloadWeb.getUniteLogementPaylaodWeb().getId(),entityFromPayLoadService.getUniteLogementFromPayLoadWeb(enqueteUniteLogementPayloadWeb.getUniteLogementPaylaodWeb()));
|
||||
Optional<UniteLogement> optionalUniteLogement= Optional.empty();
|
||||
|
||||
if (enqueteUniteLogementPayloadWeb.getUniteLogementId() == null) {
|
||||
throw new BadRequestException("Impossible d'enregistrer une nouvelle enquete d'unité de logement sans l'unité de logement.");
|
||||
}
|
||||
|
||||
// if(enqueteUniteLogementPayloadWeb.getEnqueteId()==null){
|
||||
// throw new BadRequestException("Impossible de poursuivre l'enregistrement sans la précision de l'enquête");
|
||||
// }
|
||||
|
||||
Optional<Personne> optionalPersonne=Optional.empty();
|
||||
if(enqueteUniteLogementPayloadWeb.getPersonneId()!=null){
|
||||
optionalPersonne=personneRepository.findById(enqueteUniteLogementPayloadWeb.getPersonneId());
|
||||
}
|
||||
|
||||
|
||||
//Optional<Enquete> optionalEnquete = enqueteRepository.findById(enqueteUniteLogementPayloadWeb.getEnqueteId());
|
||||
// enqueteUniteLogement.setEnquete(optionalEnquete.orElse(null));
|
||||
enqueteUniteLogement.setUniteLogement(uniteLogement);
|
||||
enqueteUniteLogement.setPersonne(optionalPersonne.orElse(null));
|
||||
enqueteUniteLogement.setEnLocation(enqueteUniteLogementPayloadWeb.isEnLocation());
|
||||
enqueteUniteLogement.setDateDebutExcemption(enqueteUniteLogementPayloadWeb.getDateDebutExcemption());
|
||||
enqueteUniteLogement.setDateFinExcemption(enqueteUniteLogementPayloadWeb.getDateFinExcemption());
|
||||
enqueteUniteLogement.setNbreHabitant(enqueteUniteLogementPayloadWeb.getNbreHabitant());
|
||||
enqueteUniteLogement.setNbreMenage(enqueteUniteLogementPayloadWeb.getNbreMenage());
|
||||
enqueteUniteLogement.setNbreMoisLocation(enqueteUniteLogementPayloadWeb.getNbreMoisLocation());
|
||||
enqueteUniteLogement.setNumCompteurSbee(enqueteUniteLogementPayloadWeb.getNumCompteurSbee());
|
||||
enqueteUniteLogement.setNumCompteurSoneb(enqueteUniteLogementPayloadWeb.getNumCompteurSoneb());
|
||||
enqueteUniteLogement.setSbee(enqueteUniteLogementPayloadWeb.isSbee());
|
||||
enqueteUniteLogement.setSoneb(enqueteUniteLogementPayloadWeb.isSoneb());
|
||||
enqueteUniteLogement.setSurfaceAuSol(enqueteUniteLogementPayloadWeb.getSurfaceAuSol());
|
||||
enqueteUniteLogement.setSurfaceLouee(enqueteUniteLogementPayloadWeb.getSurfaceLouee());
|
||||
enqueteUniteLogement.setValeurUniteLogementEstime(enqueteUniteLogementPayloadWeb.getValeurUniteLogementEstime());
|
||||
enqueteUniteLogement.setValeurUniteLogementReel(enqueteUniteLogementPayloadWeb.getValeurUniteLogementReel());
|
||||
enqueteUniteLogement.setMontantLocatifAnnuelDeclare(enqueteUniteLogementPayloadWeb.getMontantLocatifAnnuelDeclare());
|
||||
enqueteUniteLogement.setMontantMensuelLoyer(enqueteUniteLogementPayloadWeb.getMontantMensuelLoyer());
|
||||
enqueteUniteLogement = entityFromPayLoadService.getEnqueteUniteLogementFromPayLoadWeb(enqueteUniteLogementPayloadWeb);
|
||||
enqueteUniteLogement= enqueteUniteLogementRepository.save(enqueteUniteLogement);
|
||||
|
||||
//////Enregistrement des caractéristiques batiment
|
||||
Long enqueteUniteLogementId = enqueteUniteLogement.getId();
|
||||
enqueteUniteLogementPayloadWeb.getCaracteristiqueUniteLogementPayloadWebs().forEach(caracteristiqueUniteLogementPayloadWeb -> {
|
||||
caracteristiqueUniteLogementPayloadWeb.setEnqueteUniteLogementId(enqueteUniteLogementId);
|
||||
CaracteristiqueUniteLogement caracteristiqueUniteLogement=entityFromPayLoadService.getCaracteristiqueUniteLogementFromPayLoadWeb(caracteristiqueUniteLogementPayloadWeb);
|
||||
caracteristiqueUniteLogementService.createCaracteristiqueUniteLogement(caracteristiqueUniteLogement);
|
||||
});
|
||||
|
||||
///////Enregistrement des pieces
|
||||
EnqueteUniteLogement finalEnqueteUniteLogement = enqueteUniteLogement;
|
||||
enqueteUniteLogementPayloadWeb.getUploadPayLoadWebs().forEach(uploadPayLoadWeb -> {
|
||||
//optionalEnquete.ifPresent(value -> uploadPayLoadWeb.setEnqueteId(value.getId()));
|
||||
Upload upload=entityFromPayLoadService.getUploadFromPayLoadWeb(uploadPayLoadWeb);
|
||||
upload.setEnqueteUniteLogement(finalEnqueteUniteLogement);
|
||||
uploadRepository.save(upload);
|
||||
});
|
||||
|
||||
return enqueteUniteLogement ;
|
||||
enqueteUniteLogementPayloadWeb = enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(enqueteUniteLogement.getId()).orElse(null);
|
||||
return enqueteUniteLogementPayloadWeb ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnqueteUniteLogement updateEnqueteUniteLogement(Long id, EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) throws NotFoundException {
|
||||
public EnqueteUniteLogementPayloadWeb updateEnqueteUniteLogement(Long id, EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) throws NotFoundException {
|
||||
if (enqueteUniteLogementPayloadWeb.getId() == null) {
|
||||
throw new BadRequestException("Impossible de mettre à jour une nouvelle enquete d'unité de logement ayant un id null.");
|
||||
}
|
||||
@@ -108,46 +61,17 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
|
||||
if (!enqueteUniteLogementRepository.existsById(enqueteUniteLogementPayloadWeb.getId())) {
|
||||
throw new NotFoundException("Impossible de trouver la nouvelle enquete d'unité de logement spécifiée dans notre base de données.");
|
||||
}
|
||||
|
||||
if (!uniteLogementRepository.existsById(enqueteUniteLogementPayloadWeb.getUniteLogementId())) {
|
||||
throw new NotFoundException("Impossible de poursuivre l'enregistement, unite de logement nom précisée");
|
||||
}
|
||||
|
||||
EnqueteUniteLogement enqueteUniteLogement= new EnqueteUniteLogement();
|
||||
UniteLogement uniteLogement= new UniteLogement();
|
||||
|
||||
if(enqueteUniteLogementPayloadWeb.getUniteLogementPaylaodWeb().getId()==null){
|
||||
uniteLogement = uniteLogementService.createUniteLogement(entityFromPayLoadService.getUniteLogementFromPayLoadWeb(enqueteUniteLogementPayloadWeb.getUniteLogementPaylaodWeb()));
|
||||
}else{
|
||||
uniteLogement = uniteLogementService.updateUniteLogement(enqueteUniteLogementPayloadWeb.getUniteLogementPaylaodWeb().getId(),entityFromPayLoadService.getUniteLogementFromPayLoadWeb(enqueteUniteLogementPayloadWeb.getUniteLogementPaylaodWeb()));
|
||||
}
|
||||
|
||||
// if(enqueteUniteLogementPayloadWeb.getEnqueteId()==null){
|
||||
// throw new BadRequestException("Impossible de poursuivre l'enregistrement sans la précision de l'enquête");
|
||||
// }
|
||||
|
||||
Optional<Personne> optionalPersonne=Optional.empty();
|
||||
if(enqueteUniteLogementPayloadWeb.getPersonneId()!=null){
|
||||
optionalPersonne=personneRepository.findById(enqueteUniteLogementPayloadWeb.getPersonneId());
|
||||
}
|
||||
// Optional<Enquete> optionalEnquete = enqueteRepository.findById(enqueteUniteLogementPayloadWeb.getEnqueteId());
|
||||
|
||||
// enqueteUniteLogement.setEnquete(optionalEnquete.orElse(null));
|
||||
enqueteUniteLogement.setUniteLogement(uniteLogement);
|
||||
enqueteUniteLogement.setPersonne(optionalPersonne.orElse(null));
|
||||
enqueteUniteLogement.setEnLocation(enqueteUniteLogementPayloadWeb.isEnLocation());
|
||||
enqueteUniteLogement.setDateDebutExcemption(enqueteUniteLogementPayloadWeb.getDateDebutExcemption());
|
||||
enqueteUniteLogement.setDateFinExcemption(enqueteUniteLogementPayloadWeb.getDateFinExcemption());
|
||||
enqueteUniteLogement.setNbreHabitant(enqueteUniteLogementPayloadWeb.getNbreHabitant());
|
||||
enqueteUniteLogement.setNbreMenage(enqueteUniteLogementPayloadWeb.getNbreMenage());
|
||||
enqueteUniteLogement.setNbreMoisLocation(enqueteUniteLogementPayloadWeb.getNbreMoisLocation());
|
||||
enqueteUniteLogement.setNumCompteurSbee(enqueteUniteLogementPayloadWeb.getNumCompteurSbee());
|
||||
enqueteUniteLogement.setNumCompteurSoneb(enqueteUniteLogementPayloadWeb.getNumCompteurSoneb());
|
||||
enqueteUniteLogement.setSbee(enqueteUniteLogementPayloadWeb.isSbee());
|
||||
enqueteUniteLogement.setSoneb(enqueteUniteLogementPayloadWeb.isSoneb());
|
||||
enqueteUniteLogement.setSurfaceAuSol(enqueteUniteLogementPayloadWeb.getSurfaceAuSol());
|
||||
enqueteUniteLogement.setSurfaceLouee(enqueteUniteLogementPayloadWeb.getSurfaceLouee());
|
||||
enqueteUniteLogement.setValeurUniteLogementEstime(enqueteUniteLogementPayloadWeb.getValeurUniteLogementEstime());
|
||||
enqueteUniteLogement.setValeurUniteLogementReel(enqueteUniteLogementPayloadWeb.getValeurUniteLogementReel());
|
||||
enqueteUniteLogement.setMontantLocatifAnnuelDeclare(enqueteUniteLogementPayloadWeb.getMontantLocatifAnnuelDeclare());
|
||||
enqueteUniteLogement.setMontantMensuelLoyer(enqueteUniteLogementPayloadWeb.getMontantMensuelLoyer());
|
||||
enqueteUniteLogement = entityFromPayLoadService.getEnqueteUniteLogementFromPayLoadWeb(enqueteUniteLogementPayloadWeb);
|
||||
enqueteUniteLogement= enqueteUniteLogementRepository.save(enqueteUniteLogement);
|
||||
return enqueteUniteLogement;
|
||||
enqueteUniteLogementPayloadWeb = enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(enqueteUniteLogement.getId()).orElse(null);
|
||||
return enqueteUniteLogementPayloadWeb ;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -161,20 +85,30 @@ public class EnqueteUniteLogementServiceImpl implements EnqueteUniteLogementServ
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<EnqueteUniteLogement> getEnqueteUniteLogementList(Pageable pageable) {
|
||||
return enqueteUniteLogementRepository.findAll(pageable);
|
||||
public Page<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementList(Pageable pageable) {
|
||||
return enqueteUniteLogementRepository.findAllEnqueteUniteLogementToDtoPageable(pageable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnqueteUniteLogement> getEnqueteUniteLogementList() {
|
||||
return enqueteUniteLogementRepository.findAll();
|
||||
public List<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementList() {
|
||||
return enqueteUniteLogementRepository.findAllEnqueteUniteLogementToDto();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementByUniteLogementListPageable(Long uniteLogementId, Pageable pageable) {
|
||||
return enqueteUniteLogementRepository.findByAllByUniteLogementToDtoPageable(uniteLogementId,pageable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementUniteLogementList(Long uniteLogementId) {
|
||||
return enqueteUniteLogementRepository.findAllByUniteLogementToDto(uniteLogementId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Optional<EnqueteUniteLogement> getEnqueteUniteLogementById(Long id) {
|
||||
public Optional<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementById(Long id) {
|
||||
if (enqueteUniteLogementRepository.existsById(id)) {
|
||||
return enqueteUniteLogementRepository.findById(id);
|
||||
return enqueteUniteLogementRepository.findEnqueteUniteLogementToDto(id);
|
||||
} else {
|
||||
throw new NotFoundException("Impossible de trouver la nouvelle enquete d'unité de logement spécifiée dans la base de données.");
|
||||
}
|
||||
|
||||
@@ -6,39 +6,44 @@ import io.gmss.fiscad.exceptions.NotFoundException;
|
||||
import io.gmss.fiscad.interfaces.rfu.metier.UniteLogementService;
|
||||
import io.gmss.fiscad.paylaods.request.crudweb.UniteLogementPaylaodWeb;
|
||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.UniteLogementRepository;
|
||||
import io.gmss.fiscad.service.EntityFromPayLoadService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class UniteLogementServiceImpl implements UniteLogementService {
|
||||
|
||||
private final UniteLogementRepository uniteLogementRepository;
|
||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
||||
|
||||
|
||||
public UniteLogementServiceImpl(UniteLogementRepository uniteLogementRepository) {
|
||||
this.uniteLogementRepository = uniteLogementRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UniteLogement createUniteLogement(UniteLogement uniteLogement) throws BadRequestException {
|
||||
if (uniteLogement.getId() != null) {
|
||||
public UniteLogementPaylaodWeb createUniteLogement(UniteLogementPaylaodWeb uniteLogementPaylaodWeb) throws BadRequestException {
|
||||
if (uniteLogementPaylaodWeb.getId() != null) {
|
||||
throw new BadRequestException("Impossible de créer une nouvelle unité de logement ayant un id non null.");
|
||||
}
|
||||
return uniteLogementRepository.save(uniteLogement);
|
||||
UniteLogement uniteLogement = entityFromPayLoadService.getUniteLogementFromPayLoadWeb(uniteLogementPaylaodWeb);
|
||||
uniteLogement = uniteLogementRepository.save(uniteLogement);
|
||||
return uniteLogementRepository.findUniteLogementAvecOccupantCourantToDto(uniteLogement.getId()).orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UniteLogement updateUniteLogement(Long id, UniteLogement uniteLogement) throws NotFoundException {
|
||||
if (uniteLogement.getId() == null) {
|
||||
public UniteLogementPaylaodWeb updateUniteLogement(Long id, UniteLogementPaylaodWeb uniteLogementPaylaodWeb) throws NotFoundException {
|
||||
if (uniteLogementPaylaodWeb.getId() == null) {
|
||||
throw new BadRequestException("Impossible de mettre à jour une nouvelle unité de logement ayant un id null.");
|
||||
}
|
||||
if (!uniteLogementRepository.existsById(uniteLogement.getId())) {
|
||||
if (!uniteLogementRepository.existsById(uniteLogementPaylaodWeb.getId())) {
|
||||
throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données.");
|
||||
}
|
||||
return uniteLogementRepository.save(uniteLogement);
|
||||
UniteLogement uniteLogement = entityFromPayLoadService.getUniteLogementFromPayLoadWeb(uniteLogementPaylaodWeb);
|
||||
uniteLogement = uniteLogementRepository.save(uniteLogement);
|
||||
return uniteLogementRepository.findUniteLogementAvecOccupantCourantToDto(uniteLogement.getId()).orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1199,7 +1199,7 @@ public class SynchronisationServiceImpl implements SynchronisationService {
|
||||
optionalEnquete.get().setSynchronise(true);
|
||||
Enquete enquete = enqueteRepository.save(optionalEnquete.get());
|
||||
SyncResponse syncResponse = new SyncResponse();
|
||||
syncResponse.setSynchronise(enquete.isSynchronise());
|
||||
syncResponse.setSynchronise(enquete.getSynchronise());
|
||||
syncResponse.setExternalKey(enquete.getExternalKey());
|
||||
syncResponse.setIdBackend(enquete.getId());
|
||||
syncResponses.add(syncResponse);
|
||||
|
||||
@@ -12,9 +12,9 @@ import java.util.Optional;
|
||||
|
||||
public interface BatimentService {
|
||||
|
||||
Batiment createBatiment(BatimentPaylaodWeb batimentPaylaodWeb) throws BadRequestException;
|
||||
BatimentPaylaodWeb createBatiment(BatimentPaylaodWeb batimentPaylaodWeb) throws BadRequestException;
|
||||
|
||||
Batiment updateBatiment(Long id,BatimentPaylaodWeb batimentPaylaodWeb) throws NotFoundException;
|
||||
BatimentPaylaodWeb updateBatiment(Long id,BatimentPaylaodWeb batimentPaylaodWeb) throws NotFoundException;
|
||||
|
||||
void deleteBatiment(Long id) throws NotFoundException;
|
||||
|
||||
|
||||
@@ -12,15 +12,18 @@ import java.util.Optional;
|
||||
|
||||
public interface EnqueteBatimentService {
|
||||
|
||||
EnqueteBatiment createEnqueteBatiment(EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) throws BadRequestException;
|
||||
EnqueteBatimentPayloadWeb createEnqueteBatiment(EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) throws BadRequestException;
|
||||
|
||||
EnqueteBatiment updateEnqueteBatiment(Long id, EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) throws NotFoundException;
|
||||
EnqueteBatimentPayloadWeb updateEnqueteBatiment(Long id, EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb) throws NotFoundException;
|
||||
|
||||
void deleteEnqueteBatiment(Long id) throws NotFoundException;
|
||||
|
||||
Page<EnqueteBatiment> getEnqueteBatimentList(Pageable pageable);
|
||||
Page<EnqueteBatimentPayloadWeb> getEnqueteBatimentList(Pageable pageable);
|
||||
|
||||
List<EnqueteBatiment> getEnqueteBatimentList();
|
||||
List<EnqueteBatimentPayloadWeb> getEnqueteBatimentList();
|
||||
|
||||
Optional<EnqueteBatiment> getEnqueteBatimentById(Long id);
|
||||
Optional<EnqueteBatimentPayloadWeb> getEnqueteBatimentById(Long id);
|
||||
Page<EnqueteBatimentPayloadWeb> getEnqueteBatimentByBatimentListPageable(Long batimentId, Pageable pageable);
|
||||
|
||||
List<EnqueteBatimentPayloadWeb> getEnqueteBatimentByBatimentList(Long batimentId);
|
||||
}
|
||||
|
||||
@@ -12,15 +12,19 @@ import java.util.Optional;
|
||||
|
||||
public interface EnqueteUniteLogementService {
|
||||
|
||||
EnqueteUniteLogement createEnqueteUniteLogement(EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) throws BadRequestException;
|
||||
EnqueteUniteLogementPayloadWeb createEnqueteUniteLogement(EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) throws BadRequestException;
|
||||
|
||||
EnqueteUniteLogement updateEnqueteUniteLogement(Long id, EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) throws NotFoundException;
|
||||
EnqueteUniteLogementPayloadWeb updateEnqueteUniteLogement(Long id, EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb) throws NotFoundException;
|
||||
|
||||
void deleteEnqueteUniteLogement(Long id) throws NotFoundException;
|
||||
|
||||
Page<EnqueteUniteLogement> getEnqueteUniteLogementList(Pageable pageable);
|
||||
Page<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementList(Pageable pageable);
|
||||
|
||||
List<EnqueteUniteLogement> getEnqueteUniteLogementList();
|
||||
List<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementList();
|
||||
|
||||
Optional<EnqueteUniteLogement> getEnqueteUniteLogementById(Long id);
|
||||
Page<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementByUniteLogementListPageable(Long uniteLogementId,Pageable pageable);
|
||||
|
||||
List<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementUniteLogementList(Long uniteLogementId);
|
||||
|
||||
Optional<EnqueteUniteLogementPayloadWeb> getEnqueteUniteLogementById(Long enqueteUniteLogement);
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@ import java.util.Optional;
|
||||
|
||||
public interface UniteLogementService {
|
||||
|
||||
UniteLogement createUniteLogement(UniteLogement uniteLogement) throws BadRequestException;
|
||||
UniteLogementPaylaodWeb createUniteLogement(UniteLogementPaylaodWeb uniteLogementPaylaodWeb) throws BadRequestException;
|
||||
|
||||
UniteLogement updateUniteLogement(Long id,UniteLogement uniteLogement) throws NotFoundException;
|
||||
UniteLogementPaylaodWeb updateUniteLogement(Long id,UniteLogementPaylaodWeb uniteLogementPaylaodWeb) throws NotFoundException;
|
||||
|
||||
void deleteUniteLogement(Long id) throws NotFoundException;
|
||||
|
||||
|
||||
@@ -20,8 +20,10 @@ public class BatimentPaylaodWeb {
|
||||
private String personnePrenom;
|
||||
private String personneRaisonSociale;
|
||||
private Float superficieSol;
|
||||
private Float superficieLouee;
|
||||
private Long enqueteBatiementCourantId;
|
||||
|
||||
public BatimentPaylaodWeb(Long id, String nub, String code, LocalDate dateConstruction, Long parcelleId, String parcelleNup, String parcelleQ, String parcelleI, String parcelleP, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Float superficieSol) {
|
||||
public BatimentPaylaodWeb(Long id, String nub, String code, LocalDate dateConstruction, Long parcelleId, String parcelleNup, String parcelleQ, String parcelleI, String parcelleP, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Float superficieSol, Float superficieLouee,Long enqueteBatiementCourantId) {
|
||||
this.id = id;
|
||||
this.nub = nub;
|
||||
this.code = code;
|
||||
@@ -36,6 +38,7 @@ public class BatimentPaylaodWeb {
|
||||
this.personnePrenom = personnePrenom;
|
||||
this.personneRaisonSociale = personneRaisonSociale;
|
||||
this.superficieSol = superficieSol ;
|
||||
|
||||
this.superficieLouee = superficieLouee ;
|
||||
this.enqueteBatiementCourantId = enqueteBatiementCourantId ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import lombok.Data;
|
||||
public class CaracteristiqueParcellePayloadWeb {
|
||||
private Long id;
|
||||
private Long enqueteId;
|
||||
private Long enqueteDate;
|
||||
private Long caracteristiqueId;
|
||||
private String valeur;
|
||||
private String observation;
|
||||
|
||||
@@ -9,11 +9,10 @@ import java.util.List;
|
||||
@Data
|
||||
public class EnqueteBatimentPayloadWeb {
|
||||
private Long id;
|
||||
private BatimentPaylaodWeb batimentPaylaodWeb ;
|
||||
private List<CaracteristiqueBatimentPayloadWeb> caracteristiqueBatimentPayloadWebs;
|
||||
private List<UploadPayLoadWeb> uploadPayLoadWebs;
|
||||
// private BatimentPaylaodWeb batimentPaylaodWeb ;
|
||||
// private List<CaracteristiqueBatimentPayloadWeb> caracteristiqueBatimentPayloadWebs;
|
||||
// private List<UploadPayLoadWeb> uploadPayLoadWebs;
|
||||
private String observation;
|
||||
private float surfaceAuSol;
|
||||
private String autreMenuisierie;
|
||||
private String autreMur;
|
||||
private boolean sbee;
|
||||
@@ -22,7 +21,9 @@ public class EnqueteBatimentPayloadWeb {
|
||||
private String numCompteurSoneb;
|
||||
private int nbreLotUnite;
|
||||
private int nbreUniteLocation;
|
||||
private float surfaceLouee;
|
||||
private Float superficieLouee;
|
||||
private Float superficieAuSol;
|
||||
private LocalDate dateEnquete;
|
||||
private int nbreMenage;
|
||||
private int nbreHabitant;
|
||||
private Long montantMensuelLocation;
|
||||
@@ -36,7 +37,7 @@ public class EnqueteBatimentPayloadWeb {
|
||||
private LocalDate dateFinExcemption;
|
||||
// private Long enqueteId;
|
||||
private Long batimentId;
|
||||
private Long batimentNub;
|
||||
private String batimentNub;
|
||||
private Long personneId;
|
||||
private String personneNom;
|
||||
private String personnePrenom;
|
||||
@@ -45,10 +46,9 @@ public class EnqueteBatimentPayloadWeb {
|
||||
private String enqueteurNom;
|
||||
private String enqueteurPrenom;
|
||||
|
||||
public EnqueteBatimentPayloadWeb(Long id, String observation, float surfaceAuSol, String autreMenuisierie, String autreMur, boolean sbee, String numCompteurSbee, boolean soneb, String numCompteurSoneb, int nbreLotUnite, int nbreUniteLocation, float surfaceLouee, int nbreMenage, int nbreHabitant, Long montantMensuelLocation, Long montantLocatifAnnuelDeclare, Long nbreEtage, Long valeurBatimentEstime, Long valeurBatimentReel, int nbreMoisLocation, String autreCaracteristiquePhysique, LocalDate dateDebutExcemption, LocalDate dateFinExcemption, Long batimentId, Long batimentNub, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Long enqueteurId, String enqueteurNom, String enqueteurPrenom) {
|
||||
public EnqueteBatimentPayloadWeb(Long id, String observation, String autreMenuisierie, String autreMur, boolean sbee, String numCompteurSbee, boolean soneb, String numCompteurSoneb, int nbreLotUnite, int nbreUniteLocation, Float superficieLouee, Float superficieAuSol, LocalDate dateEnquete, int nbreMenage, int nbreHabitant, Long montantMensuelLocation, Long montantLocatifAnnuelDeclare, Long nbreEtage, Long valeurBatimentEstime, Long valeurBatimentReel, int nbreMoisLocation, String autreCaracteristiquePhysique, LocalDate dateDebutExcemption, LocalDate dateFinExcemption, Long batimentId, String batimentNub, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Long enqueteurId, String enqueteurNom, String enqueteurPrenom) {
|
||||
this.id = id;
|
||||
this.observation = observation;
|
||||
this.surfaceAuSol = surfaceAuSol;
|
||||
this.autreMenuisierie = autreMenuisierie;
|
||||
this.autreMur = autreMur;
|
||||
this.sbee = sbee;
|
||||
@@ -57,7 +57,9 @@ public class EnqueteBatimentPayloadWeb {
|
||||
this.numCompteurSoneb = numCompteurSoneb;
|
||||
this.nbreLotUnite = nbreLotUnite;
|
||||
this.nbreUniteLocation = nbreUniteLocation;
|
||||
this.surfaceLouee = surfaceLouee;
|
||||
this.superficieLouee = superficieLouee;
|
||||
this.superficieAuSol = superficieAuSol;
|
||||
this.dateEnquete = dateEnquete;
|
||||
this.nbreMenage = nbreMenage;
|
||||
this.nbreHabitant = nbreHabitant;
|
||||
this.montantMensuelLocation = montantMensuelLocation;
|
||||
|
||||
@@ -13,11 +13,11 @@ public class EnquetePayLoadWeb {
|
||||
private Long id;
|
||||
private LocalDate dateEnquete;
|
||||
private LocalDate dateFinalisation;
|
||||
private boolean litige;
|
||||
private ParcellePayLoadWeb parcellePayLoadWeb;
|
||||
private List<CaracteristiqueParcellePayloadWeb> caracteristiqueParcellePayloadWebs;
|
||||
private List<DeclarationNcPayloadWeb> declarationNcPayloadWebs;
|
||||
private List<PiecePayLoadWeb> piecePayLoadWebs;
|
||||
private Boolean litige;
|
||||
// private ParcellePayLoadWeb parcellePayLoadWeb;
|
||||
// private List<CaracteristiqueParcellePayloadWeb> caracteristiqueParcellePayloadWebs;
|
||||
// private List<DeclarationNcPayloadWeb> declarationNcPayloadWebs;
|
||||
// private List<PiecePayLoadWeb> piecePayLoadWebs;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private StatutEnquete statutEnquete;
|
||||
private String descriptionMotifRejet;
|
||||
@@ -27,13 +27,13 @@ public class EnquetePayLoadWeb {
|
||||
private String numEntreeParcelle;
|
||||
private String numRue;
|
||||
private String nomRue;
|
||||
private float precision;
|
||||
private int nbreCoProprietaire;
|
||||
private int nbreIndivisiaire;
|
||||
private Float precision;
|
||||
private Integer nbreCoProprietaire;
|
||||
private Integer nbreIndivisiaire;
|
||||
private String autreAdresse;
|
||||
private float superficie;
|
||||
private int nbreBatiment;
|
||||
private int nbrePiscine;
|
||||
private Float superficie;
|
||||
private Integer nbreBatiment;
|
||||
private Integer nbrePiscine;
|
||||
private LocalDate dateDebutExemption;
|
||||
private LocalDate dateFinExemption;
|
||||
private String autreNumeroTitreFoncier;
|
||||
@@ -41,27 +41,24 @@ public class EnquetePayLoadWeb {
|
||||
private Long montantAnnuelleLocation;
|
||||
private Long valeurParcelleEstime;
|
||||
private Long valeurParcelleReel;
|
||||
// private Long equipeId;
|
||||
private Long zoneRfuId;
|
||||
private String zoneRfuNom;
|
||||
private Long proprietaireId;
|
||||
private String proprietaireNom;
|
||||
private String proprietairePrenom;
|
||||
private String proprietaireRaisonSociale;
|
||||
private Long personneId;
|
||||
private String personneNom;
|
||||
private String personnePrenom;
|
||||
private String personneRaisonSociale;
|
||||
private Long enqueteurId;
|
||||
private String enqueteurNom;
|
||||
private String enqueteurPrenom;
|
||||
private Long secteurId;
|
||||
private String secteurCode;
|
||||
private String secteurNom;
|
||||
private Long parcelleId;
|
||||
private String parcelleNup;
|
||||
private String parcelleQ;
|
||||
private String parcelleI;
|
||||
private String parcelleP;
|
||||
private Long exerviceId;
|
||||
private Integer exerviceAnnee;
|
||||
|
||||
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, int nbreCoProprietaire, int nbreIndivisiaire, String autreAdresse, float superficie, int nbreBatiment, int nbrePiscine, LocalDate dateDebutExemption, LocalDate dateFinExemption, String autreNumeroTitreFoncier, Long montantMensuelleLocation, Long montantAnnuelleLocation, Long valeurParcelleEstime, Long valeurParcelleReel, Long zoneRfuId, String zoneRfuNom, Long proprietaireId, String proprietaireNom, String proprietairePrenom, String proprietaireRaisonSociale, Long enqueteurId, String enqueteurNom, String enqueteurPrenom, Long secteurId, String secteurCode, String secteurNom
|
||||
,Long parcelleId,String parcelleNup,String parcelleQ,String parcelleI,String parcelleP) {
|
||||
public EnquetePayLoadWeb(Long id, LocalDate dateEnquete, LocalDate dateFinalisation, Boolean litige, StatutEnquete statutEnquete, String descriptionMotifRejet, String observation, String numeroTitreFoncier, LocalDate dateTitreFoncier, String numEntreeParcelle, String numRue, String nomRue, Float precision, Integer nbreCoProprietaire, Integer nbreIndivisiaire, String autreAdresse, Float superficie, Integer nbreBatiment, Integer nbrePiscine, LocalDate dateDebutExemption, LocalDate dateFinExemption, String autreNumeroTitreFoncier, Long montantMensuelleLocation, Long montantAnnuelleLocation, Long valeurParcelleEstime, Long valeurParcelleReel, Long zoneRfuId, String zoneRfuNom, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Long enqueteurId, String enqueteurNom, String enqueteurPrenom,Long parcelleId, String parcelleNup, String parcelleQ, String parcelleI, String parcelleP, Long exerviceId, Integer exerviceAnnee) {
|
||||
this.id = id;
|
||||
this.dateEnquete = dateEnquete;
|
||||
this.dateFinalisation = dateFinalisation;
|
||||
@@ -90,19 +87,19 @@ public class EnquetePayLoadWeb {
|
||||
this.valeurParcelleReel = valeurParcelleReel;
|
||||
this.zoneRfuId = zoneRfuId;
|
||||
this.zoneRfuNom = zoneRfuNom;
|
||||
this.proprietaireId = proprietaireId;
|
||||
this.proprietaireNom = proprietaireNom;
|
||||
this.proprietairePrenom = proprietairePrenom;
|
||||
this.proprietaireRaisonSociale = proprietaireRaisonSociale;
|
||||
this.personneId = personneId;
|
||||
this.personneNom = personneNom;
|
||||
this.personnePrenom = personnePrenom;
|
||||
this.personneRaisonSociale = personneRaisonSociale;
|
||||
this.enqueteurId = enqueteurId;
|
||||
this.enqueteurNom = enqueteurNom;
|
||||
this.enqueteurPrenom = enqueteurPrenom;
|
||||
this.secteurId = secteurId;
|
||||
this.secteurCode = secteurCode;
|
||||
this.parcelleId = parcelleId;
|
||||
this.parcelleNup = parcelleNup;
|
||||
this.parcelleQ = parcelleQ;
|
||||
this.parcelleI = parcelleI;
|
||||
this.parcelleP = parcelleP;
|
||||
this.exerviceId = exerviceId;
|
||||
this.exerviceAnnee = exerviceAnnee;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,30 +8,25 @@ import java.util.List;
|
||||
@Data
|
||||
public class EnqueteUniteLogementPayloadWeb {
|
||||
private Long id;
|
||||
private UniteLogementPaylaodWeb uniteLogementPaylaodWeb ;
|
||||
private List<CaracteristiqueUniteLogementPayloadWeb> caracteristiqueUniteLogementPayloadWebs;
|
||||
private List<UploadPayLoadWeb> uploadPayLoadWebs;
|
||||
private String observation;
|
||||
private Long userId;
|
||||
private float surface;
|
||||
private int nbrePiece;
|
||||
private int nbreHabitant;
|
||||
private int nbreMenage;
|
||||
private boolean enLocation;
|
||||
private int nbreMoisLocation;
|
||||
private Long montantMensuelLoyer;
|
||||
private Long montantLocatifAnnuelDeclare;
|
||||
private Integer nbrePiece;
|
||||
private Integer nbreHabitant;
|
||||
private Integer nbreMenage;
|
||||
private Boolean enLocation;
|
||||
private Integer nbreMoisLocation;
|
||||
private Float montantMensuelLoyer;
|
||||
private Float montantLocatifAnnuelDeclare;
|
||||
private Long valeurUniteLogementEstime;
|
||||
private Long valeurUniteLogementReel;
|
||||
private float SurfaceAuSol;
|
||||
private float surfaceLouee;
|
||||
private boolean sbee;
|
||||
private boolean soneb;
|
||||
private Float superficieLouee;
|
||||
private Float superficieAuSol;
|
||||
private LocalDate dateEnquete;
|
||||
private Boolean sbee;
|
||||
private Boolean soneb;
|
||||
private String numCompteurSbee;
|
||||
private String numCompteurSoneb;
|
||||
private LocalDate dateDebutExcemption;
|
||||
private LocalDate dateFinExcemption;
|
||||
//private Long enqueteId;
|
||||
private LocalDate dateDebutExemption;
|
||||
private LocalDate dateFinExemption;
|
||||
private Long uniteLogementId;
|
||||
private String uniteLogementNumeroEtage;
|
||||
private String uniteLogementNul;
|
||||
@@ -42,12 +37,12 @@ public class EnqueteUniteLogementPayloadWeb {
|
||||
private Long enqueteurId;
|
||||
private String enqueteurNom;
|
||||
private String enqueteurPrenom;
|
||||
private Long exerciceId ;
|
||||
private Integer exerciceAnnee;
|
||||
|
||||
public EnqueteUniteLogementPayloadWeb(Long id, String observation, Long userId, float surface, int nbrePiece, int nbreHabitant, int nbreMenage, boolean enLocation, int nbreMoisLocation, Long montantMensuelLoyer, Long montantLocatifAnnuelDeclare, Long valeurUniteLogementEstime, Long valeurUniteLogementReel, float surfaceAuSol, float surfaceLouee, boolean sbee, boolean soneb, String numCompteurSbee, String numCompteurSoneb, LocalDate dateDebutExcemption, LocalDate dateFinExcemption, Long uniteLogementId, String uniteLogementNumeroEtage, String uniteLogementNul, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Long enqueteurId, String enqueteurNom, String enqueteurPrenom) {
|
||||
public EnqueteUniteLogementPayloadWeb(Long id, String observation, Integer nbrePiece, Integer nbreHabitant, Integer nbreMenage, Boolean enLocation, Integer nbreMoisLocation, Float montantMensuelLoyer, Float montantLocatifAnnuelDeclare, Long valeurUniteLogementEstime, Long valeurUniteLogementReel, Float superficieLouee, Float superficieAuSol, LocalDate dateEnquete, Boolean sbee, Boolean soneb, String numCompteurSbee, String numCompteurSoneb, LocalDate dateDebutExemption, LocalDate dateFinExemption, Long uniteLogementId, String uniteLogementNumeroEtage, String uniteLogementNul, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, Long enqueteurId, String enqueteurNom, String enqueteurPrenom, Long exerciceId, Integer exerciceAnnee) {
|
||||
this.id = id;
|
||||
this.observation = observation;
|
||||
this.userId = userId;
|
||||
this.surface = surface;
|
||||
this.nbrePiece = nbrePiece;
|
||||
this.nbreHabitant = nbreHabitant;
|
||||
this.nbreMenage = nbreMenage;
|
||||
@@ -57,14 +52,15 @@ public class EnqueteUniteLogementPayloadWeb {
|
||||
this.montantLocatifAnnuelDeclare = montantLocatifAnnuelDeclare;
|
||||
this.valeurUniteLogementEstime = valeurUniteLogementEstime;
|
||||
this.valeurUniteLogementReel = valeurUniteLogementReel;
|
||||
SurfaceAuSol = surfaceAuSol;
|
||||
this.surfaceLouee = surfaceLouee;
|
||||
this.superficieLouee = superficieLouee;
|
||||
this.superficieAuSol = superficieAuSol;
|
||||
this.dateEnquete = dateEnquete;
|
||||
this.sbee = sbee;
|
||||
this.soneb = soneb;
|
||||
this.numCompteurSbee = numCompteurSbee;
|
||||
this.numCompteurSoneb = numCompteurSoneb;
|
||||
this.dateDebutExcemption = dateDebutExcemption;
|
||||
this.dateFinExcemption = dateFinExcemption;
|
||||
this.dateDebutExemption = dateDebutExemption;
|
||||
this.dateFinExemption = dateFinExemption;
|
||||
this.uniteLogementId = uniteLogementId;
|
||||
this.uniteLogementNumeroEtage = uniteLogementNumeroEtage;
|
||||
this.uniteLogementNul = uniteLogementNul;
|
||||
@@ -75,5 +71,7 @@ public class EnqueteUniteLogementPayloadWeb {
|
||||
this.enqueteurId = enqueteurId;
|
||||
this.enqueteurNom = enqueteurNom;
|
||||
this.enqueteurPrenom = enqueteurPrenom;
|
||||
this.exerciceId = exerciceId;
|
||||
this.exerciceAnnee = exerciceAnnee;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +34,10 @@ public class ParcellePayLoadWeb {
|
||||
private String proprietaireNom;
|
||||
private String proprietairePrenom;
|
||||
private String proprietaireRaisonSociale;
|
||||
private Long enqueteCouranteId;
|
||||
|
||||
|
||||
public ParcellePayLoadWeb(Long id, String q, String i, String p, String nup, String nupProvisoire, String numTitreFoncier, String longitude, String latitude, String altitude, Float superficie, String observation, String situationGeographique, String numEntreeParcelle, Long quartierId, String quartierCode, String quartierNom, Long natureDomaineId, String natureDomaineLibelle, Long typeDomaineId, String typeDomaineLibelle, Long rueId, String rueNumero, String rueNom) {
|
||||
public ParcellePayLoadWeb(Long id, String q, String i, String p, String nup, String nupProvisoire, String numTitreFoncier, String longitude, String latitude, String altitude, Float superficie, String observation, String situationGeographique, String numEntreeParcelle, Long quartierId, String quartierCode, String quartierNom, Long natureDomaineId, String natureDomaineLibelle, Long typeDomaineId, String typeDomaineLibelle, Long rueId, String rueNumero, String rueNom,Long enqueteCouranteId) {
|
||||
this.id = id;
|
||||
this.q = q;
|
||||
this.i = i;
|
||||
@@ -61,9 +62,10 @@ public class ParcellePayLoadWeb {
|
||||
this.rueId = rueId;
|
||||
this.rueNumero = rueNumero;
|
||||
this.rueNom = rueNom;
|
||||
this.enqueteCouranteId = enqueteCouranteId;
|
||||
}
|
||||
|
||||
public ParcellePayLoadWeb(Long id, String q, String i, String p, String nup, String nupProvisoire, String numTitreFoncier, String longitude, String latitude, String altitude, Float superficie, String observation, String situationGeographique, String numEntreeParcelle, Long quartierId, String quartierCode, String quartierNom, Long natureDomaineId, String natureDomaineLibelle, Long typeDomaineId, String typeDomaineLibelle, Long rueId, String rueNumero, String rueNom, Long proprietaireId, String proprietaireIfu, String proprietaireNpi, String proprietaireNom, String proprietairePrenom, String proprietaireRaisonSociale) {
|
||||
public ParcellePayLoadWeb(Long id, String q, String i, String p, String nup, String nupProvisoire, String numTitreFoncier, String longitude, String latitude, String altitude, Float superficie, String observation, String situationGeographique, String numEntreeParcelle, Long quartierId, String quartierCode, String quartierNom, Long natureDomaineId, String natureDomaineLibelle, Long typeDomaineId, String typeDomaineLibelle, Long rueId, String rueNumero, String rueNom, Long proprietaireId, String proprietaireIfu, String proprietaireNpi, String proprietaireNom, String proprietairePrenom, String proprietaireRaisonSociale,Long enqueteCouranteId) {
|
||||
this.id = id;
|
||||
this.q = q;
|
||||
this.i = i;
|
||||
@@ -94,5 +96,6 @@ public class ParcellePayLoadWeb {
|
||||
this.proprietaireNom = proprietaireNom;
|
||||
this.proprietairePrenom = proprietairePrenom;
|
||||
this.proprietaireRaisonSociale = proprietaireRaisonSociale;
|
||||
this.enqueteCouranteId = enqueteCouranteId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ public class UniteLogementPaylaodWeb {
|
||||
private String code;
|
||||
private Long batimentId;
|
||||
private Float superficieSol;
|
||||
private Float superficieLouee;
|
||||
private String batimentNub;
|
||||
private String observation;
|
||||
private LocalDate dateConstruction;
|
||||
@@ -19,14 +20,16 @@ public class UniteLogementPaylaodWeb {
|
||||
private String personneNom;
|
||||
private String personnePrenom;
|
||||
private String personneRaisonSociale;
|
||||
private Long enqueteUniteLogementCourantId;
|
||||
|
||||
public UniteLogementPaylaodWeb(Long id, String nul, String numeroEtage, String code, Long batimentId, Float superficieSol, String batimentNub, String observation, LocalDate dateConstruction, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale) {
|
||||
public UniteLogementPaylaodWeb(Long id, String nul, String numeroEtage, String code, Long batimentId, Float superficieSol, Float superficieLouee, String batimentNub, String observation, LocalDate dateConstruction, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale,Long enqueteUniteLogementCourantId) {
|
||||
this.id = id;
|
||||
this.nul = nul;
|
||||
this.numeroEtage = numeroEtage;
|
||||
this.code = code;
|
||||
this.batimentId = batimentId;
|
||||
this.superficieSol = superficieSol;
|
||||
this.superficieLouee = superficieLouee;
|
||||
this.batimentNub = batimentNub;
|
||||
this.observation = observation;
|
||||
this.dateConstruction = dateConstruction;
|
||||
@@ -34,5 +37,6 @@ public class UniteLogementPaylaodWeb {
|
||||
this.personneNom = personneNom;
|
||||
this.personnePrenom = personnePrenom;
|
||||
this.personneRaisonSociale = personneRaisonSociale;
|
||||
this.enqueteUniteLogementCourantId = enqueteUniteLogementCourantId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.gmss.fiscad.persistence.repositories.infocad.metier;
|
||||
|
||||
import io.gmss.fiscad.entities.infocad.metier.Enquete;
|
||||
import io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb;
|
||||
import io.gmss.fiscad.paylaods.response.*;
|
||||
import io.gmss.fiscad.paylaods.response.report.EnqueteParBlocResponse;
|
||||
import io.gmss.fiscad.paylaods.response.restoration.EnquetePayLoad;
|
||||
@@ -9,8 +10,11 @@ import io.gmss.fiscad.paylaods.response.statistique.StatEnqueteAdminStructureRes
|
||||
import io.gmss.fiscad.paylaods.response.statistique.StatEnqueteParBlocResponse;
|
||||
import io.gmss.fiscad.paylaods.response.statistique.StatEnqueteParStatutResponse;
|
||||
import io.gmss.fiscad.paylaods.response.synchronisation.EnqueteNonSyncResponse;
|
||||
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;
|
||||
@@ -227,4 +231,365 @@ public interface EnqueteRepository extends JpaRepository<Enquete, Long> {
|
||||
|
||||
List<Enquete> findAllByParcelle_Id(Long parcelleId);
|
||||
|
||||
|
||||
|
||||
@Query("""
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb(
|
||||
e.id,
|
||||
e.dateEnquete,
|
||||
e.dateFinalisation,
|
||||
e.litige,
|
||||
e.statutEnquete,
|
||||
e.descriptionMotifRejet,
|
||||
e.observationParticuliere,
|
||||
pa.numeroTitreFoncier,
|
||||
pa.dateTitreFoncier,
|
||||
e.numEntreeParcelle,
|
||||
e.numRue,
|
||||
e.nomRue,
|
||||
e.precision,
|
||||
e.nbreCoProprietaire,
|
||||
e.nbreIndivisiaire,
|
||||
e.autreAdresse,
|
||||
e.superficie,
|
||||
e.nbreBatiment,
|
||||
e.nbrePiscine,
|
||||
e.dateDebutExemption,
|
||||
e.dateFinExemption,
|
||||
pa.autreNumeroTitreFoncier,
|
||||
e.montantMensuelleLocation,
|
||||
e.montantAnnuelleLocation,
|
||||
e.valeurParcelleEstime,
|
||||
e.valeurParcelleReel,
|
||||
zr.id,
|
||||
zr.nom,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom,
|
||||
pa.id,
|
||||
pa.nup,
|
||||
pa.q,
|
||||
pa.i,
|
||||
pa.p,
|
||||
ex.id,
|
||||
ex.annee
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.user u
|
||||
LEFT JOIN e.parcelle pa
|
||||
LEFT JOIN e.exercice ex
|
||||
""")
|
||||
List<EnquetePayLoadWeb> findAllEnquetesToDto();
|
||||
|
||||
@Query(
|
||||
value = """
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb(
|
||||
e.id,
|
||||
e.dateEnquete,
|
||||
e.dateFinalisation,
|
||||
e.litige,
|
||||
e.statutEnquete,
|
||||
e.descriptionMotifRejet,
|
||||
e.observationParticuliere,
|
||||
pa.numeroTitreFoncier,
|
||||
pa.dateTitreFoncier,
|
||||
e.numEntreeParcelle,
|
||||
e.numRue,
|
||||
e.nomRue,
|
||||
e.precision,
|
||||
e.nbreCoProprietaire,
|
||||
e.nbreIndivisiaire,
|
||||
e.autreAdresse,
|
||||
e.superficie,
|
||||
e.nbreBatiment,
|
||||
e.nbrePiscine,
|
||||
e.dateDebutExemption,
|
||||
e.dateFinExemption,
|
||||
pa.autreNumeroTitreFoncier,
|
||||
e.montantMensuelleLocation,
|
||||
e.montantAnnuelleLocation,
|
||||
e.valeurParcelleEstime,
|
||||
e.valeurParcelleReel,
|
||||
zr.id,
|
||||
zr.nom,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom,
|
||||
pa.id,
|
||||
pa.nup,
|
||||
pa.q,
|
||||
pa.i,
|
||||
pa.p,
|
||||
ex.id,
|
||||
ex.annee
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.user u
|
||||
LEFT JOIN e.parcelle pa
|
||||
LEFT JOIN e.exercice ex
|
||||
""",
|
||||
countQuery = """
|
||||
SELECT COUNT(e)
|
||||
FROM Enquete e
|
||||
"""
|
||||
)
|
||||
Page<EnquetePayLoadWeb> findAllEnquetesToDtoPageable(Pageable pageable);
|
||||
|
||||
@Query("""
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb(
|
||||
e.id,
|
||||
e.dateEnquete,
|
||||
e.dateFinalisation,
|
||||
e.litige,
|
||||
e.statutEnquete,
|
||||
e.descriptionMotifRejet,
|
||||
e.observationParticuliere,
|
||||
pa.numeroTitreFoncier,
|
||||
pa.dateTitreFoncier,
|
||||
e.numEntreeParcelle,
|
||||
e.numRue,
|
||||
e.nomRue,
|
||||
e.precision,
|
||||
e.nbreCoProprietaire,
|
||||
e.nbreIndivisiaire,
|
||||
e.autreAdresse,
|
||||
e.superficie,
|
||||
e.nbreBatiment,
|
||||
e.nbrePiscine,
|
||||
e.dateDebutExemption,
|
||||
e.dateFinExemption,
|
||||
pa.autreNumeroTitreFoncier,
|
||||
e.montantMensuelleLocation,
|
||||
e.montantAnnuelleLocation,
|
||||
e.valeurParcelleEstime,
|
||||
e.valeurParcelleReel,
|
||||
zr.id,
|
||||
zr.nom,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom,
|
||||
pa.id,
|
||||
pa.nup,
|
||||
pa.q,
|
||||
pa.i,
|
||||
pa.p,
|
||||
ex.id,
|
||||
ex.annee
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.user u
|
||||
LEFT JOIN e.parcelle pa
|
||||
LEFT JOIN e.exercice ex
|
||||
WHERE ex.id = :exerciceId
|
||||
""")
|
||||
List<EnquetePayLoadWeb> findEnquetesByExerciceToDto(
|
||||
@Param("exerciceId") Long exerciceId
|
||||
);
|
||||
|
||||
|
||||
@Query(
|
||||
value = """
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb(
|
||||
e.id,
|
||||
e.dateEnquete,
|
||||
e.dateFinalisation,
|
||||
e.litige,
|
||||
e.statutEnquete,
|
||||
e.descriptionMotifRejet,
|
||||
e.observationParticuliere,
|
||||
pa.numeroTitreFoncier,
|
||||
pa.dateTitreFoncier,
|
||||
e.numEntreeParcelle,
|
||||
e.numRue,
|
||||
e.nomRue,
|
||||
e.precision,
|
||||
e.nbreCoProprietaire,
|
||||
e.nbreIndivisiaire,
|
||||
e.autreAdresse,
|
||||
e.superficie,
|
||||
e.nbreBatiment,
|
||||
e.nbrePiscine,
|
||||
e.dateDebutExemption,
|
||||
e.dateFinExemption,
|
||||
pa.autreNumeroTitreFoncier,
|
||||
e.montantMensuelleLocation,
|
||||
e.montantAnnuelleLocation,
|
||||
e.valeurParcelleEstime,
|
||||
e.valeurParcelleReel,
|
||||
zr.id,
|
||||
zr.nom,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom,
|
||||
pa.id,
|
||||
pa.nup,
|
||||
pa.q,
|
||||
pa.i,
|
||||
pa.p,
|
||||
ex.id,
|
||||
ex.annee
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.user u
|
||||
LEFT JOIN e.parcelle pa
|
||||
LEFT JOIN e.exercice ex
|
||||
WHERE ex.id = :exerciceId
|
||||
""",
|
||||
countQuery = """
|
||||
SELECT COUNT(e)
|
||||
FROM Enquete e
|
||||
WHERE e.exercice.id = :exerciceId
|
||||
"""
|
||||
)
|
||||
Page<EnquetePayLoadWeb> findEnquetesByExerciceToDtoPageable(
|
||||
@Param("exerciceId") Long exerciceId,
|
||||
Pageable pageable
|
||||
);
|
||||
|
||||
|
||||
@Query("""
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb(
|
||||
e.id,
|
||||
e.dateEnquete,
|
||||
e.dateFinalisation,
|
||||
e.litige,
|
||||
e.statutEnquete,
|
||||
e.descriptionMotifRejet,
|
||||
e.observationParticuliere,
|
||||
pa.numeroTitreFoncier,
|
||||
pa.dateTitreFoncier,
|
||||
e.numEntreeParcelle,
|
||||
e.numRue,
|
||||
e.nomRue,
|
||||
e.precision,
|
||||
e.nbreCoProprietaire,
|
||||
e.nbreIndivisiaire,
|
||||
e.autreAdresse,
|
||||
e.superficie,
|
||||
e.nbreBatiment,
|
||||
e.nbrePiscine,
|
||||
e.dateDebutExemption,
|
||||
e.dateFinExemption,
|
||||
pa.autreNumeroTitreFoncier,
|
||||
e.montantMensuelleLocation,
|
||||
e.montantAnnuelleLocation,
|
||||
e.valeurParcelleEstime,
|
||||
e.valeurParcelleReel,
|
||||
zr.id,
|
||||
zr.nom,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom,
|
||||
pa.id,
|
||||
pa.nup,
|
||||
pa.q,
|
||||
pa.i,
|
||||
pa.p,
|
||||
ex.id,
|
||||
ex.annee
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.user u
|
||||
LEFT JOIN e.parcelle pa
|
||||
LEFT JOIN e.exercice ex
|
||||
WHERE pa.id = :parcelleId
|
||||
""")
|
||||
List<EnquetePayLoadWeb> findEnquetesByParcelleToDto(
|
||||
@Param("parcelleId") Long parcelleId
|
||||
);
|
||||
|
||||
@Query(
|
||||
value = """
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb(
|
||||
e.id,
|
||||
e.dateEnquete,
|
||||
e.dateFinalisation,
|
||||
e.litige,
|
||||
e.statutEnquete,
|
||||
e.descriptionMotifRejet,
|
||||
e.observationParticuliere,
|
||||
pa.numeroTitreFoncier,
|
||||
pa.dateTitreFoncier,
|
||||
e.numEntreeParcelle,
|
||||
e.numRue,
|
||||
e.nomRue,
|
||||
e.precision,
|
||||
e.nbreCoProprietaire,
|
||||
e.nbreIndivisiaire,
|
||||
e.autreAdresse,
|
||||
e.superficie,
|
||||
e.nbreBatiment,
|
||||
e.nbrePiscine,
|
||||
e.dateDebutExemption,
|
||||
e.dateFinExemption,
|
||||
pa.autreNumeroTitreFoncier,
|
||||
e.montantMensuelleLocation,
|
||||
e.montantAnnuelleLocation,
|
||||
e.valeurParcelleEstime,
|
||||
e.valeurParcelleReel,
|
||||
zr.id,
|
||||
zr.nom,
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom,
|
||||
pa.id,
|
||||
pa.nup,
|
||||
pa.q,
|
||||
pa.i,
|
||||
pa.p,
|
||||
ex.id,
|
||||
ex.annee
|
||||
)
|
||||
FROM Enquete e
|
||||
LEFT JOIN e.zoneRfu zr
|
||||
LEFT JOIN e.personne p
|
||||
LEFT JOIN e.user u
|
||||
LEFT JOIN e.parcelle pa
|
||||
LEFT JOIN e.exercice ex
|
||||
WHERE pa.id = :parcelleId
|
||||
""",
|
||||
countQuery = """
|
||||
SELECT COUNT(e)
|
||||
FROM Enquete e
|
||||
WHERE e.parcelle.id = :parcelleId
|
||||
"""
|
||||
)
|
||||
Page<EnquetePayLoadWeb> findEnquetesByParcelleToDtoPageable(
|
||||
@Param("parcelleId") Long parcelleId,
|
||||
Pageable pageable
|
||||
);
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
p.p,
|
||||
p.nup,
|
||||
p.nupProvisoire,
|
||||
p.numTitreFoncier,
|
||||
p.numeroTitreFoncier,
|
||||
p.longitude,
|
||||
p.latitude,
|
||||
p.altitude,
|
||||
@@ -196,7 +196,8 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
pers.npi,
|
||||
pers.nom,
|
||||
pers.prenom,
|
||||
pers.raisonSociale
|
||||
pers.raisonSociale,
|
||||
e.id
|
||||
)
|
||||
FROM Parcelle p
|
||||
LEFT JOIN p.quartier q
|
||||
@@ -224,7 +225,7 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
p.p,
|
||||
p.nup,
|
||||
p.nupProvisoire,
|
||||
p.numTitreFoncier,
|
||||
p.numeroTitreFoncier,
|
||||
p.longitude,
|
||||
p.latitude,
|
||||
p.altitude,
|
||||
@@ -247,7 +248,8 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
pers.npi,
|
||||
pers.nom,
|
||||
pers.prenom,
|
||||
pers.raisonSociale
|
||||
pers.raisonSociale,
|
||||
e.id
|
||||
)
|
||||
FROM Parcelle p
|
||||
LEFT JOIN p.quartier q
|
||||
@@ -280,7 +282,7 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
p.p,
|
||||
p.nup,
|
||||
p.nupProvisoire,
|
||||
p.numTitreFoncier,
|
||||
p.numeroTitreFoncier,
|
||||
p.longitude,
|
||||
p.latitude,
|
||||
p.altitude,
|
||||
@@ -303,7 +305,8 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
pers.npi,
|
||||
pers.nom,
|
||||
pers.prenom,
|
||||
pers.raisonSociale
|
||||
pers.raisonSociale,
|
||||
e.id
|
||||
)
|
||||
FROM Parcelle p
|
||||
LEFT JOIN p.quartier q
|
||||
@@ -340,7 +343,7 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
p.p,
|
||||
p.nup,
|
||||
p.nupProvisoire,
|
||||
p.numTitreFoncier,
|
||||
p.numeroTitreFoncier,
|
||||
p.longitude,
|
||||
p.latitude,
|
||||
p.altitude,
|
||||
@@ -363,7 +366,8 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
pers.npi,
|
||||
pers.nom,
|
||||
pers.prenom,
|
||||
pers.raisonSociale
|
||||
pers.raisonSociale,
|
||||
e.id
|
||||
)
|
||||
FROM Parcelle p
|
||||
LEFT JOIN p.quartier q
|
||||
@@ -395,7 +399,7 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
p.p,
|
||||
p.nup,
|
||||
p.nupProvisoire,
|
||||
p.numTitreFoncier,
|
||||
p.numeroTitreFoncier,
|
||||
p.longitude,
|
||||
p.latitude,
|
||||
p.altitude,
|
||||
@@ -418,7 +422,8 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
pers.npi,
|
||||
pers.nom,
|
||||
pers.prenom,
|
||||
pers.raisonSociale
|
||||
pers.raisonSociale,
|
||||
e.id
|
||||
)
|
||||
FROM Parcelle p
|
||||
LEFT JOIN p.quartier q
|
||||
@@ -460,7 +465,7 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
p.p,
|
||||
p.nup,
|
||||
p.nupProvisoire,
|
||||
p.numTitreFoncier,
|
||||
p.numeroTitreFoncier,
|
||||
p.longitude,
|
||||
p.latitude,
|
||||
p.altitude,
|
||||
@@ -483,7 +488,8 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
pers.npi,
|
||||
pers.nom,
|
||||
pers.prenom,
|
||||
pers.raisonSociale
|
||||
pers.raisonSociale,
|
||||
e.id
|
||||
)
|
||||
FROM Parcelle p
|
||||
LEFT JOIN p.quartier q
|
||||
@@ -515,7 +521,7 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
p.p,
|
||||
p.nup,
|
||||
p.nupProvisoire,
|
||||
p.numTitreFoncier,
|
||||
p.numeroTitreFoncier,
|
||||
p.longitude,
|
||||
p.latitude,
|
||||
p.altitude,
|
||||
@@ -538,7 +544,8 @@ public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSp
|
||||
pers.npi,
|
||||
pers.nom,
|
||||
pers.prenom,
|
||||
pers.raisonSociale
|
||||
pers.raisonSociale,
|
||||
e.id
|
||||
)
|
||||
FROM Parcelle p
|
||||
LEFT JOIN p.quartier q
|
||||
|
||||
@@ -29,7 +29,7 @@ public interface BatimentRepository extends JpaRepository<Batiment, Long> {
|
||||
" WHERE b.terminal_id = ?1", nativeQuery = true)
|
||||
List<BatimentPayloadRestor> getBatimentByTerminalId(Long terminalId);
|
||||
|
||||
void deleteByEnqueteId(Long enqueteId);
|
||||
// void deleteByEnqueteId(Long enqueteId);
|
||||
|
||||
Long countByParcelle_Quartier_CodeLike(String codeQuartier);
|
||||
|
||||
@@ -48,7 +48,9 @@ public interface BatimentRepository extends JpaRepository<Batiment, Long> {
|
||||
per.nom,
|
||||
per.prenom,
|
||||
per.raisonSociale,
|
||||
eb.surfaceAuSol
|
||||
eb.superficieAuSol,
|
||||
eb.superficieLouee,
|
||||
eb.id
|
||||
)
|
||||
FROM Batiment b
|
||||
JOIN b.parcelle p
|
||||
@@ -79,7 +81,9 @@ public interface BatimentRepository extends JpaRepository<Batiment, Long> {
|
||||
per.nom,
|
||||
per.prenom,
|
||||
per.raisonSociale,
|
||||
eb.surfaceAuSol
|
||||
eb.superficieAuSol,
|
||||
eb.superficieLouee,
|
||||
eb.id
|
||||
)
|
||||
FROM Batiment b
|
||||
JOIN b.parcelle p
|
||||
@@ -111,7 +115,9 @@ public interface BatimentRepository extends JpaRepository<Batiment, Long> {
|
||||
per.nom,
|
||||
per.prenom,
|
||||
per.raisonSociale,
|
||||
eb.surfaceAuSol
|
||||
eb.superficieAuSol,
|
||||
eb.superficieLouee,
|
||||
eb.id
|
||||
)
|
||||
FROM Batiment b
|
||||
JOIN b.parcelle p
|
||||
@@ -148,7 +154,9 @@ public interface BatimentRepository extends JpaRepository<Batiment, Long> {
|
||||
per.nom,
|
||||
per.prenom,
|
||||
per.raisonSociale,
|
||||
eb.surfaceAuSol
|
||||
eb.superficieAuSol,
|
||||
eb.superficieLouee,
|
||||
eb.id
|
||||
)
|
||||
FROM Batiment b
|
||||
JOIN b.parcelle p
|
||||
@@ -184,7 +192,9 @@ public interface BatimentRepository extends JpaRepository<Batiment, Long> {
|
||||
per.nom,
|
||||
per.prenom,
|
||||
per.raisonSociale,
|
||||
eb.surfaceAuSol
|
||||
eb.superficieAuSol,
|
||||
eb.superficieLouee,
|
||||
eb.id
|
||||
)
|
||||
FROM Batiment b
|
||||
JOIN b.parcelle p
|
||||
|
||||
@@ -11,7 +11,4 @@ public interface DeclarationNcRepository extends JpaRepository<DeclarationNc, Lo
|
||||
Optional<DeclarationNc> findByMobileDataId(Long id);
|
||||
Optional<DeclarationNc> findFirstByExternalKeyAndTerminal_Id(Long externalKey, Long TerminalId);
|
||||
|
||||
List<DeclarationNc> findAllByEnquete_Id(Long enqueteId);
|
||||
|
||||
void deleteAllByEnquete_Id(Long idEnquete);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public interface EnqueteActiviteRepository extends JpaRepository<EnqueteActivite
|
||||
Optional<EnqueteActivite> findByMobileDataId(Long id);
|
||||
Optional<EnqueteActivite> findFirstByExternalKeyAndTerminal_Id(Long externalKey, Long TerminalId);
|
||||
|
||||
List<EnqueteActivite> findAllByEnquete_Id(Long enqueteId);
|
||||
//List<EnqueteActivite> findAllByEnquete_Id(Long enqueteId);
|
||||
|
||||
void deleteAllByEnquete_Id(Long idEnquete);
|
||||
//void deleteAllByEnquete_Id(Long idEnquete);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package io.gmss.fiscad.persistence.repositories.rfu.metier;
|
||||
|
||||
import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment;
|
||||
import io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb;
|
||||
import io.gmss.fiscad.paylaods.response.restoration.EnqueteBatimentPayLoadRestor;
|
||||
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;
|
||||
@@ -34,8 +38,8 @@ public interface EnqueteBatimentRepository extends JpaRepository<EnqueteBatiment
|
||||
"eb.sbee as sbee, " + //ok
|
||||
"eb.nbre_unite_location as nbreUniteLocation, " + //ok
|
||||
"eb.soneb as soneb, " + //ok
|
||||
"eb.surface_au_sol as surfaceAuSol, " + //ok
|
||||
"eb.surface_louee as surfaceLouee, " + //ok
|
||||
"eb.superficie_au_sol as surfaceAuSol, " + //ok
|
||||
"eb.surperficie_louee as surfaceLouee, " + //ok
|
||||
"eb.valeur_mensuelle_location as valeurMensuelleLocation, " + //ok
|
||||
"b.external_key as batimentId, " + //ok
|
||||
// "e.external_key as enquteId, " + //ok
|
||||
@@ -51,4 +55,260 @@ public interface EnqueteBatimentRepository extends JpaRepository<EnqueteBatiment
|
||||
|
||||
|
||||
// void deleteAllByEnquete_Id(Long idEnquete);
|
||||
|
||||
@Query("""
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb(
|
||||
eb.id,
|
||||
eb.observation,
|
||||
eb.autreMenuisierie,
|
||||
eb.autreMur,
|
||||
eb.sbee,
|
||||
eb.numCompteurSbee,
|
||||
eb.soneb,
|
||||
eb.numCompteurSoneb,
|
||||
eb.nbreLotUnite,
|
||||
eb.nbreUniteLocation,
|
||||
eb.superficieLouee,
|
||||
eb.superficieAuSol,
|
||||
eb.dateEnquete,
|
||||
eb.nbreMenage,
|
||||
eb.nbreHabitant,
|
||||
eb.montantMensuelLocation,
|
||||
eb.montantLocatifAnnuelDeclare,
|
||||
eb.nbreEtage,
|
||||
eb.valeurBatimentEstime,
|
||||
eb.valeurBatimentReel,
|
||||
eb.nbreMoisLocation,
|
||||
eb.autreCaracteristiquePhysique,
|
||||
eb.dateDebutExcemption,
|
||||
eb.dateFinExcemption,
|
||||
|
||||
b.id,
|
||||
b.nub,
|
||||
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom
|
||||
)
|
||||
FROM EnqueteBatiment eb
|
||||
LEFT JOIN eb.batiment b
|
||||
LEFT JOIN eb.personne p
|
||||
LEFT JOIN eb.user u
|
||||
Where eb.id = :enqueteBatimentId
|
||||
""")
|
||||
Optional<EnqueteBatimentPayloadWeb> findEnqueteBatimentByIdToDto(@Param("enqueteBatimentId") Long enqueteBatimentId);
|
||||
|
||||
@Query("""
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb(
|
||||
eb.id,
|
||||
eb.observation,
|
||||
eb.autreMenuisierie,
|
||||
eb.autreMur,
|
||||
eb.sbee,
|
||||
eb.numCompteurSbee,
|
||||
eb.soneb,
|
||||
eb.numCompteurSoneb,
|
||||
eb.nbreLotUnite,
|
||||
eb.nbreUniteLocation,
|
||||
eb.superficieLouee,
|
||||
eb.superficieAuSol,
|
||||
eb.dateEnquete,
|
||||
eb.nbreMenage,
|
||||
eb.nbreHabitant,
|
||||
eb.montantMensuelLocation,
|
||||
eb.montantLocatifAnnuelDeclare,
|
||||
eb.nbreEtage,
|
||||
eb.valeurBatimentEstime,
|
||||
eb.valeurBatimentReel,
|
||||
eb.nbreMoisLocation,
|
||||
eb.autreCaracteristiquePhysique,
|
||||
eb.dateDebutExcemption,
|
||||
eb.dateFinExcemption,
|
||||
|
||||
b.id,
|
||||
b.nub,
|
||||
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom
|
||||
)
|
||||
FROM EnqueteBatiment eb
|
||||
LEFT JOIN eb.batiment b
|
||||
LEFT JOIN eb.personne p
|
||||
LEFT JOIN eb.user u
|
||||
""")
|
||||
List<EnqueteBatimentPayloadWeb> findAllEnqueteBatimentToDto();
|
||||
|
||||
@Query(
|
||||
value = """
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb(
|
||||
eb.id,
|
||||
eb.observation,
|
||||
eb.autreMenuisierie,
|
||||
eb.autreMur,
|
||||
eb.sbee,
|
||||
eb.numCompteurSbee,
|
||||
eb.soneb,
|
||||
eb.numCompteurSoneb,
|
||||
eb.nbreLotUnite,
|
||||
eb.nbreUniteLocation,
|
||||
eb.superficieLouee,
|
||||
eb.superficieAuSol,
|
||||
eb.dateEnquete,
|
||||
eb.nbreMenage,
|
||||
eb.nbreHabitant,
|
||||
eb.montantMensuelLocation,
|
||||
eb.montantLocatifAnnuelDeclare,
|
||||
eb.nbreEtage,
|
||||
eb.valeurBatimentEstime,
|
||||
eb.valeurBatimentReel,
|
||||
eb.nbreMoisLocation,
|
||||
eb.autreCaracteristiquePhysique,
|
||||
eb.dateDebutExcemption,
|
||||
eb.dateFinExcemption,
|
||||
|
||||
b.id,
|
||||
b.nub,
|
||||
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom
|
||||
)
|
||||
FROM EnqueteBatiment eb
|
||||
LEFT JOIN eb.batiment b
|
||||
LEFT JOIN eb.personne p
|
||||
LEFT JOIN eb.user u
|
||||
""",
|
||||
countQuery = """
|
||||
SELECT COUNT(eb)
|
||||
FROM EnqueteBatiment eb
|
||||
"""
|
||||
)
|
||||
Page<EnqueteBatimentPayloadWeb> findAllEnqueteBatimentToDtoPageable(
|
||||
Pageable pageable
|
||||
);
|
||||
|
||||
@Query("""
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb(
|
||||
eb.id,
|
||||
eb.observation,
|
||||
eb.autreMenuisierie,
|
||||
eb.autreMur,
|
||||
eb.sbee,
|
||||
eb.numCompteurSbee,
|
||||
eb.soneb,
|
||||
eb.numCompteurSoneb,
|
||||
eb.nbreLotUnite,
|
||||
eb.nbreUniteLocation,
|
||||
eb.superficieLouee,
|
||||
eb.superficieAuSol,
|
||||
eb.dateEnquete,
|
||||
eb.nbreMenage,
|
||||
eb.nbreHabitant,
|
||||
eb.montantMensuelLocation,
|
||||
eb.montantLocatifAnnuelDeclare,
|
||||
eb.nbreEtage,
|
||||
eb.valeurBatimentEstime,
|
||||
eb.valeurBatimentReel,
|
||||
eb.nbreMoisLocation,
|
||||
eb.autreCaracteristiquePhysique,
|
||||
eb.dateDebutExcemption,
|
||||
eb.dateFinExcemption,
|
||||
|
||||
b.id,
|
||||
b.nub,
|
||||
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom
|
||||
)
|
||||
FROM EnqueteBatiment eb
|
||||
LEFT JOIN eb.batiment b
|
||||
LEFT JOIN eb.personne p
|
||||
LEFT JOIN eb.user u
|
||||
WHERE b.id = :batimentId
|
||||
""")
|
||||
List<EnqueteBatimentPayloadWeb> findAllByBatimentToDto(
|
||||
@Param("batimentId") Long batimentId
|
||||
);
|
||||
|
||||
@Query(
|
||||
value = """
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb(
|
||||
eb.id,
|
||||
eb.observation,
|
||||
eb.autreMenuisierie,
|
||||
eb.autreMur,
|
||||
eb.sbee,
|
||||
eb.numCompteurSbee,
|
||||
eb.soneb,
|
||||
eb.numCompteurSoneb,
|
||||
eb.nbreLotUnite,
|
||||
eb.nbreUniteLocation,
|
||||
eb.superficieLouee,
|
||||
eb.superficieAuSol,
|
||||
eb.dateEnquete,
|
||||
eb.nbreMenage,
|
||||
eb.nbreHabitant,
|
||||
eb.montantMensuelLocation,
|
||||
eb.montantLocatifAnnuelDeclare,
|
||||
eb.nbreEtage,
|
||||
eb.valeurBatimentEstime,
|
||||
eb.valeurBatimentReel,
|
||||
eb.nbreMoisLocation,
|
||||
eb.autreCaracteristiquePhysique,
|
||||
eb.dateDebutExcemption,
|
||||
eb.dateFinExcemption,
|
||||
|
||||
b.id,
|
||||
b.nub,
|
||||
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom
|
||||
)
|
||||
FROM EnqueteBatiment eb
|
||||
LEFT JOIN eb.batiment b
|
||||
LEFT JOIN eb.personne p
|
||||
LEFT JOIN eb.user u
|
||||
WHERE b.id = :batimentId
|
||||
""",
|
||||
countQuery = """
|
||||
SELECT COUNT(eb)
|
||||
FROM EnqueteBatiment eb
|
||||
WHERE eb.batiment.id = :batimentId
|
||||
"""
|
||||
)
|
||||
Page<EnqueteBatimentPayloadWeb> findAllByBatimentToDtoPageable(
|
||||
@Param("batimentId") Long batimentId,
|
||||
Pageable pageable
|
||||
);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package io.gmss.fiscad.persistence.repositories.rfu.metier;
|
||||
|
||||
import io.gmss.fiscad.entities.rfu.metier.EnqueteUniteLogement;
|
||||
import io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb;
|
||||
import io.gmss.fiscad.paylaods.response.restoration.EnqueteUniteLogementPayLoadRestor;
|
||||
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;
|
||||
@@ -45,5 +49,374 @@ public interface EnqueteUniteLogementRepository extends JpaRepository<EnqueteUni
|
||||
"where eul.terminal_id = ?1")
|
||||
List<EnqueteUniteLogementPayLoadRestor> getEnqueteUniteLogementByTerminalId(Long terminalId);
|
||||
|
||||
|
||||
|
||||
@Query("""
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb(
|
||||
eul.id,
|
||||
eul.observation,
|
||||
eul.nbrePiece,
|
||||
eul.nbreHabitant,
|
||||
eul.nbreMenage,
|
||||
eul.enLocation,
|
||||
eul.nbreMoisLocation,
|
||||
eul.montantMensuelLoyer,
|
||||
eul.montantLocatifAnnuelDeclare,
|
||||
eul.valeurUniteLogementEstime,
|
||||
eul.valeurUniteLogementReel,
|
||||
eul.superficieLouee,
|
||||
eul.superficieAuSol,
|
||||
eul.dateEnquete,
|
||||
eul.sbee,
|
||||
eul.soneb,
|
||||
eul.numCompteurSbee,
|
||||
eul.numCompteurSoneb,
|
||||
eul.dateDebutExemption,
|
||||
eul.dateFinExemption,
|
||||
|
||||
ul.id,
|
||||
ul.numeroEtage,
|
||||
ul.nul,
|
||||
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom,
|
||||
|
||||
ex.id,
|
||||
ex.annee
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
LEFT JOIN eul.personne p
|
||||
LEFT JOIN eul.user u
|
||||
LEFT JOIN eul.exercice ex
|
||||
WHERE eul.id = :enqueteUniteLogementId
|
||||
""")
|
||||
Optional<EnqueteUniteLogementPayloadWeb> findEnqueteUniteLogementToDto(@Param("enqueteUniteLogementId") Long enqueteUniteLogementId);
|
||||
// void deleteAllByEnquete_id(Long id) ;
|
||||
@Query("""
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb(
|
||||
eul.id,
|
||||
eul.observation,
|
||||
eul.nbrePiece,
|
||||
eul.nbreHabitant,
|
||||
eul.nbreMenage,
|
||||
eul.enLocation,
|
||||
eul.nbreMoisLocation,
|
||||
eul.montantMensuelLoyer,
|
||||
eul.montantLocatifAnnuelDeclare,
|
||||
eul.valeurUniteLogementEstime,
|
||||
eul.valeurUniteLogementReel,
|
||||
eul.superficieLouee,
|
||||
eul.superficieAuSol,
|
||||
eul.dateEnquete,
|
||||
eul.sbee,
|
||||
eul.soneb,
|
||||
eul.numCompteurSbee,
|
||||
eul.numCompteurSoneb,
|
||||
eul.dateDebutExemption,
|
||||
eul.dateFinExemption,
|
||||
|
||||
ul.id,
|
||||
ul.numeroEtage,
|
||||
ul.nul,
|
||||
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom,
|
||||
|
||||
ex.id,
|
||||
ex.annee
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
LEFT JOIN eul.personne p
|
||||
LEFT JOIN eul.user u
|
||||
LEFT JOIN eul.exercice ex
|
||||
""")
|
||||
List<EnqueteUniteLogementPayloadWeb> findAllEnqueteUniteLogementToDto();
|
||||
|
||||
|
||||
@Query(
|
||||
value = """
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb(
|
||||
eul.id,
|
||||
eul.observation,
|
||||
eul.nbrePiece,
|
||||
eul.nbreHabitant,
|
||||
eul.nbreMenage,
|
||||
eul.enLocation,
|
||||
eul.nbreMoisLocation,
|
||||
eul.montantMensuelLoyer,
|
||||
eul.montantLocatifAnnuelDeclare,
|
||||
eul.valeurUniteLogementEstime,
|
||||
eul.valeurUniteLogementReel,
|
||||
eul.superficieLouee,
|
||||
eul.superficieAuSol,
|
||||
eul.dateEnquete,
|
||||
eul.sbee,
|
||||
eul.soneb,
|
||||
eul.numCompteurSbee,
|
||||
eul.numCompteurSoneb,
|
||||
eul.dateDebutExemption,
|
||||
eul.dateFinExemption,
|
||||
|
||||
ul.id,
|
||||
ul.numeroEtage,
|
||||
ul.nul,
|
||||
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom,
|
||||
|
||||
ex.id,
|
||||
ex.annee
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
LEFT JOIN eul.personne p
|
||||
LEFT JOIN eul.user u
|
||||
LEFT JOIN eul.exercice ex
|
||||
""",
|
||||
countQuery = """
|
||||
SELECT COUNT(eul)
|
||||
FROM EnqueteUniteLogement eul
|
||||
"""
|
||||
)
|
||||
Page<EnqueteUniteLogementPayloadWeb> findAllEnqueteUniteLogementToDtoPageable(
|
||||
Pageable pageable
|
||||
);
|
||||
|
||||
|
||||
@Query("""
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb(
|
||||
eul.id,
|
||||
eul.observation,
|
||||
eul.nbrePiece,
|
||||
eul.nbreHabitant,
|
||||
eul.nbreMenage,
|
||||
eul.enLocation,
|
||||
eul.nbreMoisLocation,
|
||||
eul.montantMensuelLoyer,
|
||||
eul.montantLocatifAnnuelDeclare,
|
||||
eul.valeurUniteLogementEstime,
|
||||
eul.valeurUniteLogementReel,
|
||||
eul.superficieLouee,
|
||||
eul.superficieAuSol,
|
||||
eul.dateEnquete,
|
||||
eul.sbee,
|
||||
eul.soneb,
|
||||
eul.numCompteurSbee,
|
||||
eul.numCompteurSoneb,
|
||||
eul.dateDebutExemption,
|
||||
eul.dateFinExemption,
|
||||
|
||||
ul.id,
|
||||
ul.numeroEtage,
|
||||
ul.nul,
|
||||
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom,
|
||||
|
||||
ex.id,
|
||||
ex.annee
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
LEFT JOIN eul.personne p
|
||||
LEFT JOIN eul.user u
|
||||
LEFT JOIN eul.exercice ex
|
||||
WHERE ul.id = :uniteLogementId
|
||||
""")
|
||||
List<EnqueteUniteLogementPayloadWeb> findAllByUniteLogementToDto(
|
||||
@Param("uniteLogementId") Long uniteLogementId
|
||||
);
|
||||
|
||||
@Query(
|
||||
value = """
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb(
|
||||
eul.id,
|
||||
eul.observation,
|
||||
eul.nbrePiece,
|
||||
eul.nbreHabitant,
|
||||
eul.nbreMenage,
|
||||
eul.enLocation,
|
||||
eul.nbreMoisLocation,
|
||||
eul.montantMensuelLoyer,
|
||||
eul.montantLocatifAnnuelDeclare,
|
||||
eul.valeurUniteLogementEstime,
|
||||
eul.valeurUniteLogementReel,
|
||||
eul.superficieLouee,
|
||||
eul.superficieAuSol,
|
||||
eul.dateEnquete,
|
||||
eul.sbee,
|
||||
eul.soneb,
|
||||
eul.numCompteurSbee,
|
||||
eul.numCompteurSoneb,
|
||||
eul.dateDebutExemption,
|
||||
eul.dateFinExemption,
|
||||
|
||||
ul.id,
|
||||
ul.numeroEtage,
|
||||
ul.nul,
|
||||
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom,
|
||||
|
||||
ex.id,
|
||||
ex.annee
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
LEFT JOIN eul.personne p
|
||||
LEFT JOIN eul.user u
|
||||
LEFT JOIN eul.exercice ex
|
||||
WHERE ul.id = :uniteLogementId
|
||||
""",
|
||||
countQuery = """
|
||||
SELECT COUNT(eul)
|
||||
FROM EnqueteUniteLogement eul
|
||||
WHERE eul.uniteLogement.id = :uniteLogementId
|
||||
"""
|
||||
)
|
||||
Page<EnqueteUniteLogementPayloadWeb> findByAllByUniteLogementToDtoPageable(
|
||||
@Param("uniteLogementId") Long uniteLogementId,
|
||||
Pageable pageable
|
||||
);
|
||||
|
||||
@Query("""
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb(
|
||||
eul.id,
|
||||
eul.observation,
|
||||
eul.nbrePiece,
|
||||
eul.nbreHabitant,
|
||||
eul.nbreMenage,
|
||||
eul.enLocation,
|
||||
eul.nbreMoisLocation,
|
||||
eul.montantMensuelLoyer,
|
||||
eul.montantLocatifAnnuelDeclare,
|
||||
eul.valeurUniteLogementEstime,
|
||||
eul.valeurUniteLogementReel,
|
||||
eul.superficieLouee,
|
||||
eul.superficieAuSol,
|
||||
eul.dateEnquete,
|
||||
eul.sbee,
|
||||
eul.soneb,
|
||||
eul.numCompteurSbee,
|
||||
eul.numCompteurSoneb,
|
||||
eul.dateDebutExemption,
|
||||
eul.dateFinExemption,
|
||||
|
||||
ul.id,
|
||||
ul.numeroEtage,
|
||||
ul.nul,
|
||||
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom,
|
||||
|
||||
ex.id,
|
||||
ex.annee
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
LEFT JOIN eul.personne p
|
||||
LEFT JOIN eul.user u
|
||||
LEFT JOIN eul.exercice ex
|
||||
WHERE ex.id = :exerciceId
|
||||
""")
|
||||
List<EnqueteUniteLogementPayloadWeb> findAllByExerciceToDto(
|
||||
@Param("exerciceId") Long exerciceId
|
||||
);
|
||||
|
||||
@Query(
|
||||
value = """
|
||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EnqueteUniteLogementPayloadWeb(
|
||||
eul.id,
|
||||
eul.observation,
|
||||
eul.nbrePiece,
|
||||
eul.nbreHabitant,
|
||||
eul.nbreMenage,
|
||||
eul.enLocation,
|
||||
eul.nbreMoisLocation,
|
||||
eul.montantMensuelLoyer,
|
||||
eul.montantLocatifAnnuelDeclare,
|
||||
eul.valeurUniteLogementEstime,
|
||||
eul.valeurUniteLogementReel,
|
||||
eul.superficieLouee,
|
||||
eul.superficieAuSol,
|
||||
eul.dateEnquete,
|
||||
eul.sbee,
|
||||
eul.soneb,
|
||||
eul.numCompteurSbee,
|
||||
eul.numCompteurSoneb,
|
||||
eul.dateDebutExemption,
|
||||
eul.dateFinExemption,
|
||||
|
||||
ul.id,
|
||||
ul.numeroEtage,
|
||||
ul.nul,
|
||||
|
||||
p.id,
|
||||
p.nom,
|
||||
p.prenom,
|
||||
p.raisonSociale,
|
||||
|
||||
u.id,
|
||||
u.nom,
|
||||
u.prenom,
|
||||
|
||||
ex.id,
|
||||
ex.annee
|
||||
)
|
||||
FROM EnqueteUniteLogement eul
|
||||
LEFT JOIN eul.uniteLogement ul
|
||||
LEFT JOIN eul.personne p
|
||||
LEFT JOIN eul.user u
|
||||
LEFT JOIN eul.exercice ex
|
||||
WHERE ex.id = :exerciceId
|
||||
""",
|
||||
countQuery = """
|
||||
SELECT COUNT(eul)
|
||||
FROM EnqueteUniteLogement eul
|
||||
WHERE eul.exercice.id = :exerciceId
|
||||
"""
|
||||
)
|
||||
Page<EnqueteUniteLogementPayloadWeb> findAllByExerciceToDtoPageable(
|
||||
@Param("exerciceId") Long exerciceId,
|
||||
Pageable pageable
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -43,7 +43,8 @@ public interface UniteLogementRepository extends JpaRepository<UniteLogement, Lo
|
||||
ul.code,
|
||||
|
||||
b.id,
|
||||
eul.surfaceLouee,
|
||||
eul.superficieAuSol,
|
||||
eul.superficieLouee,
|
||||
b.nub,
|
||||
eul.observation,
|
||||
ul.dateConstruction,
|
||||
@@ -51,7 +52,8 @@ public interface UniteLogementRepository extends JpaRepository<UniteLogement, Lo
|
||||
per.id,
|
||||
per.nom,
|
||||
per.prenom,
|
||||
per.raisonSociale
|
||||
per.raisonSociale,
|
||||
eul.id
|
||||
)
|
||||
FROM UniteLogement ul
|
||||
JOIN ul.batiment b
|
||||
@@ -75,7 +77,8 @@ public interface UniteLogementRepository extends JpaRepository<UniteLogement, Lo
|
||||
ul.code,
|
||||
|
||||
b.id,
|
||||
eul.surfaceLouee,
|
||||
eul.superficieAuSol,
|
||||
eul.superficieLouee,
|
||||
b.nub,
|
||||
eul.observation,
|
||||
ul.dateConstruction,
|
||||
@@ -83,7 +86,8 @@ public interface UniteLogementRepository extends JpaRepository<UniteLogement, Lo
|
||||
per.id,
|
||||
per.nom,
|
||||
per.prenom,
|
||||
per.raisonSociale
|
||||
per.raisonSociale,
|
||||
eul.id
|
||||
)
|
||||
FROM UniteLogement ul
|
||||
JOIN ul.batiment b
|
||||
@@ -108,7 +112,8 @@ public interface UniteLogementRepository extends JpaRepository<UniteLogement, Lo
|
||||
ul.code,
|
||||
|
||||
b.id,
|
||||
eul.surfaceLouee,
|
||||
eul.superficieAuSol,
|
||||
eul.superficieLouee,
|
||||
b.nub,
|
||||
eul.observation,
|
||||
ul.dateConstruction,
|
||||
@@ -116,7 +121,8 @@ public interface UniteLogementRepository extends JpaRepository<UniteLogement, Lo
|
||||
per.id,
|
||||
per.nom,
|
||||
per.prenom,
|
||||
per.raisonSociale
|
||||
per.raisonSociale,
|
||||
eul.id
|
||||
)
|
||||
FROM UniteLogement ul
|
||||
JOIN ul.batiment b
|
||||
@@ -146,7 +152,8 @@ public interface UniteLogementRepository extends JpaRepository<UniteLogement, Lo
|
||||
ul.code,
|
||||
|
||||
b.id,
|
||||
eul.surfaceLouee,
|
||||
eul.superficieAuSol,
|
||||
eul.superficieLouee,
|
||||
b.nub,
|
||||
eul.observation,
|
||||
ul.dateConstruction,
|
||||
@@ -154,7 +161,8 @@ public interface UniteLogementRepository extends JpaRepository<UniteLogement, Lo
|
||||
per.id,
|
||||
per.nom,
|
||||
per.prenom,
|
||||
per.raisonSociale
|
||||
per.raisonSociale,
|
||||
eul.id
|
||||
)
|
||||
FROM UniteLogement ul
|
||||
JOIN ul.batiment b
|
||||
@@ -181,7 +189,8 @@ public interface UniteLogementRepository extends JpaRepository<UniteLogement, Lo
|
||||
ul.code,
|
||||
|
||||
b.id,
|
||||
eul.surfaceLouee,
|
||||
eul.superficieAuSol,
|
||||
eul.superficieLouee,
|
||||
b.nub,
|
||||
eul.observation,
|
||||
ul.dateConstruction,
|
||||
@@ -189,7 +198,8 @@ public interface UniteLogementRepository extends JpaRepository<UniteLogement, Lo
|
||||
per.id,
|
||||
per.nom,
|
||||
per.prenom,
|
||||
per.raisonSociale
|
||||
per.raisonSociale,
|
||||
eul.id
|
||||
)
|
||||
FROM UniteLogement ul
|
||||
JOIN ul.batiment b
|
||||
|
||||
@@ -8,6 +8,7 @@ import io.gmss.fiscad.entities.infocad.metier.Upload;
|
||||
import io.gmss.fiscad.entities.infocad.parametre.*;
|
||||
import io.gmss.fiscad.entities.rfu.metier.*;
|
||||
import io.gmss.fiscad.entities.rfu.parametre.Caracteristique;
|
||||
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
|
||||
import io.gmss.fiscad.entities.user.AvoirFonction;
|
||||
import io.gmss.fiscad.entities.user.Fonction;
|
||||
import io.gmss.fiscad.entities.user.Profile;
|
||||
@@ -23,6 +24,7 @@ import io.gmss.fiscad.persistence.repositories.infocad.metier.UploadRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.infocad.parametre.*;
|
||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.*;
|
||||
import io.gmss.fiscad.persistence.repositories.rfu.parametre.CaracteristiqueRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.rfu.parametre.ExerciceRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.user.AvoirFonctionRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.user.ProfileRepository;
|
||||
import io.gmss.fiscad.persistence.repositories.user.UserRepository;
|
||||
@@ -67,6 +69,7 @@ public class EntityFromPayLoadService {
|
||||
private final SecteurDecoupageRepository secteurDecoupageRepository;
|
||||
private final AvoirFonctionRepository avoirFonctionRepository;
|
||||
private final EnqueteActiviteRepository enqueteActiviteRepository;
|
||||
private final ExerciceRepository exerciceRepository ;
|
||||
|
||||
|
||||
public CaracteristiqueParcelle getCaracteristiqueParcelleFromPayLoadWeb(CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb){
|
||||
@@ -185,14 +188,14 @@ public class EntityFromPayLoadService {
|
||||
declarationNc = declarationNcRepository.findById(declarationNcPayloadWeb.getId()).orElse(new DeclarationNc());
|
||||
|
||||
|
||||
if(declarationNcPayloadWeb.getEnqueteId()!=null)
|
||||
optionalEnquete=enqueteRepository.findById(declarationNcPayloadWeb.getEnqueteId());
|
||||
// if(declarationNcPayloadWeb.getEnqueteId()!=null)
|
||||
// optionalEnquete=enqueteRepository.findById(declarationNcPayloadWeb.getEnqueteId());
|
||||
if(declarationNcPayloadWeb.getPersonneId()!=null)
|
||||
optionalPersonne=personneRepository.findById(declarationNcPayloadWeb.getPersonneId());
|
||||
if(declarationNcPayloadWeb.getStructureId()!=null)
|
||||
optionalStructure=structureRepository.findById(declarationNcPayloadWeb.getStructureId());
|
||||
declarationNc.setId(declarationNcPayloadWeb.getId());
|
||||
declarationNc.setEnquete(optionalEnquete.orElse(null));
|
||||
//declarationNc.setEnquete(optionalEnquete.orElse(null));
|
||||
declarationNc.setStructure(optionalStructure.orElse(null));
|
||||
declarationNc.setPersonne(optionalPersonne.orElse(null));
|
||||
declarationNc.setNc(declarationNcPayloadWeb.getNc());
|
||||
@@ -250,6 +253,7 @@ public class EntityFromPayLoadService {
|
||||
batiment.setCode(batimentPaylaodWeb.getCode());
|
||||
batiment.setNub(batimentPaylaodWeb.getNub());
|
||||
batiment.setDateConstruction(batimentPaylaodWeb.getDateConstruction());
|
||||
|
||||
return batiment ;
|
||||
}
|
||||
|
||||
@@ -482,7 +486,7 @@ public class EntityFromPayLoadService {
|
||||
|
||||
public EnqueteActivite getEnqueteActivitePayLoadWeb(EnqueteActivitePayLoadWeb enqueteActivitePayLoadWeb){
|
||||
EnqueteActivite enqueteActivite=new EnqueteActivite();
|
||||
Optional<Enquete> optionalEnquete=Optional.empty();
|
||||
//Optional<Enquete> optionalEnquete=Optional.empty();
|
||||
Optional<Structure> optionalStructure=Optional.empty();
|
||||
Optional<Personne> optionalPersonne=Optional.empty();
|
||||
Optional<Batiment> optionalBatiment=Optional.empty();
|
||||
@@ -496,8 +500,8 @@ public class EntityFromPayLoadService {
|
||||
if(enqueteActivitePayLoadWeb.getBatimentId()!=null)
|
||||
optionalBatiment=batimentRepository.findById(enqueteActivitePayLoadWeb.getBatimentId());
|
||||
|
||||
if(enqueteActivitePayLoadWeb.getEnqueteId()!=null)
|
||||
optionalEnquete=enqueteRepository.findById(enqueteActivitePayLoadWeb.getEnqueteId());
|
||||
// if(enqueteActivitePayLoadWeb.getEnqueteId()!=null)
|
||||
// optionalEnquete=enqueteRepository.findById(enqueteActivitePayLoadWeb.getEnqueteId());
|
||||
|
||||
if(enqueteActivitePayLoadWeb.getStructureId()!=null)
|
||||
optionalStructure=structureRepository.findById(enqueteActivitePayLoadWeb.getStructureId());
|
||||
@@ -517,7 +521,7 @@ public class EntityFromPayLoadService {
|
||||
enqueteActivite.setBatiment(optionalBatiment.orElse(null));
|
||||
enqueteActivite.setUniteLogement(optionalUniteLogement.orElse(null));
|
||||
enqueteActivite.setPersonne(optionalPersonne.orElse(null));
|
||||
enqueteActivite.setEnquete(optionalEnquete.orElse(null));
|
||||
//enqueteActivite.setEnquete(optionalEnquete.orElse(null));
|
||||
enqueteActivite.setProfession(optionalProfession.orElse(null));
|
||||
enqueteActivite.setParcelle(optionalParcelle.orElse(null));
|
||||
enqueteActivite.setStructure(optionalStructure.orElse(null));
|
||||
@@ -554,4 +558,121 @@ public class EntityFromPayLoadService {
|
||||
user.setResetPassword(true);
|
||||
return user ;
|
||||
}
|
||||
|
||||
public EnqueteUniteLogement getEnqueteUniteLogementFromPayLoadWeb(EnqueteUniteLogementPayloadWeb enqueteUniteLogementPayloadWeb){
|
||||
|
||||
EnqueteUniteLogement eul = new EnqueteUniteLogement();
|
||||
if (enqueteUniteLogementPayloadWeb.getId()!=null)
|
||||
eul =enqueteUniteLogementRepository.findById(enqueteUniteLogementPayloadWeb.getId()).orElse(new EnqueteUniteLogement());
|
||||
|
||||
Optional<Exercice> optionalExercice = Optional.empty();
|
||||
Optional<Personne> optionalPersonne = Optional.empty();
|
||||
Optional<UniteLogement> optionalUniteLogement = Optional.empty();
|
||||
Optional<User> optionalUser = Optional.empty();
|
||||
|
||||
if(enqueteUniteLogementPayloadWeb.getExerciceId()!=null)
|
||||
optionalExercice= exerciceRepository.findById(enqueteUniteLogementPayloadWeb.getExerciceId());
|
||||
eul.setExercice(optionalExercice.orElse(null));
|
||||
|
||||
if(enqueteUniteLogementPayloadWeb.getUniteLogementId()!=null)
|
||||
optionalUniteLogement= uniteLogementRepository.findById(enqueteUniteLogementPayloadWeb.getUniteLogementId());
|
||||
eul.setUniteLogement(optionalUniteLogement.orElse(null));
|
||||
if(enqueteUniteLogementPayloadWeb.getPersonneId()!=null)
|
||||
optionalPersonne= personneRepository.findById(enqueteUniteLogementPayloadWeb.getPersonneId());
|
||||
eul.setPersonne(optionalPersonne.orElse(null));
|
||||
|
||||
if(enqueteUniteLogementPayloadWeb.getEnqueteurId()!=null)
|
||||
optionalUser= userRepository.findById(enqueteUniteLogementPayloadWeb.getEnqueteurId());
|
||||
eul.setUser(optionalUser.orElse(null));
|
||||
|
||||
|
||||
eul.setId(enqueteUniteLogementPayloadWeb.getId());
|
||||
eul.setObservation(enqueteUniteLogementPayloadWeb.getObservation());
|
||||
eul.setNbrePiece(enqueteUniteLogementPayloadWeb.getNbrePiece());
|
||||
eul.setNbreHabitant(enqueteUniteLogementPayloadWeb.getNbreHabitant());
|
||||
eul.setNbreMenage(enqueteUniteLogementPayloadWeb.getNbreMenage());
|
||||
eul.setEnLocation(enqueteUniteLogementPayloadWeb.getEnLocation());
|
||||
eul.setNbreMoisLocation(enqueteUniteLogementPayloadWeb.getNbreMoisLocation());
|
||||
eul.setMontantMensuelLoyer(enqueteUniteLogementPayloadWeb.getMontantMensuelLoyer());
|
||||
eul.setMontantLocatifAnnuelDeclare(enqueteUniteLogementPayloadWeb.getMontantLocatifAnnuelDeclare());
|
||||
eul.setValeurUniteLogementEstime(enqueteUniteLogementPayloadWeb.getValeurUniteLogementEstime());
|
||||
eul.setValeurUniteLogementReel(enqueteUniteLogementPayloadWeb.getValeurUniteLogementReel());
|
||||
eul.setSuperficieLouee(enqueteUniteLogementPayloadWeb.getSuperficieLouee());
|
||||
eul.setSuperficieAuSol(enqueteUniteLogementPayloadWeb.getSuperficieAuSol());
|
||||
eul.setDateEnquete(enqueteUniteLogementPayloadWeb.getDateEnquete());
|
||||
eul.setSbee(enqueteUniteLogementPayloadWeb.getSbee());
|
||||
eul.setSoneb(enqueteUniteLogementPayloadWeb.getSoneb());
|
||||
eul.setNumCompteurSbee(enqueteUniteLogementPayloadWeb.getNumCompteurSbee());
|
||||
eul.setNumCompteurSoneb(enqueteUniteLogementPayloadWeb.getNumCompteurSoneb());
|
||||
eul.setDateDebutExemption(enqueteUniteLogementPayloadWeb.getDateDebutExemption());
|
||||
eul.setDateFinExemption(enqueteUniteLogementPayloadWeb.getDateFinExemption());
|
||||
|
||||
return eul;
|
||||
}
|
||||
|
||||
public EnqueteBatiment getEnqueteBatimentFromPayLoadWeb(EnqueteBatimentPayloadWeb enqueteBatimentPayloadWeb){
|
||||
EnqueteBatiment enqueteBatiment = new EnqueteBatiment();
|
||||
if (enqueteBatimentPayloadWeb.getId()!=null)
|
||||
enqueteBatimentRepository.findById(enqueteBatimentPayloadWeb.getId()).orElse(new EnqueteBatiment());
|
||||
|
||||
// ======================
|
||||
// Relations (sans hit DB)
|
||||
// ======================
|
||||
|
||||
if (enqueteBatimentPayloadWeb.getBatimentId() != null) {
|
||||
Batiment batiment = new Batiment();
|
||||
batiment.setId(enqueteBatimentPayloadWeb.getBatimentId());
|
||||
enqueteBatiment.setBatiment(batiment);
|
||||
}
|
||||
|
||||
if (enqueteBatimentPayloadWeb.getPersonneId() != null) {
|
||||
Personne personne = new Personne();
|
||||
personne.setId(enqueteBatimentPayloadWeb.getPersonneId());
|
||||
enqueteBatiment.setPersonne(personne);
|
||||
}
|
||||
|
||||
if (enqueteBatimentPayloadWeb.getEnqueteurId() != null) {
|
||||
User user = new User();
|
||||
user.setId(enqueteBatimentPayloadWeb.getEnqueteurId());
|
||||
enqueteBatiment.setUser(user);
|
||||
}
|
||||
|
||||
// ======================
|
||||
// Champs simples
|
||||
// ======================
|
||||
|
||||
enqueteBatiment.setId(enqueteBatimentPayloadWeb.getId());
|
||||
enqueteBatiment.setObservation(enqueteBatimentPayloadWeb.getObservation());
|
||||
enqueteBatiment.setAutreMenuisierie(enqueteBatimentPayloadWeb.getAutreMenuisierie());
|
||||
enqueteBatiment.setAutreMur(enqueteBatimentPayloadWeb.getAutreMur());
|
||||
|
||||
enqueteBatiment.setSbee(enqueteBatimentPayloadWeb.isSbee());
|
||||
enqueteBatiment.setNumCompteurSbee(enqueteBatimentPayloadWeb.getNumCompteurSbee());
|
||||
enqueteBatiment.setSoneb(enqueteBatimentPayloadWeb.isSoneb());
|
||||
enqueteBatiment.setNumCompteurSoneb(enqueteBatimentPayloadWeb.getNumCompteurSoneb());
|
||||
|
||||
enqueteBatiment.setNbreLotUnite(enqueteBatimentPayloadWeb.getNbreLotUnite());
|
||||
enqueteBatiment.setNbreUniteLocation(enqueteBatimentPayloadWeb.getNbreUniteLocation());
|
||||
enqueteBatiment.setNbreMenage(enqueteBatimentPayloadWeb.getNbreMenage());
|
||||
enqueteBatiment.setNbreHabitant(enqueteBatimentPayloadWeb.getNbreHabitant());
|
||||
enqueteBatiment.setNbreMoisLocation(enqueteBatimentPayloadWeb.getNbreMoisLocation());
|
||||
|
||||
enqueteBatiment.setMontantMensuelLocation(enqueteBatimentPayloadWeb.getMontantMensuelLocation());
|
||||
enqueteBatiment.setMontantLocatifAnnuelDeclare(enqueteBatimentPayloadWeb.getMontantLocatifAnnuelDeclare());
|
||||
enqueteBatiment.setValeurBatimentEstime(enqueteBatimentPayloadWeb.getValeurBatimentEstime());
|
||||
enqueteBatiment.setValeurBatimentReel(enqueteBatimentPayloadWeb.getValeurBatimentReel());
|
||||
|
||||
enqueteBatiment.setSuperficieLouee(enqueteBatimentPayloadWeb.getSuperficieLouee());
|
||||
enqueteBatiment.setSuperficieAuSol(enqueteBatimentPayloadWeb.getSuperficieAuSol());
|
||||
|
||||
enqueteBatiment.setDateEnquete(enqueteBatimentPayloadWeb.getDateEnquete());
|
||||
enqueteBatiment.setDateDebutExcemption(enqueteBatimentPayloadWeb.getDateDebutExcemption());
|
||||
enqueteBatiment.setDateFinExcemption(enqueteBatimentPayloadWeb.getDateFinExcemption());
|
||||
|
||||
enqueteBatiment.setAutreCaracteristiquePhysique(enqueteBatimentPayloadWeb.getAutreCaracteristiquePhysique());
|
||||
|
||||
enqueteBatiment.setNbreEtage(enqueteBatimentPayloadWeb.getNbreEtage());
|
||||
|
||||
return enqueteBatiment;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,12 +85,12 @@ public class BatimentAsyncWorker {
|
||||
Optional<Tpe> optionalTpe = tpeRepository.findById(batimentPaylaod.getTerminalId());
|
||||
batiment.setTerminal(optionalTpe.orElse(null));
|
||||
}
|
||||
if (batimentPaylaod.getTerminalId() != null && batimentPaylaod.getEnqueteId() != null) {
|
||||
Optional<Enquete> optionalEnquete = enqueteRepository.findFirstByExternalKeyAndTerminal_Id(batimentPaylaod.getEnqueteId(), batimentPaylaod.getTerminalId());
|
||||
if (optionalEnquete.isPresent()) {
|
||||
batiment.setEnqueteId(optionalEnquete.get().getId());
|
||||
}
|
||||
}
|
||||
// if (batimentPaylaod.getTerminalId() != null && batimentPaylaod.getEnqueteId() != null) {
|
||||
// Optional<Enquete> optionalEnquete = enqueteRepository.findFirstByExternalKeyAndTerminal_Id(batimentPaylaod.getEnqueteId(), batimentPaylaod.getTerminalId());
|
||||
// if (optionalEnquete.isPresent()) {
|
||||
// batiment.setEnqueteId(optionalEnquete.get().getId());
|
||||
// }
|
||||
// }
|
||||
batiment.setParcelleExternalKey(batimentPaylaod.getParcelleId());
|
||||
batiment.setEnqueteExternalKey(batimentPaylaod.getEnqueteId());
|
||||
batiment.setNub(batimentPaylaod.getNub());
|
||||
|
||||
@@ -121,10 +121,10 @@ public class DeclarationNcAsyncWorker {
|
||||
declarationNc.setPersonne(optionalPersonne.orElse(null));
|
||||
}
|
||||
|
||||
if (declarationNcPayload.getEnqueteId() != null) {
|
||||
Optional<Enquete> optionalEnquete = enqueteRepository.findFirstByExternalKeyAndTerminal_Id(declarationNcPayload.getEnqueteId(), declarationNcPayload.getTerminalId());
|
||||
declarationNc.setEnquete(optionalEnquete.orElse(null));
|
||||
}
|
||||
// if (declarationNcPayload.getEnqueteId() != null) {
|
||||
// Optional<Enquete> optionalEnquete = enqueteRepository.findFirstByExternalKeyAndTerminal_Id(declarationNcPayload.getEnqueteId(), declarationNcPayload.getTerminalId());
|
||||
// declarationNc.setEnquete(optionalEnquete.orElse(null));
|
||||
// }
|
||||
if (declarationNcPayload.getTerminalId() != null) {
|
||||
Optional<Tpe> optionalTpe = tpeRepository.findById(declarationNcPayload.getTerminalId());
|
||||
declarationNc.setTerminal(optionalTpe.orElse(null));
|
||||
|
||||
@@ -180,10 +180,10 @@ public class EnqueteActiviteAsyncWorker {
|
||||
enqueteActivite.setStructure(optionalStructure.orElse(null));
|
||||
}
|
||||
|
||||
if (enqueteActivitePayload.getEnqueteId() != null) {
|
||||
Optional<Enquete> optionalEnquete = enqueteRepository.findFirstByExternalKeyAndTerminal_Id(enqueteActivitePayload.getEnqueteId(), enqueteActivitePayload.getTerminalId());
|
||||
enqueteActivite.setEnquete(optionalEnquete.orElse(null));
|
||||
}
|
||||
// if (enqueteActivitePayload.getEnqueteId() != null) {
|
||||
// Optional<Enquete> optionalEnquete = enqueteRepository.findFirstByExternalKeyAndTerminal_Id(enqueteActivitePayload.getEnqueteId(), enqueteActivitePayload.getTerminalId());
|
||||
// enqueteActivite.setEnquete(optionalEnquete.orElse(null));
|
||||
// }
|
||||
if (enqueteActivitePayload.getTerminalId() != null) {
|
||||
Optional<Tpe> optionalTpe = tpeRepository.findById(enqueteActivitePayload.getTerminalId());
|
||||
enqueteActivite.setTerminal(optionalTpe.orElse(null));
|
||||
|
||||
@@ -253,17 +253,17 @@ public class EnqueteAsyncWorker {
|
||||
//
|
||||
// }
|
||||
|
||||
try {
|
||||
uniteLogementRepository.deleteByEnqueteId(idEnquete);
|
||||
} catch (Exception e) {
|
||||
// try {
|
||||
// uniteLogementRepository.deleteByEnqueteId(idEnquete);
|
||||
// } catch (Exception e) {
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
batimentRepository.deleteByEnqueteId(idEnquete);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
// try {
|
||||
// batimentRepository.deleteByEnqueteId(idEnquete);
|
||||
// } catch (Exception e) {
|
||||
//
|
||||
// }
|
||||
try {
|
||||
enqueteRepository.deleteById(idEnquete);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -95,7 +95,7 @@ public class EnqueteBatimentAsyncWorker {
|
||||
|
||||
|
||||
private EnqueteBatiment getEnqueteBatimentFromEnqueteBatimentPayLoad(EnqueteBatiment enqueteBatiment, EnqueteBatimentPayload enqueteBatimentPayload) {
|
||||
enqueteBatiment.setSurfaceAuSol(enqueteBatimentPayload.getSurfaceAuSol());
|
||||
enqueteBatiment.setSuperficieAuSol(enqueteBatimentPayload.getSurfaceAuSol());
|
||||
enqueteBatiment.setAutreMenuisierie(enqueteBatimentPayload.getAutreMenuisierie());
|
||||
enqueteBatiment.setAutreMur(enqueteBatimentPayload.getAutreMur());
|
||||
enqueteBatiment.setSbee(enqueteBatimentPayload.isSbee());
|
||||
@@ -104,7 +104,7 @@ public class EnqueteBatimentAsyncWorker {
|
||||
enqueteBatiment.setNumCompteurSoneb(enqueteBatimentPayload.getNumCompteurSoneb());
|
||||
enqueteBatiment.setNbreLotUnite(enqueteBatimentPayload.getNbreLotUnite());
|
||||
enqueteBatiment.setNbreUniteLocation(enqueteBatimentPayload.getNbreUniteLocation());
|
||||
enqueteBatiment.setSurfaceLouee(enqueteBatimentPayload.getSurfaceLouee());
|
||||
enqueteBatiment.setSuperficieLouee(enqueteBatimentPayload.getSurfaceLouee());
|
||||
enqueteBatiment.setNbreMenage(enqueteBatimentPayload.getNbreMenage());
|
||||
enqueteBatiment.setNbreHabitant(enqueteBatimentPayload.getNbreHabitant());
|
||||
enqueteBatiment.setMontantMensuelLocation(enqueteBatimentPayload.getValeurMensuelleLocation());
|
||||
|
||||
@@ -120,7 +120,7 @@ public class EnqueteUniteLogementAsyncWorker {
|
||||
enqueteUniteLogement.setUser(optionalUser.orElse(null));
|
||||
}
|
||||
enqueteUniteLogement.setEnqueteExternalKey(enqueteUniteLogementPayload.getEnqueteId());
|
||||
enqueteUniteLogement.setSurfaceAuSol(enqueteUniteLogementPayload.getSurface());
|
||||
enqueteUniteLogement.setSuperficieAuSol(enqueteUniteLogementPayload.getSurface());
|
||||
enqueteUniteLogement.setNbrePiece(enqueteUniteLogementPayload.getNbrePiece());
|
||||
enqueteUniteLogement.setNbreHabitant(enqueteUniteLogementPayload.getNbreHabitant());
|
||||
enqueteUniteLogement.setNbreMenage(enqueteUniteLogementPayload.getNbreMenage());
|
||||
@@ -128,13 +128,13 @@ public class EnqueteUniteLogementAsyncWorker {
|
||||
enqueteUniteLogement.setMontantMensuelLoyer(enqueteUniteLogementPayload.getMontantMensuelLoyer());
|
||||
enqueteUniteLogement.setNbreMoisLocation(enqueteUniteLogementPayload.getNbreMoisEnLocation());
|
||||
enqueteUniteLogement.setMontantLocatifAnnuelDeclare(enqueteUniteLogementPayload.getMontantLocatifAnnuelDeclare());
|
||||
enqueteUniteLogement.setSurfaceLouee(enqueteUniteLogementPayload.getSurfaceLouee());
|
||||
enqueteUniteLogement.setSuperficieLouee(enqueteUniteLogementPayload.getSurfaceLouee());
|
||||
enqueteUniteLogement.setSbee(enqueteUniteLogementPayload.isSbee());
|
||||
enqueteUniteLogement.setSoneb(enqueteUniteLogementPayload.isSoneb());
|
||||
enqueteUniteLogement.setNumCompteurSbee(enqueteUniteLogementPayload.getNumCompteurSbee());
|
||||
enqueteUniteLogement.setNumCompteurSoneb(enqueteUniteLogementPayload.getNumCompteurSoneb());
|
||||
enqueteUniteLogement.setDateDebutExcemption(enqueteUniteLogementPayload.getDateDebutExcemption());
|
||||
enqueteUniteLogement.setDateFinExcemption(enqueteUniteLogementPayload.getDateFinExcemption());
|
||||
enqueteUniteLogement.setDateDebutExemption(enqueteUniteLogementPayload.getDateDebutExcemption());
|
||||
enqueteUniteLogement.setDateFinExemption(enqueteUniteLogementPayload.getDateFinExcemption());
|
||||
enqueteUniteLogement.setExternalKey(enqueteUniteLogementPayload.getExternalKey());
|
||||
enqueteUniteLogement.setPersonneExternalKey(enqueteUniteLogementPayload.getPersonneId());
|
||||
enqueteUniteLogement.setUniteLogementExternalKey(enqueteUniteLogementPayload.getUniteLogementId());
|
||||
|
||||
@@ -95,7 +95,7 @@ public class ParcelleAsyncWorker {
|
||||
parcelle.setNup(parcellePayLoad.getNup());
|
||||
parcelle.setLongitude(parcellePayLoad.getLongitude());
|
||||
parcelle.setLatitude(parcellePayLoad.getLatitude());
|
||||
parcelle.setNumTitreFoncier(parcellePayLoad.getNumTitreFoncier());
|
||||
parcelle.setNumeroTitreFoncier(parcellePayLoad.getNumTitreFoncier());
|
||||
// parcelle.setTypeDomaineId(parcellePayLoad.getTypeDomaineId());
|
||||
parcelle.setNumeroProvisoire(parcellePayLoad.getNumeroProvisoire());
|
||||
parcelle.setBlocId(parcellePayLoad.getBlocId());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
spring.profiles.active=${SPRING_PROFILES_ACTIVE}
|
||||
#spring.profiles.active=${SPRING_PROFILES_ACTIVE}
|
||||
#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.enable_lazy_load_no_trans=true
|
||||
spring.jpa.open-in-view=false
|
||||
|
||||
Reference in New Issue
Block a user