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:
@@ -182,7 +182,7 @@ public class SecteurController {
|
|||||||
public ResponseEntity<?> getSecteurByStructureId(@PathVariable Long structureId) {
|
public ResponseEntity<?> getSecteurByStructureId(@PathVariable Long structureId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
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
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import io.gmss.fiscad.interfaces.infocad.parametre.BlocService;
|
|||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
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.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;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -23,7 +24,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "api/bloc", produces = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(value = "api/bloc", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
//@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Bloc")
|
@Tag(name = "Bloc")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
public class BlocController {
|
public class BlocController {
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ public class SecteurDecoupage extends BaseEntity implements Serializable {
|
|||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
private LocalDate dateDebut;
|
private LocalDate dateDebut;
|
||||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
private LocalDate dateFin;
|
private LocalDate dateFin;
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,10 @@ public class ParcelleGeom extends BaseEntity implements Serializable {
|
|||||||
private String latitude;
|
private String latitude;
|
||||||
private String pointsPolygone;
|
private String pointsPolygone;
|
||||||
|
|
||||||
|
@OneToOne
|
||||||
|
private Parcelle parcelle;
|
||||||
|
|
||||||
|
|
||||||
@ColumnDefault("0")
|
@ColumnDefault("0")
|
||||||
private int geomSrid;
|
private int geomSrid;
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class Bloc extends BaseEntity implements Serializable {
|
|||||||
@ManyToOne
|
@ManyToOne
|
||||||
private SecteurDecoupage secteurDecoupage;
|
private SecteurDecoupage secteurDecoupage;
|
||||||
|
|
||||||
@JsonIgnore
|
//@JsonIgnore
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Secteur secteur;
|
private Secteur secteur;
|
||||||
|
|
||||||
|
|||||||
@@ -86,18 +86,22 @@ public class User extends BaseEntity implements Serializable {
|
|||||||
public Long getIdCampagneCourant() {
|
public Long getIdCampagneCourant() {
|
||||||
for (Participer p : participers) {
|
for (Participer p : participers) {
|
||||||
if (p.getDateFin() == null) {
|
if (p.getDateFin() == null) {
|
||||||
|
if(p.getEquipe().getCampagne()!=null) {
|
||||||
return p.getEquipe().getCampagne().getId();
|
return p.getEquipe().getCampagne().getId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getIdSecteurCourant() {
|
public Long getIdSecteurCourant() {
|
||||||
for (Participer p : participers) {
|
for (Participer p : participers) {
|
||||||
if (p.getDateFin() == null) {
|
if (p.getDateFin() == null) {
|
||||||
|
if(p.getEquipe().getSecteur()!=null) {
|
||||||
return p.getEquipe().getSecteur().getId();
|
return p.getEquipe().getSecteur().getId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ public class BlocServiceImpl implements BlocService {
|
|||||||
if (bloc.getQuartier() != null) {
|
if (bloc.getQuartier() != null) {
|
||||||
bloc.setCoteq(getCoteQuartierByCoteBloc(bloc.getCote(), bloc.getQuartier()));
|
bloc.setCoteq(getCoteQuartierByCoteBloc(bloc.getCote(), bloc.getQuartier()));
|
||||||
}
|
}
|
||||||
if (bloc.getSecteurDecoupage() != null) {
|
// if (bloc.getSecteurDecoupage() != null) {
|
||||||
bloc.setSecteur(bloc.getSecteurDecoupage().getSecteur());
|
// bloc.setSecteur(bloc.getSecteurDecoupage().getSecteur());
|
||||||
}
|
// }
|
||||||
return blocRepository.save(bloc);
|
return blocRepository.save(bloc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
BIN
uploads/2ff74222e03f4415bc1a2ee8a90ebba3.png
Normal file
BIN
uploads/2ff74222e03f4415bc1a2ee8a90ebba3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 100 KiB |
Reference in New Issue
Block a user