Compare commits
142 Commits
develop
...
c4916022b2
| Author | SHA1 | Date | |
|---|---|---|---|
| c4916022b2 | |||
| 3eb4406f4a | |||
| 53bdeb0734 | |||
| ed054ae4f3 | |||
| b3c563d4b6 | |||
| 58b6924be2 | |||
| c224185aa1 | |||
| 838eb03833 | |||
| bb2dccf7f5 | |||
| 945391fb89 | |||
| 87306e6c42 | |||
| 121ac58f51 | |||
| 9e652e2acc | |||
| dd8891a3fb | |||
| f7bb899497 | |||
| 0bd56a6e44 | |||
| 3a057aa155 | |||
| 39d673270f | |||
| 65050cf981 | |||
| 27981d656e | |||
| 98641cd52f | |||
| 3c2bd72aeb | |||
| c16a64b1cc | |||
| ceb806db2d | |||
| 02cd322eed | |||
| 95828a304d | |||
| 3edef3963e | |||
| cde3847b5f | |||
| 919e3938eb | |||
| 5cdd27a2f9 | |||
| 8cba64f520 | |||
| 5c4248a5ae | |||
| 6a2aadd6dd | |||
| 272182d605 | |||
| a404b9b678 | |||
| ce0bf6cdf9 | |||
| 6c9c0d1920 | |||
| 6ac42d08fb | |||
| 816bff63bd | |||
| 07dc4630db | |||
| 752f01cfc4 | |||
| 7911903bd8 | |||
| 953deff41c | |||
| aa8a24f81e | |||
| ad28588b0a | |||
| 1775c19c0a | |||
| dda6262b23 | |||
| 5094b1a945 | |||
| 0bedbf0764 | |||
| e333b82e96 | |||
| a192520b30 | |||
| 4cd6e7cbae | |||
| 6c0fa1ca27 | |||
| 1e4e8f9ff6 | |||
| d4d4a7be44 | |||
| 5ea1c93d2b | |||
| e325b12546 | |||
| 47bcda41fd | |||
| 3438da3880 | |||
| ebb91f8318 | |||
| 767756acfc | |||
| 84ede82428 | |||
| 5beddc7c1b | |||
| a6f7f3d465 | |||
| 43b060371a | |||
| 71f0aa6cd0 | |||
| 87f8ad7a61 | |||
| 6a29a3f43c | |||
| 3e871a31e6 | |||
| 9c62c99305 | |||
| 8fb0088010 | |||
| 1e810f0ddb | |||
| a54adcdcb8 | |||
| 6b63ae2f52 | |||
| 6851270bd5 | |||
| 739cc89872 | |||
| dffd6a54a3 | |||
| 267c09c064 | |||
| be4524ed67 | |||
| 06ea9474f1 | |||
| c0267fca5e | |||
| 55b97936ab | |||
| adcd51e32b | |||
| 666519df84 | |||
| beb41af562 | |||
| 57dfdaf64f | |||
| f7e3c118e2 | |||
| 2b4adc0db2 | |||
| a0baf985d4 | |||
| 85e9a41fe2 | |||
| 3102dbc053 | |||
| a21be6aef3 | |||
| 4d708ff4ca | |||
| ea1f92c7e2 | |||
| 9e5e8551f0 | |||
| b8b28a673b | |||
| 70c8c26367 | |||
| e1459d85ea | |||
| f927db064a | |||
| 0589883f8e | |||
| d73e64dbac | |||
| cf7c3aaeb2 | |||
| cd4fcb7aa0 | |||
| 1e0cfead5b | |||
| 0837d0ce08 | |||
| b58316bb88 | |||
| 209d1cd777 | |||
| 1eb3aeeda0 | |||
| b3c288628c | |||
| d45e01ac85 | |||
| 9bb0cc5c75 | |||
| 3a68fd2ce4 | |||
| fa7421c35b | |||
| 5cb9497163 | |||
| 15cac660bc | |||
| 0feec2982f | |||
| b5ab0772a0 | |||
| f293f65650 | |||
| cfd1104c28 | |||
| 7d64390bae | |||
| 4876d8ab14 | |||
| 2bfb298054 | |||
| 54ef33d1ab | |||
| 3fd779854f | |||
| de2928414b | |||
| 9d6d278d78 | |||
| c8b0457195 | |||
| 9cc74a9a38 | |||
| 8e6168d4ee | |||
| c1a8ce86a6 | |||
| 14feb49dcd | |||
| 39de1c48c0 | |||
| f9e2b32118 | |||
| 3ebb1cf165 | |||
| c84176b8d3 | |||
| 61f4dd513f | |||
| 5e9f437497 | |||
| 69af57f876 | |||
| 56f78e77f3 | |||
| 0c7dc082fd | |||
| 3f5d7e980c | |||
| 87be4e4483 |
@@ -6,7 +6,6 @@ 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.*;
|
import io.gmss.fiscad.exceptions.*;
|
||||||
import io.gmss.fiscad.interfaces.rfu.metier.DonneesImpositionTfuService;
|
import io.gmss.fiscad.interfaces.rfu.metier.DonneesImpositionTfuService;
|
||||||
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.DonneesImpositionPaylaodWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
|
||||||
@@ -409,7 +408,7 @@ public class DonneesImpositionTfuController {
|
|||||||
@PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')")
|
@PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')")
|
||||||
public ResponseEntity<?> genererDonneesFiscaleBatieUneParcelle(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb,@PathVariable Long parcelleId) {
|
public ResponseEntity<?> genererDonneesFiscaleBatieUneParcelle(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb,@PathVariable Long parcelleId) {
|
||||||
try {
|
try {
|
||||||
Optional<ImpositionsTfuPaylaodWeb> optionalImpositionsTfu =impositionsTfuRepository.findByIdToDto(impositionsTfuPaylaodWeb.getId());
|
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
|
||||||
|
|
||||||
if(optionalImpositionsTfu.isEmpty()){
|
if(optionalImpositionsTfu.isEmpty()){
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -425,7 +424,6 @@ public class DonneesImpositionTfuController {
|
|||||||
}
|
}
|
||||||
impositionsTfuPaylaodWeb=donneesImpositionTfuService.genererDonneesFiscalesParcelleBatieUneParcelle(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId(),parcelleId);
|
impositionsTfuPaylaodWeb=donneesImpositionTfuService.genererDonneesFiscalesParcelleBatieUneParcelle(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId(),parcelleId);
|
||||||
|
|
||||||
System.out.println("OK apres sorti bati une parcelle");
|
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true,impositionsTfuPaylaodWeb, "Données d'imposition des fonciers batis Générées avec succès."),
|
new ApiResponse<>(true,impositionsTfuPaylaodWeb, "Données d'imposition des fonciers batis Générées avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
@@ -509,7 +507,7 @@ public class DonneesImpositionTfuController {
|
|||||||
@PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')")
|
@PreAuthorize("hasAnyAuthority('CREATE_DONNEESIMPOSITIONTFU', 'UPDATE_DONNEESIMPOSITIONTFU')")
|
||||||
public ResponseEntity<?> genererDonneesImpositionNonBatiesUneParcelle(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, @PathVariable Long parcelleId) {
|
public ResponseEntity<?> genererDonneesImpositionNonBatiesUneParcelle(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, @PathVariable Long parcelleId) {
|
||||||
try {
|
try {
|
||||||
Optional<ImpositionsTfuPaylaodWeb> optionalImpositionsTfu = impositionsTfuRepository.findByIdToDto(impositionsTfuPaylaodWeb.getId());
|
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
|
||||||
|
|
||||||
if(optionalImpositionsTfu.isEmpty()){
|
if(optionalImpositionsTfu.isEmpty()){
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -518,13 +516,19 @@ public class DonneesImpositionTfuController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if(!optionalImpositionsTfu.get().getStatusAvis().equals(StatusAvis.GENERATION_AUTORISE)){
|
||||||
|
// return new ResponseEntity<>(
|
||||||
|
// new ApiResponse<>(false, null, "l'état actuel : "+optionalImpositionsTfu.get().getStatusAvis()+" ne permet pas cette opération."),
|
||||||
|
// HttpStatus.OK
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
if(userPrincipal==null){
|
if(userPrincipal==null){
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(false, null, "Vous n'êtes pas autorisé à accéder à cette ressource"),
|
new ApiResponse<>(false, null, "Vous n'êtes pas autorisé à accéder à cette ressource"),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
impositionsTfuPaylaodWeb=donneesImpositionTfuService.genererDonneesFiscalesParcelleNonBatieUneParcelle(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId(),parcelleId);
|
impositionsTfuPaylaodWeb=donneesImpositionTfuService.genererDonneesFiscalesParcelleNonBatieUneParcelle(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId(),parcelleId);
|
||||||
|
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
package io.gmss.fiscad.controllers.rfu.metier;
|
package io.gmss.fiscad.controllers.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.entities.user.User;
|
import io.gmss.fiscad.entities.user.User;
|
||||||
import io.gmss.fiscad.enums.StatusAvis;
|
import io.gmss.fiscad.enums.StatusAvis;
|
||||||
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.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.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.StructurePaylaodWeb;
|
|
||||||
import io.gmss.fiscad.security.CurrentUser;
|
import io.gmss.fiscad.security.CurrentUser;
|
||||||
import io.gmss.fiscad.security.UserPrincipal;
|
import io.gmss.fiscad.security.UserPrincipal;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
@@ -32,8 +29,6 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@@ -44,8 +39,6 @@ import java.util.Optional;
|
|||||||
public class ImpositionsTfuController {
|
public class ImpositionsTfuController {
|
||||||
|
|
||||||
private final ImpositionsTfuService impositionsTfuService;
|
private final ImpositionsTfuService impositionsTfuService;
|
||||||
private final StructureService structureService;
|
|
||||||
|
|
||||||
private final EnqueteService enqueteService;
|
private final EnqueteService enqueteService;
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ImpositionsTfuController.class);
|
private static final Logger logger = LoggerFactory.getLogger(ImpositionsTfuController.class);
|
||||||
|
|
||||||
@@ -61,22 +54,11 @@ public class ImpositionsTfuController {
|
|||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
User user=currentUser.getUser();
|
||||||
if(impositionsTfuPaylaodWeb.getStructureId()==null){
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(false, null, "Veuillez préciser la strucuture."),
|
|
||||||
HttpStatus.OK
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
User user = currentUser.getUser();
|
|
||||||
|
|
||||||
StructurePaylaodWeb st = structureService.getStructureById(impositionsTfuPaylaodWeb.getStructureId()).orElseGet(null);
|
|
||||||
|
|
||||||
|
|
||||||
if(user.getStructure().getId()!=impositionsTfuPaylaodWeb.getStructureId()){
|
if(user.getStructure().getId()!=impositionsTfuPaylaodWeb.getStructureId()){
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(false, null, "Vous n'etes pas autorisé à accéder à cette ressource. Votre centre : "+ user.getStructure().getNom() +" le centre de liquidation : "+ st.getNom()),
|
new ApiResponse<>(false, null, "Vous n'etes pas autorisé à accéder à cette ressource."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ public class CampagneController {
|
|||||||
|
|
||||||
@GetMapping("/by-exercice-id/{exerciceId}")
|
@GetMapping("/by-exercice-id/{exerciceId}")
|
||||||
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
|
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
|
||||||
public ResponseEntity<?> getCampagneByExercice(@PathVariable Long exerciceId) {
|
public ResponseEntity<?> getCampagneByType(@PathVariable Long exerciceId) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
@@ -238,7 +238,7 @@ public class CampagneController {
|
|||||||
|
|
||||||
@GetMapping("/page/by-exercice-id/{exerciceId}")
|
@GetMapping("/page/by-exercice-id/{exerciceId}")
|
||||||
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
|
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
|
||||||
public ResponseEntity<?> getCampagneByExercice(@PathVariable Long exerciceId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
public ResponseEntity<?> getCampagneByType(@PathVariable Long exerciceId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
@@ -261,58 +261,5 @@ public class CampagneController {
|
|||||||
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/by-structure-id/{structureId}")
|
|
||||||
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
|
|
||||||
public ResponseEntity<?> getCampagneByStructure(@PathVariable Long structureId) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, campagneService.getCampagneByStructureId(structureId), "Liste des campagne par type 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("/page/by-structure-id/{structureId}")
|
|
||||||
@PreAuthorize("hasAuthority('READ_CAMPAGNE')")
|
|
||||||
public ResponseEntity<?> getCampagneByStructure(@PathVariable Long structureId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, campagneService.getCampagneByStructureId(structureId,pageable), "Liste des campagne par type 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ public class ExerciceController {
|
|||||||
@PreAuthorize("hasAuthority('CREATE_EXERCICE')")
|
@PreAuthorize("hasAuthority('CREATE_EXERCICE')")
|
||||||
public ResponseEntity<?> createExercice(@RequestBody @Valid @Validated Exercice exercice) {
|
public ResponseEntity<?> createExercice(@RequestBody @Valid @Validated Exercice exercice) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
||||||
exercice = exerciceService.createExercice(exercice);
|
exercice = exerciceService.createExercice(exercice);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, exercice, "Exercice créé avec succès."),
|
new ApiResponse<>(true, exercice, "Exercice créé avec succès."),
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.hibernate.annotations.Formula;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@@ -184,14 +183,6 @@ public class Enquete extends BaseEntity implements Serializable {
|
|||||||
private Integer nbreIndivisiaire;
|
private Integer nbreIndivisiaire;
|
||||||
private String autreAdresse;
|
private String autreAdresse;
|
||||||
private Float superficie ;
|
private Float superficie ;
|
||||||
@Formula("""
|
|
||||||
(
|
|
||||||
SELECT COUNT(DISTINCT (bat.id))
|
|
||||||
FROM enquete e
|
|
||||||
join batiment bat on bat.parcelle_id =e.parcelle_id
|
|
||||||
WHERE bat.parcelle_id = parcelle_id
|
|
||||||
)
|
|
||||||
""")
|
|
||||||
private Integer nbreBatiment;
|
private Integer nbreBatiment;
|
||||||
private Integer nbrePiscine;
|
private Integer nbrePiscine;
|
||||||
private Long montantMensuelleLocation;
|
private Long montantMensuelleLocation;
|
||||||
|
|||||||
@@ -93,10 +93,10 @@ public class ImpositionsTfu extends BaseEntity implements Serializable {
|
|||||||
@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")
|
||||||
// private List<DonneesImpositionTfu> donneesImpositionTfus;
|
private List<DonneesImpositionTfu> donneesImpositionTfus;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,15 +22,7 @@ import java.time.LocalDate;
|
|||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
//@Where(clause = " deleted = false")
|
@Where(clause = " deleted = false")
|
||||||
@Table(
|
|
||||||
uniqueConstraints = {
|
|
||||||
@UniqueConstraint(
|
|
||||||
name = "uk_participer_equipe_user",
|
|
||||||
columnNames = {"equipe_id", "user_id"}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
public class Participer extends BaseEntity implements Serializable {
|
public class Participer extends BaseEntity implements Serializable {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ 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.infocad.metier.Enquete;
|
import io.gmss.fiscad.entities.infocad.metier.Enquete;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.Structure;
|
|
||||||
import io.gmss.fiscad.enums.TypeCampagne;
|
import io.gmss.fiscad.enums.TypeCampagne;
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -43,9 +42,6 @@ public class Campagne extends BaseEntity implements Serializable {
|
|||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Exercice exercice ;
|
private Exercice exercice ;
|
||||||
|
|
||||||
@ManyToOne
|
|
||||||
private Structure structure ;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,11 +21,6 @@ import java.time.LocalDate;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Where(clause = " deleted = false")
|
@Where(clause = " deleted = false")
|
||||||
@Table(
|
|
||||||
uniqueConstraints = {
|
|
||||||
@UniqueConstraint(name = "uk_exercice_annee", columnNames = "annee")
|
|
||||||
}
|
|
||||||
)
|
|
||||||
public class Exercice extends BaseEntity implements Serializable {
|
public class Exercice extends BaseEntity implements Serializable {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
|||||||
@@ -267,6 +267,7 @@ public class PersonneServiceImpl implements PersonneService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(request.getNpi()!=null && !request.getNpi().equals("")){
|
if(request.getNpi()!=null && !request.getNpi().equals("")){
|
||||||
|
|
||||||
List<PersonnePayLoadWeb> personnePayLoadWebs = personneRepository.findAllPersonneByNpiToDto(request.getNpi());
|
List<PersonnePayLoadWeb> personnePayLoadWebs = personneRepository.findAllPersonneByNpiToDto(request.getNpi());
|
||||||
if(!personnePayLoadWebs.isEmpty())
|
if(!personnePayLoadWebs.isEmpty())
|
||||||
return personnePayLoadWebs;
|
return personnePayLoadWebs;
|
||||||
@@ -276,14 +277,13 @@ public class PersonneServiceImpl implements PersonneService {
|
|||||||
|
|
||||||
result = recherchePersonneLocal(request);
|
result = recherchePersonneLocal(request);
|
||||||
|
|
||||||
if (result != null && ! result.isEmpty()) {
|
if (result != null && !result.isEmpty()) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
// Conversion date en String format yyyy-MM-dd
|
// Conversion date en String format yyyy-MM-dd
|
||||||
String dateNaissance = Optional.ofNullable(request.getDateNaissance())
|
String dateNaissance = Optional.ofNullable(request.getDateNaissance())
|
||||||
.map(d -> d.format(DateTimeFormatter.ISO_LOCAL_DATE))
|
.map(d -> d.format(DateTimeFormatter.ISO_LOCAL_DATE))
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
|
|
||||||
// Construction du body IFU
|
// Construction du body IFU
|
||||||
IfuEnLigneRechercheBody ifuRequest = new IfuEnLigneRechercheBody();
|
IfuEnLigneRechercheBody ifuRequest = new IfuEnLigneRechercheBody();
|
||||||
ifuRequest.setNom(request.getNom());
|
ifuRequest.setNom(request.getNom());
|
||||||
|
|||||||
@@ -2,16 +2,16 @@ package io.gmss.fiscad.implementations.rfu.metier;
|
|||||||
|
|
||||||
import io.gmss.fiscad.entities.decoupage.Arrondissement;
|
import io.gmss.fiscad.entities.decoupage.Arrondissement;
|
||||||
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
|
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.Structure;
|
|
||||||
import io.gmss.fiscad.entities.rfu.metier.DonneesImpositionTfu;
|
import io.gmss.fiscad.entities.rfu.metier.DonneesImpositionTfu;
|
||||||
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
|
import io.gmss.fiscad.entities.rfu.metier.ImpositionsTfu;
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuNonBati;
|
import io.gmss.fiscad.entities.rfu.parametre.BaremRfuNonBati;
|
||||||
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.DonneesImpositionTfuService;
|
import io.gmss.fiscad.interfaces.rfu.metier.DonneesImpositionTfuService;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.*;
|
import io.gmss.fiscad.paylaods.request.crudweb.ArrondissementPaylaodWeb;
|
||||||
|
import io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb;
|
||||||
|
import io.gmss.fiscad.paylaods.request.crudweb.ImpositionsTfuPaylaodWeb;
|
||||||
import io.gmss.fiscad.paylaods.response.DonneesImpositionTfuResponse;
|
import io.gmss.fiscad.paylaods.response.DonneesImpositionTfuResponse;
|
||||||
import io.gmss.fiscad.persistence.repositories.decoupage.ArrondissementRepository;
|
import io.gmss.fiscad.persistence.repositories.decoupage.ArrondissementRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository;
|
import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository;
|
||||||
@@ -45,7 +45,6 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
|
|||||||
private final ArrondissementRepository arrondissementRepository;
|
private final ArrondissementRepository arrondissementRepository;
|
||||||
private final BaremRfuRepository baremRfuRepository;
|
private final BaremRfuRepository baremRfuRepository;
|
||||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
private final EntityFromPayLoadService entityFromPayLoadService;
|
||||||
private final StructureService structureService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -117,38 +116,23 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleNonBatieUneParcelle(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId,Long parcelleId) {
|
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleNonBatieUneParcelle(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId,Long parcelleId) {
|
||||||
|
|
||||||
boolean existsBareme = baremRfuNonBatiRepository.existsBaremForParcelleNonBati(parcelleId);
|
boolean existsBareme = baremRfuNonBatiRepository.existsBaremForParcelleNonBati(parcelleId);
|
||||||
|
Optional<Parcelle> optionalParcelle= parcelleRepository.findById(parcelleId);
|
||||||
Optional<ParcellePayLoadWeb> optionalParcelle= parcelleRepository.findParcelleToDtoById(parcelleId);
|
|
||||||
|
|
||||||
String nomQuartier="";
|
String nomQuartier="";
|
||||||
String nomArrondissement="";
|
String nomArrondissement="";
|
||||||
String nomCommune="";
|
String nomCommune="";
|
||||||
if(optionalParcelle.isPresent()){
|
if(optionalParcelle.isPresent()){
|
||||||
nomQuartier= optionalParcelle.get().getQuartierNom();
|
nomQuartier= optionalParcelle.get().getQuartier().getNom();
|
||||||
|
nomArrondissement= optionalParcelle.get().getQuartier().getArrondissement().getNom();
|
||||||
|
nomCommune= optionalParcelle.get().getQuartier().getArrondissement().getCommune().getNom();
|
||||||
}
|
}
|
||||||
if(!existsBareme){
|
if(!existsBareme){
|
||||||
throw new BadRequestException("Impossible de continuer la liquidation : Il n'existe pas de barème configuré pour la zone de cette parcelle : "+nomQuartier);
|
throw new BadRequestException("Impossible de continuer la liquidation : Il n'existe pas de barème configuré pour la zone de cette parcelle : "+nomCommune+" : "+nomArrondissement+" : "+nomQuartier);
|
||||||
}
|
}
|
||||||
|
Integer nb= donneesImpositionTfuRepository.genererDonneesTfuNonBatie(impositionsTfuPaylaodWeb.getId(),userId,parcelleId);
|
||||||
List<Structure> structures = structureService.getListStructureUserId(userId);
|
|
||||||
|
|
||||||
boolean existe = structures.stream()
|
|
||||||
.anyMatch(s -> s.getId().equals(impositionsTfuPaylaodWeb.getStructureId()));
|
|
||||||
|
|
||||||
if (!existe) {
|
|
||||||
throw new BadRequestException("Impossible de continuer la liquidation : La parcelle ne se trouve pas dans votre territoire ");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Integer nb= donneesImpositionTfuRepository.genererDonneesTfuNonBatie(impositionsTfuPaylaodWeb.getId(), userId, parcelleId);
|
|
||||||
|
|
||||||
System.out.println(nb);
|
|
||||||
|
|
||||||
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
||||||
impositionsTfu.setStatusAvis(StatusAvis.TFU_FNB_GENERE);
|
impositionsTfu.setStatusAvis(StatusAvis.TFU_FNB_GENERE);
|
||||||
|
//impositionsTfu.setNombreAvisFnb(nb);
|
||||||
impositionsTfuRepository.save(impositionsTfu);
|
impositionsTfuRepository.save(impositionsTfu);
|
||||||
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
||||||
}
|
}
|
||||||
@@ -196,14 +180,16 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean existsBareme = baremRfuRepository.existsBaremForParcelle(parcelleId);
|
|
||||||
|
|
||||||
Optional<ParcellePayLoadWeb> optionalParcelle= parcelleRepository.findParcelleToDtoById(parcelleId);
|
boolean existsBareme = baremRfuRepository.existsBaremForParcelle(parcelleId);
|
||||||
|
Optional<Parcelle> optionalParcelle= parcelleRepository.findById(parcelleId);
|
||||||
String nomQuartier="";
|
String nomQuartier="";
|
||||||
String nomArrondissement="";
|
String nomArrondissement="";
|
||||||
String nomCommune="";
|
String nomCommune="";
|
||||||
if(optionalParcelle.isPresent()){
|
if(optionalParcelle.isPresent()){
|
||||||
nomQuartier= optionalParcelle.get().getQuartierNom();
|
nomQuartier= optionalParcelle.get().getQuartier().getNom();
|
||||||
|
nomArrondissement= optionalParcelle.get().getQuartier().getArrondissement().getNom();
|
||||||
|
nomCommune= optionalParcelle.get().getQuartier().getArrondissement().getCommune().getNom();
|
||||||
}
|
}
|
||||||
if(!existsBareme){
|
if(!existsBareme){
|
||||||
throw new BadRequestException("Impossible de continuer la liquidation : Il n'existe pas de barème configuré pour la zone de cette parcelle : "+nomCommune+" : "+nomArrondissement+" : "+nomQuartier);
|
throw new BadRequestException("Impossible de continuer la liquidation : Il n'existe pas de barème configuré pour la zone de cette parcelle : "+nomCommune+" : "+nomArrondissement+" : "+nomQuartier);
|
||||||
@@ -223,10 +209,15 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
|
|||||||
|
|
||||||
Integer nbMajAcompteRirf= donneesImpositionTfuRepository.majDonneesAcompteRirfUneParcelle(impositionsTfuPaylaodWeb.getId(),parcelleId);
|
Integer nbMajAcompteRirf= donneesImpositionTfuRepository.majDonneesAcompteRirfUneParcelle(impositionsTfuPaylaodWeb.getId(),parcelleId);
|
||||||
|
|
||||||
|
|
||||||
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
||||||
|
|
||||||
impositionsTfu.setStatusAvis(StatusAvis.GENERE);
|
impositionsTfu.setStatusAvis(StatusAvis.GENERE);
|
||||||
|
|
||||||
|
//impositionsTfu.setNombreAvis(impositionsTfu.getNombreAvis()+1);
|
||||||
|
//impositionsTfu.setNombreAvisBatiment(impositionsTfu.getNombreAvisFnb()+1);
|
||||||
|
//impositionsTfu.setNombreAvisUniteLog(impositionsTfu.getNombreAvisUniteLog()+1);
|
||||||
|
|
||||||
impositionsTfuRepository.save(impositionsTfu);
|
impositionsTfuRepository.save(impositionsTfu);
|
||||||
|
|
||||||
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package io.gmss.fiscad.implementations.rfu.metier;
|
|||||||
|
|
||||||
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
|
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
|
||||||
import io.gmss.fiscad.entities.rfu.metier.Participer;
|
import io.gmss.fiscad.entities.rfu.metier.Participer;
|
||||||
import io.gmss.fiscad.exceptions.ApplicationException;
|
|
||||||
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.rfu.metier.ParticiperService;
|
import io.gmss.fiscad.interfaces.rfu.metier.ParticiperService;
|
||||||
@@ -42,22 +41,12 @@ public class ParticiperServiceImpl implements ParticiperService {
|
|||||||
throw new BadRequestException("Impossible de créer la participation: L'équipe doit être précisée.");
|
throw new BadRequestException("Impossible de créer la participation: L'équipe doit être précisée.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (participerPaylaodWeb.getUserId() == null) {
|
if (participerPaylaodWeb.getUserId() == null) {
|
||||||
throw new BadRequestException("Impossible de créer la participation : Le participant doit être précisé.");
|
throw new BadRequestException("Impossible de créer la participation : Le participant doit être précisé.");
|
||||||
}else {
|
}else {
|
||||||
if(!userRepository.existsById(participerPaylaodWeb.getUserId()))
|
if(!userRepository.existsById(participerPaylaodWeb.getUserId()))
|
||||||
throw new BadRequestException("Impossible de créer un nouveau participer: Le participant doit être précisé.");
|
throw new BadRequestException("Impossible de créer un nouveau participer: Le participant doit être précisé.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (participerRepository.existsByEquipeIdAndUserId(
|
|
||||||
participerPaylaodWeb.getEquipeId(),
|
|
||||||
participerPaylaodWeb.getUserId())) {
|
|
||||||
throw new ApplicationException("Cet utilisateur participe déjà à cette équipe.");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Participer participer= entityFromPayLoadService.getParticiperFromPayLoadWeb(participerPaylaodWeb);
|
Participer participer= entityFromPayLoadService.getParticiperFromPayLoadWeb(participerPaylaodWeb);
|
||||||
participer= participerRepository.save(participer);
|
participer= participerRepository.save(participer);
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ public class CampagneServiceImpl implements CampagneService {
|
|||||||
if (campagnePayloadWeb.getId() != null) {
|
if (campagnePayloadWeb.getId() != null) {
|
||||||
throw new BadRequestException("Impossible de créer une nouvelle campgne ayant un id non null.");
|
throw new BadRequestException("Impossible de créer une nouvelle campgne ayant un id non null.");
|
||||||
}
|
}
|
||||||
|
|
||||||
Campagne campagne= entityFromPayLoadService.getCampagneFromPayLoadWeb(campagnePayloadWeb);
|
Campagne campagne= entityFromPayLoadService.getCampagneFromPayLoadWeb(campagnePayloadWeb);
|
||||||
campagne= campagneRepository.save(campagne);
|
campagne= campagneRepository.save(campagne);
|
||||||
|
|
||||||
@@ -89,15 +88,5 @@ public class CampagneServiceImpl implements CampagneService {
|
|||||||
public Page<CampagnePayloadWeb> getCampagneByExerciceId(Long exerciceId, Pageable pageable) {
|
public Page<CampagnePayloadWeb> getCampagneByExerciceId(Long exerciceId, Pageable pageable) {
|
||||||
return campagneRepository.findAllPayloadByExerciceId(exerciceId,pageable);
|
return campagneRepository.findAllPayloadByExerciceId(exerciceId,pageable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CampagnePayloadWeb> getCampagneByStructureId(Long structureId) {
|
|
||||||
return campagneRepository.findAllPayloadByStructureId(structureId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<CampagnePayloadWeb> getCampagneByStructureId(Long structureId, Pageable pageable) {
|
|
||||||
return campagneRepository.findAllPayloadByStructureId(structureId,pageable);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package io.gmss.fiscad.implementations.rfu.parametre;
|
package io.gmss.fiscad.implementations.rfu.parametre;
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
|
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
|
||||||
import io.gmss.fiscad.exceptions.ApplicationException;
|
|
||||||
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.rfu.parametre.ExerciceService;
|
import io.gmss.fiscad.interfaces.rfu.parametre.ExerciceService;
|
||||||
@@ -23,14 +22,8 @@ public class ExerciceServiceImpl implements ExerciceService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Exercice createExercice(Exercice exercice) throws BadRequestException {
|
public Exercice createExercice(Exercice exercice) throws BadRequestException {
|
||||||
if (exercice.getId() == null) {
|
if (exercice.getId() != null) {
|
||||||
if (exerciceRepository.existsByAnnee(exercice.getAnnee())) {
|
throw new BadRequestException("Impossible de créer une nouvelle campgne ayant un id non null.");
|
||||||
throw new ApplicationException("Un exercice existe déjà pour l'année " + exercice.getAnnee() + ".");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (exerciceRepository.existsByAnneeAndIdNot(exercice.getAnnee(), exercice.getId())) {
|
|
||||||
throw new ApplicationException("Un exercice existe déjà pour l'année " + exercice.getAnnee() + ".");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return exerciceRepository.save(exercice);
|
return exerciceRepository.save(exercice);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,10 +137,9 @@ public class UserServiceImpl implements UserService {
|
|||||||
public UserPaylaodWeb updateUser(Long id, UserPaylaodWeb userPaylaodWeb) {
|
public UserPaylaodWeb updateUser(Long id, UserPaylaodWeb userPaylaodWeb) {
|
||||||
|
|
||||||
if ((userRepository.findByUsername(userPaylaodWeb.getLogin()).isEmpty())
|
if ((userRepository.findByUsername(userPaylaodWeb.getLogin()).isEmpty())
|
||||||
&& (userRepository.findByEmail(userPaylaodWeb.getEmail()).isEmpty())) {
|
|| (userRepository.findByEmail(userPaylaodWeb.getEmail()).isEmpty())) {
|
||||||
throw new BadRequestException("Cet utilisateur n'existe pas.");
|
throw new BadRequestException("Cet utilisateur n'existe pas.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userPaylaodWeb.getId() == null) {
|
if (userPaylaodWeb.getId() == null) {
|
||||||
throw new BadRequestException("Cet utilisateur n'existe déjà.");
|
throw new BadRequestException("Cet utilisateur n'existe déjà.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ public interface CampagneService {
|
|||||||
Optional<CampagnePayloadWeb> getCampagneById(Long id);
|
Optional<CampagnePayloadWeb> getCampagneById(Long id);
|
||||||
List<CampagnePayloadWeb> getCampagneByExerciceId(Long exerciceId);
|
List<CampagnePayloadWeb> getCampagneByExerciceId(Long exerciceId);
|
||||||
Page<CampagnePayloadWeb> getCampagneByExerciceId(Long exerciceId,Pageable pageable);
|
Page<CampagnePayloadWeb> getCampagneByExerciceId(Long exerciceId,Pageable pageable);
|
||||||
List<CampagnePayloadWeb> getCampagneByStructureId(Long structureId);
|
|
||||||
Page<CampagnePayloadWeb> getCampagneByStructureId(Long structureId, Pageable pageable);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,7 @@ public class CampagnePayloadWeb {
|
|||||||
private Long exerciceId ;
|
private Long exerciceId ;
|
||||||
private Integer exerciceAnnee ;
|
private Integer exerciceAnnee ;
|
||||||
|
|
||||||
private Long structureId ;
|
public CampagnePayloadWeb(Long id, String refAdministrative, String nom, LocalDate dateDebut, LocalDate dateFin, TypeCampagne typeCampagne, Long exerciceId, Integer exerciceAnnee) {
|
||||||
private String structureCode ;
|
|
||||||
private String structureNom ;
|
|
||||||
|
|
||||||
public CampagnePayloadWeb(Long id, String refAdministrative, String nom, LocalDate dateDebut, LocalDate dateFin, TypeCampagne typeCampagne, Long exerciceId, Integer exerciceAnnee, Long structureId, String structureCode, String structureNom) {
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.refAdministrative = refAdministrative;
|
this.refAdministrative = refAdministrative;
|
||||||
this.nom = nom;
|
this.nom = nom;
|
||||||
@@ -42,8 +38,5 @@ public class CampagnePayloadWeb {
|
|||||||
this.typeCampagne = typeCampagne;
|
this.typeCampagne = typeCampagne;
|
||||||
this.exerciceId = exerciceId;
|
this.exerciceId = exerciceId;
|
||||||
this.exerciceAnnee = exerciceAnnee;
|
this.exerciceAnnee = exerciceAnnee;
|
||||||
this.structureId = structureId;
|
|
||||||
this.structureCode = structureCode;
|
|
||||||
this.structureNom = structureNom;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ public class EnquetePayLoadWeb {
|
|||||||
private Long zoneRfuId;
|
private Long zoneRfuId;
|
||||||
private String zoneRfuNom;
|
private String zoneRfuNom;
|
||||||
private Long personneId;
|
private Long personneId;
|
||||||
private String personneIfu;
|
|
||||||
private String personneNom;
|
private String personneNom;
|
||||||
private String personnePrenom;
|
private String personnePrenom;
|
||||||
private String personneRaisonSociale;
|
private String personneRaisonSociale;
|
||||||
|
|||||||
@@ -73,12 +73,12 @@ public class ParcelleRepositoryCustomImpl implements ParcelleRepositoryCustom {
|
|||||||
r.numero as rueNumero,
|
r.numero as rueNumero,
|
||||||
r.nom as rueNom,
|
r.nom as rueNom,
|
||||||
|
|
||||||
pers.id as proprietaireId,
|
pers.id as personneId,
|
||||||
pers.ifu as proprietaireIfu,
|
pers.ifu as ifu,
|
||||||
pers.npi as proprietaireNpi,
|
pers.npi as npi,
|
||||||
pers.nom as proprietaireNom,
|
pers.nom as nom,
|
||||||
pers.prenom as proprietairePrenom,
|
pers.prenom as prenom,
|
||||||
pers.raison_sociale as proprietaireRaisonSociale,
|
pers.raison_sociale as raisonSociale,
|
||||||
|
|
||||||
de.id as enqueteCouranteId
|
de.id as enqueteCouranteId
|
||||||
|
|
||||||
|
|||||||
@@ -121,10 +121,6 @@ FROM impositions_tfu imp
|
|||||||
order by exo.annee,dimp.parcelle_id,dimp.nature_impot, dimp.montant_taxe-coalesce(dimp.acompte,0)-coalesce(dimp.retenu_irf,0) desc ;
|
order by exo.annee,dimp.parcelle_id,dimp.nature_impot, dimp.montant_taxe-coalesce(dimp.acompte,0)-coalesce(dimp.retenu_irf,0) desc ;
|
||||||
|
|
||||||
|
|
||||||
select * from e_avis_view
|
|
||||||
|
|
||||||
select *
|
|
||||||
from impositions_tfu;
|
|
||||||
|
|
||||||
|
|
||||||
---------------------------------------------------
|
---------------------------------------------------
|
||||||
|
|||||||
@@ -63,15 +63,6 @@ $$;
|
|||||||
|
|
||||||
call integrer_eavis();
|
call integrer_eavis();
|
||||||
|
|
||||||
call integrer_eavis_detail();
|
select * from eavis
|
||||||
|
|
||||||
select *
|
delete from eavis;
|
||||||
from e_avis_view ;
|
|
||||||
|
|
||||||
select * from eavis;
|
|
||||||
|
|
||||||
|
|
||||||
select * from eavis_detail;
|
|
||||||
|
|
||||||
select *
|
|
||||||
from donnees_imposition_tfu;
|
|
||||||
@@ -147,11 +147,3 @@ select * from arrondissement
|
|||||||
|
|
||||||
select left(code,4) as code_commune_fiscad, code as code_quartier_fiscad,nom as nom_quartier_fiscad
|
select left(code,4) as code_commune_fiscad, code as code_quartier_fiscad,nom as nom_quartier_fiscad
|
||||||
from quartier;
|
from quartier;
|
||||||
|
|
||||||
|
|
||||||
create function get_dblink_connection_sigibe() returns text
|
|
||||||
language sql
|
|
||||||
as
|
|
||||||
$$
|
|
||||||
SELECT 'host=193.181.208.4 port=5433 dbname=sigibe_test user=sigibe_test_user password=sigibe_test_pwd';
|
|
||||||
$$;
|
|
||||||
@@ -12,7 +12,6 @@ import java.util.List;
|
|||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public interface ParticiperRepository extends JpaRepository<Participer, Long> {
|
public interface ParticiperRepository extends JpaRepository<Participer, Long> {
|
||||||
boolean existsByEquipeIdAndUserId(Long equipeId, Long userId);
|
|
||||||
@Query("""
|
@Query("""
|
||||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ParticiperPayloadWeb(
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.ParticiperPayloadWeb(
|
||||||
p.id,
|
p.id,
|
||||||
|
|||||||
@@ -24,14 +24,10 @@ public interface CampagneRepository extends JpaRepository<Campagne, Long> {
|
|||||||
c.dateFin,
|
c.dateFin,
|
||||||
c.typeCampagne,
|
c.typeCampagne,
|
||||||
e.id,
|
e.id,
|
||||||
e.annee,
|
e.annee
|
||||||
s.id,
|
|
||||||
s.code,
|
|
||||||
s.nom
|
|
||||||
)
|
)
|
||||||
FROM Campagne c
|
FROM Campagne c
|
||||||
LEFT JOIN c.exercice e
|
LEFT JOIN c.exercice e
|
||||||
LEFT JOIN c.structure s
|
|
||||||
WHERE c.id = :id
|
WHERE c.id = :id
|
||||||
""")
|
""")
|
||||||
Optional<CampagnePayloadWeb> findPayloadById(@Param("id") Long id);
|
Optional<CampagnePayloadWeb> findPayloadById(@Param("id") Long id);
|
||||||
@@ -45,14 +41,10 @@ public interface CampagneRepository extends JpaRepository<Campagne, Long> {
|
|||||||
c.dateFin,
|
c.dateFin,
|
||||||
c.typeCampagne,
|
c.typeCampagne,
|
||||||
e.id,
|
e.id,
|
||||||
e.annee,
|
e.annee
|
||||||
s.id,
|
|
||||||
s.code,
|
|
||||||
s.nom
|
|
||||||
)
|
)
|
||||||
FROM Campagne c
|
FROM Campagne c
|
||||||
LEFT JOIN c.exercice e
|
LEFT JOIN c.exercice e
|
||||||
LEFT JOIN c.structure s
|
|
||||||
ORDER BY c.dateDebut DESC
|
ORDER BY c.dateDebut DESC
|
||||||
""")
|
""")
|
||||||
List<CampagnePayloadWeb> findAllPayload();
|
List<CampagnePayloadWeb> findAllPayload();
|
||||||
@@ -66,14 +58,10 @@ public interface CampagneRepository extends JpaRepository<Campagne, Long> {
|
|||||||
c.dateFin,
|
c.dateFin,
|
||||||
c.typeCampagne,
|
c.typeCampagne,
|
||||||
e.id,
|
e.id,
|
||||||
e.annee,
|
e.annee
|
||||||
s.id,
|
|
||||||
s.code,
|
|
||||||
s.nom
|
|
||||||
)
|
)
|
||||||
FROM Campagne c
|
FROM Campagne c
|
||||||
LEFT JOIN c.exercice e
|
LEFT JOIN c.exercice e
|
||||||
LEFT JOIN c.structure s
|
|
||||||
""",
|
""",
|
||||||
countQuery = """
|
countQuery = """
|
||||||
SELECT COUNT(c)
|
SELECT COUNT(c)
|
||||||
@@ -90,14 +78,10 @@ public interface CampagneRepository extends JpaRepository<Campagne, Long> {
|
|||||||
c.dateFin,
|
c.dateFin,
|
||||||
c.typeCampagne,
|
c.typeCampagne,
|
||||||
e.id,
|
e.id,
|
||||||
e.annee,
|
e.annee
|
||||||
s.id,
|
|
||||||
s.code,
|
|
||||||
s.nom
|
|
||||||
)
|
)
|
||||||
FROM Campagne c
|
FROM Campagne c
|
||||||
LEFT JOIN c.exercice e
|
LEFT JOIN c.exercice e
|
||||||
LEFT JOIN c.structure s
|
|
||||||
WHERE e.id = :exerciceId
|
WHERE e.id = :exerciceId
|
||||||
ORDER BY c.dateDebut DESC
|
ORDER BY c.dateDebut DESC
|
||||||
""")
|
""")
|
||||||
@@ -113,14 +97,10 @@ public interface CampagneRepository extends JpaRepository<Campagne, Long> {
|
|||||||
c.dateFin,
|
c.dateFin,
|
||||||
c.typeCampagne,
|
c.typeCampagne,
|
||||||
e.id,
|
e.id,
|
||||||
e.annee,
|
e.annee
|
||||||
s.id,
|
|
||||||
s.code,
|
|
||||||
s.nom
|
|
||||||
)
|
)
|
||||||
FROM Campagne c
|
FROM Campagne c
|
||||||
LEFT JOIN c.exercice e
|
LEFT JOIN c.exercice e
|
||||||
LEFT JOIN c.structure s
|
|
||||||
WHERE e.id = :exerciceId
|
WHERE e.id = :exerciceId
|
||||||
""",
|
""",
|
||||||
countQuery = """
|
countQuery = """
|
||||||
@@ -131,57 +111,5 @@ public interface CampagneRepository extends JpaRepository<Campagne, Long> {
|
|||||||
Page<CampagnePayloadWeb> findAllPayloadByExerciceId(
|
Page<CampagnePayloadWeb> findAllPayloadByExerciceId(
|
||||||
@Param("exerciceId") Long exerciceId,
|
@Param("exerciceId") Long exerciceId,
|
||||||
Pageable pageable);
|
Pageable pageable);
|
||||||
|
|
||||||
|
|
||||||
@Query("""
|
|
||||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.CampagnePayloadWeb(
|
|
||||||
c.id,
|
|
||||||
c.refAdministrative,
|
|
||||||
c.nom,
|
|
||||||
c.dateDebut,
|
|
||||||
c.dateFin,
|
|
||||||
c.typeCampagne,
|
|
||||||
e.id,
|
|
||||||
e.annee,
|
|
||||||
s.id,
|
|
||||||
s.code,
|
|
||||||
s.nom
|
|
||||||
)
|
|
||||||
FROM Campagne c
|
|
||||||
LEFT JOIN c.exercice e
|
|
||||||
LEFT JOIN c.structure s
|
|
||||||
WHERE s.id = :structureId
|
|
||||||
ORDER BY c.dateDebut DESC
|
|
||||||
""")
|
|
||||||
List<CampagnePayloadWeb> findAllPayloadByStructureId(@Param("structureId") Long structureId);
|
|
||||||
|
|
||||||
|
|
||||||
@Query(value = """
|
|
||||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.CampagnePayloadWeb(
|
|
||||||
c.id,
|
|
||||||
c.refAdministrative,
|
|
||||||
c.nom,
|
|
||||||
c.dateDebut,
|
|
||||||
c.dateFin,
|
|
||||||
c.typeCampagne,
|
|
||||||
e.id,
|
|
||||||
e.annee,
|
|
||||||
s.id,
|
|
||||||
s.code,
|
|
||||||
s.nom
|
|
||||||
)
|
|
||||||
FROM Campagne c
|
|
||||||
LEFT JOIN c.exercice e
|
|
||||||
LEFT JOIN c.structure s
|
|
||||||
WHERE s.id = :structureId
|
|
||||||
""",
|
|
||||||
countQuery = """
|
|
||||||
SELECT COUNT(c)
|
|
||||||
FROM Campagne c
|
|
||||||
WHERE c.structure.id = :structureId
|
|
||||||
""")
|
|
||||||
Page<CampagnePayloadWeb> findAllPayloadByStructureId(
|
|
||||||
@Param("exerciceId") Long structureId,
|
|
||||||
Pageable pageable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,5 @@ import java.util.Optional;
|
|||||||
|
|
||||||
public interface ExerciceRepository extends JpaRepository<Exercice, Long> {
|
public interface ExerciceRepository extends JpaRepository<Exercice, Long> {
|
||||||
Optional<Exercice> findFirstByAnnee(int annee);
|
Optional<Exercice> findFirstByAnnee(int annee);
|
||||||
boolean existsByAnnee(Integer annee);
|
|
||||||
|
|
||||||
boolean existsByAnneeAndIdNot(Integer annee, Long id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ public interface AvoirFonctionRepository extends JpaRepository<AvoirFonction, Lo
|
|||||||
LEFT JOIN af.user u
|
LEFT JOIN af.user u
|
||||||
LEFT JOIN af.fonction f
|
LEFT JOIN af.fonction f
|
||||||
WHERE u.id = :userId
|
WHERE u.id = :userId
|
||||||
AND (af.dateFin IS NULL OR af.dateFin >= CURRENT_DATE)
|
|
||||||
""")
|
""")
|
||||||
List<AvoirFonctionPaylaodWeb> findAllAvoirFonctionByUserToDto(@Param("userId") Long userId);
|
List<AvoirFonctionPaylaodWeb> findAllAvoirFonctionByUserToDto(@Param("userId") Long userId);
|
||||||
|
|
||||||
|
|||||||
@@ -1243,12 +1243,6 @@ public class EntityFromPayLoadService {
|
|||||||
campagne.setExercice(exercice);
|
campagne.setExercice(exercice);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (campagnePayloadWeb.getStructureId() != null) {
|
|
||||||
Structure structure = new Structure();
|
|
||||||
structure.setId(campagnePayloadWeb.getStructureId());
|
|
||||||
campagne.setStructure(structure);
|
|
||||||
}
|
|
||||||
|
|
||||||
campagne.setId(campagnePayloadWeb.getId());
|
campagne.setId(campagnePayloadWeb.getId());
|
||||||
campagne.setDateDebut(campagnePayloadWeb.getDateDebut());
|
campagne.setDateDebut(campagnePayloadWeb.getDateDebut());
|
||||||
campagne.setDateFin(campagnePayloadWeb.getDateFin());
|
campagne.setDateFin(campagnePayloadWeb.getDateFin());
|
||||||
|
|||||||
@@ -2,16 +2,16 @@ server.port=8282
|
|||||||
io.gmss.fiscad.profile=test
|
io.gmss.fiscad.profile=test
|
||||||
|
|
||||||
# LOCAL ENV TEST
|
# LOCAL ENV TEST
|
||||||
#spring.datasource.url=jdbc:postgresql://localhost:5432/fiscad_dgi
|
spring.datasource.url=jdbc:postgresql://localhost:5432/fiscad_dgi
|
||||||
#spring.datasource.username=infocad_user
|
spring.datasource.username=infocad_user
|
||||||
#spring.datasource.password=W5fwD({9*q53
|
|
||||||
|
|
||||||
|
|
||||||
spring.datasource.url=jdbc:postgresql://193.181.208.4:5432/fiscad_db
|
|
||||||
spring.datasource.username=fiscad_user
|
|
||||||
spring.datasource.password=W5fwD({9*q53
|
spring.datasource.password=W5fwD({9*q53
|
||||||
|
|
||||||
|
|
||||||
|
#spring.datasource.url=jdbc:postgresql://193.181.208.4:5432/fiscad_db
|
||||||
|
#spring.datasource.username=fiscad_user
|
||||||
|
#spring.datasource.password=W5fwD({9*q53
|
||||||
|
|
||||||
|
|
||||||
app.default-user.username=fiscad_admin
|
app.default-user.username=fiscad_admin
|
||||||
app.default-user.password=1234567890
|
app.default-user.password=1234567890
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user