Merge branch 'ch-evo-19-03-2025' into 'main'

Modification apportées par le DAI

See merge request christianakpona/fiscad!7
This commit is contained in:
2025-03-24 22:09:48 +00:00
9 changed files with 42 additions and 10 deletions

View File

@@ -182,7 +182,7 @@ public class SecteurController {
public ResponseEntity<?> getSecteurByStructureId(@PathVariable Long structureId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, secteurService.getSecteurById(structureId), "Secteur trouvée avec succès."),
new ApiResponse<>(true, secteurService.getSecteurListUneStruture(structureId), "Secteur trouvée avec succès."),
HttpStatus.OK
);
} catch (HttpClientErrorException.MethodNotAllowed e) {

View File

@@ -7,6 +7,7 @@ import io.gmss.fiscad.interfaces.infocad.parametre.BlocService;
import io.gmss.fiscad.paylaods.ApiResponse;
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.tags.Tag;
import jakarta.validation.Valid;
import org.slf4j.Logger;
@@ -23,7 +24,7 @@ import org.springframework.web.client.HttpClientErrorException;
@RestController
@RequestMapping(value = "api/bloc", produces = MediaType.APPLICATION_JSON_VALUE)
//@SecurityRequirement(name = "bearer")
@SecurityRequirement(name = "bearer")
@Tag(name = "Bloc")
@CrossOrigin(origins = "*")
public class BlocController {

View File

@@ -28,10 +28,10 @@ public class SecteurDecoupage extends BaseEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateDebut;
@JsonFormat(pattern = "dd-MM-yyyy")
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateFin;

View File

@@ -44,6 +44,10 @@ public class ParcelleGeom extends BaseEntity implements Serializable {
private String latitude;
private String pointsPolygone;
@OneToOne
private Parcelle parcelle;
@ColumnDefault("0")
private int geomSrid;

View File

@@ -67,7 +67,7 @@ public class Bloc extends BaseEntity implements Serializable {
@ManyToOne
private SecteurDecoupage secteurDecoupage;
@JsonIgnore
//@JsonIgnore
@ManyToOne
private Secteur secteur;

View File

@@ -86,7 +86,9 @@ public class User extends BaseEntity implements Serializable {
public Long getIdCampagneCourant() {
for (Participer p : participers) {
if (p.getDateFin() == null) {
return p.getEquipe().getCampagne().getId();
if(p.getEquipe().getCampagne()!=null) {
return p.getEquipe().getCampagne().getId();
}
}
}
return null;
@@ -95,7 +97,9 @@ public class User extends BaseEntity implements Serializable {
public Long getIdSecteurCourant() {
for (Participer p : participers) {
if (p.getDateFin() == null) {
return p.getEquipe().getSecteur().getId();
if(p.getEquipe().getSecteur()!=null) {
return p.getEquipe().getSecteur().getId();
}
}
}
return null;

View File

@@ -50,9 +50,9 @@ public class BlocServiceImpl implements BlocService {
if (bloc.getQuartier() != null) {
bloc.setCoteq(getCoteQuartierByCoteBloc(bloc.getCote(), bloc.getQuartier()));
}
if (bloc.getSecteurDecoupage() != null) {
bloc.setSecteur(bloc.getSecteurDecoupage().getSecteur());
}
// if (bloc.getSecteurDecoupage() != null) {
// bloc.setSecteur(bloc.getSecteurDecoupage().getSecteur());
// }
return blocRepository.save(bloc);
}

View File

@@ -0,0 +1,23 @@
package io.gmss.fiscad.interfaces.infocad.metier;
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import io.gmss.fiscad.paylaods.request.ParcellePayLoad;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Optional;
public interface ParcelleGeomService {
Parcelle createParcelle(MultipartFile file) throws BadRequestException;
Parcelle updateParcelle(MultipartFile file) throws NotFoundException;
void deleteParcelle(Long id) throws NotFoundException;
Page<Parcelle> getParcelleList(Pageable pageable);
List<Parcelle> getParcelleList();
Optional<Parcelle> getParcelleById(Long id);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB