Modification apportées par le DAI
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class Bloc extends BaseEntity implements Serializable {
|
||||
@ManyToOne
|
||||
private SecteurDecoupage secteurDecoupage;
|
||||
|
||||
@JsonIgnore
|
||||
//@JsonIgnore
|
||||
@ManyToOne
|
||||
private Secteur secteur;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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