Merge pull request 'reajustement secteur decoupage perimetre' (#262) from features/fiche_refonte into develop
Reviewed-on: #262
This commit was merged in pull request #262.
This commit is contained in:
@@ -112,30 +112,38 @@ public class EnqueteServiceImpl implements EnqueteService {
|
||||
}
|
||||
|
||||
Optional<Quartier> optionalQuartier = quartierRepository.findById(enquetePayLoadWeb.getQuartierId());
|
||||
if (!optionalQuartier.isPresent()) {
|
||||
if (optionalQuartier.isEmpty()) {
|
||||
throw new BadRequestException("Echec de l'enregistrement : Quartier inexistant");
|
||||
}
|
||||
|
||||
Optional<User> optionalUser = userRepository.findById(enquetePayLoadWeb.getEnqueteurId());
|
||||
if (!optionalUser.isPresent()) {
|
||||
if (optionalUser.isEmpty()) {
|
||||
throw new BadRequestException("Echec de l'enregistrement : Enquêteur inexistant");
|
||||
}
|
||||
|
||||
if(enquetePayLoadWeb.getPersonneId()==null) {
|
||||
throw new BadRequestException("Echec de l'enregistrement : Veuillez préciser le Propriétaire");
|
||||
}
|
||||
|
||||
Optional<Personne> optionalPersonne = personneRepository.findById(enquetePayLoadWeb.getPersonneId());
|
||||
if (!optionalPersonne.isPresent()) {
|
||||
if (optionalPersonne.isEmpty()) {
|
||||
throw new BadRequestException("Echec de l'enregistrement : Propriétaire inexistant");
|
||||
}
|
||||
|
||||
|
||||
if(enquetePayLoadWeb.getParcelleId()!=null) {
|
||||
Optional<Parcelle> optionalParcelle = parcelleRepository.findById(enquetePayLoadWeb.getParcelleId());
|
||||
if (!optionalParcelle.isPresent()) {
|
||||
if (optionalParcelle.isEmpty()) {
|
||||
throw new BadRequestException("Echec de l'enregistrement : Parcelle inexistante");
|
||||
}
|
||||
}
|
||||
|
||||
if(enquetePayLoadWeb.getZoneRfuId()==null){
|
||||
throw new BadRequestException("Echec de l'enregistrement : Veuillez préciser la zone RFU");
|
||||
}
|
||||
|
||||
Optional<ZoneRfu> optionalZoneRfu = zoneRfuRepository.findById(enquetePayLoadWeb.getZoneRfuId());
|
||||
if (!optionalZoneRfu.isPresent()) {
|
||||
if (optionalZoneRfu.isEmpty()) {
|
||||
throw new BadRequestException("Echec de l'enregistrement : zone inexistante");
|
||||
}
|
||||
|
||||
|
||||
@@ -817,11 +817,10 @@ public class EntityFromPayLoadService {
|
||||
enquete.setParcelle(parcelle);
|
||||
}
|
||||
|
||||
if (enquetePayLoadWeb.getPersonneId() != null) {
|
||||
Personne personne = new Personne();
|
||||
personne.setId(enquetePayLoadWeb.getPersonneId());
|
||||
enquete.setPersonne(personne);
|
||||
}
|
||||
Personne personne = new Personne();
|
||||
personne.setId(enquetePayLoadWeb.getPersonneId());
|
||||
enquete.setPersonne(personne);
|
||||
|
||||
|
||||
if (enquetePayLoadWeb.getEnqueteurId() != null) {
|
||||
User user = new User();
|
||||
|
||||
Reference in New Issue
Block a user