Gestion cloture #138
@@ -315,5 +315,31 @@ public class SecteurController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(
|
||||||
|
summary = "recuperer tous les secteurs d'un departement",
|
||||||
|
description = "Permet de récuperer l'ensemble des secteurs du departement dont l'ID est fourni en path"
|
||||||
|
)
|
||||||
|
@GetMapping("/by-departement-id/{departementId}")
|
||||||
|
public ResponseEntity<?> getSecteurByDepartementId(@PathVariable Long departementId) {
|
||||||
|
try {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, secteurService.getListSecteurByDepartementId(departementId), "Secteur 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ package io.gmss.fiscad.controllers.infocad.metier;
|
|||||||
|
|
||||||
import io.gmss.fiscad.entities.infocad.metier.Enquete;
|
import io.gmss.fiscad.entities.infocad.metier.Enquete;
|
||||||
import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment;
|
import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment;
|
||||||
|
import io.gmss.fiscad.entities.user.User;
|
||||||
import io.gmss.fiscad.exceptions.*;
|
import io.gmss.fiscad.exceptions.*;
|
||||||
import io.gmss.fiscad.interfaces.infocad.metier.EnqueteService;
|
import io.gmss.fiscad.interfaces.infocad.metier.EnqueteService;
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
@@ -10,6 +11,8 @@ import io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb;
|
|||||||
import io.gmss.fiscad.paylaods.request.synchronisation.EnquetePayLoad;
|
import io.gmss.fiscad.paylaods.request.synchronisation.EnquetePayLoad;
|
||||||
import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad;
|
import io.gmss.fiscad.paylaods.request.EnqueteTraitementPayLoad;
|
||||||
import io.gmss.fiscad.paylaods.request.FiltreEnquetePayLoad;
|
import io.gmss.fiscad.paylaods.request.FiltreEnquetePayLoad;
|
||||||
|
import io.gmss.fiscad.security.CurrentUser;
|
||||||
|
import io.gmss.fiscad.security.UserPrincipal;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@@ -480,5 +483,38 @@ public class EnqueteController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@PutMapping("/cloturer-enquete")
|
||||||
|
public ResponseEntity<?> cloturerEnquete(@CurrentUser UserPrincipal userPrincipal) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
if(userPrincipal==null){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, null, "Accès non autorisé"),
|
||||||
|
HttpStatus.NOT_ACCEPTABLE
|
||||||
|
);
|
||||||
|
}
|
||||||
|
User user= userPrincipal.getUser();
|
||||||
|
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, enqueteService.cloturerEnqueteParcelleBatimentUniteLogementByUserId(user.getId()), "enquete cloturées avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||||
|
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||||
|
FileStorageException e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -388,6 +388,33 @@ public class ParcelleController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@PutMapping("/syncrhonise-etat-batie-parcelle")
|
||||||
|
public ResponseEntity<?> putSynchroniseEtatBatieParcelle() {
|
||||||
|
try {
|
||||||
|
Integer nombreParcelleSync= parcelleService.majParcelleBatieNonbatie();
|
||||||
|
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,nombreParcelleSync , "Parcelle mise à jour avec succes."),
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,13 @@ package io.gmss.fiscad.controllers.rfu.metier;
|
|||||||
|
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
|
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
|
||||||
|
import io.gmss.fiscad.entities.user.User;
|
||||||
import io.gmss.fiscad.exceptions.*;
|
import io.gmss.fiscad.exceptions.*;
|
||||||
import io.gmss.fiscad.interfaces.rfu.metier.ImpositionsTfuService;
|
import io.gmss.fiscad.interfaces.rfu.metier.ImpositionsTfuService;
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
|
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
|
||||||
|
import io.gmss.fiscad.security.CurrentUser;
|
||||||
|
import io.gmss.fiscad.security.UserPrincipal;
|
||||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
@@ -35,11 +39,11 @@ public class ImpositionsTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public ResponseEntity<?> createImpositionsTfu(@RequestBody @Valid @Validated ImpositionsTfu impositionsTfu) {
|
public ResponseEntity<?> createImpositionsTfu(@RequestBody @Valid @Validated ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
impositionsTfu = impositionsTfuService.createImpositionsTfu(impositionsTfu);
|
impositionsTfuPaylaodWeb = impositionsTfuService.createImpositionsTfu(impositionsTfuPaylaodWeb);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, impositionsTfu, "Unite de logement créé avec succès."),
|
new ApiResponse<>(true, impositionsTfuPaylaodWeb, "Unite de logement créé avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -58,35 +62,35 @@ public class ImpositionsTfuController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
// @PutMapping("/update/{id}")
|
||||||
public ResponseEntity<?> updateImpositionsTfu(@PathVariable Long id, @RequestBody ImpositionsTfu impositionsTfu) {
|
// public ResponseEntity<?> updateImpositionsTfu(@PathVariable Long id, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
||||||
try {
|
// try {
|
||||||
return new ResponseEntity<>(
|
// return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, impositionsTfuService.updateImpositionsTfu(id, impositionsTfu), "Unite de logement mise à jour avec succès."),
|
// new ApiResponse<>(true, impositionsTfuService.updateImpositionsTfu(id, impositionsTfuPaylaodWeb), "Unite de logement mise à jour avec succès."),
|
||||||
HttpStatus.OK
|
// HttpStatus.OK
|
||||||
);
|
// );
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
// } catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
logger.error(e.getLocalizedMessage());
|
// logger.error(e.getLocalizedMessage());
|
||||||
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
// return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||||
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
// } catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||||
FileStorageException e) {
|
// FileStorageException e) {
|
||||||
logger.error(e.getLocalizedMessage());
|
// logger.error(e.getLocalizedMessage());
|
||||||
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
// return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||||
} catch (NullPointerException e) {
|
// } catch (NullPointerException e) {
|
||||||
logger.error(e.getLocalizedMessage());
|
// logger.error(e.getLocalizedMessage());
|
||||||
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
// return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
logger.error(e.getLocalizedMessage());
|
// logger.error(e.getLocalizedMessage());
|
||||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
// return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
@PutMapping("/valider/{id}")
|
@PutMapping("/valider/{id}")
|
||||||
public ResponseEntity<?> validerImpositionsTfu(@RequestBody ImpositionsTfu impositionsTfu) {
|
public ResponseEntity<?> validerImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, impositionsTfuService.validerImpositionsTfu(impositionsTfu), "Unite de logement mise à jour avec succès."),
|
new ApiResponse<>(true, impositionsTfuService.validerImpositionsTfu(impositionsTfuPaylaodWeb), "Unite de logement mise à jour avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -106,10 +110,10 @@ public class ImpositionsTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/annuler/{id}")
|
@PutMapping("/annuler/{id}")
|
||||||
public ResponseEntity<?> annulerImpositionsTfu(@PathVariable Long id, @RequestBody ImpositionsTfu impositionsTfu) {
|
public ResponseEntity<?> annulerImpositionsTfu(@PathVariable Long id, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, impositionsTfuService.annulerImpositionsTfu(impositionsTfu), "Unite de logement mise à jour avec succès."),
|
new ApiResponse<>(true, impositionsTfuService.annulerImpositionsTfu(impositionsTfuPaylaodWeb), "Unite de logement mise à jour avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -152,11 +156,19 @@ public class ImpositionsTfuController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all")
|
@GetMapping("/all/by-user")
|
||||||
public ResponseEntity<?> getAllImpositionsTfuList() {
|
public ResponseEntity<?> getAllImpositionsTfuList(@CurrentUser UserPrincipal userPrincipal) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
if(userPrincipal==null){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, null, "Vous n'êtes pas autorisé à acceder à cette ressource"),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
User user= userPrincipal.getUser();
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, impositionsTfuService.getImpositionsTfuList(), "Liste des Enquetes des unites Logements chargée avec succès."),
|
new ApiResponse<>(true, impositionsTfuService.getImpositionsTfuByUserIdIds(user.getId()), "Liste des Enquetes des unites Logements chargée avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
|
|||||||
@@ -2,8 +2,9 @@ package io.gmss.fiscad.controllers.rfu.parametre;
|
|||||||
|
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
|
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
|
||||||
import io.gmss.fiscad.exceptions.*;
|
import io.gmss.fiscad.exceptions.*;
|
||||||
import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuService;
|
import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuBatiService;
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
|
import io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb;
|
||||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
@@ -24,20 +25,20 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Barem Rfu")
|
@Tag(name = "Barem Rfu")
|
||||||
public class BaremRfuController {
|
public class BaremRfuController {
|
||||||
private final BaremRfuService baremRfuService;
|
private final BaremRfuBatiService baremRfuBatiService;
|
||||||
private static final Logger logger = LoggerFactory.getLogger(BaremRfuController.class);
|
private static final Logger logger = LoggerFactory.getLogger(BaremRfuController.class);
|
||||||
|
|
||||||
public BaremRfuController(BaremRfuService baremRfuService) {
|
public BaremRfuController(BaremRfuBatiService baremRfuBatiService) {
|
||||||
this.baremRfuService = baremRfuService;
|
this.baremRfuBatiService = baremRfuBatiService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public ResponseEntity<?> createBaremRfu(@RequestBody @Valid @Validated BaremRfuBati baremRfuBati) {
|
public ResponseEntity<?> createBaremRfu(@RequestBody @Valid @Validated BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
baremRfuBati = baremRfuService.createBaremRfu(baremRfuBati);
|
baremRfuBatiPayloadWeb = baremRfuBatiService.createBaremRfu(baremRfuBatiPayloadWeb);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, baremRfuBati, "BaremRfuBati créé avec succès."),
|
new ApiResponse<>(true, baremRfuBatiPayloadWeb, "BaremRfuBati créé avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -57,10 +58,10 @@ public class BaremRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
public ResponseEntity<?> updateBaremRfu(@PathVariable Long id, @RequestBody BaremRfuBati baremRfuBati) {
|
public ResponseEntity<?> updateBaremRfu(@PathVariable Long id, @RequestBody BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, baremRfuService.updateBaremRfu(id, baremRfuBati), "BaremRfuBati mis à jour avec succès."),
|
new ApiResponse<>(true, baremRfuBatiService.updateBaremRfu(id, baremRfuBatiPayloadWeb), "BaremRfuBati mis à jour avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -82,7 +83,7 @@ public class BaremRfuController {
|
|||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
public ResponseEntity<?> deleteBaremRfur(@PathVariable Long id) {
|
public ResponseEntity<?> deleteBaremRfur(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
baremRfuService.deleteBaremRfu(id);
|
baremRfuBatiService.deleteBaremRfu(id);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, "BaremRfuBati supprimée avec succès."),
|
new ApiResponse<>(true, "BaremRfuBati supprimée avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
@@ -107,7 +108,7 @@ public class BaremRfuController {
|
|||||||
public ResponseEntity<?> getAllBaremRfuList() {
|
public ResponseEntity<?> getAllBaremRfuList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, baremRfuService.getBaremRfuList(), "Liste des baremRfus chargée avec succès."),
|
new ApiResponse<>(true, baremRfuBatiService.getBaremRfuList(), "Liste des baremRfus chargée avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -132,7 +133,7 @@ public class BaremRfuController {
|
|||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, baremRfuService.getBaremRfuList(pageable), "Liste des baremRfus chargée avec succès."),
|
new ApiResponse<>(true, baremRfuBatiService.getBaremRfuList(pageable), "Liste des baremRfus chargée avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -155,7 +156,7 @@ public class BaremRfuController {
|
|||||||
public ResponseEntity<?> getBaremRfuById(@PathVariable Long id) {
|
public ResponseEntity<?> getBaremRfuById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, baremRfuService.getBaremRfuById(id), "BaremRfuBati trouvée avec succès."),
|
new ApiResponse<>(true, baremRfuBatiService.getBaremRfuById(id), "BaremRfuBati trouvée avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -174,13 +175,68 @@ public class BaremRfuController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/categorie-batiment/{idCategorieBatiment}")
|
@GetMapping("/by-categorie-batiment-id/{idCategorieBatiment}")
|
||||||
public ResponseEntity<?> getBaremRfuByType( //@Parameter(description = "ID de la catégorie de bâtiment", required = true)
|
public ResponseEntity<?> getBaremRfuByType( //@Parameter(description = "ID de la catégorie de bâtiment", required = true)
|
||||||
@PathVariable Long idCategorieBatiment) {
|
@PathVariable Long idCategorieBatiment) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, baremRfuService.getBaremRfuByType(idCategorieBatiment), "Liste des baremRfu par categorie de batiments chargée avec succès."),
|
new ApiResponse<>(true, baremRfuBatiService.getBaremRfuByCategorieBatiment(idCategorieBatiment), "Liste des baremRfu par categorie de batiments chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||||
|
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||||
|
FileStorageException e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/by-arrondissement-id/by-categorie-batiment-id/{idArrondissement}/{idCategorieBatiment}")
|
||||||
|
public ResponseEntity<?> getBaremRfuByArrondisementAndCategorie( //@Parameter(description = "ID de la catégorie de bâtiment", required = true)
|
||||||
|
@PathVariable Long idArrondissement,
|
||||||
|
@PathVariable Long idCategorieBatiment
|
||||||
|
) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, baremRfuBatiService.getBaremRfuByArrondissementAndCategorieBatiment(idArrondissement,idCategorieBatiment), "Liste des baremRfu par categorie de batiments chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||||
|
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||||
|
FileStorageException e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/by-quartier-id/by-categorie-batiment-id/{idQuartier}/{idCategorieBatiment}")
|
||||||
|
public ResponseEntity<?> getBaremRfuByQuartierAndCategorie( //@Parameter(description = "ID de la catégorie de bâtiment", required = true)
|
||||||
|
@PathVariable Long idQuartier,
|
||||||
|
@PathVariable Long idCategorieBatiment
|
||||||
|
) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, baremRfuBatiService.getBaremRfuByQuartierAndCategorieBatiment(idQuartier,idCategorieBatiment), "Liste des baremRfu par categorie de batiments chargée avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||||||
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
|
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
|
||||||
import io.gmss.fiscad.entities.BaseEntity;
|
import io.gmss.fiscad.entities.BaseEntity;
|
||||||
import io.gmss.fiscad.entities.decoupage.Commune;
|
import io.gmss.fiscad.entities.decoupage.Commune;
|
||||||
|
import io.gmss.fiscad.entities.infocad.parametre.Structure;
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
|
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.Participer;
|
import io.gmss.fiscad.entities.rfu.parametre.Participer;
|
||||||
import io.gmss.fiscad.enums.StatusAvis;
|
import io.gmss.fiscad.enums.StatusAvis;
|
||||||
@@ -33,18 +34,32 @@ public class ImpositionsTfu extends BaseEntity implements Serializable {
|
|||||||
private Long id;
|
private Long id;
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Exercice exercice;
|
private Exercice exercice;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Commune commune;
|
private Commune commune;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
private Structure structure ;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
private LocalDate dateGeneration;
|
private LocalDate dateGeneration;
|
||||||
private String ReferencePieceAdmin;
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateCloture;
|
||||||
|
|
||||||
|
private String referencePieceAdmin;
|
||||||
private String datePieceAdmin;
|
private String datePieceAdmin;
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
private StatusAvis statusAvis;
|
private StatusAvis statusAvis;
|
||||||
|
|
||||||
private Long nombreAvis;
|
private Long nombreAvis;
|
||||||
|
|
||||||
@Column(columnDefinition = "TEXT")
|
@Column(columnDefinition = "TEXT")
|
||||||
private String motif;
|
private String motif;
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||||
@JoinColumn(name = "impositions_tfu_id")
|
@JoinColumn(name = "impositions_tfu_id")
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ public class SituationFiscaleParcelle extends BaseEntity implements Serializable
|
|||||||
private Long montantDu ;
|
private Long montantDu ;
|
||||||
private Long montantPaye ;
|
private Long montantPaye ;
|
||||||
private Long resteAPayer ;
|
private Long resteAPayer ;
|
||||||
private StatutParcelle etatFiscalParcelle ;
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
private LocalDate dateSync;
|
private LocalDate dateSync;
|
||||||
|
|||||||
@@ -69,4 +69,5 @@ public class UniteLogement extends BaseEntity implements Serializable {
|
|||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
private LocalDate dateFinExemption;
|
private LocalDate dateFinExemption;
|
||||||
private Integer idToitRfu;
|
private Integer idToitRfu;
|
||||||
|
private Integer nombreEtage;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package io.gmss.fiscad.entities.rfu.parametre;
|
|||||||
|
|
||||||
import io.gmss.fiscad.entities.BaseEntity;
|
import io.gmss.fiscad.entities.BaseEntity;
|
||||||
import io.gmss.fiscad.entities.decoupage.Arrondissement;
|
import io.gmss.fiscad.entities.decoupage.Arrondissement;
|
||||||
|
import io.gmss.fiscad.entities.decoupage.Quartier;
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -28,4 +29,6 @@ public class BaremRfuBati extends BaseEntity implements Serializable {
|
|||||||
private CategorieBatiment categorieBatiment;
|
private CategorieBatiment categorieBatiment;
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Arrondissement arrondissement;
|
private Arrondissement arrondissement;
|
||||||
|
@ManyToOne
|
||||||
|
private Quartier quartier ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
package io.gmss.fiscad.entities.rfu.parametre;
|
package io.gmss.fiscad.entities.rfu.parametre;
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.BaseEntity;
|
import io.gmss.fiscad.entities.BaseEntity;
|
||||||
import jakarta.persistence.Entity;
|
import io.gmss.fiscad.enums.CategorieUsage;
|
||||||
import jakarta.persistence.GeneratedValue;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.GenerationType;
|
|
||||||
import jakarta.persistence.Id;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -25,5 +23,7 @@ public class Usage extends BaseEntity implements Serializable {
|
|||||||
private Long id;
|
private Long id;
|
||||||
private String code;
|
private String code;
|
||||||
private String nom;
|
private String nom;
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private CategorieUsage categorieUsage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
src/main/java/io/gmss/fiscad/enums/CategorieUsage.java
Normal file
8
src/main/java/io/gmss/fiscad/enums/CategorieUsage.java
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
package io.gmss.fiscad.enums;
|
||||||
|
|
||||||
|
public enum CategorieUsage {
|
||||||
|
|
||||||
|
HABITATION,
|
||||||
|
PROFESSIONNELLE,
|
||||||
|
MIXTE
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package io.gmss.fiscad.enums;
|
package io.gmss.fiscad.enums;
|
||||||
|
|
||||||
public enum StatusAvis {
|
public enum StatusAvis {
|
||||||
CREE,
|
CREE, //Equivaut à la cloture des enquêtes et des mise à jour + Creation d'une imposition
|
||||||
GENERE,
|
GENERE,
|
||||||
ANNULE,
|
ANNULE,
|
||||||
VALIDE,
|
VALIDE,
|
||||||
|
|||||||
@@ -2,9 +2,6 @@ package io.gmss.fiscad.enums;
|
|||||||
|
|
||||||
public enum StatutParcelle {
|
public enum StatutParcelle {
|
||||||
NON_ENQUETER,
|
NON_ENQUETER,
|
||||||
ENQUETER_NON_BATIE_AJOUR,
|
AJOUR,
|
||||||
ENQUETER_BATIE_AJOUR,
|
NON_AJOUR;
|
||||||
ENQUETER_NON_BATIE_NON_AJOUR,
|
|
||||||
ENQUETER_BATIE_NON_AJOUR
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,8 +163,15 @@ public class SecteurServiceImpl implements SecteurService {
|
|||||||
secteurs.addAll(secteurRepository.findDistinctBySection_Id(avoirFonction.getFonction().getSection().getId()));
|
secteurs.addAll(secteurRepository.findDistinctBySection_Id(avoirFonction.getFonction().getSection().getId()));
|
||||||
}else if(avoirFonction.getFonction().getStructure()!=null){
|
}else if(avoirFonction.getFonction().getStructure()!=null){
|
||||||
secteurs.addAll(secteurRepository.findDistinctBySection_Structure_Id(avoirFonction.getFonction().getStructure().getId()));
|
secteurs.addAll(secteurRepository.findDistinctBySection_Structure_Id(avoirFonction.getFonction().getStructure().getId()));
|
||||||
|
}else if(avoirFonction.getFonction().getDepartement()!=null){
|
||||||
|
secteurs.addAll(secteurRepository.findSectionsByDepartement(avoirFonction.getFonction().getDepartement().getId()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return secteurs;
|
return secteurs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Secteur> getListSecteurByDepartementId(Long departementId) {
|
||||||
|
return secteurRepository.findSectionsByDepartement(departementId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -43,6 +43,7 @@ import io.gmss.fiscad.service.EntityFromPayLoadService;
|
|||||||
import jakarta.persistence.EntityManager;
|
import jakarta.persistence.EntityManager;
|
||||||
import jakarta.persistence.PersistenceContext;
|
import jakarta.persistence.PersistenceContext;
|
||||||
import jakarta.persistence.Query;
|
import jakarta.persistence.Query;
|
||||||
|
import jakarta.transaction.Transactional;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.modelmapper.ModelMapper;
|
import org.modelmapper.ModelMapper;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
@@ -541,4 +542,26 @@ public class EnqueteServiceImpl implements EnqueteService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public int cloturerEnqueteParcelleBatimentUniteLogementByUserId(Long userId) {
|
||||||
|
Optional<User> optionalUser= userRepository.findById(userId);
|
||||||
|
int nbreEnquete=0;
|
||||||
|
if(optionalUser.isPresent() && optionalUser.get().getStructure()!=null){
|
||||||
|
Long structureId=optionalUser.get().getStructure().getId();
|
||||||
|
nbreEnquete=cloturerEnqueteParcelleBatimentUniteLogementByStructureId(structureId);
|
||||||
|
}
|
||||||
|
return nbreEnquete;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public int cloturerEnqueteParcelleBatimentUniteLogementByStructureId(Long structureId) {
|
||||||
|
Integer nombreParcelleImpacte=enqueteRepository.clotureEnqueteParcelle(structureId);
|
||||||
|
Integer nombreBatiment=enqueteBatimentRepository.clotureEnqueteBatiment(structureId);
|
||||||
|
Integer nombreUniteLogement=enqueteUniteLogementRepository.clotureEnqueteUniteLogement(structureId);
|
||||||
|
return nombreParcelleImpacte;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import io.gmss.fiscad.persistence.repositories.infocad.parametre.SituationGeogra
|
|||||||
import io.gmss.fiscad.persistence.specification.ParcelleSpecification;
|
import io.gmss.fiscad.persistence.specification.ParcelleSpecification;
|
||||||
import io.gmss.fiscad.service.GeometryService;
|
import io.gmss.fiscad.service.GeometryService;
|
||||||
import jakarta.persistence.Query;
|
import jakarta.persistence.Query;
|
||||||
|
import jakarta.transaction.Transactional;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.data.domain.*;
|
import org.springframework.data.domain.*;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -193,6 +194,13 @@ public class ParcelleServiceImpl implements ParcelleService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public Integer majParcelleBatieNonbatie() {
|
||||||
|
return parcelleRepository.updateParcelleBatieTrue()+parcelleRepository.updateParcelleBatieFalse();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<Long> getSecteurIdListForUser(Long userId) {
|
private List<Long> getSecteurIdListForUser(Long userId) {
|
||||||
List<Secteur> secteurs = secteurService.getListSecteurUserId(userId);
|
List<Secteur> secteurs = secteurService.getListSecteurUserId(userId);
|
||||||
List<Long> secteurIds = secteurs.stream()
|
List<Long> secteurIds = secteurs.stream()
|
||||||
|
|||||||
@@ -1,20 +1,25 @@
|
|||||||
package io.gmss.fiscad.implementations.infocad.parametre;
|
package io.gmss.fiscad.implementations.infocad.parametre;
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.decoupage.Commune;
|
import io.gmss.fiscad.entities.decoupage.Commune;
|
||||||
|
import io.gmss.fiscad.entities.decoupage.Secteur;
|
||||||
import io.gmss.fiscad.entities.decoupage.Section;
|
import io.gmss.fiscad.entities.decoupage.Section;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.Structure;
|
import io.gmss.fiscad.entities.infocad.parametre.Structure;
|
||||||
|
import io.gmss.fiscad.entities.user.AvoirFonction;
|
||||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
import io.gmss.fiscad.exceptions.BadRequestException;
|
||||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
import io.gmss.fiscad.exceptions.NotFoundException;
|
||||||
import io.gmss.fiscad.interfaces.infocad.parametre.StructureService;
|
import io.gmss.fiscad.interfaces.infocad.parametre.StructureService;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.StructurePaylaodWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.StructurePaylaodWeb;
|
||||||
import io.gmss.fiscad.paylaods.response.StructureResponse;
|
import io.gmss.fiscad.paylaods.response.StructureResponse;
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.parametre.StructureRepository;
|
import io.gmss.fiscad.persistence.repositories.infocad.parametre.StructureRepository;
|
||||||
|
import io.gmss.fiscad.persistence.repositories.user.AvoirFonctionRepository;
|
||||||
import io.gmss.fiscad.service.EntityFromPayLoadService;
|
import io.gmss.fiscad.service.EntityFromPayLoadService;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@@ -23,6 +28,7 @@ public class StructureServiceImpl implements StructureService {
|
|||||||
|
|
||||||
private final StructureRepository structureRepository;
|
private final StructureRepository structureRepository;
|
||||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
private final EntityFromPayLoadService entityFromPayLoadService;
|
||||||
|
private final AvoirFonctionRepository avoirFonctionRepository;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StructurePaylaodWeb createStructure(StructurePaylaodWeb structurePaylaodWeb) throws BadRequestException {
|
public StructurePaylaodWeb createStructure(StructurePaylaodWeb structurePaylaodWeb) throws BadRequestException {
|
||||||
@@ -89,5 +95,29 @@ public class StructureServiceImpl implements StructureService {
|
|||||||
return structureRepository.findStructureToDtoById(id);
|
return structureRepository.findStructureToDtoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Structure> getListStructureUserId(Long userId) {
|
||||||
|
List<AvoirFonction> avoirFonctions= avoirFonctionRepository.findAvoirFonctionByUser_Id(userId);
|
||||||
|
List<Structure> structures = new ArrayList<>();
|
||||||
|
avoirFonctions.stream()
|
||||||
|
.filter(af -> af.getDateFin() == null || af.getDateFin().isAfter(LocalDate.now()))
|
||||||
|
.forEach(avoirFonction -> {
|
||||||
|
if(avoirFonction.getFonction().getStructure()!=null){
|
||||||
|
structures.addAll(List.of(avoirFonction.getFonction().getStructure()));
|
||||||
|
}else if (avoirFonction.getFonction().getDepartement()!=null){
|
||||||
|
structures.addAll(structureRepository.findDistinctByCommune_Departement_Id(avoirFonction.getFonction().getDepartement().getId()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return structures;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// public List<Long> getStructureIdListForUser(Long userId) {
|
||||||
|
// List<Structure> structures = secteurService.getListSecteurUserId(userId);
|
||||||
|
// List<Long> secteurIds = secteurs.stream()
|
||||||
|
// .map(Secteur::getId)
|
||||||
|
// .toList();
|
||||||
|
// return secteurIds;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ public class CaracteristiqueBatimentServiceImpl implements CaracteristiqueBatime
|
|||||||
return caracteristiqueBatimentRepository.findAllCaracteristiqueBatimentToDto();
|
return caracteristiqueBatimentRepository.findAllCaracteristiqueBatimentToDto();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentToDto(Long id) {
|
public Optional<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentToDto(Long id) {
|
||||||
if (caracteristiqueBatimentRepository.existsById(id)) {
|
if (caracteristiqueBatimentRepository.existsById(id)) {
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
package io.gmss.fiscad.implementations.rfu.metier;
|
package io.gmss.fiscad.implementations.rfu.metier;
|
||||||
|
|
||||||
|
import io.gmss.fiscad.entities.infocad.parametre.Structure;
|
||||||
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
|
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
|
||||||
import io.gmss.fiscad.enums.StatusAvis;
|
import io.gmss.fiscad.enums.StatusAvis;
|
||||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
import io.gmss.fiscad.exceptions.BadRequestException;
|
||||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
import io.gmss.fiscad.exceptions.NotFoundException;
|
||||||
|
import io.gmss.fiscad.interfaces.infocad.parametre.StructureService;
|
||||||
import io.gmss.fiscad.interfaces.rfu.metier.ImpositionsTfuService;
|
import io.gmss.fiscad.interfaces.rfu.metier.ImpositionsTfuService;
|
||||||
|
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository;
|
import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository;
|
||||||
|
import io.gmss.fiscad.service.EntityFromPayLoadService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -13,63 +18,79 @@ import org.springframework.stereotype.Service;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
@AllArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
public class ImpositionsTfuServiceImpl implements ImpositionsTfuService {
|
public class ImpositionsTfuServiceImpl implements ImpositionsTfuService {
|
||||||
|
|
||||||
private final ImpositionsTfuRepository impositionsTfuRepository;
|
private final ImpositionsTfuRepository impositionsTfuRepository;
|
||||||
|
private final StructureService structureService;
|
||||||
|
private final EntityFromPayLoadService entityFromPayLoadService;
|
||||||
|
|
||||||
public ImpositionsTfuServiceImpl(ImpositionsTfuRepository impositionsTfuRepository) {
|
|
||||||
this.impositionsTfuRepository = impositionsTfuRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de créer pour un centre la synthèse de l'imposition de l'année en prélude de la
|
||||||
|
* génération des avis d'imposition : 1- cloture de enquete et creation de imposition tfu
|
||||||
|
* @param impositionsTfuPaylaodWeb
|
||||||
|
* @return
|
||||||
|
* @throws BadRequestException
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ImpositionsTfu createImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException {
|
public ImpositionsTfuPaylaodWeb createImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException {
|
||||||
if (impositionsTfu.getId() != null) {
|
if (impositionsTfuPaylaodWeb.getId() != null) {
|
||||||
throw new BadRequestException("Impossible de créer une nouvelle unité de logement ayant un id non null.");
|
throw new BadRequestException("Impossible de créer une nouvelle unité de logement ayant un id non null.");
|
||||||
}
|
}
|
||||||
List<ImpositionsTfu> impositionsTfus=impositionsTfuRepository.getImpositionsTfuByCommuneAndExercice(impositionsTfu.getCommune().getCode(),impositionsTfu.getExercice().getAnnee());
|
List<ImpositionsTfu> impositionsTfus=impositionsTfuRepository.getImpositionsTfuByStructureAndExercice(impositionsTfuPaylaodWeb.getStructureId(),impositionsTfuPaylaodWeb.getExerciceId());
|
||||||
if (!impositionsTfus.isEmpty()) {
|
if (!impositionsTfus.isEmpty()) {
|
||||||
throw new BadRequestException("Une Imposition non annulée existe déjà");
|
throw new BadRequestException("Une Imposition non annulée existe déjà");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImpositionsTfu impositionsTfu=entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
||||||
impositionsTfu.setStatusAvis(StatusAvis.CREE);
|
impositionsTfu.setStatusAvis(StatusAvis.CREE);
|
||||||
impositionsTfu.setDateGeneration(LocalDate.now());
|
|
||||||
return impositionsTfuRepository.save(impositionsTfu);
|
//TODO : cloture des enquetes
|
||||||
|
|
||||||
|
|
||||||
|
impositionsTfu =impositionsTfuRepository.save(impositionsTfu);
|
||||||
|
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ImpositionsTfu annulerImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException {
|
public ImpositionsTfuPaylaodWeb annulerImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException {
|
||||||
if (impositionsTfu.getId() == null) {
|
if (impositionsTfuPaylaodWeb.getId() == null) {
|
||||||
throw new BadRequestException("Impossible d'annuler une imposition ayant un id null.");
|
throw new BadRequestException("Impossible d'annuler une imposition ayant un id null.");
|
||||||
}
|
}
|
||||||
if (!impositionsTfuRepository.existsById(impositionsTfu.getId())) {
|
if (!impositionsTfuRepository.existsById(impositionsTfuPaylaodWeb.getId())) {
|
||||||
throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données.");
|
throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données.");
|
||||||
}
|
}
|
||||||
|
ImpositionsTfu impositionsTfu= entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
||||||
impositionsTfu.setStatusAvis(StatusAvis.ANNULE);
|
impositionsTfu.setStatusAvis(StatusAvis.ANNULE);
|
||||||
return impositionsTfuRepository.save(impositionsTfu);
|
impositionsTfu =impositionsTfuRepository.save(impositionsTfu);
|
||||||
|
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ImpositionsTfu validerImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException {
|
public ImpositionsTfuPaylaodWeb validerImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException {
|
||||||
if (impositionsTfu.getId() == null) {
|
if (impositionsTfuPaylaodWeb.getId() == null) {
|
||||||
throw new BadRequestException("Impossible de valider une imposition ayant un id null.");
|
throw new BadRequestException("Impossible de valider une imposition ayant un id null.");
|
||||||
}
|
}
|
||||||
if (!impositionsTfuRepository.existsById(impositionsTfu.getId())) {
|
if (!impositionsTfuRepository.existsById(impositionsTfuPaylaodWeb.getId())) {
|
||||||
throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données.");
|
throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données.");
|
||||||
}
|
}
|
||||||
|
ImpositionsTfu impositionsTfu= entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
||||||
impositionsTfu.setStatusAvis(StatusAvis.VALIDE);
|
impositionsTfu.setStatusAvis(StatusAvis.VALIDE);
|
||||||
return impositionsTfuRepository.save(impositionsTfu);
|
impositionsTfu =impositionsTfuRepository.save(impositionsTfu);
|
||||||
|
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ImpositionsTfu updateImpositionsTfu(Long id, ImpositionsTfu impositionsTfu) throws NotFoundException {
|
public ImpositionsTfuPaylaodWeb updateImpositionsTfu(Long id, ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws NotFoundException {
|
||||||
if (impositionsTfu.getId() == null) {
|
// if (impositionsTfu.getId() == null) {
|
||||||
throw new BadRequestException("Impossible de mettre à jour une nouvelle unité de logement ayant un id null.");
|
// throw new BadRequestException("Impossible de mettre à jour une nouvelle unité de logement ayant un id null.");
|
||||||
}
|
// }
|
||||||
if (!impositionsTfuRepository.existsById(impositionsTfu.getId())) {
|
// if (!impositionsTfuRepository.existsById(impositionsTfu.getId())) {
|
||||||
throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données.");
|
// throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans notre base de données.");
|
||||||
}
|
// }
|
||||||
return impositionsTfuRepository.save(impositionsTfu);
|
return null; // impositionsTfuRepository.save(impositionsTfu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -101,4 +122,14 @@ public class ImpositionsTfuServiceImpl implements ImpositionsTfuService {
|
|||||||
throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans la base de données.");
|
throw new NotFoundException("Impossible de trouver la nouvelle unité de logement spécifiée dans la base de données.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ImpositionsTfuPaylaodWeb> getImpositionsTfuByUserIdIds(Long userId) {
|
||||||
|
List<Structure> structures = structureService.getListStructureUserId(userId);
|
||||||
|
List<Long> structureIds = structures.stream()
|
||||||
|
.map(Structure::getId)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
return impositionsTfuRepository.findByStructureIdsToDto(structureIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package io.gmss.fiscad.implementations.rfu.parametre;
|
||||||
|
|
||||||
|
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
|
||||||
|
import io.gmss.fiscad.exceptions.BadRequestException;
|
||||||
|
import io.gmss.fiscad.exceptions.NotFoundException;
|
||||||
|
import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuBatiService;
|
||||||
|
import io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb;
|
||||||
|
import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuRepository;
|
||||||
|
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 BaremRfuBatiServiceImpl implements BaremRfuBatiService {
|
||||||
|
private final BaremRfuRepository baremRfuRepository;
|
||||||
|
private final EntityFromPayLoadService entityFromPayLoadService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaremRfuBatiPayloadWeb createBaremRfu(BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) throws BadRequestException {
|
||||||
|
if (baremRfuBatiPayloadWeb.getId() != null) {
|
||||||
|
throw new BadRequestException("Impossible de créer un nouvel bareme rfu ayant un id non null.");
|
||||||
|
}
|
||||||
|
BaremRfuBati baremRfuBati = entityFromPayLoadService.getBaremRfuBatiFromPayLoadWeb(baremRfuBatiPayloadWeb);
|
||||||
|
baremRfuBati = baremRfuRepository.save(baremRfuBati);
|
||||||
|
return baremRfuRepository.findByBaremRfuBatieId(baremRfuBati.getId()).orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaremRfuBatiPayloadWeb updateBaremRfu(Long id, BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) throws NotFoundException {
|
||||||
|
if (baremRfuBatiPayloadWeb.getId() == null) {
|
||||||
|
throw new BadRequestException("Impossible de mettre à jour une nouvel bareme rfu ayant un id null.");
|
||||||
|
}
|
||||||
|
if (!baremRfuRepository.existsById(baremRfuBatiPayloadWeb.getId())) {
|
||||||
|
throw new NotFoundException("Impossible de trouver le bareme spécifiée dans notre base de données.");
|
||||||
|
}
|
||||||
|
BaremRfuBati baremRfuBati = entityFromPayLoadService.getBaremRfuBatiFromPayLoadWeb(baremRfuBatiPayloadWeb);
|
||||||
|
baremRfuBati = baremRfuRepository.save(baremRfuBati);
|
||||||
|
return baremRfuRepository.findByBaremRfuBatieId(baremRfuBati.getId()).orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteBaremRfu(Long id) throws NotFoundException {
|
||||||
|
Optional<BaremRfuBati> baremRfuOptional = baremRfuRepository.findById(id);
|
||||||
|
if (baremRfuOptional.isPresent()) {
|
||||||
|
baremRfuRepository.deleteById(baremRfuOptional.get().getId());
|
||||||
|
} else {
|
||||||
|
throw new NotFoundException("Impossible de trouver le Bareme spécifié dans notre base de données.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<BaremRfuBatiPayloadWeb> getBaremRfuList(Pageable pageable) {
|
||||||
|
return baremRfuRepository.findAllPayloadPaged(pageable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BaremRfuBatiPayloadWeb> getBaremRfuList() {
|
||||||
|
return baremRfuRepository.findAllPayload();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BaremRfuBatiPayloadWeb> getBaremRfuByCategorieBatiment(Long idCategorieBatiment) {
|
||||||
|
return baremRfuRepository.findByCategorieBatiment(idCategorieBatiment);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BaremRfuBatiPayloadWeb> getBaremRfuByArrondissement(Long idArrondissement) {
|
||||||
|
return baremRfuRepository.findByArrondissementId(idArrondissement);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BaremRfuBatiPayloadWeb> getBaremRfuByArrondissementAndCategorieBatiment(Long IdArrondissement, Long IdCategorieBatiment) {
|
||||||
|
return baremRfuRepository.findByArrondissementAndCategorieBatiment(IdArrondissement,IdCategorieBatiment);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BaremRfuBatiPayloadWeb> getBaremRfuByQuartierAndCategorieBatiment(Long idQuartier, Long IdCategorieBatiment) {
|
||||||
|
return baremRfuRepository.findByQuartierAndCategorieBatiment(idQuartier,IdCategorieBatiment);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaremRfuBatiPayloadWeb getBaremRfuById(Long id) {
|
||||||
|
return baremRfuRepository.findByBaremRfuBatieId(id).orElse(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
package io.gmss.fiscad.implementations.rfu.parametre;
|
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
|
|
||||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
|
||||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
|
||||||
import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuService;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuRepository;
|
|
||||||
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;
|
|
||||||
@Service
|
|
||||||
public class BaremRfuServiceImpl implements BaremRfuService {
|
|
||||||
private final BaremRfuRepository baremRfuRepository;
|
|
||||||
|
|
||||||
public BaremRfuServiceImpl(BaremRfuRepository baremRfuRepository) {
|
|
||||||
this.baremRfuRepository = baremRfuRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BaremRfuBati createBaremRfu(BaremRfuBati baremRfuBati) throws BadRequestException {
|
|
||||||
if (baremRfuBati.getId() != null) {
|
|
||||||
throw new BadRequestException("Impossible de créer un nouvel bareme rfu ayant un id non null.");
|
|
||||||
}
|
|
||||||
return baremRfuRepository.save(baremRfuBati);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BaremRfuBati updateBaremRfu(Long id, BaremRfuBati baremRfuBati) throws NotFoundException {
|
|
||||||
if (baremRfuBati.getId() == null) {
|
|
||||||
throw new BadRequestException("Impossible de mettre à jour une nouvel bareme rfu ayant un id null.");
|
|
||||||
}
|
|
||||||
if (!baremRfuRepository.existsById(baremRfuBati.getId())) {
|
|
||||||
throw new NotFoundException("Impossible de trouver le bareme spécifiée dans notre base de données.");
|
|
||||||
}
|
|
||||||
return baremRfuRepository.save(baremRfuBati);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteBaremRfu(Long id) throws NotFoundException {
|
|
||||||
Optional<BaremRfuBati> baremRfuOptional = baremRfuRepository.findById(id);
|
|
||||||
if (baremRfuOptional.isPresent()) {
|
|
||||||
baremRfuRepository.deleteById(baremRfuOptional.get().getId());
|
|
||||||
} else {
|
|
||||||
throw new NotFoundException("Impossible de trouver le Bareme spécifié dans notre base de données.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<BaremRfuBati> getBaremRfuList(Pageable pageable) {
|
|
||||||
return baremRfuRepository.findAll(pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<BaremRfuBati> getBaremRfuList() {
|
|
||||||
return baremRfuRepository.findAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<BaremRfuBati> getBaremRfuByType(Long idCategorieBatiment) {
|
|
||||||
return baremRfuRepository.findAllByCategorieBatiment_Id(idCategorieBatiment);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<BaremRfuBati> getBaremRfuById(Long id) {
|
|
||||||
return baremRfuRepository.findById(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -32,4 +32,5 @@ public interface SecteurService {
|
|||||||
Optional<SecteurPaylaodWeb> getSecteurById(Long id);
|
Optional<SecteurPaylaodWeb> getSecteurById(Long id);
|
||||||
|
|
||||||
List<Secteur> getListSecteurUserId(Long userId) ;
|
List<Secteur> getListSecteurUserId(Long userId) ;
|
||||||
|
List<Secteur> getListSecteurByDepartementId(Long departementId) ;
|
||||||
}
|
}
|
||||||
@@ -58,5 +58,6 @@ public interface EnqueteService {
|
|||||||
|
|
||||||
public List<EnqueteNonSyncResponse> getEnqueteValideNonSynch(Long terminalId);
|
public List<EnqueteNonSyncResponse> getEnqueteValideNonSynch(Long terminalId);
|
||||||
|
|
||||||
|
int cloturerEnqueteParcelleBatimentUniteLogementByStructureId(Long strucutreId);
|
||||||
|
int cloturerEnqueteParcelleBatimentUniteLogementByUserId(Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,4 +35,5 @@ public interface ParcelleService {
|
|||||||
Page<ParcellePayLoadWeb> getParcelleListByRuePageableToDto(Long userId,Long rueId,Pageable pageable);
|
Page<ParcellePayLoadWeb> getParcelleListByRuePageableToDto(Long userId,Long rueId,Pageable pageable);
|
||||||
|
|
||||||
Page<ParcellePayLoadWeb> getParcelleByMultiFiltre(Long userId, FiltreParcelle filtreParcelle, Pageable pageable);
|
Page<ParcellePayLoadWeb> getParcelleByMultiFiltre(Long userId, FiltreParcelle filtreParcelle, Pageable pageable);
|
||||||
|
Integer majParcelleBatieNonbatie();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package io.gmss.fiscad.interfaces.infocad.parametre;
|
package io.gmss.fiscad.interfaces.infocad.parametre;
|
||||||
|
|
||||||
|
import io.gmss.fiscad.entities.decoupage.Secteur;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.Structure;
|
import io.gmss.fiscad.entities.infocad.parametre.Structure;
|
||||||
|
import io.gmss.fiscad.entities.user.AvoirFonction;
|
||||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
import io.gmss.fiscad.exceptions.BadRequestException;
|
||||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
import io.gmss.fiscad.exceptions.NotFoundException;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.StructurePaylaodWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.StructurePaylaodWeb;
|
||||||
@@ -8,6 +10,8 @@ import io.gmss.fiscad.paylaods.response.StructureResponse;
|
|||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@@ -31,4 +35,6 @@ public interface StructureService {
|
|||||||
//List<StructureResponse> getStructuresByArrondissement(Long arrondissementID);
|
//List<StructureResponse> getStructuresByArrondissement(Long arrondissementID);
|
||||||
|
|
||||||
|
|
||||||
|
public List<Structure> getListStructureUserId(Long userId) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package io.gmss.fiscad.interfaces.rfu.metier;
|
|||||||
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
|
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
|
||||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
import io.gmss.fiscad.exceptions.BadRequestException;
|
||||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
import io.gmss.fiscad.exceptions.NotFoundException;
|
||||||
|
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
@@ -11,11 +12,11 @@ import java.util.Optional;
|
|||||||
|
|
||||||
public interface ImpositionsTfuService {
|
public interface ImpositionsTfuService {
|
||||||
|
|
||||||
ImpositionsTfu createImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException;
|
ImpositionsTfuPaylaodWeb createImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException;
|
||||||
ImpositionsTfu annulerImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException;
|
ImpositionsTfuPaylaodWeb annulerImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException;
|
||||||
ImpositionsTfu validerImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException;
|
ImpositionsTfuPaylaodWeb validerImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException;
|
||||||
|
|
||||||
ImpositionsTfu updateImpositionsTfu(Long id, ImpositionsTfu impositionsTfu) throws NotFoundException;
|
ImpositionsTfuPaylaodWeb updateImpositionsTfu(Long id, ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws NotFoundException;
|
||||||
|
|
||||||
void deleteImpositionsTfu(Long id) throws NotFoundException;
|
void deleteImpositionsTfu(Long id) throws NotFoundException;
|
||||||
|
|
||||||
@@ -24,4 +25,5 @@ public interface ImpositionsTfuService {
|
|||||||
List<ImpositionsTfu> getImpositionsTfuList();
|
List<ImpositionsTfu> getImpositionsTfuList();
|
||||||
|
|
||||||
Optional<ImpositionsTfu> getImpositionsTfuById(Long id);
|
Optional<ImpositionsTfu> getImpositionsTfuById(Long id);
|
||||||
|
List<ImpositionsTfuPaylaodWeb> getImpositionsTfuByUserIdIds(Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package io.gmss.fiscad.interfaces.rfu.parametre;
|
||||||
|
|
||||||
|
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
|
||||||
|
import io.gmss.fiscad.exceptions.BadRequestException;
|
||||||
|
import io.gmss.fiscad.exceptions.NotFoundException;
|
||||||
|
import io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
public interface BaremRfuBatiService {
|
||||||
|
|
||||||
|
BaremRfuBatiPayloadWeb createBaremRfu(BaremRfuBatiPayloadWeb baremRfuBati) throws BadRequestException;
|
||||||
|
|
||||||
|
BaremRfuBatiPayloadWeb updateBaremRfu(Long id, BaremRfuBatiPayloadWeb baremRfuBati) throws NotFoundException;
|
||||||
|
|
||||||
|
void deleteBaremRfu(Long id) throws NotFoundException;
|
||||||
|
|
||||||
|
Page<BaremRfuBatiPayloadWeb> getBaremRfuList(Pageable pageable);
|
||||||
|
|
||||||
|
List<BaremRfuBatiPayloadWeb> getBaremRfuList();
|
||||||
|
|
||||||
|
List<BaremRfuBatiPayloadWeb> getBaremRfuByCategorieBatiment(Long IdCategorieBatiment);
|
||||||
|
List<BaremRfuBatiPayloadWeb> getBaremRfuByArrondissement(Long IdArrondissement);
|
||||||
|
List<BaremRfuBatiPayloadWeb> getBaremRfuByArrondissementAndCategorieBatiment(Long IdArrondissement,Long IdCategorieBatiment);
|
||||||
|
List<BaremRfuBatiPayloadWeb> getBaremRfuByQuartierAndCategorieBatiment(Long idQuartier,Long IdCategorieBatiment);
|
||||||
|
|
||||||
|
BaremRfuBatiPayloadWeb getBaremRfuById(Long id);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
package io.gmss.fiscad.interfaces.rfu.parametre;
|
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
|
|
||||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
|
||||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
|
||||||
import org.springframework.data.domain.Page;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public interface BaremRfuService {
|
|
||||||
|
|
||||||
BaremRfuBati createBaremRfu(BaremRfuBati baremRfuBati) throws BadRequestException;
|
|
||||||
|
|
||||||
BaremRfuBati updateBaremRfu(Long id, BaremRfuBati baremRfuBati) throws NotFoundException;
|
|
||||||
|
|
||||||
void deleteBaremRfu(Long id) throws NotFoundException;
|
|
||||||
|
|
||||||
Page<BaremRfuBati> getBaremRfuList(Pageable pageable);
|
|
||||||
|
|
||||||
List<BaremRfuBati> getBaremRfuList();
|
|
||||||
|
|
||||||
List<BaremRfuBati> getBaremRfuByType(Long IdCategorieBatiment);
|
|
||||||
|
|
||||||
Optional<BaremRfuBati> getBaremRfuById(Long id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package io.gmss.fiscad.paylaods.request.crudweb;
|
||||||
|
|
||||||
|
import io.gmss.fiscad.entities.decoupage.Arrondissement;
|
||||||
|
import io.gmss.fiscad.entities.rfu.parametre.CategorieBatiment;
|
||||||
|
import jakarta.persistence.ManyToOne;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class BaremRfuBatiPayloadWeb {
|
||||||
|
private Long id;
|
||||||
|
private Long valeurLocative;
|
||||||
|
private Double tfuMetreCarre;
|
||||||
|
private Long tfuMinimum;
|
||||||
|
private Long categorieBatimentId;
|
||||||
|
private String categorieBatimentNom;
|
||||||
|
private String categorieBatimentStanding;
|
||||||
|
private Long arrondissementId;
|
||||||
|
private String arrondissementCode;
|
||||||
|
private String arrondissementNom;
|
||||||
|
|
||||||
|
private Long quartierId;
|
||||||
|
private String quartierCode;
|
||||||
|
private String quartierNom;
|
||||||
|
|
||||||
|
public BaremRfuBatiPayloadWeb(Long id, Long valeurLocative, Double tfuMetreCarre, Long tfuMinimum, Long categorieBatimentId, String categorieBatimentNom, String categorieBatimentStanding, Long arrondissementId, String arrondissementCode, String arrondissementNom,
|
||||||
|
Long quartierId,
|
||||||
|
String quartierCode,
|
||||||
|
String quartierNom ) {
|
||||||
|
this.id = id;
|
||||||
|
this.valeurLocative = valeurLocative;
|
||||||
|
this.tfuMetreCarre = tfuMetreCarre;
|
||||||
|
this.tfuMinimum = tfuMinimum;
|
||||||
|
this.categorieBatimentId = categorieBatimentId;
|
||||||
|
this.categorieBatimentNom = categorieBatimentNom;
|
||||||
|
this.categorieBatimentStanding = categorieBatimentStanding;
|
||||||
|
this.arrondissementId = arrondissementId;
|
||||||
|
this.arrondissementCode = arrondissementCode;
|
||||||
|
this.arrondissementNom = arrondissementNom;
|
||||||
|
this.quartierId = quartierId;
|
||||||
|
this.quartierCode = quartierCode;
|
||||||
|
this.quartierNom = quartierNom;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package io.gmss.fiscad.paylaods.request.crudweb;
|
||||||
|
|
||||||
|
import io.gmss.fiscad.entities.decoupage.Commune;
|
||||||
|
import io.gmss.fiscad.entities.rfu.parametre.ZoneRfu;
|
||||||
|
import jakarta.persistence.ManyToOne;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class BaremRfuNonBatiPayloadWeb {
|
||||||
|
private Long id;
|
||||||
|
private Long valeurAdministrative;
|
||||||
|
private float taux;
|
||||||
|
private Long communeId;
|
||||||
|
private String communeCode;
|
||||||
|
private String communeNom;
|
||||||
|
private Long zoneRfu;
|
||||||
|
private String zoneRfuCode;
|
||||||
|
private String zoneRfuNom;
|
||||||
|
|
||||||
|
public BaremRfuNonBatiPayloadWeb(Long id, Long valeurAdministrative, float taux, Long communeId, String communeCode, String communeNom, Long zoneRfu, String zoneRfuCode, String zoneRfuNom) {
|
||||||
|
this.id = id;
|
||||||
|
this.valeurAdministrative = valeurAdministrative;
|
||||||
|
this.taux = taux;
|
||||||
|
this.communeId = communeId;
|
||||||
|
this.communeCode = communeCode;
|
||||||
|
this.communeNom = communeNom;
|
||||||
|
this.zoneRfu = zoneRfu;
|
||||||
|
this.zoneRfuCode = zoneRfuCode;
|
||||||
|
this.zoneRfuNom = zoneRfuNom;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package io.gmss.fiscad.paylaods.request.crudweb;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
|
||||||
|
import io.gmss.fiscad.entities.decoupage.Commune;
|
||||||
|
import io.gmss.fiscad.entities.infocad.parametre.Structure;
|
||||||
|
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
|
||||||
|
import io.gmss.fiscad.enums.StatusAvis;
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class ImpositionsTfuPaylaodWeb {
|
||||||
|
private Long id;
|
||||||
|
private LocalDate dateGeneration;
|
||||||
|
private LocalDate dateCloture;
|
||||||
|
private String referencePieceAdmin;
|
||||||
|
private String datePieceAdmin;
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private StatusAvis statusAvis;
|
||||||
|
private Long nombreAvis;
|
||||||
|
@Column(columnDefinition = "TEXT")
|
||||||
|
private String motif;
|
||||||
|
private Long exerciceId;
|
||||||
|
private Integer exerciceAnnee;
|
||||||
|
private Long communeId;
|
||||||
|
private String communeCode;
|
||||||
|
private String communeNom;
|
||||||
|
private Long structureId ;
|
||||||
|
private String structureNom ;
|
||||||
|
|
||||||
|
public ImpositionsTfuPaylaodWeb(Long id, LocalDate dateGeneration, LocalDate dateCloture, String referencePieceAdmin, String datePieceAdmin, StatusAvis statusAvis, Long nombreAvis, String motif, Long exerciceId, Integer exerciceAnnee, Long communeId, String communeCode, String communeNom, Long structureId, String structureNom) {
|
||||||
|
this.id = id;
|
||||||
|
this.dateGeneration = dateGeneration;
|
||||||
|
this.dateCloture = dateCloture;
|
||||||
|
this.referencePieceAdmin = referencePieceAdmin;
|
||||||
|
this.datePieceAdmin = datePieceAdmin;
|
||||||
|
this.statusAvis = statusAvis;
|
||||||
|
this.nombreAvis = nombreAvis;
|
||||||
|
this.motif = motif;
|
||||||
|
this.exerciceId = exerciceId;
|
||||||
|
this.exerciceAnnee = exerciceAnnee;
|
||||||
|
this.communeId = communeId;
|
||||||
|
this.communeCode = communeCode;
|
||||||
|
this.communeNom = communeNom;
|
||||||
|
this.structureId = structureId;
|
||||||
|
this.structureNom = structureNom;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -186,5 +186,19 @@ public interface SecteurRepository extends JpaRepository<Secteur, Long> {
|
|||||||
Optional<SecteurPaylaodWeb> findSecteurToDtoById(@Param("idSecteur") Long idSecteur);
|
Optional<SecteurPaylaodWeb> findSecteurToDtoById(@Param("idSecteur") Long idSecteur);
|
||||||
|
|
||||||
|
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.entities.decoupage.Secteur(
|
||||||
|
sec.id,
|
||||||
|
sec.code,
|
||||||
|
sec.nom,
|
||||||
|
secti
|
||||||
|
)
|
||||||
|
FROM Secteur sec
|
||||||
|
LEFT JOIN sec.section secti
|
||||||
|
LEFT JOIN secti.structure st
|
||||||
|
LEFT JOIN st.commune com
|
||||||
|
LEFT JOIN com.departement dep
|
||||||
|
WHERE dep.id = :idDepartement
|
||||||
|
""")
|
||||||
|
List<Secteur> findSectionsByDepartement(@Param("idDepartement") Long idDepartement);
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,7 @@ import io.gmss.fiscad.paylaods.response.synchronisation.EnqueteNonSyncResponse;
|
|||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
import org.springframework.data.repository.query.Param;
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
@@ -22,6 +23,25 @@ import java.util.Optional;
|
|||||||
public interface EnqueteRepository extends JpaRepository<Enquete, Long> {
|
public interface EnqueteRepository extends JpaRepository<Enquete, Long> {
|
||||||
Optional<Enquete> findFirstByCodeParcelle(String codeParcelle);
|
Optional<Enquete> findFirstByCodeParcelle(String codeParcelle);
|
||||||
Optional<Enquete> findByMobileDataId(Long id);
|
Optional<Enquete> findByMobileDataId(Long id);
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("""
|
||||||
|
UPDATE Enquete e
|
||||||
|
SET e.statutEnquete = 'CLOTURE'
|
||||||
|
WHERE EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM Parcelle p
|
||||||
|
JOIN p.quartier q
|
||||||
|
JOIN SecteurDecoupage cd on cd.quartier.id=q.id
|
||||||
|
JOIN cd.secteur s
|
||||||
|
JOIN s.section sect
|
||||||
|
JOIN sect.structure stru
|
||||||
|
WHERE e.parcelle.id=p.id
|
||||||
|
AND stru.id= :structureId
|
||||||
|
)
|
||||||
|
""")
|
||||||
|
Integer clotureEnqueteParcelle(@Param("structureId") Long structureId);
|
||||||
|
|
||||||
@Query(value = "select distinct " +
|
@Query(value = "select distinct " +
|
||||||
" e.id," +
|
" e.id," +
|
||||||
" e.parcelle_id as parcelleId," +
|
" e.parcelle_id as parcelleId," +
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import org.springframework.data.domain.Page;
|
|||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
import org.springframework.data.repository.query.Param;
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
@@ -20,6 +21,32 @@ import java.util.Optional;
|
|||||||
public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSpecificationExecutor<Parcelle>, ParcelleRepositoryCustom {
|
public interface ParcelleRepository extends JpaRepository<Parcelle, Long>, JpaSpecificationExecutor<Parcelle>, ParcelleRepositoryCustom {
|
||||||
Optional<Parcelle> findFirstByExternalKeyAndTerminal_Id(Long externalKey, Long TerminalId);
|
Optional<Parcelle> findFirstByExternalKeyAndTerminal_Id(Long externalKey, Long TerminalId);
|
||||||
Optional<Parcelle> findByMobileDataId(Long id);
|
Optional<Parcelle> findByMobileDataId(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("""
|
||||||
|
UPDATE Parcelle p
|
||||||
|
SET p.batie = TRUE
|
||||||
|
WHERE EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM Batiment b
|
||||||
|
WHERE b.parcelle.id = p.id
|
||||||
|
)
|
||||||
|
""")
|
||||||
|
Integer updateParcelleBatieTrue();
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("""
|
||||||
|
UPDATE Parcelle p
|
||||||
|
SET p.batie = FALSE
|
||||||
|
WHERE NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM Batiment b
|
||||||
|
WHERE b.parcelle.id = p.id
|
||||||
|
)
|
||||||
|
""")
|
||||||
|
Integer updateParcelleBatieFalse();
|
||||||
|
|
||||||
@Query(value = "Select " +
|
@Query(value = "Select " +
|
||||||
" p.id as idBackend, " +
|
" p.id as idBackend, " +
|
||||||
" p.external_key as externalKey, " +
|
" p.external_key as externalKey, " +
|
||||||
|
|||||||
@@ -174,4 +174,6 @@ public interface StructureRepository extends JpaRepository<Structure, Long> {
|
|||||||
""")
|
""")
|
||||||
Page<StructurePaylaodWeb> findAllStructureByCommuneToDtoPageable(@Param("communeId") Long communeId, Pageable pageable);
|
Page<StructurePaylaodWeb> findAllStructureByCommuneToDtoPageable(@Param("communeId") Long communeId, Pageable pageable);
|
||||||
|
|
||||||
|
|
||||||
|
List<Structure> findDistinctByCommune_Departement_Id(Long departementId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,9 +60,9 @@ public interface CaracteristiqueBatimentRepository extends JpaRepository<Caracte
|
|||||||
ca.typeCaracteristique.libelle
|
ca.typeCaracteristique.libelle
|
||||||
)
|
)
|
||||||
FROM CaracteristiqueBatiment cb
|
FROM CaracteristiqueBatiment cb
|
||||||
JOIN cb.caracteristique ca
|
LEFT JOIN cb.caracteristique ca
|
||||||
JOIN cb.enqueteBatiment eb
|
LEFT JOIN cb.enqueteBatiment eb
|
||||||
JOIN eb.exercice ex
|
LEFT JOIN eb.exercice ex
|
||||||
WHERE cb.id = :caracteristiqueBatimentId
|
WHERE cb.id = :caracteristiqueBatimentId
|
||||||
""")
|
""")
|
||||||
Optional<CaracteristiqueBatimentPayloadWeb> findCaracteristiqueBatimentToDto(@Param("caracteristiqueBatimentId") Long caracteristiqueBatimentId);
|
Optional<CaracteristiqueBatimentPayloadWeb> findCaracteristiqueBatimentToDto(@Param("caracteristiqueBatimentId") Long caracteristiqueBatimentId);
|
||||||
@@ -126,7 +126,6 @@ public interface CaracteristiqueBatimentRepository extends JpaRepository<Caracte
|
|||||||
JOIN cb.caracteristique ca
|
JOIN cb.caracteristique ca
|
||||||
JOIN cb.enqueteBatiment eb
|
JOIN cb.enqueteBatiment eb
|
||||||
JOIN eb.exercice ex
|
JOIN eb.exercice ex
|
||||||
WHERE eb.id = :enqueteBatimentId
|
|
||||||
""",
|
""",
|
||||||
countQuery = """
|
countQuery = """
|
||||||
SELECT COUNT(distinct cb)
|
SELECT COUNT(distinct cb)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import io.gmss.fiscad.paylaods.response.restoration.EnqueteBatimentPayLoadRestor
|
|||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
import org.springframework.data.repository.query.Param;
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
@@ -19,6 +20,25 @@ public interface EnqueteBatimentRepository extends JpaRepository<EnqueteBatiment
|
|||||||
|
|
||||||
//List<EnqueteBatiment> findAllByEnquete_Id(Long enqueteId);
|
//List<EnqueteBatiment> findAllByEnquete_Id(Long enqueteId);
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("""
|
||||||
|
UPDATE EnqueteBatiment eb
|
||||||
|
SET eb.statutEnquete = 'CLOTURE'
|
||||||
|
WHERE EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM Parcelle p
|
||||||
|
JOIN p.quartier q
|
||||||
|
JOIN SecteurDecoupage cd on cd.quartier.id=q.id
|
||||||
|
JOIN cd.secteur s
|
||||||
|
JOIN s.section sect
|
||||||
|
JOIN sect.structure stru
|
||||||
|
WHERE eb.batiment.parcelle.id=p.id
|
||||||
|
AND stru.id= :structureId
|
||||||
|
)
|
||||||
|
""")
|
||||||
|
Integer clotureEnqueteBatiment(@Param("structureId") Long structureId);
|
||||||
|
|
||||||
|
|
||||||
@Query(
|
@Query(
|
||||||
nativeQuery = true,
|
nativeQuery = true,
|
||||||
value = "select eb.id as idBackend, " +
|
value = "select eb.id as idBackend, " +
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import io.gmss.fiscad.paylaods.response.restoration.EnqueteUniteLogementPayLoadR
|
|||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
import org.springframework.data.repository.query.Param;
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
@@ -18,7 +19,23 @@ public interface EnqueteUniteLogementRepository extends JpaRepository<EnqueteUni
|
|||||||
Optional<EnqueteUniteLogement> findByMobileDataId(Long id);
|
Optional<EnqueteUniteLogement> findByMobileDataId(Long id);
|
||||||
|
|
||||||
//List<EnqueteUniteLogement> findAllByEnquete_Id(Long id);
|
//List<EnqueteUniteLogement> findAllByEnquete_Id(Long id);
|
||||||
|
@Modifying
|
||||||
|
@Query("""
|
||||||
|
UPDATE EnqueteUniteLogement eul
|
||||||
|
SET eul.statutEnquete = 'CLOTURE'
|
||||||
|
WHERE EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM Parcelle p
|
||||||
|
JOIN p.quartier q
|
||||||
|
JOIN SecteurDecoupage cd on cd.quartier.id=q.id
|
||||||
|
JOIN cd.secteur s
|
||||||
|
JOIN s.section sect
|
||||||
|
JOIN sect.structure stru
|
||||||
|
WHERE eul.uniteLogement.batiment.parcelle.id=p.id
|
||||||
|
AND stru.id= :structureId
|
||||||
|
)
|
||||||
|
""")
|
||||||
|
Integer clotureEnqueteUniteLogement(@Param("structureId") Long structureId);
|
||||||
@Query(nativeQuery = true,
|
@Query(nativeQuery = true,
|
||||||
value = "select eul.id as idBackend, " +
|
value = "select eul.id as idBackend, " +
|
||||||
"eul.terminal_id as terminalId, " +
|
"eul.terminal_id as terminalId, " +
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
package io.gmss.fiscad.persistence.repositories.rfu.metier;
|
package io.gmss.fiscad.persistence.repositories.rfu.metier;
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
|
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
|
||||||
|
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
|
||||||
|
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.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -19,4 +23,156 @@ public interface ImpositionsTfuRepository extends JpaRepository<ImpositionsTfu,
|
|||||||
" and c.code= ?1 and e.annee = ?2 " +
|
" and c.code= ?1 and e.annee = ?2 " +
|
||||||
" and i.deleted is false ", nativeQuery = true)
|
" and i.deleted is false ", nativeQuery = true)
|
||||||
List<ImpositionsTfu> getImpositionsTfuByCommuneAndExercice(String codeCommnune,int annee);
|
List<ImpositionsTfu> getImpositionsTfuByCommuneAndExercice(String codeCommnune,int annee);
|
||||||
|
|
||||||
|
@Query(value = "select i.* " +
|
||||||
|
" from impositions_tfu i " +
|
||||||
|
" inner join commune c on c.id=i.commune_id" +
|
||||||
|
" inner join exercice e on e.id=i.exercice_id" +
|
||||||
|
" inner join structure s on s.id=i.structure_id" +
|
||||||
|
" where status_avis in ('VALIDE','CREE','GENERE') " +
|
||||||
|
" and s.id= ?1 and e.id = ?2 " +
|
||||||
|
" and i.deleted is false ", nativeQuery = true)
|
||||||
|
List<ImpositionsTfu> getImpositionsTfuByStructureAndExercice(Long structureId,Long exerciceId);
|
||||||
|
|
||||||
|
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb(
|
||||||
|
i.id,
|
||||||
|
i.dateGeneration,
|
||||||
|
i.dateCloture,
|
||||||
|
i.referencePieceAdmin,
|
||||||
|
i.datePieceAdmin,
|
||||||
|
i.statusAvis,
|
||||||
|
i.nombreAvis,
|
||||||
|
i.motif,
|
||||||
|
e.id,
|
||||||
|
e.annee,
|
||||||
|
c.id,
|
||||||
|
c.code,
|
||||||
|
c.nom,
|
||||||
|
s.id,
|
||||||
|
s.nom
|
||||||
|
)
|
||||||
|
FROM ImpositionsTfu i
|
||||||
|
LEFT JOIN i.exercice e
|
||||||
|
LEFT JOIN i.commune c
|
||||||
|
LEFT JOIN i.structure s
|
||||||
|
WHERE i.id= :impositionId
|
||||||
|
""")
|
||||||
|
Optional<ImpositionsTfuPaylaodWeb> findByIdToDto(@Param("impositionId") Long impositionId);
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb(
|
||||||
|
i.id,
|
||||||
|
i.dateGeneration,
|
||||||
|
i.dateCloture,
|
||||||
|
i.referencePieceAdmin,
|
||||||
|
i.datePieceAdmin,
|
||||||
|
i.statusAvis,
|
||||||
|
i.nombreAvis,
|
||||||
|
i.motif,
|
||||||
|
e.id,
|
||||||
|
e.annee,
|
||||||
|
c.id,
|
||||||
|
c.code,
|
||||||
|
c.nom,
|
||||||
|
s.id,
|
||||||
|
s.nom
|
||||||
|
)
|
||||||
|
FROM ImpositionsTfu i
|
||||||
|
LEFT JOIN i.exercice e
|
||||||
|
LEFT JOIN i.commune c
|
||||||
|
LEFT JOIN i.structure s
|
||||||
|
""")
|
||||||
|
List<ImpositionsTfuPaylaodWeb> findAllPayloadToDto();
|
||||||
|
|
||||||
|
|
||||||
|
@Query(
|
||||||
|
value = """
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb(
|
||||||
|
i.id,
|
||||||
|
i.dateGeneration,
|
||||||
|
i.dateCloture,
|
||||||
|
i.referencePieceAdmin,
|
||||||
|
i.datePieceAdmin,
|
||||||
|
i.statusAvis,
|
||||||
|
i.nombreAvis,
|
||||||
|
i.motif,
|
||||||
|
e.id,
|
||||||
|
e.annee,
|
||||||
|
c.id,
|
||||||
|
c.code,
|
||||||
|
c.nom,
|
||||||
|
s.id,
|
||||||
|
s.nom
|
||||||
|
)
|
||||||
|
FROM ImpositionsTfu i
|
||||||
|
LEFT JOIN i.exercice e
|
||||||
|
LEFT JOIN i.commune c
|
||||||
|
LEFT JOIN i.structure s
|
||||||
|
""",
|
||||||
|
countQuery = """
|
||||||
|
SELECT COUNT(i)
|
||||||
|
FROM ImpositionsTfu i
|
||||||
|
LEFT JOIN i.exercice e
|
||||||
|
LEFT JOIN i.commune c
|
||||||
|
LEFT JOIN i.structure s
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
Page<ImpositionsTfuPaylaodWeb> findAllPayloadToDto(Pageable pageable);
|
||||||
|
|
||||||
|
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb(
|
||||||
|
i.id,
|
||||||
|
i.dateGeneration,
|
||||||
|
i.dateCloture,
|
||||||
|
i.referencePieceAdmin,
|
||||||
|
i.datePieceAdmin,
|
||||||
|
i.statusAvis,
|
||||||
|
i.nombreAvis,
|
||||||
|
i.motif,
|
||||||
|
e.id,
|
||||||
|
e.annee,
|
||||||
|
c.id,
|
||||||
|
c.code,
|
||||||
|
c.nom,
|
||||||
|
s.id,
|
||||||
|
s.nom
|
||||||
|
)
|
||||||
|
FROM ImpositionsTfu i
|
||||||
|
LEFT JOIN i.exercice e
|
||||||
|
LEFT JOIN i.commune c
|
||||||
|
LEFT JOIN i.structure s
|
||||||
|
WHERE s.id in(:structureIds)
|
||||||
|
""")
|
||||||
|
List<ImpositionsTfuPaylaodWeb> findByStructureIdsToDto(@Param("structureIds") List<Long> structureIds);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb(
|
||||||
|
i.id,
|
||||||
|
i.dateGeneration,
|
||||||
|
i.dateCloture,
|
||||||
|
i.referencePieceAdmin,
|
||||||
|
i.datePieceAdmin,
|
||||||
|
i.statusAvis,
|
||||||
|
i.nombreAvis,
|
||||||
|
i.motif,
|
||||||
|
e.id,
|
||||||
|
e.annee,
|
||||||
|
c.id,
|
||||||
|
c.code,
|
||||||
|
c.nom,
|
||||||
|
s.id,
|
||||||
|
s.nom
|
||||||
|
)
|
||||||
|
FROM ImpositionsTfu i
|
||||||
|
LEFT JOIN i.exercice e
|
||||||
|
LEFT JOIN i.commune c
|
||||||
|
LEFT JOIN i.structure s
|
||||||
|
LEFT JOIN c.departement d
|
||||||
|
WHERE d.id= :departementId
|
||||||
|
""")
|
||||||
|
List<ImpositionsTfuPaylaodWeb> findByDepartementIdToDto(@Param("departementId") Long departementId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,224 @@
|
|||||||
package io.gmss.fiscad.persistence.repositories.rfu.parametre;
|
package io.gmss.fiscad.persistence.repositories.rfu.parametre;
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
|
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuBati;
|
||||||
|
import io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb;
|
||||||
|
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.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public interface BaremRfuRepository extends JpaRepository<BaremRfuBati, Long> {
|
public interface BaremRfuRepository extends JpaRepository<BaremRfuBati, Long> {
|
||||||
List<BaremRfuBati> findAllByCategorieBatiment_Id(Long idCategorieBat);
|
/// List<BaremRfuBati> findAllByCategorieBatiment_Id(Long idCategorieBat);
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb(
|
||||||
|
b.id,
|
||||||
|
b.valeurLocative,
|
||||||
|
b.tfuMetreCarre,
|
||||||
|
b.tfuMinimum,
|
||||||
|
cb.id,
|
||||||
|
cb.nom,
|
||||||
|
cb.standing,
|
||||||
|
a.id,
|
||||||
|
a.code,
|
||||||
|
a.nom,
|
||||||
|
q.id,
|
||||||
|
q.code,
|
||||||
|
q.nom
|
||||||
|
)
|
||||||
|
FROM BaremRfuBati b
|
||||||
|
LEFT JOIN b.categorieBatiment cb
|
||||||
|
LEFT JOIN b.arrondissement a
|
||||||
|
LEFT JOIN b.quartier q
|
||||||
|
""")
|
||||||
|
Page<BaremRfuBatiPayloadWeb> findAllPayloadPaged(Pageable pageable);
|
||||||
|
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb(
|
||||||
|
b.id,
|
||||||
|
b.valeurLocative,
|
||||||
|
b.tfuMetreCarre,
|
||||||
|
b.tfuMinimum,
|
||||||
|
cb.id,
|
||||||
|
cb.nom,
|
||||||
|
cb.standing,
|
||||||
|
a.id,
|
||||||
|
a.code,
|
||||||
|
a.nom,
|
||||||
|
q.id,
|
||||||
|
q.code,
|
||||||
|
q.nom
|
||||||
|
)
|
||||||
|
FROM BaremRfuBati b
|
||||||
|
LEFT JOIN b.categorieBatiment cb
|
||||||
|
LEFT JOIN b.arrondissement a
|
||||||
|
LEFT JOIN b.quartier q
|
||||||
|
""")
|
||||||
|
List<BaremRfuBatiPayloadWeb> findAllPayload();
|
||||||
|
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb(
|
||||||
|
b.id,
|
||||||
|
b.valeurLocative,
|
||||||
|
b.tfuMetreCarre,
|
||||||
|
b.tfuMinimum,
|
||||||
|
cb.id,
|
||||||
|
cb.nom,
|
||||||
|
cb.standing,
|
||||||
|
a.id,
|
||||||
|
a.code,
|
||||||
|
a.nom,
|
||||||
|
q.id,
|
||||||
|
q.code,
|
||||||
|
q.nom
|
||||||
|
)
|
||||||
|
FROM BaremRfuBati b
|
||||||
|
LEFT JOIN b.categorieBatiment cb
|
||||||
|
LEFT JOIN b.arrondissement a
|
||||||
|
LEFT JOIN b.quartier q
|
||||||
|
WHERE a.id = :arrondissementId
|
||||||
|
""")
|
||||||
|
List<BaremRfuBatiPayloadWeb> findByArrondissementId(
|
||||||
|
@Param("arrondissementId") Long arrondissementId
|
||||||
|
);
|
||||||
|
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb(
|
||||||
|
b.id,
|
||||||
|
b.valeurLocative,
|
||||||
|
b.tfuMetreCarre,
|
||||||
|
b.tfuMinimum,
|
||||||
|
cb.id,
|
||||||
|
cb.nom,
|
||||||
|
cb.standing,
|
||||||
|
a.id,
|
||||||
|
a.code,
|
||||||
|
a.nom,
|
||||||
|
q.id,
|
||||||
|
q.code,
|
||||||
|
q.nom
|
||||||
|
)
|
||||||
|
FROM BaremRfuBati b
|
||||||
|
LEFT JOIN b.categorieBatiment cb
|
||||||
|
LEFT JOIN b.arrondissement a
|
||||||
|
LEFT JOIN b.quartier q
|
||||||
|
WHERE b.id = :baremRfuBatiId
|
||||||
|
""")
|
||||||
|
Optional<BaremRfuBatiPayloadWeb> findByBaremRfuBatieId(
|
||||||
|
@Param("baremRfuBatiId") Long id
|
||||||
|
);
|
||||||
|
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb(
|
||||||
|
b.id,
|
||||||
|
b.valeurLocative,
|
||||||
|
b.tfuMetreCarre,
|
||||||
|
b.tfuMinimum,
|
||||||
|
cb.id,
|
||||||
|
cb.nom,
|
||||||
|
cb.standing,
|
||||||
|
a.id,
|
||||||
|
a.code,
|
||||||
|
a.nom,
|
||||||
|
q.id,
|
||||||
|
q.code,
|
||||||
|
q.nom
|
||||||
|
)
|
||||||
|
FROM BaremRfuBati b
|
||||||
|
LEFT JOIN b.categorieBatiment cb
|
||||||
|
LEFT JOIN b.arrondissement a
|
||||||
|
LEFT JOIN b.quartier q
|
||||||
|
WHERE a.id = :arrondissementId
|
||||||
|
""")
|
||||||
|
Page<BaremRfuBatiPayloadWeb> findByArrondissementIdPaged(
|
||||||
|
@Param("arrondissementId") Long arrondissementId,
|
||||||
|
Pageable pageable
|
||||||
|
);
|
||||||
|
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb(
|
||||||
|
b.id,
|
||||||
|
b.valeurLocative,
|
||||||
|
b.tfuMetreCarre,
|
||||||
|
b.tfuMinimum,
|
||||||
|
cb.id,
|
||||||
|
cb.nom,
|
||||||
|
cb.standing,
|
||||||
|
a.id,
|
||||||
|
a.code,
|
||||||
|
a.nom,
|
||||||
|
q.id,
|
||||||
|
q.code,
|
||||||
|
q.nom
|
||||||
|
)
|
||||||
|
FROM BaremRfuBati b
|
||||||
|
LEFT JOIN b.categorieBatiment cb
|
||||||
|
LEFT JOIN b.arrondissement a
|
||||||
|
LEFT JOIN b.quartier q
|
||||||
|
WHERE a.id = :arrondissementId
|
||||||
|
and cb.id = :categorieBatimentId
|
||||||
|
""")
|
||||||
|
List<BaremRfuBatiPayloadWeb> findByArrondissementAndCategorieBatiment(
|
||||||
|
@Param("arrondissementId") Long arrondissementId,
|
||||||
|
@Param("categorieBatimentId") Long categorieBatimentId
|
||||||
|
);
|
||||||
|
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb(
|
||||||
|
b.id,
|
||||||
|
b.valeurLocative,
|
||||||
|
b.tfuMetreCarre,
|
||||||
|
b.tfuMinimum,
|
||||||
|
cb.id,
|
||||||
|
cb.nom,
|
||||||
|
cb.standing,
|
||||||
|
a.id,
|
||||||
|
a.code,
|
||||||
|
a.nom,
|
||||||
|
q.id,
|
||||||
|
q.code,
|
||||||
|
q.nom
|
||||||
|
)
|
||||||
|
FROM BaremRfuBati b
|
||||||
|
LEFT JOIN b.categorieBatiment cb
|
||||||
|
LEFT JOIN b.arrondissement a
|
||||||
|
LEFT JOIN b.quartier q
|
||||||
|
WHERE cb.id = :categorieBatimentId
|
||||||
|
""")
|
||||||
|
List<BaremRfuBatiPayloadWeb> findByCategorieBatiment(
|
||||||
|
@Param("categorieBatimentId") Long categorieBatimentId
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.BaremRfuBatiPayloadWeb(
|
||||||
|
b.id,
|
||||||
|
b.valeurLocative,
|
||||||
|
b.tfuMetreCarre,
|
||||||
|
b.tfuMinimum,
|
||||||
|
cb.id,
|
||||||
|
cb.nom,
|
||||||
|
cb.standing,
|
||||||
|
a.id,
|
||||||
|
a.code,
|
||||||
|
a.nom,
|
||||||
|
q.id,
|
||||||
|
q.code,
|
||||||
|
q.nom
|
||||||
|
)
|
||||||
|
FROM BaremRfuBati b
|
||||||
|
LEFT JOIN b.categorieBatiment cb
|
||||||
|
LEFT JOIN b.arrondissement a
|
||||||
|
LEFT JOIN b.quartier q
|
||||||
|
WHERE cb.id = :categorieBatimentId
|
||||||
|
and q.id = :quartierId
|
||||||
|
""")
|
||||||
|
List<BaremRfuBatiPayloadWeb> findByQuartierAndCategorieBatiment(
|
||||||
|
@Param("quartierId") Long quartierId,
|
||||||
|
@Param("categorieBatimentId") Long categorieBatimentId
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.gmss.fiscad.service;
|
package io.gmss.fiscad.service;
|
||||||
|
|
||||||
|
import io.gmss.fiscad.controllers.rfu.metier.ImpositionsTfuController;
|
||||||
import io.gmss.fiscad.entities.decoupage.*;
|
import io.gmss.fiscad.entities.decoupage.*;
|
||||||
import io.gmss.fiscad.entities.infocad.metier.Enquete;
|
import io.gmss.fiscad.entities.infocad.metier.Enquete;
|
||||||
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
|
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
|
||||||
@@ -23,6 +24,7 @@ import io.gmss.fiscad.persistence.repositories.infocad.metier.PieceRepository;
|
|||||||
import io.gmss.fiscad.persistence.repositories.infocad.metier.UploadRepository;
|
import io.gmss.fiscad.persistence.repositories.infocad.metier.UploadRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.parametre.*;
|
import io.gmss.fiscad.persistence.repositories.infocad.parametre.*;
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.*;
|
import io.gmss.fiscad.persistence.repositories.rfu.metier.*;
|
||||||
|
import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.parametre.CaracteristiqueRepository;
|
import io.gmss.fiscad.persistence.repositories.rfu.parametre.CaracteristiqueRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.parametre.ExerciceRepository;
|
import io.gmss.fiscad.persistence.repositories.rfu.parametre.ExerciceRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.user.AvoirFonctionRepository;
|
import io.gmss.fiscad.persistence.repositories.user.AvoirFonctionRepository;
|
||||||
@@ -71,6 +73,8 @@ public class EntityFromPayLoadService {
|
|||||||
private final AvoirFonctionRepository avoirFonctionRepository;
|
private final AvoirFonctionRepository avoirFonctionRepository;
|
||||||
private final EnqueteActiviteRepository enqueteActiviteRepository;
|
private final EnqueteActiviteRepository enqueteActiviteRepository;
|
||||||
private final ExerciceRepository exerciceRepository ;
|
private final ExerciceRepository exerciceRepository ;
|
||||||
|
private final BaremRfuRepository baremRfuRepository ;
|
||||||
|
private final ImpositionsTfuRepository impositionsTfuRepository ;
|
||||||
|
|
||||||
|
|
||||||
public CaracteristiqueParcelle getCaracteristiqueParcelleFromPayLoadWeb(CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb){
|
public CaracteristiqueParcelle getCaracteristiqueParcelleFromPayLoadWeb(CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb){
|
||||||
@@ -850,4 +854,77 @@ public class EntityFromPayLoadService {
|
|||||||
|
|
||||||
return enquete;
|
return enquete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BaremRfuBati getBaremRfuBatiFromPayLoadWeb(BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb){
|
||||||
|
BaremRfuBati baremRfuBati = new BaremRfuBati();
|
||||||
|
if (baremRfuBatiPayloadWeb.getId()!=null)
|
||||||
|
baremRfuBati=baremRfuRepository.findById(baremRfuBatiPayloadWeb.getId()).orElse(new BaremRfuBati());
|
||||||
|
|
||||||
|
// ======================
|
||||||
|
// Relations (sans hit DB)
|
||||||
|
// ======================
|
||||||
|
|
||||||
|
if (baremRfuBatiPayloadWeb.getArrondissementId() != null) {
|
||||||
|
Arrondissement arrondissement = new Arrondissement();
|
||||||
|
arrondissement.setId(baremRfuBatiPayloadWeb.getArrondissementId());
|
||||||
|
baremRfuBati.setArrondissement(arrondissement);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (baremRfuBatiPayloadWeb.getQuartierId() != null) {
|
||||||
|
Quartier quartier = new Quartier();
|
||||||
|
quartier.setId(baremRfuBatiPayloadWeb.getQuartierId());
|
||||||
|
baremRfuBati.setQuartier(quartier);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (baremRfuBatiPayloadWeb.getCategorieBatimentId() != null) {
|
||||||
|
CategorieBatiment categorieBatiment = new CategorieBatiment();
|
||||||
|
categorieBatiment.setId(baremRfuBatiPayloadWeb.getCategorieBatimentId());
|
||||||
|
baremRfuBati.setCategorieBatiment(categorieBatiment);
|
||||||
|
}
|
||||||
|
|
||||||
|
baremRfuBati.setTfuMinimum(baremRfuBatiPayloadWeb.getTfuMinimum());
|
||||||
|
baremRfuBati.setValeurLocative(baremRfuBatiPayloadWeb.getValeurLocative());
|
||||||
|
baremRfuBati.setTfuMetreCarre(baremRfuBatiPayloadWeb.getTfuMetreCarre());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return baremRfuBati;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ImpositionsTfu getImpositionsTfuFromPayLoadWeb(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb){
|
||||||
|
ImpositionsTfu impositionsTfu = new ImpositionsTfu();
|
||||||
|
if (impositionsTfuPaylaodWeb.getId()!=null)
|
||||||
|
impositionsTfu=impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId()).orElse(new ImpositionsTfu());
|
||||||
|
|
||||||
|
// ======================
|
||||||
|
// Relations (sans hit DB)
|
||||||
|
// ======================
|
||||||
|
|
||||||
|
if (impositionsTfuPaylaodWeb.getExerciceId() != null) {
|
||||||
|
Exercice exercice = new Exercice();
|
||||||
|
exercice.setId(impositionsTfuPaylaodWeb.getExerciceId());
|
||||||
|
impositionsTfu.setExercice(exercice);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (impositionsTfuPaylaodWeb.getCommuneId() != null) {
|
||||||
|
Commune commune = new Commune();
|
||||||
|
commune.setId(impositionsTfuPaylaodWeb.getCommuneId());
|
||||||
|
impositionsTfu.setCommune(commune);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (impositionsTfuPaylaodWeb.getStructureId() != null) {
|
||||||
|
Structure structure = new Structure();
|
||||||
|
structure.setId(impositionsTfuPaylaodWeb.getStructureId());
|
||||||
|
impositionsTfu.setStructure(structure);
|
||||||
|
}
|
||||||
|
impositionsTfu.setMotif(impositionsTfuPaylaodWeb.getMotif());
|
||||||
|
impositionsTfu.setDatePieceAdmin(impositionsTfuPaylaodWeb.getDatePieceAdmin());
|
||||||
|
impositionsTfu.setReferencePieceAdmin(impositionsTfuPaylaodWeb.getReferencePieceAdmin());
|
||||||
|
|
||||||
|
return impositionsTfu;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user